Arreglo de informes de presupuestos para que salga o no el descuento (bonificacion)

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@517 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2008-08-20 11:41:11 +00:00
parent b2731c9f15
commit 41fc3856a9
6 changed files with 111 additions and 80 deletions

View File

@ -7,6 +7,7 @@ uses
const const
DISPLAY_EUROS2 = '#,0.00 €'; DISPLAY_EUROS2 = '#,0.00 €';
DISPLAY_PORCENTAJE = '#,0.00%';
procedure StringToStrings(Source:string; Delimiter:char; Target:TStrings); procedure StringToStrings(Source:string; Delimiter:char; Target:TStrings);
function StringsToString(Source:TStrings; Delimiter:char):string; function StringsToString(Source:TStrings; Delimiter:char):string;

File diff suppressed because one or more lines are too long

View File

@ -64,21 +64,19 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
inherited pgPaginas: TPageControl inherited pgPaginas: TPageControl
Width = 873 Width = 873
Height = 534 Height = 534
ActivePage = pagContenido
TabOrder = 1 TabOrder = 1
OnChanging = pgPaginasChanging OnChanging = pgPaginasChanging
ExplicitWidth = 873 ExplicitWidth = 873
ExplicitHeight = 486 ExplicitHeight = 534
inherited pagGeneral: TTabSheet inherited pagGeneral: TTabSheet
ExplicitLeft = 4 ExplicitLeft = 4
ExplicitTop = 24 ExplicitTop = 24
ExplicitWidth = 865 ExplicitWidth = 865
ExplicitHeight = 455 ExplicitHeight = 506
end end
object pagContenido: TTabSheet object pagContenido: TTabSheet
Caption = 'Contenido' Caption = 'Contenido'
ImageIndex = 1 ImageIndex = 1
ExplicitHeight = 458
inline frViewDetallesPedidoProveedor1: TfrViewDetallesPedidoProveedor inline frViewDetallesPedidoProveedor1: TfrViewDetallesPedidoProveedor
Left = 0 Left = 0
Top = 0 Top = 0
@ -96,15 +94,28 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
TabOrder = 0 TabOrder = 0
ReadOnly = False ReadOnly = False
ExplicitWidth = 865 ExplicitWidth = 865
ExplicitHeight = 458 ExplicitHeight = 506
inherited ToolBar1: TToolBar inherited ToolBar1: TToolBar
Width = 865 Width = 865
Height = 51 Height = 51
ExplicitWidth = 865 ExplicitWidth = 865
ExplicitHeight = 51 ExplicitHeight = 51
inherited ToolButton14: TToolButton inherited ToolButton3: TToolButton
Wrap = False Wrap = False
end end
inherited ToolButton4: TToolButton
Left = 278
Top = 0
ExplicitLeft = 278
ExplicitTop = 0
end
inherited ToolButton14: TToolButton
Left = 334
Top = 0
Wrap = False
ExplicitLeft = 334
ExplicitTop = 0
end
inherited FontName: TJvFontComboBox inherited FontName: TJvFontComboBox
Left = 399 Left = 399
Top = 0 Top = 0
@ -114,10 +125,10 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
inherited FontSize: TEdit inherited FontSize: TEdit
Left = 544 Left = 544
Top = 0 Top = 0
Width = 150 Width = 166
ExplicitLeft = 544 ExplicitLeft = 544
ExplicitTop = 0 ExplicitTop = 0
ExplicitWidth = 150 ExplicitWidth = 166
end end
inherited ToolButton13: TToolButton [7] inherited ToolButton13: TToolButton [7]
Left = 0 Left = 0
@ -154,10 +165,8 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
inherited ToolButton12: TToolButton inherited ToolButton12: TToolButton
Left = 233 Left = 233
Top = 27 Top = 27
Wrap = False
ExplicitLeft = 233 ExplicitLeft = 233
ExplicitTop = 27 ExplicitTop = 27
ExplicitHeight = 22
end end
inherited ToolButton9: TToolButton inherited ToolButton9: TToolButton
Left = 241 Left = 241
@ -184,7 +193,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Height = 429 Height = 429
ExplicitTop = 77 ExplicitTop = 77
ExplicitWidth = 865 ExplicitWidth = 865
ExplicitHeight = 381 ExplicitHeight = 429
end end
inherited TBXDock1: TTBXDock inherited TBXDock1: TTBXDock
Top = 51 Top = 51
@ -209,7 +218,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
object pagInicidencias: TTabSheet object pagInicidencias: TTabSheet
Caption = 'Incidencias' Caption = 'Incidencias'
ImageIndex = 2 ImageIndex = 2
ExplicitHeight = 458
inline frViewIncidenciasProv: TfrViewIncidencias inline frViewIncidenciasProv: TfrViewIncidencias
Left = 0 Left = 0
Top = 0 Top = 0
@ -225,7 +233,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
TabOrder = 0 TabOrder = 0
ReadOnly = False ReadOnly = False
ExplicitWidth = 865 ExplicitWidth = 865
ExplicitHeight = 458 ExplicitHeight = 506
inherited pnlSup: TPanel inherited pnlSup: TPanel
Width = 865 Width = 865
ExplicitWidth = 865 ExplicitWidth = 865
@ -237,10 +245,10 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Width = 865 Width = 865
Height = 478 Height = 478
ExplicitWidth = 865 ExplicitWidth = 865
ExplicitHeight = 430 ExplicitHeight = 478
inherited eIncidencias: TcxDBMemo inherited eIncidencias: TcxDBMemo
ExplicitWidth = 848 ExplicitWidth = 848
ExplicitHeight = 403 ExplicitHeight = 451
Height = 451 Height = 451
Width = 848 Width = 848
end end
@ -255,7 +263,7 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
item item
Width = 200 Width = 200
end> end>
ExplicitTop = 614 ExplicitTop = 659
ExplicitWidth = 879 ExplicitWidth = 879
end end
inline frViewTotales1: TfrViewTotales [4] inline frViewTotales1: TfrViewTotales [4]

View File

@ -15,8 +15,6 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
TabOrder = 0 TabOrder = 0
TabStop = False TabStop = False
AutoContentSizes = [acsWidth, acsHeight] AutoContentSizes = [acsWidth, acsHeight]
ExplicitWidth = 787
ExplicitHeight = 615
DesignSize = ( DesignSize = (
965 965
546) 546)
@ -40,7 +38,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
StyleFocused.LookAndFeel.NativeStyle = True StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 1 TabOrder = 1
Width = 4 Width = 333
end end
object edtFechaConfirmacion: TcxDBDateEdit object edtFechaConfirmacion: TcxDBDateEdit
Left = 599 Left = 599
@ -61,7 +59,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
StyleFocused.LookAndFeel.NativeStyle = True StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 10 TabOrder = 10
Width = 359 Width = 344
end end
object edtFechaEntrega: TcxDBDateEdit object edtFechaEntrega: TcxDBDateEdit
Left = 599 Left = 599
@ -80,7 +78,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
StyleFocused.LookAndFeel.NativeStyle = True StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 11 TabOrder = 11
Width = 359 Width = 344
end end
object memObservaciones: TcxDBMemo object memObservaciones: TcxDBMemo
Left = 484 Left = 484
@ -97,8 +95,8 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
StyleFocused.LookAndFeel.NativeStyle = True StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 12 TabOrder = 12
Height = 380 Height = 200
Width = 239 Width = 459
end end
object eReferencia: TcxDBTextEdit object eReferencia: TcxDBTextEdit
Left = 121 Left = 121
@ -120,13 +118,13 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
StyleFocused.LookAndFeel.NativeStyle = True StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 0 TabOrder = 0
Width = 359 Width = 333
end end
inline frViewDireccionEntregaPedidoProv1: TfrViewDireccionEntregaPedidoProv inline frViewDireccionEntregaPedidoProv1: TfrViewDireccionEntregaPedidoProv
Left = 22 Left = 22
Top = 168 Top = 168
Width = 432 Width = 432
Height = 270 Height = 248
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -11 Font.Height = -11
@ -138,12 +136,12 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
ExplicitLeft = 22 ExplicitLeft = 22
ExplicitTop = 168 ExplicitTop = 168
ExplicitWidth = 432 ExplicitWidth = 432
ExplicitHeight = 270 ExplicitHeight = 248
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 432 Width = 432
Height = 270 Height = 248
ExplicitWidth = 355 ExplicitWidth = 432
ExplicitHeight = 314 ExplicitHeight = 270
inherited Bevel1: TBevel inherited Bevel1: TBevel
Top = 204 Top = 204
Width = 412 Width = 412
@ -151,16 +149,16 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
ExplicitWidth = 412 ExplicitWidth = 412
end end
inherited rdxDestino1: TRadioButton inherited rdxDestino1: TRadioButton
Width = 414 Width = 412
ExplicitWidth = 414 ExplicitWidth = 412
end end
inherited rdxDestino2: TRadioButton inherited rdxDestino2: TRadioButton
Width = 414 Width = 412
ExplicitWidth = 414 ExplicitWidth = 412
end end
inherited cbListaAlmacenes: TcxDBLookupComboBox inherited cbListaAlmacenes: TcxDBLookupComboBox
ExplicitWidth = 399 ExplicitWidth = 397
Width = 399 Width = 397
end end
inherited bModificar: TBitBtn inherited bModificar: TBitBtn
Left = 294 Left = 294
@ -169,24 +167,24 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
ExplicitTop = 168 ExplicitTop = 168
end end
inherited txtDireccion: TStaticText inherited txtDireccion: TStaticText
Width = 399 Width = 397
Height = 62 Height = 29
ExplicitWidth = 399 ExplicitWidth = 397
ExplicitHeight = 62 ExplicitHeight = 29
end end
inherited RadioButton1: TRadioButton inherited RadioButton1: TRadioButton
Width = 454 Width = 412
ExplicitWidth = 454 ExplicitWidth = 412
end end
inherited cbListaObras: TcxDBLookupComboBox inherited cbListaObras: TcxDBLookupComboBox
ExplicitWidth = 439 ExplicitWidth = 397
Width = 439 Width = 397
end end
inherited edtEntregarA: TcxDBButtonEdit inherited edtEntregarA: TcxDBButtonEdit
Top = 217 Top = 217
ExplicitTop = 217 ExplicitTop = 217
ExplicitWidth = 394 ExplicitWidth = 180
Width = 394 Width = 180
end end
end end
inherited ActionList1: TActionList inherited ActionList1: TActionList
@ -228,7 +226,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 2 TabOrder = 2
Width = 24 Width = 195
end end
object bFormasPago: TButton object bFormasPago: TButton
Left = 322 Left = 322
@ -281,7 +279,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 4 TabOrder = 4
Width = 221 Width = 195
end end
object bVerPedidoCliente: TButton object bVerPedidoCliente: TButton
Left = 322 Left = 322
@ -294,7 +292,7 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
inline frViewProveedorPedido1: TfrViewProveedorPedido inline frViewProveedorPedido1: TfrViewProveedorPedido
Left = 484 Left = 484
Top = 28 Top = 28
Width = 486 Width = 459
Height = 149 Height = 149
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -306,59 +304,65 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
ReadOnly = False ReadOnly = False
ExplicitLeft = 484 ExplicitLeft = 484
ExplicitTop = 28 ExplicitTop = 28
ExplicitWidth = 486 ExplicitWidth = 459
ExplicitHeight = 149 ExplicitHeight = 149
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 486 Width = 459
Height = 266 Height = 266
ExplicitWidth = 358 ExplicitWidth = 486
ExplicitHeight = 266 ExplicitHeight = 266
inherited edtlNombre: TcxDBTextEdit inherited edtlNombre: TcxDBTextEdit
ExplicitWidth = 213 ExplicitWidth = 331
Width = 213 Width = 331
end end
inherited edtNIFCIF: TcxDBTextEdit inherited edtNIFCIF: TcxDBTextEdit
ExplicitWidth = 213 ExplicitWidth = 331
Width = 213 Width = 331
end end
inherited edtCalle: TcxDBTextEdit inherited edtCalle: TcxDBTextEdit
ExplicitWidth = 213 ExplicitWidth = 331
Width = 213 Width = 331
end end
inherited edtPoblacion: TcxDBTextEdit inherited edtPoblacion: TcxDBTextEdit
ExplicitWidth = 95
Width = 95
end
inherited edtProvincia: TcxDBTextEdit
ExplicitWidth = 213 ExplicitWidth = 213
Width = 213 Width = 213
end end
inherited edtProvincia: TcxDBTextEdit
ExplicitWidth = 331
Width = 331
end
inherited edtCodigoPostal: TcxDBTextEdit inherited edtCodigoPostal: TcxDBTextEdit
Left = 367 Left = 367
ExplicitLeft = 367 ExplicitLeft = 367
end end
inherited Button1: TBitBtn
OnClick = frViewProveedorPedidoButton1Click
end
inherited Button2: TBitBtn
OnClick = frViewProveedorPedidoButton2Click
end
inherited Button3: TBitBtn inherited Button3: TBitBtn
Left = 251 Left = 251
ExplicitLeft = 251 ExplicitLeft = 251
end end
inherited edtPersonaContacto: TcxDBTextEdit inherited edtPersonaContacto: TcxDBTextEdit
ExplicitWidth = 213 ExplicitWidth = 331
Width = 213 Width = 331
end end
inherited edtReferenciaAsignada: TcxDBTextEdit inherited edtReferenciaAsignada: TcxDBTextEdit
Left = 328 Left = 328
ExplicitLeft = 328 ExplicitLeft = 328
end end
inherited edtFax: TcxDBTextEdit inherited edtFax: TcxDBTextEdit
ExplicitWidth = 82 ExplicitWidth = 138
Width = 82 Width = 138
end end
end end
end end
inline frViewObraReserva1: TfrViewObraReserva inline frViewObraReserva1: TfrViewObraReserva
Left = 22 Left = 22
Top = 452 Top = 452
Width = 331 Width = 432
Height = 72 Height = 72
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -370,19 +374,20 @@ inherited frViewPedidoProveedor: TfrViewPedidoProveedor
ReadOnly = False ReadOnly = False
ExplicitLeft = 22 ExplicitLeft = 22
ExplicitTop = 452 ExplicitTop = 452
ExplicitWidth = 331 ExplicitWidth = 432
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 331 Width = 432
ExplicitWidth = 331
DesignSize = ( DesignSize = (
331 432
72) 72)
inherited Label1: TLabel inherited Label1: TLabel
Width = 235 Width = 235
ExplicitWidth = 235 ExplicitWidth = 235
end end
inherited cbListaObrasReserva: TcxDBLookupComboBox inherited cbListaObrasReserva: TcxDBLookupComboBox
ExplicitWidth = 296 ExplicitWidth = 397
Width = 296 Width = 397
end end
end end
end end

View File

@ -233,10 +233,11 @@ begin
with FDocumento, tbl_Cabecera do with FDocumento, tbl_Cabecera do
begin begin
{ ----------------------- PENDIENTE if FieldByName('DESCUENTO').AsFloat > 0 then
FDesBonificacion := FieldByName('DESBONIFICACION').AsVariant; FDesBonificacion := 'Bonificación ' + FormatFloat(DISPLAY_PORCENTAJE, FieldByName('DESCUENTO').AsFloat)
FImpBonificacion := FieldByName('IMPBONIFICACION').AsFloat; else
----------------------- } FDesBonificacion := Null;
FImpBonificacion := FieldByName('IMPORTE_DESCUENTO').AsFloat;
ReplaceBookmark('CodigoPresupuestoCab', FieldByName('REFERENCIA').AsString); ReplaceBookmark('CodigoPresupuestoCab', FieldByName('REFERENCIA').AsString);
ReplaceBookmark('FechaPresupuestoCab', FieldByName('FECHA_PRESUPUESTO').AsString); ReplaceBookmark('FechaPresupuestoCab', FieldByName('FECHA_PRESUPUESTO').AsString);

View File

@ -388,6 +388,20 @@ begin
end; end;
end; end;
//En el caso de tener descuento (bonificación) el presupuesto se añade una fila con el importe
if (AListaPresupuestos.IMPORTE_DESCUENTO > 0) then
begin
AFacturasClienteController.DetallesController.Add(AFacturaActual.Detalles, TIPO_DETALLE_CONCEPTO);
with AFacturaActual.Detalles do
begin
Edit;
CONCEPTO := 'Bonificación ' + FloatToStr(AListaPresupuestos.DESCUENTO) + '%';
CANTIDAD := -1;
IMPORTE_UNIDAD := AListaPresupuestos.IMPORTE_DESCUENTO;
Post;
end;
end;
// Añado el resumen // Añado el resumen
AFacturasClienteController.DetallesController.Add(AFacturaActual.Detalles, TIPO_DETALLE_SUBTOTAL); AFacturasClienteController.DetallesController.Add(AFacturaActual.Detalles, TIPO_DETALLE_SUBTOTAL);
with AFacturaActual.Detalles do with AFacturaActual.Detalles do