Modificación de viewDetallesDTO en la base para poder introducir un valor en importe neto y a partir de el calcular el dto, solo se habilita la funcionalidad en albaranes de proveedor y facturas de proveedor

git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@138 c93665c3-c93d-084d-9b98-7d5f4a9c3376
This commit is contained in:
roberto 2007-08-22 17:01:32 +00:00
parent 6bfc50d3c6
commit 7be510cf2f
14 changed files with 65 additions and 39 deletions

Binary file not shown.

View File

@ -29,15 +29,18 @@ inherited frViewDetallesDTO: TfrViewDetallesDTO
DataBinding.FieldName = 'DESCUENTO' DataBinding.FieldName = 'DESCUENTO'
PropertiesClassName = 'TcxCurrencyEditProperties' PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.DisplayFormat = ',0.00 %;-,0.00 %' Properties.DisplayFormat = ',0.00 %;-,0.00 %'
Properties.EditFormat = ',0.00;-,0.00'
Properties.MaxValue = 100.000000000000000000 Properties.MaxValue = 100.000000000000000000
end end
object cxGridViewIMPORTENETO: TcxGridDBColumn [7] object cxGridViewIMPORTENETO: TcxGridDBColumn [7]
Caption = 'Importe neto' Caption = 'Importe neto'
DataBinding.ValueType = 'Currency'
PropertiesClassName = 'TcxCurrencyEditProperties' PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.Alignment.Horz = taRightJustify Properties.Alignment.Horz = taRightJustify
Properties.DisplayFormat = ',0.00 '#8364';-,0.00 '#8364 Properties.DisplayFormat = ',0.00 '#8364';-,0.00 '#8364
Properties.EditFormat = ',0.00 '#8364';-,0.00 '#8364 Properties.EditFormat = ',0.00 '#8364';-,0.00 '#8364
Properties.ReadOnly = True Properties.ReadOnly = True
Properties.OnValidate = cxGridViewIMPORTENETOPropertiesValidate
OnGetDisplayText = cxGridViewIMPORTENETOGetDisplayText OnGetDisplayText = cxGridViewIMPORTENETOGetDisplayText
HeaderAlignmentHorz = taRightJustify HeaderAlignmentHorz = taRightJustify
Options.Editing = False Options.Editing = False
@ -53,7 +56,6 @@ inherited frViewDetallesDTO: TfrViewDetallesDTO
end end
end end
inherited TBXDock1: TTBXDock inherited TBXDock1: TTBXDock
ExplicitTop = 72
inherited TBXToolbar1: TTBXToolbar inherited TBXToolbar1: TTBXToolbar
ExplicitWidth = 447 ExplicitWidth = 447
end end

View File

@ -23,6 +23,8 @@ type
cxGridViewIMPORTENETO: TcxGridDBColumn; cxGridViewIMPORTENETO: TcxGridDBColumn;
procedure cxGridViewIMPORTENETOGetDisplayText(Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; procedure cxGridViewIMPORTENETOGetDisplayText(Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
var AText: string); var AText: string);
procedure cxGridViewIMPORTENETOPropertiesValidate(Sender: TObject;
var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
protected protected
function HayQueRecalcular(AItem: TcxCustomGridTableItem): Boolean; override; function HayQueRecalcular(AItem: TcxCustomGridTableItem): Boolean; override;
end; end;
@ -32,8 +34,7 @@ implementation
{ TfrViewDetallesDTO } { TfrViewDetallesDTO }
procedure TfrViewDetallesDTO.cxGridViewIMPORTENETOGetDisplayText( procedure TfrViewDetallesDTO.cxGridViewIMPORTENETOGetDisplayText(Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord;
var AText: string); var AText: string);
var var
ImporteNeto : Double; ImporteNeto : Double;
@ -53,6 +54,17 @@ begin
end; end;
end; end;
procedure TfrViewDetallesDTO.cxGridViewIMPORTENETOPropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption;
var Error: Boolean);
begin
inherited;
if not VarIsNull(DisplayValue) then
begin
cxGridViewDESCUENTO.DataBinding.Field.Value := ((cxGridViewIMPORTEUNIDAD.DataBinding.Field.Value - DisplayValue) * 100) / cxGridViewIMPORTEUNIDAD.DataBinding.Field.Value;
Controller.ActualizarTotales(Detalles);
end;
end;
function TfrViewDetallesDTO.HayQueRecalcular(AItem: TcxCustomGridTableItem): Boolean; function TfrViewDetallesDTO.HayQueRecalcular(AItem: TcxCustomGridTableItem): Boolean;
begin begin
Result := inherited HayQueRecalcular(AItem); Result := inherited HayQueRecalcular(AItem);

Binary file not shown.

View File

@ -147,20 +147,20 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor
inherited pgPaginas: TPageControl inherited pgPaginas: TPageControl
Width = 765 Width = 765
Height = 460 Height = 460
ActivePage = pagContenido
TabOrder = 1 TabOrder = 1
OnChanging = pgPaginasChanging OnChanging = pgPaginasChanging
ExplicitWidth = 765 ExplicitWidth = 765
ExplicitHeight = 425 ExplicitHeight = 460
inherited pagGeneral: TTabSheet inherited pagGeneral: TTabSheet
ExplicitLeft = 4 ExplicitLeft = 4
ExplicitTop = 24 ExplicitTop = 24
ExplicitWidth = 757 ExplicitWidth = 757
ExplicitHeight = 397 ExplicitHeight = 432
end end
object pagContenido: TTabSheet object pagContenido: TTabSheet
Caption = 'Contenido' Caption = 'Contenido'
ImageIndex = 1 ImageIndex = 1
ExplicitHeight = 397
inline frViewDetallesAlbaranProveedor1: TfrViewDetallesAlbaranProveedor inline frViewDetallesAlbaranProveedor1: TfrViewDetallesAlbaranProveedor
Left = 0 Left = 0
Top = 0 Top = 0
@ -178,7 +178,7 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor
TabOrder = 0 TabOrder = 0
ReadOnly = False ReadOnly = False
ExplicitWidth = 757 ExplicitWidth = 757
ExplicitHeight = 397 ExplicitHeight = 432
inherited ToolBar1: TToolBar inherited ToolBar1: TToolBar
Width = 757 Width = 757
ExplicitWidth = 757 ExplicitWidth = 757
@ -187,7 +187,7 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor
Width = 757 Width = 757
Height = 360 Height = 360
ExplicitWidth = 757 ExplicitWidth = 757
ExplicitHeight = 325 ExplicitHeight = 360
end end
inherited TBXDock1: TTBXDock inherited TBXDock1: TTBXDock
Width = 757 Width = 757
@ -201,7 +201,6 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor
object pagInicidencias: TTabSheet object pagInicidencias: TTabSheet
Caption = 'Incidencias' Caption = 'Incidencias'
ImageIndex = 2 ImageIndex = 2
ExplicitHeight = 397
inline frViewIncidenciasCli: TfrViewIncidencias inline frViewIncidenciasCli: TfrViewIncidencias
Left = 0 Left = 0
Top = 0 Top = 0
@ -217,7 +216,7 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor
TabOrder = 0 TabOrder = 0
ReadOnly = False ReadOnly = False
ExplicitWidth = 757 ExplicitWidth = 757
ExplicitHeight = 397 ExplicitHeight = 432
inherited pnlSup: TPanel inherited pnlSup: TPanel
Width = 757 Width = 757
ExplicitWidth = 757 ExplicitWidth = 757
@ -229,10 +228,10 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor
Width = 757 Width = 757
Height = 404 Height = 404
ExplicitWidth = 757 ExplicitWidth = 757
ExplicitHeight = 423 ExplicitHeight = 404
inherited eIncidencias: TcxDBMemo inherited eIncidencias: TcxDBMemo
ExplicitWidth = 734 ExplicitWidth = 734
ExplicitHeight = 390 ExplicitHeight = 371
Height = 371 Height = 371
Width = 734 Width = 734
end end
@ -247,7 +246,7 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor
item item
Width = 200 Width = 200
end> end>
ExplicitTop = 546 ExplicitTop = 600
ExplicitWidth = 765 ExplicitWidth = 765
end end
inline frViewTotales1: TfrViewTotales [4] inline frViewTotales1: TfrViewTotales [4]

View File

@ -1,2 +1,10 @@
inherited frViewDetallesAlbaranProveedor: TfrViewDetallesAlbaranProveedor inherited frViewDetallesAlbaranProveedor: TfrViewDetallesAlbaranProveedor
inherited cxGrid: TcxGrid
inherited cxGridView: TcxGridDBTableView
inherited cxGridViewIMPORTENETO: TcxGridDBColumn
Properties.ReadOnly = False
Options.Editing = True
end
end
end
end end

View File

@ -71,6 +71,7 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
inherited pgPaginas: TPageControl inherited pgPaginas: TPageControl
Width = 788 Width = 788
Height = 317 Height = 317
ActivePage = pagContenido
OnChanging = pgPaginasChanging OnChanging = pgPaginasChanging
ExplicitWidth = 788 ExplicitWidth = 788
ExplicitHeight = 317 ExplicitHeight = 317
@ -196,49 +197,49 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor
ExplicitLeft = 334 ExplicitLeft = 334
ExplicitTop = 2 ExplicitTop = 2
end end
inherited FontName: TJvFontComboBox inherited FontSize: TEdit [5]
Left = 0 Left = 0
ExplicitLeft = 0 ExplicitLeft = 0
end end
inherited FontSize: TEdit inherited UpDown1: TUpDown [6]
Left = 145 Left = 42
ExplicitLeft = 145 ExplicitLeft = 42
end end
inherited UpDown1: TUpDown inherited FontName: TJvFontComboBox [7]
Left = 203 Left = 59
ExplicitLeft = 203 ExplicitLeft = 59
end end
inherited ToolButton13: TToolButton inherited ToolButton13: TToolButton
Left = 220 Left = 204
ExplicitLeft = 220 ExplicitLeft = 204
end end
inherited ToolButton6: TToolButton inherited ToolButton6: TToolButton
Left = 228 Left = 212
ExplicitLeft = 228 ExplicitLeft = 212
end end
inherited ToolButton7: TToolButton inherited ToolButton7: TToolButton
Left = 262 Left = 246
ExplicitLeft = 262 ExplicitLeft = 246
end end
inherited ToolButton8: TToolButton inherited ToolButton8: TToolButton
Left = 296 Left = 280
ExplicitLeft = 296 ExplicitLeft = 280
end end
inherited ToolButton12: TToolButton inherited ToolButton12: TToolButton
Left = 330 Left = 314
ExplicitLeft = 330 ExplicitLeft = 314
end end
inherited ToolButton9: TToolButton inherited ToolButton9: TToolButton
Left = 338 Left = 322
ExplicitLeft = 338 ExplicitLeft = 322
end end
inherited ToolButton10: TToolButton inherited ToolButton10: TToolButton
Left = 372 Left = 356
ExplicitLeft = 372 ExplicitLeft = 356
end end
inherited ToolButton11: TToolButton inherited ToolButton11: TToolButton
Left = 406 Left = 390
ExplicitLeft = 406 ExplicitLeft = 390
end end
end end
inherited cxGrid: TcxGrid inherited cxGrid: TcxGrid

View File

@ -1,6 +1,10 @@
inherited frViewDetallesFacturaProveedor: TfrViewDetallesFacturaProveedor inherited frViewDetallesFacturaProveedor: TfrViewDetallesFacturaProveedor
inherited TBXDock1: TTBXDock inherited cxGrid: TcxGrid
ExplicitTop = 46 inherited cxGridView: TcxGridDBTableView
ExplicitWidth = 451 inherited cxGridViewIMPORTENETO: TcxGridDBColumn
Properties.ReadOnly = False
Options.Editing = True
end
end
end end
end end