From 82e02df1d2018fb558c172ba38fa7493539a2e1e Mon Sep 17 00:00:00 2001 From: roberto Date: Mon, 22 Oct 2007 17:55:10 +0000 Subject: [PATCH] =?UTF-8?q?Cambios=20liberaci=C3=B3n=20de=20memoria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@60 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- Build/Build.fbv | 2 +- .../Empresas/Data/uDataModuleEmpresas.dfm | 1 + .../Empresas/Data/uDataModuleEmpresas.pas | 34 +- .../Controller/uUsuariosController.pas | 1 - .../Usuarios/Views/uUsuariosViewRegister.pas | 2 +- Source/ApplicationBase/uFactuGES_App.pas | 2 +- Source/Base/Base.dpk | 4 +- Source/Base/Base.dproj | 5 +- Source/Base/Base.res | Bin 384 -> 4748 bytes Source/Base/Controladores/uControllerBase.pas | 4 +- .../Controladores/uControllerDetallesBase.pas | 12 +- .../Controladores/uControllerDetallesDTO.pas | 70 - Source/Base/Utiles/uCalculosUtils.pas | 153 ++ Source/Cliente/FactuGES.dpr | 3 +- Source/Cliente/FactuGES.dproj | 6 +- Source/Cliente/FactuGES.drc | 11 +- Source/Cliente/FactuGES.rc | 2 +- Source/Cliente/FactuGES.res | Bin 171980 -> 172180 bytes Source/Cliente/JvJansD11R.drc | 2 - Source/Cliente/uBootStrap.pas | 1 + Source/Cliente/uPantallaPrincipal.dfm | 2 +- Source/Cliente/uPantallaPrincipal.pas | 17 +- Source/GUIBase/GUIBase.drc | 48 +- Source/GUIBase/GUIBase.res | Bin 384 -> 4748 bytes Source/GUIBase/uViewDetallesBase.pas | 2 + Source/GUIBase/uViewDetallesGenerico.pas | 2 +- .../Controller/Contactos_controller.drc | 4 +- .../Modulos/Contactos/Data/Contactos_data.drc | 12 +- .../Contactos/Data/uDataModuleContactos.dfm | 1 + .../Contactos/Data/uDataModuleContactos.pas | 6 + .../Contactos/Model/Contactos_model.drc | 4 +- .../Contactos/Plugin/Contactos_plugin.drc | 6 +- .../Contactos/Views/Contactos_view.drc | 68 +- .../Contactos/Views/Contactos_view.res | Bin 384 -> 4748 bytes .../Contactos/Views/uEditorContactos.pas | 1 + .../Controller/FormasPago_controller.dproj | 498 +++- .../Controller/FormasPago_controller.res | Bin 384 -> 4748 bytes .../Formas de pago/Data/FormasPago_data.dproj | 496 +++- .../Formas de pago/Data/FormasPago_data.res | Bin 384 -> 4748 bytes .../Model/FormasPago_model.dproj | 5 + .../Formas de pago/Model/FormasPago_model.res | Bin 384 -> 4748 bytes .../Plugin/FormasPago_plugin.dproj | 502 +++- .../Plugin/FormasPago_plugin.res | Bin 384 -> 4748 bytes .../Views/FormasPago_view.dproj | 15 +- .../Formas de pago/Views/FormasPago_view.res | Bin 384 -> 4748 bytes .../Tipos de IVA/Data/TiposIVA_data.drc | 6 +- .../Tipos de IVA/Model/TiposIVA_model.drc | 4 +- Source/Servidor/FactuGES_Server.RES | Bin 23200 -> 23204 bytes Source/Servidor/FactuGES_Server.dpr | 1 - Source/Servidor/FactuGES_Server.dproj | 204 +- Source/Servidor/FactuGES_Server.drc | 2119 +---------------- Source/Servidor/FactuGES_Server.rc | 4 +- 52 files changed, 1929 insertions(+), 2413 deletions(-) delete mode 100644 Source/Base/Controladores/uControllerDetallesDTO.pas create mode 100644 Source/Base/Utiles/uCalculosUtils.pas diff --git a/Build/Build.fbv b/Build/Build.fbv index 411786d2..f2a6fa1d 100644 --- a/Build/Build.fbv +++ b/Build/Build.fbv @@ -1 +1 @@ - + diff --git a/Source/ApplicationBase/Empresas/Data/uDataModuleEmpresas.dfm b/Source/ApplicationBase/Empresas/Data/uDataModuleEmpresas.dfm index d24532a6..14571f20 100644 --- a/Source/ApplicationBase/Empresas/Data/uDataModuleEmpresas.dfm +++ b/Source/ApplicationBase/Empresas/Data/uDataModuleEmpresas.dfm @@ -1,6 +1,7 @@ object DataModuleEmpresasObj: TDataModuleEmpresasObj OldCreateOrder = True OnCreate = DAClientDataModuleCreate + OnDestroy = DataModuleDestroy Height = 267 Width = 402 object RORemoteService: TRORemoteService diff --git a/Source/ApplicationBase/Empresas/Data/uDataModuleEmpresas.pas b/Source/ApplicationBase/Empresas/Data/uDataModuleEmpresas.pas index e5aedc6a..e6c673ac 100644 --- a/Source/ApplicationBase/Empresas/Data/uDataModuleEmpresas.pas +++ b/Source/ApplicationBase/Empresas/Data/uDataModuleEmpresas.pas @@ -8,10 +8,10 @@ uses {vcl:} SysUtils, Classes, DB, DBClient, uROClient, uROBinMessage, uROWinInetHttpChannel, uDADesigntimeCall, uIDataModuleEmpresas, uBizEmpresas, uBizEmpresasDatosBancarios, uDARemoteDataAdapter, uDADataStreamer, uRODynamicRequest, uDAInterfaces, - uDAMemDataTable, uDABin2DataStreamer, uIntegerListUtils; + uDAMemDataTable, uDABin2DataStreamer, uIntegerListUtils, uControllerBase; type - TDataModuleEmpresasObj = class(TDataModule, IDataModuleEmpresas) + TDataModuleEmpresasObj = class(TDataModule) RORemoteService: TRORemoteService; rda_Empresas: TDARemoteDataAdapter; Bin2DataStreamer: TDABin2DataStreamer; @@ -20,6 +20,7 @@ type tbl_EmpresasDatosBanco: TDAMemDataTable; ds_EmpresasDatosBanco: TDADataSource; procedure DAClientDataModuleCreate(Sender: TObject); + procedure DataModuleDestroy(Sender: TObject); private function _GetDatosBancarios : IBizEmpresasDatosBancarios; public @@ -28,13 +29,16 @@ type function GetItems : IBizEmpresa; end; - TDataModuleEmpresas = class(TInterfacedObject, IDataModuleEmpresas) + TDataModuleEmpresas = class(TMiInterfacedObject, IDataModuleEmpresas) private FDataModule : TDataModuleEmpresasObj; - property DataModule : TDataModuleEmpresasObj read FDataModule implements IDataModuleEmpresas; public constructor Create; destructor Destroy; override; + + function GetItem(const ID : Integer) : IBizEmpresa; + function NewItem : IBizEmpresa; + function GetItems : IBizEmpresa; end; implementation @@ -42,7 +46,7 @@ implementation {$R *.DFM} uses - uDataModuleConexion, uDataTableUtils, + uDataModuleConexion, uDataTableUtils, Dialogs, FactuGES_Intf, schEmpresasClient_Intf, cxControls; procedure TDataModuleEmpresasObj.DAClientDataModuleCreate(Sender: TObject); @@ -51,6 +55,11 @@ begin RORemoteService.Message := dmConexion.Message; end; +procedure TDataModuleEmpresasObj.DataModuleDestroy(Sender: TObject); +begin + ShowMessage('TDataModuleEmpresasObj.Destroy'); +end; + function TDataModuleEmpresasObj.GetItem(const ID: Integer): IBizEmpresa; begin ShowHourglassCursor; @@ -127,4 +136,19 @@ begin inherited; end; +function TDataModuleEmpresas.GetItem(const ID: Integer): IBizEmpresa; +begin + Result := FDataModule.GetItem(ID); +end; + +function TDataModuleEmpresas.GetItems: IBizEmpresa; +begin + Result := FDataModule.GetItems; +end; + +function TDataModuleEmpresas.NewItem: IBizEmpresa; +begin + Result := FDataModule.NewItem; +end; + end. diff --git a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas index c7916e98..cb3ead53 100644 --- a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas +++ b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas @@ -199,7 +199,6 @@ begin ShowHourglassCursor; try CreateEditor('EditorLogin', IEditorLogin, AEditor); - with AEditor do Controller := Self; finally diff --git a/Source/ApplicationBase/Usuarios/Views/uUsuariosViewRegister.pas b/Source/ApplicationBase/Usuarios/Views/uUsuariosViewRegister.pas index 99cb4a0c..86cfb05b 100644 --- a/Source/ApplicationBase/Usuarios/Views/uUsuariosViewRegister.pas +++ b/Source/ApplicationBase/Usuarios/Views/uUsuariosViewRegister.pas @@ -8,7 +8,7 @@ procedure UnregisterViews; implementation uses - uEditorRegistryUtils, uEditorLogin; + uEditorRegistryUtils, uEditorLogin, Dialogs; procedure RegisterViews; begin diff --git a/Source/ApplicationBase/uFactuGES_App.pas b/Source/ApplicationBase/uFactuGES_App.pas index c0b69f36..61b7a447 100644 --- a/Source/ApplicationBase/uFactuGES_App.pas +++ b/Source/ApplicationBase/uFactuGES_App.pas @@ -134,7 +134,7 @@ var implementation uses - cxControls, uDataModuleBase, uUsuariosViewRegister, + Dialogs, cxControls, uDataModuleBase, uUsuariosViewRegister, uEmpresasViewRegister; procedure TAppFactuGES.CambiarEmpresa(const AIDEmpresa: Integer); diff --git a/Source/Base/Base.dpk b/Source/Base/Base.dpk index 834a1bab..b697db04 100644 --- a/Source/Base/Base.dpk +++ b/Source/Base/Base.dpk @@ -98,8 +98,8 @@ contains uPasswordUtils in 'Utiles\uPasswordUtils.pas', uInfoProjectUtils in 'Utiles\uInfoProjectUtils.pas', uInformeRegistryUtils in 'Utiles\ClassRegistry\uInformeRegistryUtils.pas', - uControllerDetallesDTO in 'Controladores\uControllerDetallesDTO.pas', uControllerBase in 'Controladores\uControllerBase.pas', - uControllerDetallesBase in 'Controladores\uControllerDetallesBase.pas'; + uControllerDetallesBase in 'Controladores\uControllerDetallesBase.pas', + uCalculosUtils in 'Utiles\uCalculosUtils.pas'; end. diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 40cf7b90..83f2751b 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -1,4 +1,5 @@ - + + {70a31e92-41c6-4435-a901-d77c3d82951e} Base.dpk @@ -116,7 +117,6 @@ -
dmBase
@@ -124,6 +124,7 @@ + diff --git a/Source/Base/Base.res b/Source/Base/Base.res index 8b251f312bcccec5485024f6fe8d80e1cdf25746..1641339fcc482e7e3492d1b45813a86619622c33 100644 GIT binary patch literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP delta 11 ScmeBCZD5|Duvteife`=|>;pCc diff --git a/Source/Base/Controladores/uControllerBase.pas b/Source/Base/Controladores/uControllerBase.pas index 41e73b0e..db6bb9ff 100644 --- a/Source/Base/Controladores/uControllerBase.pas +++ b/Source/Base/Controladores/uControllerBase.pas @@ -20,7 +20,6 @@ type procedure DeleteObservador(Observador: IObservador); end; - { ******************* PARA PRUEBAS ******************************************} IMiInterface = interface(IInterface) ['{C4C3F81D-4318-457C-860A-6034617FE39E}'] @@ -43,7 +42,6 @@ type { ***************************************************************************} - TObservador = class(TInterfacedObject, IObservador) protected procedure RecibirAviso(ASujeto: ISujeto); overload; virtual; @@ -138,6 +136,7 @@ begin end; + { TSujeto } procedure TSujeto.addObservador(Observador: IObservador); @@ -193,5 +192,4 @@ begin // end; - end. diff --git a/Source/Base/Controladores/uControllerDetallesBase.pas b/Source/Base/Controladores/uControllerDetallesBase.pas index 9b113746..8198311e 100644 --- a/Source/Base/Controladores/uControllerDetallesBase.pas +++ b/Source/Base/Controladores/uControllerDetallesBase.pas @@ -2,17 +2,9 @@ unit uControllerDetallesBase; interface -uses Classes, Variants, uDACDSDataTable, uDADataTable, uControllerBase; +uses Classes, Variants, uDACDSDataTable, uDADataTable, uControllerBase, uCalculosUtils; const - CAMPO_ID = 'ID'; - CAMPO_POSICION = 'POSICION'; - CAMPO_TIPO = 'TIPO_DETALLE'; - CAMPO_CONCEPTO = 'CONCEPTO'; - CAMPO_CANTIDAD = 'CANTIDAD'; - CAMPO_IMPORTE_UNIDAD = 'IMPORTE_UNIDAD'; - CAMPO_IMPORTE_TOTAL = 'IMPORTE_TOTAL'; - TIPO_DETALLE_CONCEPTO = 'Concepto'; TIPO_DETALLE_TITULO = 'Titulo'; TIPO_DETALLE_SUBTOTAL = 'Subtotal'; @@ -283,6 +275,7 @@ var AField: TDAField; DeletePosicion: Integer; begin + DeletePosicion := 0; AField := ADataTable.DataTable.FindField(CAMPO_POSICION); if not Assigned(AField) then raise Exception.Create('Campo ' + CAMPO_POSICION + ' no encontrado (Delete)'); @@ -291,7 +284,6 @@ begin try with ADataTable do begin - DeletePosicion := 0; for i := 0 to High(POSICION) do begin DataTable.First; diff --git a/Source/Base/Controladores/uControllerDetallesDTO.pas b/Source/Base/Controladores/uControllerDetallesDTO.pas deleted file mode 100644 index 63c5ece3..00000000 --- a/Source/Base/Controladores/uControllerDetallesDTO.pas +++ /dev/null @@ -1,70 +0,0 @@ -unit uControllerDetallesDTO; - -interface - -uses Classes, Variants, uDACDSDataTable, uDADataTable, uControllerDetallesBase; - -const - CAMPO_DESCUENTO = 'DESCUENTO'; - //Además del descuento tambien se añade el Precio de porte por artículo - CAMPO_IMPORTE_PORTE = 'IMPORTE_PORTE'; - -type - IControllerDetallesDTO = interface(IControllerDetallesBase) - ['{F6C5D9E4-4D3D-404F-9B6A-58D4A24B01C6}'] - end; - - TControllerDetallesDTO = class (TControllerDetallesBase, IControllerDetallesDTO) - protected - //Si en los hijos existen campos a tener en cuenta se sobreescribira este metodo - procedure ValidarCampos(DataTable: TDADataTable); override; - - //Si sobreescribimos este método podremos tener en cuenta otras columnas para el calculo del importe total de un concepto - function CalcularImporteTotalConcepto(DataTable: TDADataTable): Double; override; - end; - - -implementation - -{ TControllerDetallesBase } - -uses SysUtils, uDAInterfaces; - -function TControllerDetallesDTO.CalcularImporteTotalConcepto(DataTable: TDADataTable): Double; -var - ImporteTotal : Double; -begin - with DataTable do - begin - if (VarIsNull(FieldByName(CAMPO_DESCUENTO).AsVariant)) then - ImporteTotal := FieldByName(CAMPO_CANTIDAD).asInteger * FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat - else - ImporteTotal := FieldByName(CAMPO_CANTIDAD).asInteger * (FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat - (FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat * (FieldByName(CAMPO_DESCUENTO).AsFloat/100))); - - if (VarIsNull(FieldByName(CAMPO_IMPORTE_PORTE).AsVariant)) then - ImporteTotal := ImporteTotal - else - ImporteTotal := ImporteTotal + (FieldByName(CAMPO_CANTIDAD).asInteger * FieldByName(CAMPO_IMPORTE_PORTE).AsFloat); - end; - - Result := ImporteTotal; -end; - -procedure TControllerDetallesDTO.validarCampos(DataTable: TDADataTable); -var - AField: TDAField; -begin - inherited; - //Validamos la existencia de todos los campos necesarios - - AField := DataTable.FindField(CAMPO_DESCUENTO); - if not Assigned(AField) then - raise Exception.Create('Campo ' + CAMPO_DESCUENTO + ' no encontrado (validarCampos)'); - - - AField := DataTable.FindField(CAMPO_IMPORTE_PORTE); - if not Assigned(AField) then - raise Exception.Create('Campo ' + CAMPO_IMPORTE_PORTE + ' no encontrado (validarCampos)'); -end; - -end. diff --git a/Source/Base/Utiles/uCalculosUtils.pas b/Source/Base/Utiles/uCalculosUtils.pas new file mode 100644 index 00000000..b5eb6dea --- /dev/null +++ b/Source/Base/Utiles/uCalculosUtils.pas @@ -0,0 +1,153 @@ +unit uCalculosUtils; + +interface + +uses + uDADataTable, uDAInterfaces; + +const + CAMPO_ID = 'ID'; + CAMPO_POSICION = 'POSICION'; + CAMPO_TIPO = 'TIPO_DETALLE'; + CAMPO_ID_ARTICULOS = 'ID_ARTICULO'; + CAMPO_CONCEPTO = 'CONCEPTO'; + CAMPO_CANTIDAD = 'CANTIDAD'; + CAMPO_IMPORTE_UNIDAD = 'IMPORTE_UNIDAD'; + CAMPO_IMPORTE_TOTAL = 'IMPORTE_TOTAL'; + CAMPO_DESCUENTO = 'DESCUENTO'; + CAMPO_IMPORTE_PORTE = 'IMPORTE_PORTE'; + + function CalcularLineaConcepto (const ADataTable : TDADataTable): Double; + procedure ValidarCamposLineaConcepto(DataTable: TDADataTable); + + procedure DesglosarPorte(ImportePorte: Currency; ADetalles: IDAStronglyTypedDataTable); + function DarTotalPorte(ADetalles: IDAStronglyTypedDataTable): Double; + + +implementation + +uses + SysUtils, DB, Variants; + +function CalcularLineaConcepto (const ADataTable : TDADataTable): Double; +var + ImporteTotal : Double; +begin + ImporteTotal := 0; + + with ADataTable do + begin + if (VarIsNull(FieldByName(CAMPO_DESCUENTO).AsVariant)) then + ImporteTotal := FieldByName(CAMPO_CANTIDAD).asInteger * FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat + else + ImporteTotal := FieldByName(CAMPO_CANTIDAD).asInteger * (FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat - (FieldByName(CAMPO_IMPORTE_UNIDAD).AsFloat * (FieldByName(CAMPO_DESCUENTO).AsFloat/100))); + + if (VarIsNull(FieldByName(CAMPO_IMPORTE_PORTE).AsVariant)) then + ImporteTotal := ImporteTotal + else + ImporteTotal := ImporteTotal + (FieldByName(CAMPO_CANTIDAD).asInteger * FieldByName(CAMPO_IMPORTE_PORTE).AsFloat); + end; + + Result := ImporteTotal; +end; + +procedure ValidarCamposLineaConcepto(DataTable: TDADataTable); +var + AField: TDAField; +begin + //Validamos la existencia de todos los campos necesarios + AField := DataTable.FindField(CAMPO_DESCUENTO); + if not Assigned(AField) then + raise Exception.Create('Campo ' + CAMPO_DESCUENTO + ' no encontrado (validarCampos)'); + + + AField := DataTable.FindField(CAMPO_IMPORTE_PORTE); + if not Assigned(AField) then + raise Exception.Create('Campo ' + CAMPO_IMPORTE_PORTE + ' no encontrado (validarCampos)'); +end; + +procedure DesglosarPorte(ImportePorte: Currency; ADetalles: IDAStronglyTypedDataTable); +var + Unidades: Integer; + ImporteUnidad: Currency; + ImporteSobrante: Currency; + ABookmark : TBookmark; + +begin + + try + ABookmark := ADetalles.DataTable.GetBookMark; + ADetalles.DataTable.DisableControls; + ADetalles.DataTable.DisableEventHandlers; + + ADetalles.DataTable.First; + Unidades := 0; + while not ADetalles.DataTable.eof do + begin + if (ADetalles.DataTable.FieldByName(CAMPO_ID_ARTICULOS).AsInteger > 0) then + Unidades := Unidades + ADetalles.DataTable.FieldByName(CAMPO_CANTIDAD).AsInteger; + ADetalles.DataTable.Next; + end; + + if Unidades > 0 then + begin + ImporteUnidad := StrToCurr(FormatFloat('0000000000.00', (ImportePorte / Unidades))); + ImporteSobrante := ((ImportePorte / Unidades) - ImporteUnidad) * Unidades; + end; + + ADetalles.DataTable.First; + while not ADetalles.DataTable.eof do + begin + if (ADetalles.DataTable.FieldByName(CAMPO_ID_ARTICULOS).AsInteger > 0) then + begin + ADetalles.DataTable.Edit; + ADetalles.DataTable.FieldByName(CAMPO_IMPORTE_PORTE).AsCurrency := ImporteUnidad; + ADetalles.DataTable.Post; + end; + ADetalles.DataTable.Next; + end; + + ADetalles.DataTable.Edit; + ADetalles.DataTable.FieldByName(CAMPO_IMPORTE_PORTE).AsCurrency := ImporteUnidad + ImporteSobrante; + ADetalles.DataTable.Post; + + finally + ADetalles.DataTable.EnableEventHandlers; + ADetalles.DataTable.GotoBookmark(ABookmark); + ADetalles.DataTable.FreeBookmark(ABookmark); + ADetalles.DataTable.EnableControls; + end; +end; + +function DarTotalPorte(ADetalles: IDAStronglyTypedDataTable): Double; +var + ImporteTotal: Currency; + ABookmark : TBookmark; + +begin + try + ABookmark := ADetalles.DataTable.GetBookMark; + ADetalles.DataTable.DisableControls; + ADetalles.DataTable.DisableEventHandlers; + + ADetalles.DataTable.First; + ImporteTotal := 0; + while not ADetalles.DataTable.eof do + begin + if (ADetalles.DataTable.FieldByName(CAMPO_ID_ARTICULOS).AsInteger > 0) then + ImporteTotal := ImporteTotal + (ADetalles.DataTable.FieldByName(CAMPO_CANTIDAD).AsInteger * ADetalles.DataTable.FieldByName(CAMPO_IMPORTE_PORTE).AsFloat); + ADetalles.DataTable.Next; + end; + + finally + ADetalles.DataTable.EnableEventHandlers; + ADetalles.DataTable.GotoBookmark(ABookmark); + ADetalles.DataTable.FreeBookmark(ABookmark); + ADetalles.DataTable.EnableControls; + end; + + Result := ImporteTotal; +end; + + +end. diff --git a/Source/Cliente/FactuGES.dpr b/Source/Cliente/FactuGES.dpr index 10a482a8..1a44f8f2 100644 --- a/Source/Cliente/FactuGES.dpr +++ b/Source/Cliente/FactuGES.dpr @@ -1,7 +1,6 @@ program FactuGES; uses - ExceptionLog, Forms, Windows, SysUtils, @@ -24,6 +23,7 @@ begin Application.Initialize; Application.ShowMainForm := False; + ReportMemoryLeaksOnShutdown := True; // ¡¡¡Fallo en Delphi 2007!!! @@ -34,7 +34,6 @@ begin uBootStrap.Run; // <- Aquí dentro esta Application.Run uBootStrap.Terminate; - //Application.Terminate; //<- No descomentar para así ver los Memory Leaks end. diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index 3ff7f264..e27398e7 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -45,7 +45,7 @@ $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;T:\COMPON~1\jcl\lib\d11\debug;$(BDSCOMMONDIR)\Dcp;..\Lib;..\Modulos\Lib $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;T:\COMPON~1\jcl\lib\d11\debug;$(BDSCOMMONDIR)\Dcp;..\Lib;..\Modulos\Lib $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;T:\COMPON~1\jcl\lib\d11\debug;$(BDSCOMMONDIR)\Dcp;..\Lib;..\Modulos\Lib - DEBUG;EUREKALOG;EUREKALOG_VER6 + DEBUG;
Delphi.Personality @@ -88,7 +88,7 @@ diff --git a/Source/Modulos/Formas de pago/Controller/FormasPago_controller.res b/Source/Modulos/Formas de pago/Controller/FormasPago_controller.res index 8b251f312bcccec5485024f6fe8d80e1cdf25746..1641339fcc482e7e3492d1b45813a86619622c33 100644 GIT binary patch literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP delta 11 ScmeBCZD5|Duvteife`=|>;pCc diff --git a/Source/Modulos/Formas de pago/Data/FormasPago_data.dproj b/Source/Modulos/Formas de pago/Data/FormasPago_data.dproj index b8f727d1..9991a637 100644 --- a/Source/Modulos/Formas de pago/Data/FormasPago_data.dproj +++ b/Source/Modulos/Formas de pago/Data/FormasPago_data.dproj @@ -47,14 +47,498 @@ MainSource - - - - - - + + + + + +
DataModuleFormasPago
+ + diff --git a/Source/Modulos/Formas de pago/Data/FormasPago_data.res b/Source/Modulos/Formas de pago/Data/FormasPago_data.res index 8b251f312bcccec5485024f6fe8d80e1cdf25746..1641339fcc482e7e3492d1b45813a86619622c33 100644 GIT binary patch literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP delta 11 ScmeBCZD5|Duvteife`=|>;pCc diff --git a/Source/Modulos/Formas de pago/Model/FormasPago_model.dproj b/Source/Modulos/Formas de pago/Model/FormasPago_model.dproj index 894619ec..004c1524 100644 --- a/Source/Modulos/Formas de pago/Model/FormasPago_model.dproj +++ b/Source/Modulos/Formas de pago/Model/FormasPago_model.dproj @@ -47,6 +47,11 @@ MainSource + + + + + diff --git a/Source/Modulos/Formas de pago/Model/FormasPago_model.res b/Source/Modulos/Formas de pago/Model/FormasPago_model.res index 8b251f312bcccec5485024f6fe8d80e1cdf25746..1641339fcc482e7e3492d1b45813a86619622c33 100644 GIT binary patch literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP delta 11 ScmeBCZD5|Duvteife`=|>;pCc diff --git a/Source/Modulos/Formas de pago/Plugin/FormasPago_plugin.dproj b/Source/Modulos/Formas de pago/Plugin/FormasPago_plugin.dproj index e6a2ae38..f8913308 100644 --- a/Source/Modulos/Formas de pago/Plugin/FormasPago_plugin.dproj +++ b/Source/Modulos/Formas de pago/Plugin/FormasPago_plugin.dproj @@ -47,15 +47,499 @@ MainSource - - - - - - - - - + + + + + + + + +
+ + diff --git a/Source/Modulos/Formas de pago/Plugin/FormasPago_plugin.res b/Source/Modulos/Formas de pago/Plugin/FormasPago_plugin.res index 8b251f312bcccec5485024f6fe8d80e1cdf25746..1641339fcc482e7e3492d1b45813a86619622c33 100644 GIT binary patch literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP delta 11 ScmeBCZD5|Duvteife`=|>;pCc diff --git a/Source/Modulos/Formas de pago/Views/FormasPago_view.dproj b/Source/Modulos/Formas de pago/Views/FormasPago_view.dproj index c34c9dcb..c1baf6be 100644 --- a/Source/Modulos/Formas de pago/Views/FormasPago_view.dproj +++ b/Source/Modulos/Formas de pago/Views/FormasPago_view.dproj @@ -48,12 +48,13 @@ MainSource - - - - - - + + + + + + +
fEditorFormaPago
@@ -61,10 +62,8 @@
fEditorFormasPago
- -