- Arreglado error al recalcular los totales en los detalles.
- En el editor de la factura no se mostraban los totales (no estaban enlazados a la tabla). git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@192 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
parent
ff3c571ffb
commit
2d2dc11604
@ -117,7 +117,6 @@ uses
|
|||||||
uDataModuleUsuarios, uDAInterfaces, uDataTableUtils, uDateUtils,
|
uDataModuleUsuarios, uDAInterfaces, uDataTableUtils, uDateUtils,
|
||||||
uAlbaranesClienteController, schAlbaranesClienteClient_Intf, uROTypes, uDetallesAlbaranClienteController,
|
uAlbaranesClienteController, schAlbaranesClienteClient_Intf, uROTypes, uDetallesAlbaranClienteController,
|
||||||
uBizDetallesAlbaranCliente, uFacturasClienteReportController,
|
uBizDetallesAlbaranCliente, uFacturasClienteReportController,
|
||||||
// uBizPedidosCliente, uPedidosClienteController, uBizDetallesPedidoCliente,
|
|
||||||
DateUtils, Forms, Dialogs,
|
DateUtils, Forms, Dialogs,
|
||||||
uFormasPagoController, uBizFormasPago, uIEditorElegirFacturasCliente,
|
uFormasPagoController, uBizFormasPago, uIEditorElegirFacturasCliente,
|
||||||
uRecibosClienteController, uBizRecibosCliente;
|
uRecibosClienteController, uBizRecibosCliente;
|
||||||
@ -786,6 +785,7 @@ procedure TFacturasClienteController.RecalcularImportes(
|
|||||||
AFactura: IBizFacturaCliente);
|
AFactura: IBizFacturaCliente);
|
||||||
var
|
var
|
||||||
bEnEdicion : Boolean;
|
bEnEdicion : Boolean;
|
||||||
|
ADetallePosAct : Integer;
|
||||||
begin
|
begin
|
||||||
if not Assigned(AFactura) then
|
if not Assigned(AFactura) then
|
||||||
raise Exception.Create ('Factura no asignado (RecalcularImportes)');
|
raise Exception.Create ('Factura no asignado (RecalcularImportes)');
|
||||||
@ -793,18 +793,23 @@ begin
|
|||||||
if AFactura.DataTable.Active then
|
if AFactura.DataTable.Active then
|
||||||
AFactura.DataTable.Active := True;
|
AFactura.DataTable.Active := True;
|
||||||
|
|
||||||
|
ADetallePosAct := AFactura.Detalles.POSICION;
|
||||||
|
|
||||||
bEnEdicion := (AFactura.DataTable.State in dsEditModes);
|
bEnEdicion := (AFactura.DataTable.State in dsEditModes);
|
||||||
if not bEnEdicion then
|
if not bEnEdicion then
|
||||||
AFactura.Edit;
|
AFactura.Edit;
|
||||||
|
|
||||||
ShowHourglassCursor;
|
ShowHourglassCursor;
|
||||||
AFactura.Edit;
|
|
||||||
try
|
try
|
||||||
AFactura.IMPORTE_NETO := FDetallesController.DarTotalImporteTotal(AFactura.Detalles);
|
AFactura.IMPORTE_NETO := FDetallesController.DarTotalImporteTotal(AFactura.Detalles);
|
||||||
AFactura.IMPORTE_PORTE := FDetallesController.DarTotalPorteTotal(AFactura.Detalles);
|
AFactura.IMPORTE_PORTE := FDetallesController.DarTotalPorteTotal(AFactura.Detalles);
|
||||||
|
FDetallesController.LocalizarPosicion(AFactura.Detalles, ADetallePosAct);
|
||||||
if not bEnEdicion then
|
if not bEnEdicion then
|
||||||
AFactura.Post;
|
AFactura.Post;
|
||||||
finally
|
finally
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HideHourglassCursor;
|
HideHourglassCursor;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
|||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
OnClose = CustomEditorClose
|
OnClose = CustomEditorClose
|
||||||
ExplicitWidth = 796
|
ExplicitWidth = 796
|
||||||
ExplicitHeight = 602
|
ExplicitHeight = 609
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 96
|
||||||
TextHeight = 13
|
TextHeight = 13
|
||||||
inherited JvNavPanelHeader: TJvNavPanelHeader
|
inherited JvNavPanelHeader: TJvNavPanelHeader
|
||||||
@ -69,21 +69,21 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited pgPaginas: TPageControl
|
inherited pgPaginas: TPageControl
|
||||||
Width = 788
|
Width = 782
|
||||||
Height = 317
|
Height = 311
|
||||||
OnChanging = pgPaginasChanging
|
OnChanging = pgPaginasChanging
|
||||||
ExplicitWidth = 788
|
ExplicitWidth = 782
|
||||||
ExplicitHeight = 317
|
ExplicitHeight = 311
|
||||||
inherited pagGeneral: TTabSheet
|
inherited pagGeneral: TTabSheet
|
||||||
ExplicitLeft = 4
|
ExplicitLeft = 4
|
||||||
ExplicitTop = 24
|
ExplicitTop = 24
|
||||||
ExplicitWidth = 780
|
ExplicitWidth = 774
|
||||||
ExplicitHeight = 289
|
ExplicitHeight = 283
|
||||||
inline frViewFacturaCliente1: TfrViewFacturaCliente
|
inline frViewFacturaCliente1: TfrViewFacturaCliente
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 780
|
Width = 774
|
||||||
Height = 289
|
Height = 283
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = clWindowText
|
Font.Color = clWindowText
|
||||||
@ -93,16 +93,16 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
|||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
ReadOnly = False
|
ReadOnly = False
|
||||||
ExplicitWidth = 780
|
ExplicitWidth = 774
|
||||||
ExplicitHeight = 289
|
ExplicitHeight = 283
|
||||||
inherited dxLayoutControl1: TdxLayoutControl
|
inherited dxLayoutControl1: TdxLayoutControl
|
||||||
Width = 780
|
Width = 774
|
||||||
Height = 289
|
Height = 283
|
||||||
ExplicitWidth = 780
|
ExplicitWidth = 774
|
||||||
ExplicitHeight = 289
|
ExplicitHeight = 283
|
||||||
DesignSize = (
|
DesignSize = (
|
||||||
780
|
774
|
||||||
289)
|
283)
|
||||||
inherited eReferencia: TcxDBTextEdit
|
inherited eReferencia: TcxDBTextEdit
|
||||||
ExplicitWidth = 393
|
ExplicitWidth = 393
|
||||||
Width = 393
|
Width = 393
|
||||||
@ -118,9 +118,9 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
|||||||
Width = 473
|
Width = 473
|
||||||
end
|
end
|
||||||
inherited frViewClienteFactura: TfrViewDatosYSeleccionCliente
|
inherited frViewClienteFactura: TfrViewDatosYSeleccionCliente
|
||||||
Left = 474
|
Left = 471
|
||||||
Width = 332
|
Width = 332
|
||||||
ExplicitLeft = 474
|
ExplicitLeft = 471
|
||||||
ExplicitWidth = 332
|
ExplicitWidth = 332
|
||||||
inherited dxLayoutControl1: TdxLayoutControl
|
inherited dxLayoutControl1: TdxLayoutControl
|
||||||
Width = 332
|
Width = 332
|
||||||
@ -161,8 +161,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
|||||||
Width = 255
|
Width = 255
|
||||||
end
|
end
|
||||||
inherited bFormasPago: TButton
|
inherited bFormasPago: TButton
|
||||||
Left = 314
|
Left = 311
|
||||||
ExplicitLeft = 314
|
ExplicitLeft = 311
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -173,8 +173,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
|||||||
inline frViewDetallesFacturaCliente1: TfrViewDetallesFacturaCliente
|
inline frViewDetallesFacturaCliente1: TfrViewDetallesFacturaCliente
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 780
|
Width = 774
|
||||||
Height = 289
|
Height = 283
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BiDiMode = bdLeftToRight
|
BiDiMode = bdLeftToRight
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
@ -186,11 +186,11 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
|||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
ReadOnly = False
|
ReadOnly = False
|
||||||
ExplicitWidth = 780
|
ExplicitWidth = 774
|
||||||
ExplicitHeight = 289
|
ExplicitHeight = 283
|
||||||
inherited ToolBar1: TToolBar
|
inherited ToolBar1: TToolBar
|
||||||
Width = 780
|
Width = 774
|
||||||
ExplicitWidth = 780
|
ExplicitWidth = 774
|
||||||
inherited ToolButton4: TToolButton
|
inherited ToolButton4: TToolButton
|
||||||
Wrap = False
|
Wrap = False
|
||||||
end
|
end
|
||||||
@ -249,13 +249,13 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited cxGrid: TcxGrid
|
inherited cxGrid: TcxGrid
|
||||||
Width = 780
|
Width = 774
|
||||||
Height = 217
|
Height = 211
|
||||||
ExplicitWidth = 780
|
ExplicitWidth = 774
|
||||||
ExplicitHeight = 217
|
ExplicitHeight = 211
|
||||||
end
|
end
|
||||||
inherited TBXDock1: TTBXDock
|
inherited TBXDock1: TTBXDock
|
||||||
Width = 780
|
Width = 774
|
||||||
ExplicitWidth = 780
|
ExplicitWidth = 780
|
||||||
inherited TBXToolbar1: TTBXToolbar
|
inherited TBXToolbar1: TTBXToolbar
|
||||||
ExplicitWidth = 548
|
ExplicitWidth = 548
|
||||||
|
|||||||
@ -176,10 +176,14 @@ procedure TfEditorFacturaCliente.frViewTotales1cbRecargoEquivalenciaPropertiesEd
|
|||||||
Sender: TObject);
|
Sender: TObject);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
if frViewTotales1.cbRecargoEquivalencia.Checked then
|
if Assigned(Factura) then
|
||||||
Factura.RECARGO_EQUIVALENCIA := 1
|
begin
|
||||||
else
|
Factura.Edit;
|
||||||
Factura.RECARGO_EQUIVALENCIA := 0;
|
if frViewTotales1.cbRecargoEquivalencia.Checked then
|
||||||
|
Factura.RECARGO_EQUIVALENCIA := 1
|
||||||
|
else
|
||||||
|
Factura.RECARGO_EQUIVALENCIA := 0;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfEditorFacturaCliente.frViewTotales1edtDescuentoPropertiesValidate(
|
procedure TfEditorFacturaCliente.frViewTotales1edtDescuentoPropertiesValidate(
|
||||||
@ -391,7 +395,7 @@ begin
|
|||||||
if Assigned(FFactura) then
|
if Assigned(FFactura) then
|
||||||
begin
|
begin
|
||||||
dsDataTable.DataTable := FFactura.DataTable;
|
dsDataTable.DataTable := FFactura.DataTable;
|
||||||
// frViewTotales1.DADataSource.DataTable := FFactura.DataTable;
|
frViewTotales1.DADataSource.DataTable := FFactura.DataTable;
|
||||||
|
|
||||||
FTiposIVA := FTiposIVAController.BuscarTodos;
|
FTiposIVA := FTiposIVAController.BuscarTodos;
|
||||||
frViewTotales1.dsTiposIVA.DataTable := FTiposIVA.DataTable;
|
frViewTotales1.dsTiposIVA.DataTable := FTiposIVA.DataTable;
|
||||||
|
|||||||
@ -1,12 +1,6 @@
|
|||||||
inherited frViewDetallesFacturaCliente: TfrViewDetallesFacturaCliente
|
inherited frViewDetallesFacturaCliente: TfrViewDetallesFacturaCliente
|
||||||
inherited cxGrid: TcxGrid
|
inherited cxGrid: TcxGrid
|
||||||
inherited cxGridView: TcxGridDBTableView
|
inherited cxGridView: TcxGridDBTableView
|
||||||
inherited cxGridViewID: TcxGridDBColumn
|
|
||||||
Visible = False
|
|
||||||
end
|
|
||||||
inherited cxGridViewPOSICION: TcxGridDBColumn
|
|
||||||
Visible = False
|
|
||||||
end
|
|
||||||
inherited cxGridViewTIPO: TcxGridDBColumn
|
inherited cxGridViewTIPO: TcxGridDBColumn
|
||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
|
|||||||
@ -12,7 +12,7 @@ uses
|
|||||||
Grids, DBGrids, StdCtrls, ExtCtrls, cxRichEdit, StdActns, ExtActns,
|
Grids, DBGrids, StdCtrls, ExtCtrls, cxRichEdit, StdActns, ExtActns,
|
||||||
JvExStdCtrls, JvCombobox, JvColorCombo, TB2Item, TBX, TB2Dock, TB2Toolbar,
|
JvExStdCtrls, JvCombobox, JvColorCombo, TB2Item, TBX, TB2Dock, TB2Toolbar,
|
||||||
uControllerDetallesArticulos, uViewDetallesArticulos, uBizFacturasCliente,
|
uControllerDetallesArticulos, uViewDetallesArticulos, uBizFacturasCliente,
|
||||||
uDAInterfaces;
|
uDAInterfaces, cxDropDownEdit;
|
||||||
|
|
||||||
type
|
type
|
||||||
IViewDetallesFacturaCliente = interface(IViewDetallesArticulos)
|
IViewDetallesFacturaCliente = interface(IViewDetallesArticulos)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user