- 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:
David Arranz 2007-12-20 20:36:56 +00:00
parent ff3c571ffb
commit 2d2dc11604
5 changed files with 49 additions and 46 deletions

View File

@ -117,7 +117,6 @@ uses
uDataModuleUsuarios, uDAInterfaces, uDataTableUtils, uDateUtils,
uAlbaranesClienteController, schAlbaranesClienteClient_Intf, uROTypes, uDetallesAlbaranClienteController,
uBizDetallesAlbaranCliente, uFacturasClienteReportController,
// uBizPedidosCliente, uPedidosClienteController, uBizDetallesPedidoCliente,
DateUtils, Forms, Dialogs,
uFormasPagoController, uBizFormasPago, uIEditorElegirFacturasCliente,
uRecibosClienteController, uBizRecibosCliente;
@ -786,6 +785,7 @@ procedure TFacturasClienteController.RecalcularImportes(
AFactura: IBizFacturaCliente);
var
bEnEdicion : Boolean;
ADetallePosAct : Integer;
begin
if not Assigned(AFactura) then
raise Exception.Create ('Factura no asignado (RecalcularImportes)');
@ -793,18 +793,23 @@ begin
if AFactura.DataTable.Active then
AFactura.DataTable.Active := True;
ADetallePosAct := AFactura.Detalles.POSICION;
bEnEdicion := (AFactura.DataTable.State in dsEditModes);
if not bEnEdicion then
AFactura.Edit;
ShowHourglassCursor;
AFactura.Edit;
try
AFactura.IMPORTE_NETO := FDetallesController.DarTotalImporteTotal(AFactura.Detalles);
AFactura.IMPORTE_PORTE := FDetallesController.DarTotalPorteTotal(AFactura.Detalles);
FDetallesController.LocalizarPosicion(AFactura.Detalles, ADetallePosAct);
if not bEnEdicion then
AFactura.Post;
finally
HideHourglassCursor;
end;
end;

View File

@ -7,7 +7,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Position = poScreenCenter
OnClose = CustomEditorClose
ExplicitWidth = 796
ExplicitHeight = 602
ExplicitHeight = 609
PixelsPerInch = 96
TextHeight = 13
inherited JvNavPanelHeader: TJvNavPanelHeader
@ -69,21 +69,21 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
end
end
inherited pgPaginas: TPageControl
Width = 788
Height = 317
Width = 782
Height = 311
OnChanging = pgPaginasChanging
ExplicitWidth = 788
ExplicitHeight = 317
ExplicitWidth = 782
ExplicitHeight = 311
inherited pagGeneral: TTabSheet
ExplicitLeft = 4
ExplicitTop = 24
ExplicitWidth = 780
ExplicitHeight = 289
ExplicitWidth = 774
ExplicitHeight = 283
inline frViewFacturaCliente1: TfrViewFacturaCliente
Left = 0
Top = 0
Width = 780
Height = 289
Width = 774
Height = 283
Align = alClient
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
@ -93,16 +93,16 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
ParentFont = False
TabOrder = 0
ReadOnly = False
ExplicitWidth = 780
ExplicitHeight = 289
ExplicitWidth = 774
ExplicitHeight = 283
inherited dxLayoutControl1: TdxLayoutControl
Width = 780
Height = 289
ExplicitWidth = 780
ExplicitHeight = 289
Width = 774
Height = 283
ExplicitWidth = 774
ExplicitHeight = 283
DesignSize = (
780
289)
774
283)
inherited eReferencia: TcxDBTextEdit
ExplicitWidth = 393
Width = 393
@ -118,9 +118,9 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Width = 473
end
inherited frViewClienteFactura: TfrViewDatosYSeleccionCliente
Left = 474
Left = 471
Width = 332
ExplicitLeft = 474
ExplicitLeft = 471
ExplicitWidth = 332
inherited dxLayoutControl1: TdxLayoutControl
Width = 332
@ -161,8 +161,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Width = 255
end
inherited bFormasPago: TButton
Left = 314
ExplicitLeft = 314
Left = 311
ExplicitLeft = 311
end
end
end
@ -173,8 +173,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
inline frViewDetallesFacturaCliente1: TfrViewDetallesFacturaCliente
Left = 0
Top = 0
Width = 780
Height = 289
Width = 774
Height = 283
Align = alClient
BiDiMode = bdLeftToRight
Font.Charset = DEFAULT_CHARSET
@ -186,11 +186,11 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
ParentFont = False
TabOrder = 0
ReadOnly = False
ExplicitWidth = 780
ExplicitHeight = 289
ExplicitWidth = 774
ExplicitHeight = 283
inherited ToolBar1: TToolBar
Width = 780
ExplicitWidth = 780
Width = 774
ExplicitWidth = 774
inherited ToolButton4: TToolButton
Wrap = False
end
@ -249,13 +249,13 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
end
end
inherited cxGrid: TcxGrid
Width = 780
Height = 217
ExplicitWidth = 780
ExplicitHeight = 217
Width = 774
Height = 211
ExplicitWidth = 774
ExplicitHeight = 211
end
inherited TBXDock1: TTBXDock
Width = 780
Width = 774
ExplicitWidth = 780
inherited TBXToolbar1: TTBXToolbar
ExplicitWidth = 548

View File

@ -176,10 +176,14 @@ procedure TfEditorFacturaCliente.frViewTotales1cbRecargoEquivalenciaPropertiesEd
Sender: TObject);
begin
inherited;
if frViewTotales1.cbRecargoEquivalencia.Checked then
Factura.RECARGO_EQUIVALENCIA := 1
else
Factura.RECARGO_EQUIVALENCIA := 0;
if Assigned(Factura) then
begin
Factura.Edit;
if frViewTotales1.cbRecargoEquivalencia.Checked then
Factura.RECARGO_EQUIVALENCIA := 1
else
Factura.RECARGO_EQUIVALENCIA := 0;
end;
end;
procedure TfEditorFacturaCliente.frViewTotales1edtDescuentoPropertiesValidate(
@ -391,7 +395,7 @@ begin
if Assigned(FFactura) then
begin
dsDataTable.DataTable := FFactura.DataTable;
// frViewTotales1.DADataSource.DataTable := FFactura.DataTable;
frViewTotales1.DADataSource.DataTable := FFactura.DataTable;
FTiposIVA := FTiposIVAController.BuscarTodos;
frViewTotales1.dsTiposIVA.DataTable := FTiposIVA.DataTable;

View File

@ -1,12 +1,6 @@
inherited frViewDetallesFacturaCliente: TfrViewDetallesFacturaCliente
inherited cxGrid: TcxGrid
inherited cxGridView: TcxGridDBTableView
inherited cxGridViewID: TcxGridDBColumn
Visible = False
end
inherited cxGridViewPOSICION: TcxGridDBColumn
Visible = False
end
inherited cxGridViewTIPO: TcxGridDBColumn
Visible = False
end

View File

@ -12,7 +12,7 @@ uses
Grids, DBGrids, StdCtrls, ExtCtrls, cxRichEdit, StdActns, ExtActns,
JvExStdCtrls, JvCombobox, JvColorCombo, TB2Item, TBX, TB2Dock, TB2Toolbar,
uControllerDetallesArticulos, uViewDetallesArticulos, uBizFacturasCliente,
uDAInterfaces;
uDAInterfaces, cxDropDownEdit;
type
IViewDetallesFacturaCliente = interface(IViewDetallesArticulos)