diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 33f4302b..e7914e6e 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -721,6 +721,7 @@ CREATE TABLE FACTURAS_CLIENTE ( ID_EMPRESA TIPO_ID, REFERENCIA VARCHAR(255), FECHA_FACTURA DATE, + FECHA_VENCIMIENTO DATE, BASE_IMPONIBLE TIPO_IMPORTE, DESCUENTO TIPO_PORCENTAJE, IMPORTE_DESCUENTO TIPO_IMPORTE, @@ -733,7 +734,7 @@ CREATE TABLE FACTURAS_CLIENTE ( ID_CLIENTE TIPO_ID, NIF_CIF VARCHAR(15), NOMBRE VARCHAR(255), - ID_DIRECCION TIPO_ID, + ID_DIRECCION TIPO_ID, CALLE VARCHAR(255), POBLACION VARCHAR(255), PROVINCIA VARCHAR(255), @@ -748,7 +749,7 @@ CREATE TABLE FACTURAS_CLIENTE ( RECARGO_EQUIVALENCIA TIPO_BOOLEANO, ID_COMISION_LIQUIDADA TIPO_ID, DATOS_BANCARIOS VARCHAR(255), - CLIENTE_FINAL VARCHAR(255) + CLIENTE_FINAL VARCHAR(255) ); CREATE TABLE FACTURAS_CLIENTE_DETALLES ( @@ -799,7 +800,8 @@ CREATE TABLE FACTURAS_PROVEEDOR ( IMPORTE_PORTE TIPO_IMPORTE, ID_TIPO_IVA TIPO_ID, RECARGO_EQUIVALENCIA TIPO_BOOLEANO, - DATOS_BANCARIOS VARCHAR(255) + DATOS_BANCARIOS VARCHAR(255), + FECHA_VENCIMIENTO DATE ); CREATE TABLE FACTURAS_PROVEEDOR_DETALLES ( @@ -2099,6 +2101,7 @@ CREATE VIEW V_FACTURAS_CLIENTE( TIPO, ID_COMISION_LIQUIDADA, FECHA_FACTURA, + FECHA_VENCIMIENTO, SITUACION, BASE_IMPONIBLE, DESCUENTO, @@ -2136,6 +2139,7 @@ SELECT FACTURAS_CLIENTE.ID, CASE WHEN (FACTURAS_CLIENTE.IMPORTE_TOTAL < 0) THEN 'A' ELSE 'F' END AS TIPO, FACTURAS_CLIENTE.ID_COMISION_LIQUIDADA, FACTURAS_CLIENTE.FECHA_FACTURA, + FACTURAS_CLIENTE.FECHA_VENCIMIENTO, TRIM(V_FAC_CLI_SITUACION.SITUACION), FACTURAS_CLIENTE.BASE_IMPONIBLE, FACTURAS_CLIENTE.DESCUENTO, @@ -2184,6 +2188,7 @@ CREATE VIEW V_FACTURAS_PROVEEDOR( TIPO, REFERENCIA_PROVEEDOR, FECHA_FACTURA, + FECHA_VENCIMIENTO, SITUACION, BASE_IMPONIBLE, DESCUENTO, @@ -2217,6 +2222,7 @@ SELECT FACTURAS_PROVEEDOR.ID, CASE WHEN (FACTURAS_PROVEEDOR.IMPORTE_TOTAL < 0) THEN 'A' ELSE 'F' END AS TIPO, FACTURAS_PROVEEDOR.REFERENCIA_PROVEEDOR, FACTURAS_PROVEEDOR.FECHA_FACTURA, + FACTURAS_PROVEEDOR.FECHA_VENCIMIENTO, TRIM(V_FAC_PRO_SITUACION.SITUACION), FACTURAS_PROVEEDOR.BASE_IMPONIBLE, FACTURAS_PROVEEDOR.DESCUENTO, diff --git a/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas b/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas index 01fba3b7..577ed711 100644 --- a/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas +++ b/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas @@ -144,8 +144,8 @@ begin ADatosBancarios.DataTable.First; while not ADatosBancarios.DataTable.EOF do begin - Aux := Format('Nº de cuenta: %s %s %s %s', [ADatosBancarios.ENTIDAD, - ADatosBancarios.SUCURSAL, ADatosBancarios.DC, ADatosBancarios.CUENTA]); + Aux := Format('Nº de cuenta: %s %s %s %s - %s', [ADatosBancarios.ENTIDAD, + ADatosBancarios.SUCURSAL, ADatosBancarios.DC, ADatosBancarios.CUENTA, ADatosBancarios.NOMBRE]); Add(Format('%s=%d', [Aux, ADatosBancarios.ID])); ADatosBancarios.DataTable.Next; end; @@ -177,7 +177,7 @@ begin begin if not EsCadenaVacia(ADatosBancarios.IBAN) then begin - Aux := Format('IBAN: %s - SWIFT: %s', [ADatosBancarios.IBAN, ADatosBancarios.SWIFT]); + Aux := Format('IBAN: %s - SWIFT: %s - %s', [ADatosBancarios.IBAN, ADatosBancarios.SWIFT, ADatosBancarios.NOMBRE]); Add(Format('%s=%d', [Aux, ADatosBancarios.ID])); end; ADatosBancarios.DataTable.Next; diff --git a/Source/ApplicationBase/Empresas/Views/uEditorDatosBancariosEmpresa.dfm b/Source/ApplicationBase/Empresas/Views/uEditorDatosBancariosEmpresa.dfm index 1407019d..2aa9e1db 100644 --- a/Source/ApplicationBase/Empresas/Views/uEditorDatosBancariosEmpresa.dfm +++ b/Source/ApplicationBase/Empresas/Views/uEditorDatosBancariosEmpresa.dfm @@ -23,7 +23,6 @@ object fEditorDatosBancariosEmpresa: TfEditorDatosBancariosEmpresa Caption = '&Guardar' ModalResult = 1 TabOrder = 0 - ExplicitLeft = 350 end object CancelBtn: TButton Left = 366 @@ -35,7 +34,6 @@ object fEditorDatosBancariosEmpresa: TfEditorDatosBancariosEmpresa Caption = '&Cancelar' ModalResult = 2 TabOrder = 1 - ExplicitLeft = 350 end object GroupBox1: TGroupBox Left = 8 @@ -166,6 +164,7 @@ object fEditorDatosBancariosEmpresa: TfEditorDatosBancariosEmpresa Height = 83 Caption = 'Sufijos para normas CSB' TabOrder = 3 + Visible = False object Label7: TLabel Left = 12 Top = 28 diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 50eb3891..51882323 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -54,57 +54,57 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fConfigurarConexion
diff --git a/Source/Modulos/Contactos/Controller/uClientesController.pas b/Source/Modulos/Contactos/Controller/uClientesController.pas index e011632f..852c91b5 100644 --- a/Source/Modulos/Contactos/Controller/uClientesController.pas +++ b/Source/Modulos/Contactos/Controller/uClientesController.pas @@ -3,7 +3,7 @@ unit uClientesController; interface uses - uCustomEditor, + uCustomEditor, Classes, uContactosController, uBizContactos, uBizDireccionesContacto, uIEditorClientes, uIEditorCliente, uIDataModuleContactos, uIDataModuleClientes, uDireccionesContactoController, uBizContactosPersonal; @@ -22,6 +22,7 @@ type procedure VerAlbaranesDeCliente(ACliente : IBizCliente); procedure VerFacturasDeCliente(ACliente : IBizCliente); procedure VerRecibosDeCliente(ACliente : IBizCliente); + function DarListaCuentasBancarias(const IdCliente: Integer): TStringList; end; TClientesController = class(TContactosController, IClientesController) @@ -53,12 +54,13 @@ type procedure VerAlbaranesDeCliente(ACliente : IBizCliente); procedure VerFacturasDeCliente(ACliente : IBizCliente); procedure VerRecibosDeCliente(ACliente : IBizCliente); + function DarListaCuentasBancarias(const IdCliente: Integer): TStringList; end; implementation uses - Forms, Classes, Windows, SysUtils, Controls, cxControls, uDialogUtils, uDataModuleClientes, uEditorRegistryUtils, + Forms, Windows, SysUtils, Controls, cxControls, uDialogUtils, uDataModuleClientes, uEditorRegistryUtils, uDataTableUtils, uDADataTable, DB, schContactosClient_Intf, uEtiquetasContactosReportController, uIEditorElegirClientes, uIEditorElegirDireccionEntrega, uEditorGridBase, uModuleController, Dialogs, uIntegerListUtils, uFactuGES_App, @@ -91,6 +93,35 @@ begin FDireccionesController := TDireccionesContactoController.Create; end; +function TClientesController.DarListaCuentasBancarias(const IdCliente: Integer): TStringList; +var + ACliente: IBizCliente; + Aux : String; + +begin + ACliente := (Buscar(IdCliente) as IBizCliente); + ACliente.DataTable.Active := True; + + Result := TStringList.Create; + ShowHourglassCursor; + try + with Result do + begin + ACliente.DatosBancarios.DataTable.First; + while not ACliente.DatosBancarios.DataTable.EOF do + begin + Aux := Format('Nº de cuenta: %s %s %s %s - Titular: %s ', [ACliente.DatosBancarios.ENTIDAD, + ACliente.DatosBancarios.SUCURSAL, ACliente.DatosBancarios.DC, ACliente.DatosBancarios.CUENTA, ACliente.DatosBancarios.TITULAR]); + Add(Format('%s=%d', [Aux, ACliente.DatosBancarios.ID])); + ACliente.DatosBancarios.DataTable.Next; + end; + end; + finally + ACliente := NIL; + HideHourglassCursor; + end; +end; + destructor TClientesController.Destroy; begin FDireccionesController := NIL; diff --git a/Source/Modulos/Contactos/Controller/uProveedoresController.pas b/Source/Modulos/Contactos/Controller/uProveedoresController.pas index a286eec2..e65747f4 100644 --- a/Source/Modulos/Contactos/Controller/uProveedoresController.pas +++ b/Source/Modulos/Contactos/Controller/uProveedoresController.pas @@ -23,8 +23,8 @@ type procedure VerAlbaranesDeProveedor(AProveedor : IBizProveedor); procedure VerDevolucionesDeProveedor(AProveedor : IBizProveedor); procedure VerFacturasDeProveedor(AProveedor : IBizProveedor); - procedure VerRecibosDeProveedor(AProveedor : IBizProveedor); - + procedure VerRecibosDeProveedor(AProveedor : IBizProveedor); + function DarListaCuentasBancarias(const IdProveedor: Integer): TStringList; end; TProveedoresController = class(TContactosController, IProveedoresController) @@ -54,7 +54,8 @@ type procedure VerAlbaranesDeProveedor(AProveedor : IBizProveedor); procedure VerDevolucionesDeProveedor(AProveedor : IBizProveedor); procedure VerFacturasDeProveedor(AProveedor : IBizProveedor); - procedure VerRecibosDeProveedor(AProveedor : IBizProveedor); + procedure VerRecibosDeProveedor(AProveedor : IBizProveedor); + function DarListaCuentasBancarias(const IdProveedor: Integer): TStringList; end; implementation @@ -106,6 +107,35 @@ begin FDireccionesController := TDireccionesContactoController.Create; end; +function TProveedoresController.DarListaCuentasBancarias(const IdProveedor: Integer): TStringList; +var + AProveedor: IBizProveedor; + Aux : String; + +begin + AProveedor := (Buscar(IdProveedor) as IBizProveedor); + AProveedor.DataTable.Active := True; + + Result := TStringList.Create; + ShowHourglassCursor; + try + with Result do + begin + AProveedor.DatosBancarios.DataTable.First; + while not AProveedor.DatosBancarios.DataTable.EOF do + begin + Aux := Format('Nº de cuenta: %s %s %s %s - Titular: %s ', [AProveedor.DatosBancarios.ENTIDAD, + AProveedor.DatosBancarios.SUCURSAL, AProveedor.DatosBancarios.DC, AProveedor.DatosBancarios.CUENTA, AProveedor.DatosBancarios.TITULAR]); + Add(Format('%s=%d', [Aux, AProveedor.DatosBancarios.ID])); + AProveedor.DatosBancarios.DataTable.Next; + end; + end; + finally + AProveedor := NIL; + HideHourglassCursor; + end; +end; + function TProveedoresController.DarListaDescripcionesProveedores: TStringList; begin Result := (FDataModule as IDataModuleProveedores).DarListaDescripcionesProveedores; diff --git a/Source/Modulos/Contactos/Views/Contactos_view.res b/Source/Modulos/Contactos/Views/Contactos_view.res index 1641339f..8b251f31 100644 Binary files a/Source/Modulos/Contactos/Views/Contactos_view.res and b/Source/Modulos/Contactos/Views/Contactos_view.res differ diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas index 85483f37..7cd59a01 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas @@ -555,6 +555,9 @@ begin end; function TFacturasClienteController.ValidarFactura(AFactura: IBizFacturaCliente): Boolean; +var + AFormaPago: IBizFormaPago; + begin if not Assigned(AFactura) then raise Exception.Create ('Factura no asignada'); @@ -584,6 +587,22 @@ begin { if (AFactura.ID_TIPO_IVA = 0) then raise Exception.Create('Debe indicar un tipo de IVA para esta factura');} + //De esta forma obligaremos siempre a tener un recibo asociado a la factura, + //porque si la forma de pago no tiene plazos es obligatorio la fecha de vencimiento + with TFormasPagoController.Create do + begin + try + AFormaPago := Buscar(AFactura.ID_FORMA_PAGO); + AFormaPago.DataTable.Active := True; + if (AFormaPago.Plazos.RecordCount = 0) + and (EsFechaVacia(AFactura.FECHA_VENCIMIENTO)) then + raise Exception.Create('Debe indicar una fecha de vencimiento para esta factura'); + finally + AFormaPago := NIL; + Free; + end; + end; + //En caso de ser un Abono no podra tener un importe total positivo if (AFactura.TIPO = CTE_TIPO_ABONO) then if (AFactura.IMPORTE_TOTAL > 0) then @@ -1104,41 +1123,48 @@ begin begin i := 1; First; - while not eof do - begin + repeat ARecibos := ARecibosClienteController.Nuevo; ARecibos.Edit; ARecibos.ID_FACTURA := AFactura.ID; ARecibos.REFERENCIA := AFactura.REFERENCIA + ' - ' + IntToStr(i); ARecibos.FECHA_EMISION := AFactura.FECHA_FACTURA; - AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; - ADiasMas := 0; - if (AFactura.Cliente.VENCIMIENTO_FACTURAS_1 <> 0) - or (AFactura.Cliente.VENCIMIENTO_FACTURAS_2 <> 0) - or (AFactura.Cliente.VENCIMIENTO_FACTURAS_3 <> 0) then + if AFormaPago.Plazos.RecordCount < 1 then begin - ADiaVencimiento := DayOf(AFechaVencimiento); - while (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_1) - and (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_2) - and (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_3) do + ARecibos.FECHA_VENCIMIENTO := AFactura.FECHA_VENCIMIENTO; + ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL; + end + else + begin + AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; + ADiasMas := 0; + if (AFactura.Cliente.VENCIMIENTO_FACTURAS_1 <> 0) + or (AFactura.Cliente.VENCIMIENTO_FACTURAS_2 <> 0) + or (AFactura.Cliente.VENCIMIENTO_FACTURAS_3 <> 0) then begin - if ADiaVencimiento = DaysInMonth(AFechaVencimiento) then - ADiaVencimiento := 1 - else - Inc(ADiaVencimiento); - Inc(ADiasMas); + ADiaVencimiento := DayOf(AFechaVencimiento); + while (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_1) + and (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_2) + and (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS_3) do + begin + if ADiaVencimiento = DaysInMonth(AFechaVencimiento) then + ADiaVencimiento := 1 + else + Inc(ADiaVencimiento); + Inc(ADiasMas); + end; end; + AFechaVencimiento := IncDay(AFechaVencimiento, ADiasMas); + ARecibos.FECHA_VENCIMIENTO := AFechaVencimiento; + ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL * (AFormaPago.Plazos.PORCENTAJE / 100); end; - AFechaVencimiento := IncDay(AFechaVencimiento, ADiasMas); - ARecibos.FECHA_VENCIMIENTO := AFechaVencimiento; - ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL * (AFormaPago.Plazos.PORCENTAJE / 100); ARecibos.DESCRIPCION := 'Pago de factura ' + AFactura.REFERENCIA + ': son ' + CifraToLetras(ARecibos.IMPORTE); ARecibosClienteController.Guardar(ARecibos); Inc(i); Next; - end; + until (eof); end; //Liberamos diff --git a/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.dfm b/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.dfm index 5236d6cd..fc349d72 100644 --- a/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.dfm @@ -65,6 +65,10 @@ inherited DataModuleFacturasCliente: TDataModuleFacturasCliente DisplayLabel = 'Fecha de las factura' DictionaryEntry = 'FacturasCliente_FECHA_FACTURA' end + item + Name = 'FECHA_VENCIMIENTO' + DataType = datDateTime + end item Name = 'SITUACION' DataType = datString diff --git a/Source/Modulos/Facturas de cliente/Model/schFacturasClienteClient_Intf.pas b/Source/Modulos/Facturas de cliente/Model/schFacturasClienteClient_Intf.pas index b191e5bf..c235eb85 100644 --- a/Source/Modulos/Facturas de cliente/Model/schFacturasClienteClient_Intf.pas +++ b/Source/Modulos/Facturas de cliente/Model/schFacturasClienteClient_Intf.pas @@ -9,8 +9,8 @@ const { Data table rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } - RID_FacturasCliente = '{AAD3829C-018F-45F7-B05F-44C9F3765E1D}'; - RID_FacturasCliente_Detalles = '{9C153EDF-C5B3-4A2A-960C-9719E16B36E2}'; + RID_FacturasCliente = '{6398871A-62BF-4C9E-84DC-AE2D59FEBF59}'; + RID_FacturasCliente_Detalles = '{41556FA6-05C4-45B5-9FEF-D01F46998FE6}'; { Data table names } nme_FacturasCliente = 'FacturasCliente'; @@ -23,6 +23,7 @@ const fld_FacturasClienteTIPO = 'TIPO'; fld_FacturasClienteID_COMISION_LIQUIDADA = 'ID_COMISION_LIQUIDADA'; fld_FacturasClienteFECHA_FACTURA = 'FECHA_FACTURA'; + fld_FacturasClienteFECHA_VENCIMIENTO = 'FECHA_VENCIMIENTO'; fld_FacturasClienteSITUACION = 'SITUACION'; fld_FacturasClienteBASE_IMPONIBLE = 'BASE_IMPONIBLE'; fld_FacturasClienteDESCUENTO = 'DESCUENTO'; @@ -61,36 +62,37 @@ const idx_FacturasClienteTIPO = 3; idx_FacturasClienteID_COMISION_LIQUIDADA = 4; idx_FacturasClienteFECHA_FACTURA = 5; - idx_FacturasClienteSITUACION = 6; - idx_FacturasClienteBASE_IMPONIBLE = 7; - idx_FacturasClienteDESCUENTO = 8; - idx_FacturasClienteIMPORTE_DESCUENTO = 9; - idx_FacturasClienteIVA = 10; - idx_FacturasClienteIMPORTE_IVA = 11; - idx_FacturasClienteRE = 12; - idx_FacturasClienteIMPORTE_RE = 13; - idx_FacturasClienteIMPORTE_TOTAL = 14; - idx_FacturasClienteOBSERVACIONES = 15; - idx_FacturasClienteID_CLIENTE = 16; - idx_FacturasClienteNIF_CIF = 17; - idx_FacturasClienteNOMBRE = 18; - idx_FacturasClienteID_DIRECCION = 19; - idx_FacturasClienteCALLE = 20; - idx_FacturasClientePOBLACION = 21; - idx_FacturasClientePROVINCIA = 22; - idx_FacturasClienteCODIGO_POSTAL = 23; - idx_FacturasClienteDATOS_BANCARIOS = 24; - idx_FacturasClienteCLIENTE_FINAL = 25; - idx_FacturasClienteFECHA_ALTA = 26; - idx_FacturasClienteFECHA_MODIFICACION = 27; - idx_FacturasClienteUSUARIO = 28; - idx_FacturasClienteID_FORMA_PAGO = 29; - idx_FacturasClienteRECARGO_EQUIVALENCIA = 30; - idx_FacturasClienteID_TIPO_IVA = 31; - idx_FacturasClienteIMPORTE_NETO = 32; - idx_FacturasClienteIMPORTE_PORTE = 33; - idx_FacturasClienteID_AGENTE = 34; - idx_FacturasClienteREFERENCIA_COMISION = 35; + idx_FacturasClienteFECHA_VENCIMIENTO = 6; + idx_FacturasClienteSITUACION = 7; + idx_FacturasClienteBASE_IMPONIBLE = 8; + idx_FacturasClienteDESCUENTO = 9; + idx_FacturasClienteIMPORTE_DESCUENTO = 10; + idx_FacturasClienteIVA = 11; + idx_FacturasClienteIMPORTE_IVA = 12; + idx_FacturasClienteRE = 13; + idx_FacturasClienteIMPORTE_RE = 14; + idx_FacturasClienteIMPORTE_TOTAL = 15; + idx_FacturasClienteOBSERVACIONES = 16; + idx_FacturasClienteID_CLIENTE = 17; + idx_FacturasClienteNIF_CIF = 18; + idx_FacturasClienteNOMBRE = 19; + idx_FacturasClienteID_DIRECCION = 20; + idx_FacturasClienteCALLE = 21; + idx_FacturasClientePOBLACION = 22; + idx_FacturasClientePROVINCIA = 23; + idx_FacturasClienteCODIGO_POSTAL = 24; + idx_FacturasClienteDATOS_BANCARIOS = 25; + idx_FacturasClienteCLIENTE_FINAL = 26; + idx_FacturasClienteFECHA_ALTA = 27; + idx_FacturasClienteFECHA_MODIFICACION = 28; + idx_FacturasClienteUSUARIO = 29; + idx_FacturasClienteID_FORMA_PAGO = 30; + idx_FacturasClienteRECARGO_EQUIVALENCIA = 31; + idx_FacturasClienteID_TIPO_IVA = 32; + idx_FacturasClienteIMPORTE_NETO = 33; + idx_FacturasClienteIMPORTE_PORTE = 34; + idx_FacturasClienteID_AGENTE = 35; + idx_FacturasClienteREFERENCIA_COMISION = 36; { FacturasCliente_Detalles fields } fld_FacturasCliente_DetallesID = 'ID'; @@ -129,7 +131,7 @@ const type { IFacturasCliente } IFacturasCliente = interface(IDAStronglyTypedDataTable) - ['{795D27FE-3D8E-4107-80CF-B7D21B781D7B}'] + ['{841A0CB0-FD20-4D3E-B21C-7E57896A7E3F}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -155,6 +157,10 @@ type procedure SetFECHA_FACTURAValue(const aValue: DateTime); function GetFECHA_FACTURAIsNull: Boolean; procedure SetFECHA_FACTURAIsNull(const aValue: Boolean); + function GetFECHA_VENCIMIENTOValue: DateTime; + procedure SetFECHA_VENCIMIENTOValue(const aValue: DateTime); + function GetFECHA_VENCIMIENTOIsNull: Boolean; + procedure SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); function GetSITUACIONValue: String; procedure SetSITUACIONValue(const aValue: String); function GetSITUACIONIsNull: Boolean; @@ -289,6 +295,8 @@ type property ID_COMISION_LIQUIDADAIsNull: Boolean read GetID_COMISION_LIQUIDADAIsNull write SetID_COMISION_LIQUIDADAIsNull; property FECHA_FACTURA: DateTime read GetFECHA_FACTURAValue write SetFECHA_FACTURAValue; property FECHA_FACTURAIsNull: Boolean read GetFECHA_FACTURAIsNull write SetFECHA_FACTURAIsNull; + property FECHA_VENCIMIENTO: DateTime read GetFECHA_VENCIMIENTOValue write SetFECHA_VENCIMIENTOValue; + property FECHA_VENCIMIENTOIsNull: Boolean read GetFECHA_VENCIMIENTOIsNull write SetFECHA_VENCIMIENTOIsNull; property SITUACION: String read GetSITUACIONValue write SetSITUACIONValue; property SITUACIONIsNull: Boolean read GetSITUACIONIsNull write SetSITUACIONIsNull; property BASE_IMPONIBLE: Currency read GetBASE_IMPONIBLEValue write SetBASE_IMPONIBLEValue; @@ -382,6 +390,10 @@ type procedure SetFECHA_FACTURAValue(const aValue: DateTime); virtual; function GetFECHA_FACTURAIsNull: Boolean; virtual; procedure SetFECHA_FACTURAIsNull(const aValue: Boolean); virtual; + function GetFECHA_VENCIMIENTOValue: DateTime; virtual; + procedure SetFECHA_VENCIMIENTOValue(const aValue: DateTime); virtual; + function GetFECHA_VENCIMIENTOIsNull: Boolean; virtual; + procedure SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); virtual; function GetSITUACIONValue: String; virtual; procedure SetSITUACIONValue(const aValue: String); virtual; function GetSITUACIONIsNull: Boolean; virtual; @@ -515,6 +527,8 @@ type property ID_COMISION_LIQUIDADAIsNull: Boolean read GetID_COMISION_LIQUIDADAIsNull write SetID_COMISION_LIQUIDADAIsNull; property FECHA_FACTURA: DateTime read GetFECHA_FACTURAValue write SetFECHA_FACTURAValue; property FECHA_FACTURAIsNull: Boolean read GetFECHA_FACTURAIsNull write SetFECHA_FACTURAIsNull; + property FECHA_VENCIMIENTO: DateTime read GetFECHA_VENCIMIENTOValue write SetFECHA_VENCIMIENTOValue; + property FECHA_VENCIMIENTOIsNull: Boolean read GetFECHA_VENCIMIENTOIsNull write SetFECHA_VENCIMIENTOIsNull; property SITUACION: String read GetSITUACIONValue write SetSITUACIONValue; property SITUACIONIsNull: Boolean read GetSITUACIONIsNull write SetSITUACIONIsNull; property BASE_IMPONIBLE: Currency read GetBASE_IMPONIBLEValue write SetBASE_IMPONIBLEValue; @@ -584,7 +598,7 @@ type { IFacturasCliente_Detalles } IFacturasCliente_Detalles = interface(IDAStronglyTypedDataTable) - ['{B6EB9F06-15CD-4E96-B620-4AC3D546A907}'] + ['{49F2E19B-A0E4-4622-8698-5BA5688EA6F4}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -937,6 +951,27 @@ begin DataTable.Fields[idx_FacturasClienteFECHA_FACTURA].AsVariant := Null; end; +function TFacturasClienteDataTableRules.GetFECHA_VENCIMIENTOValue: DateTime; +begin + result := DataTable.Fields[idx_FacturasClienteFECHA_VENCIMIENTO].AsDateTime; +end; + +procedure TFacturasClienteDataTableRules.SetFECHA_VENCIMIENTOValue(const aValue: DateTime); +begin + DataTable.Fields[idx_FacturasClienteFECHA_VENCIMIENTO].AsDateTime := aValue; +end; + +function TFacturasClienteDataTableRules.GetFECHA_VENCIMIENTOIsNull: boolean; +begin + result := DataTable.Fields[idx_FacturasClienteFECHA_VENCIMIENTO].IsNull; +end; + +procedure TFacturasClienteDataTableRules.SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_FacturasClienteFECHA_VENCIMIENTO].AsVariant := Null; +end; + function TFacturasClienteDataTableRules.GetSITUACIONValue: String; begin result := DataTable.Fields[idx_FacturasClienteSITUACION].AsString; diff --git a/Source/Modulos/Facturas de cliente/Model/schFacturasClienteServer_Intf.pas b/Source/Modulos/Facturas de cliente/Model/schFacturasClienteServer_Intf.pas index d19fe351..7fe446a3 100644 --- a/Source/Modulos/Facturas de cliente/Model/schFacturasClienteServer_Intf.pas +++ b/Source/Modulos/Facturas de cliente/Model/schFacturasClienteServer_Intf.pas @@ -9,13 +9,13 @@ const { Delta rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } - RID_FacturasClienteDelta = '{DBF89ADF-3FF2-4A40-9543-09F93862C1E8}'; - RID_FacturasCliente_DetallesDelta = '{59EC1836-B8BD-4243-8A4E-CB96C079CDF6}'; + RID_FacturasClienteDelta = '{4DF9EBCC-478A-4AC5-A507-11E084413331}'; + RID_FacturasCliente_DetallesDelta = '{C026B2FA-D8FB-46B6-B9A9-CD245AB46BBF}'; type { IFacturasClienteDelta } IFacturasClienteDelta = interface(IFacturasCliente) - ['{DBF89ADF-3FF2-4A40-9543-09F93862C1E8}'] + ['{4DF9EBCC-478A-4AC5-A507-11E084413331}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -23,6 +23,7 @@ type function GetOldTIPOValue : String; function GetOldID_COMISION_LIQUIDADAValue : Integer; function GetOldFECHA_FACTURAValue : DateTime; + function GetOldFECHA_VENCIMIENTOValue : DateTime; function GetOldSITUACIONValue : String; function GetOldBASE_IMPONIBLEValue : Currency; function GetOldDESCUENTOValue : Float; @@ -61,6 +62,7 @@ type property OldTIPO : String read GetOldTIPOValue; property OldID_COMISION_LIQUIDADA : Integer read GetOldID_COMISION_LIQUIDADAValue; property OldFECHA_FACTURA : DateTime read GetOldFECHA_FACTURAValue; + property OldFECHA_VENCIMIENTO : DateTime read GetOldFECHA_VENCIMIENTOValue; property OldSITUACION : String read GetOldSITUACIONValue; property OldBASE_IMPONIBLE : Currency read GetOldBASE_IMPONIBLEValue; property OldDESCUENTO : Float read GetOldDESCUENTOValue; @@ -136,6 +138,12 @@ type function GetOldFECHA_FACTURAIsNull: Boolean; virtual; procedure SetFECHA_FACTURAValue(const aValue: DateTime); virtual; procedure SetFECHA_FACTURAIsNull(const aValue: Boolean); virtual; + function GetFECHA_VENCIMIENTOValue: DateTime; virtual; + function GetFECHA_VENCIMIENTOIsNull: Boolean; virtual; + function GetOldFECHA_VENCIMIENTOValue: DateTime; virtual; + function GetOldFECHA_VENCIMIENTOIsNull: Boolean; virtual; + procedure SetFECHA_VENCIMIENTOValue(const aValue: DateTime); virtual; + procedure SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); virtual; function GetSITUACIONValue: String; virtual; function GetSITUACIONIsNull: Boolean; virtual; function GetOldSITUACIONValue: String; virtual; @@ -341,6 +349,10 @@ type property FECHA_FACTURAIsNull : Boolean read GetFECHA_FACTURAIsNull write SetFECHA_FACTURAIsNull; property OldFECHA_FACTURA : DateTime read GetOldFECHA_FACTURAValue; property OldFECHA_FACTURAIsNull : Boolean read GetOldFECHA_FACTURAIsNull; + property FECHA_VENCIMIENTO : DateTime read GetFECHA_VENCIMIENTOValue write SetFECHA_VENCIMIENTOValue; + property FECHA_VENCIMIENTOIsNull : Boolean read GetFECHA_VENCIMIENTOIsNull write SetFECHA_VENCIMIENTOIsNull; + property OldFECHA_VENCIMIENTO : DateTime read GetOldFECHA_VENCIMIENTOValue; + property OldFECHA_VENCIMIENTOIsNull : Boolean read GetOldFECHA_VENCIMIENTOIsNull; property SITUACION : String read GetSITUACIONValue write SetSITUACIONValue; property SITUACIONIsNull : Boolean read GetSITUACIONIsNull write SetSITUACIONIsNull; property OldSITUACION : String read GetOldSITUACIONValue; @@ -470,7 +482,7 @@ type { IFacturasCliente_DetallesDelta } IFacturasCliente_DetallesDelta = interface(IFacturasCliente_Detalles) - ['{59EC1836-B8BD-4243-8A4E-CB96C079CDF6}'] + ['{C026B2FA-D8FB-46B6-B9A9-CD245AB46BBF}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_FACTURAValue : Integer; @@ -883,6 +895,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasClienteFECHA_FACTURA] := Null; end; +function TFacturasClienteBusinessProcessorRules.GetFECHA_VENCIMIENTOValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasClienteFECHA_VENCIMIENTO]; +end; + +function TFacturasClienteBusinessProcessorRules.GetFECHA_VENCIMIENTOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasClienteFECHA_VENCIMIENTO]); +end; + +function TFacturasClienteBusinessProcessorRules.GetOldFECHA_VENCIMIENTOValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasClienteFECHA_VENCIMIENTO]; +end; + +function TFacturasClienteBusinessProcessorRules.GetOldFECHA_VENCIMIENTOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasClienteFECHA_VENCIMIENTO]); +end; + +procedure TFacturasClienteBusinessProcessorRules.SetFECHA_VENCIMIENTOValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasClienteFECHA_VENCIMIENTO] := aValue; +end; + +procedure TFacturasClienteBusinessProcessorRules.SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasClienteFECHA_VENCIMIENTO] := Null; +end; + function TFacturasClienteBusinessProcessorRules.GetSITUACIONValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasClienteSITUACION]; diff --git a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm index a7785601..84a1cd4f 100644 --- a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm +++ b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm @@ -165,6 +165,10 @@ object srvFacturasCliente: TsrvFacturasCliente item DatasetField = 'ID_DIRECCION' TableField = 'ID_DIRECCION' + end + item + DatasetField = 'FECHA_VENCIMIENTO' + TableField = 'FECHA_VENCIMIENTO' end> end> Name = 'FacturasCliente' @@ -204,6 +208,10 @@ object srvFacturasCliente: TsrvFacturasCliente DataType = datDateTime DictionaryEntry = 'FacturasCliente_FECHA_FACTURA' end + item + Name = 'FECHA_VENCIMIENTO' + DataType = datDateTime + end item Name = 'SITUACION' DataType = datString @@ -758,6 +766,10 @@ object srvFacturasCliente: TsrvFacturasCliente Name = 'FECHA_FACTURA' Value = '' end + item + Name = 'FECHA_VENCIMIENTO' + Value = '' + end item Name = 'BASE_IMPONIBLE' Value = '' @@ -806,6 +818,10 @@ object srvFacturasCliente: TsrvFacturasCliente Name = 'NOMBRE' Value = '' end + item + Name = 'ID_DIRECCION' + Value = '' + end item Name = 'CALLE' Value = '' @@ -869,23 +885,24 @@ object srvFacturasCliente: TsrvFacturasCliente TargetTable = 'FACTURAS_CLIENTE' SQL = 'INSERT INTO FACTURAS_CLIENTE ('#10' ID,'#10' ID_EMPRESA,'#10' REFER' + - 'ENCIA,'#10' FECHA_FACTURA,'#10' BASE_IMPONIBLE,'#10' DESCUENTO,'#10' ' + - ' IMPORTE_DESCUENTO,'#10' IVA,'#10' IMPORTE_IVA,'#10' RE,'#10' IMPORT' + - 'E_RE,'#10' IMPORTE_TOTAL,'#10' OBSERVACIONES,'#10' ID_CLIENTE,'#10' ' + - 'NIF_CIF,'#10' NOMBRE,'#10' ID_DIRECCION,'#10' CALLE,'#10' POBLACION,' + - #10' PROVINCIA,'#10' CODIGO_POSTAL,'#10' FECHA_ALTA,'#10' FECHA_MOD' + - 'IFICACION,'#10' USUARIO,'#10' ID_FORMA_PAGO,'#10' RECARGO_EQUIVALEN' + - 'CIA,'#10' ID_TIPO_IVA,'#10' IMPORTE_NETO,'#10' IMPORTE_PORTE,'#10' D' + - 'ATOS_BANCARIOS,'#10' CLIENTE_FINAL)'#10' VALUES ('#10' :ID,'#10' :ID_E' + - 'MPRESA,'#10' :REFERENCIA,'#10' :FECHA_FACTURA,'#10' :BASE_IMPONIBLE' + - ','#10' :DESCUENTO,'#10' :IMPORTE_DESCUENTO,'#10' :IVA,'#10' :IMPORTE' + - '_IVA,'#10' :RE,'#10' :IMPORTE_RE,'#10' :IMPORTE_TOTAL,'#10' :OBSERVA' + - 'CIONES,'#10' :ID_CLIENTE,'#10' :NIF_CIF,'#10' :NOMBRE,'#10' :ID_DIRE' + - 'CCION,'#10' :CALLE,'#10' :POBLACION,'#10' :PROVINCIA,'#10' :CODIGO_P' + - 'OSTAL,'#10' :FECHA_ALTA,'#10' :FECHA_MODIFICACION,'#10' :USUARIO,'#10' ' + - ' :ID_FORMA_PAGO,'#10' :RECARGO_EQUIVALENCIA,'#10' :ID_TIPO_IVA,'#10 + - ' :IMPORTE_NETO,'#10' :IMPORTE_PORTE,'#10' :DATOS_BANCARIOS,'#10' ' + - ' :CLIENTE_FINAL);'#10 + 'ENCIA,'#10' FECHA_FACTURA,'#10' FECHA_VENCIMIENTO,'#10' BASE_IMPONI' + + 'BLE,'#10' DESCUENTO,'#10' IMPORTE_DESCUENTO,'#10' IVA,'#10' IMPORTE_' + + 'IVA,'#10' RE,'#10' IMPORTE_RE,'#10' IMPORTE_TOTAL,'#10' OBSERVACIONE' + + 'S,'#10' ID_CLIENTE,'#10' NIF_CIF,'#10' NOMBRE,'#10' ID_DIRECCION,'#10' ' + + ' CALLE,'#10' POBLACION,'#10' PROVINCIA,'#10' CODIGO_POSTAL,'#10' FE' + + 'CHA_ALTA,'#10' FECHA_MODIFICACION,'#10' USUARIO,'#10' ID_FORMA_PAGO' + + ','#10' RECARGO_EQUIVALENCIA,'#10' ID_TIPO_IVA,'#10' IMPORTE_NETO,'#10' ' + + ' IMPORTE_PORTE,'#10' DATOS_BANCARIOS,'#10' CLIENTE_FINAL)'#10' VALU' + + 'ES ('#10' :ID,'#10' :ID_EMPRESA,'#10' :REFERENCIA,'#10' :FECHA_FACTU' + + 'RA,'#10' :FECHA_VENCIMIENTO,'#10' :BASE_IMPONIBLE,'#10' :DESCUENTO,' + + #10' :IMPORTE_DESCUENTO,'#10' :IVA,'#10' :IMPORTE_IVA,'#10' :RE,'#10' ' + + ' :IMPORTE_RE,'#10' :IMPORTE_TOTAL,'#10' :OBSERVACIONES,'#10' :ID_C' + + 'LIENTE,'#10' :NIF_CIF,'#10' :NOMBRE,'#10' :ID_DIRECCION,'#10' :CALLE' + + ','#10' :POBLACION,'#10' :PROVINCIA,'#10' :CODIGO_POSTAL,'#10' :FECHA' + + '_ALTA,'#10' :FECHA_MODIFICACION,'#10' :USUARIO,'#10' :ID_FORMA_PAGO' + + ','#10' :RECARGO_EQUIVALENCIA,'#10' :ID_TIPO_IVA,'#10' :IMPORTE_NETO' + + ','#10' :IMPORTE_PORTE,'#10' :DATOS_BANCARIOS,'#10' :CLIENTE_FINAL);' + + #10 StatementType = stSQL ColumnMappings = <> end> @@ -905,6 +922,10 @@ object srvFacturasCliente: TsrvFacturasCliente Name = 'FECHA_FACTURA' Value = '' end + item + Name = 'FECHA_VENCIMIENTO' + Value = '' + end item Name = 'BASE_IMPONIBLE' Value = '' @@ -1024,20 +1045,21 @@ object srvFacturasCliente: TsrvFacturasCliente SQL = 'UPDATE FACTURAS_CLIENTE'#10' SET'#10' ID_EMPRESA = :ID_EMPRESA,'#10' ' + 'REFERENCIA = :REFERENCIA,'#10' FECHA_FACTURA = :FECHA_FACTURA,'#10' ' + - ' BASE_IMPONIBLE = :BASE_IMPONIBLE,'#10' DESCUENTO = :DESCUENTO,'#10 + - ' IMPORTE_DESCUENTO = :IMPORTE_DESCUENTO,'#10' IVA = :IVA,'#10' ' + - 'IMPORTE_IVA = :IMPORTE_IVA,'#10' RE = :RE,'#10' IMPORTE_RE = :IMPO' + - 'RTE_RE,'#10' IMPORTE_TOTAL = :IMPORTE_TOTAL,'#10' OBSERVACIONES = ' + - ':OBSERVACIONES,'#10' ID_CLIENTE = :ID_CLIENTE,'#10' NIF_CIF = :NIF' + - '_CIF,'#10' NOMBRE = :NOMBRE,'#10' ID_DIRECCION = :ID_DIRECCION,'#10' ' + - ' CALLE = :CALLE,'#10' POBLACION = :POBLACION,'#10' PROVINCIA = :P' + - 'ROVINCIA,'#10' CODIGO_POSTAL = :CODIGO_POSTAL,'#10' FECHA_ALTA = :' + - 'FECHA_ALTA,'#10' FECHA_MODIFICACION = :FECHA_MODIFICACION,'#10' US' + - 'UARIO = :USUARIO,'#10' ID_FORMA_PAGO = :ID_FORMA_PAGO,'#10' RECARG' + - 'O_EQUIVALENCIA = :RECARGO_EQUIVALENCIA,'#10' ID_TIPO_IVA = :ID_TI' + - 'PO_IVA,'#10' IMPORTE_NETO = :IMPORTE_NETO,'#10' IMPORTE_PORTE = :I' + - 'MPORTE_PORTE,'#10' DATOS_BANCARIOS = :DATOS_BANCARIOS,'#10' CLIENT' + - 'E_FINAL = :CLIENTE_FINAL'#10' WHERE'#10' (ID = :OLD_ID);'#10 + ' FECHA_VENCIMIENTO = :FECHA_VENCIMIENTO,'#10' BASE_IMPONIBLE = :' + + 'BASE_IMPONIBLE,'#10' DESCUENTO = :DESCUENTO,'#10' IMPORTE_DESCUENT' + + 'O = :IMPORTE_DESCUENTO,'#10' IVA = :IVA,'#10' IMPORTE_IVA = :IMPOR' + + 'TE_IVA,'#10' RE = :RE,'#10' IMPORTE_RE = :IMPORTE_RE,'#10' IMPORTE_' + + 'TOTAL = :IMPORTE_TOTAL,'#10' OBSERVACIONES = :OBSERVACIONES,'#10' ' + + 'ID_CLIENTE = :ID_CLIENTE,'#10' NIF_CIF = :NIF_CIF,'#10' NOMBRE = :' + + 'NOMBRE,'#10' ID_DIRECCION = :ID_DIRECCION,'#10' CALLE = :CALLE,'#10' ' + + ' POBLACION = :POBLACION,'#10' PROVINCIA = :PROVINCIA,'#10' CODIGO' + + '_POSTAL = :CODIGO_POSTAL,'#10' FECHA_ALTA = :FECHA_ALTA,'#10' FECH' + + 'A_MODIFICACION = :FECHA_MODIFICACION,'#10' USUARIO = :USUARIO,'#10' ' + + ' ID_FORMA_PAGO = :ID_FORMA_PAGO,'#10' RECARGO_EQUIVALENCIA = :RE' + + 'CARGO_EQUIVALENCIA,'#10' ID_TIPO_IVA = :ID_TIPO_IVA,'#10' IMPORTE_' + + 'NETO = :IMPORTE_NETO,'#10' IMPORTE_PORTE = :IMPORTE_PORTE,'#10' DA' + + 'TOS_BANCARIOS = :DATOS_BANCARIOS,'#10' CLIENTE_FINAL = :CLIENTE_F' + + 'INAL'#10' WHERE'#10' (ID = :OLD_ID);'#10 StatementType = stSQL ColumnMappings = <> end> diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm index bdc26d27..db8542a1 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm @@ -120,9 +120,9 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente 798 316) inherited Label1: TLabel - Left = 351 + Left = 378 Width = 311 - ExplicitLeft = 351 + ExplicitLeft = 378 ExplicitWidth = 311 end inherited eReferencia: TcxDBTextEdit @@ -160,8 +160,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 111 end inherited bFormasPago: TButton - Left = 180 - ExplicitLeft = 180 + Left = 196 + ExplicitLeft = 196 end inherited cbCuentaBancaria: TcxDBComboBox Style.LookAndFeel.SkinName = '' @@ -172,12 +172,12 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 249 end inherited cbClienteFinal: TcxDBTextEdit - Left = 351 + Left = 378 Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 351 + ExplicitLeft = 378 ExplicitWidth = 339 Width = 339 end @@ -186,9 +186,9 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente ExplicitLeft = 725 end inherited frViewDatosYSeleccionClienteFacturaCliente1: TfrViewDatosYSeleccionClienteFacturaCliente - Left = 340 + Left = 367 Width = 505 - ExplicitLeft = 340 + ExplicitLeft = 367 ExplicitWidth = 505 inherited dxLayoutControl1: TdxLayoutControl Width = 505 @@ -201,16 +201,16 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 224 end inherited edtNIFCIF: TcxDBTextEdit - Left = 306 + Left = 279 Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 306 + ExplicitLeft = 279 end inherited Button3: TBitBtn - Left = 217 - ExplicitLeft = 217 + Left = 190 + ExplicitLeft = 190 end inherited edtDireccion: TcxTextEdit Style.LookAndFeel.SkinName = '' @@ -221,11 +221,19 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 121 end inherited Button4: TButton - Left = 386 - ExplicitLeft = 386 + Left = 359 + ExplicitLeft = 359 end end end + inherited edtFechaVemcimiento: TcxDBDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 275 + Width = 275 + end end end end diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas index 0054d8c6..aa8ad996 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas @@ -402,7 +402,10 @@ begin FController := Value; if Assigned(FController) then + begin + ViewFacturaCliente.Controller := FController; frViewDetallesFacturaCliente1.Controller := Controller.DetallesController; + end; end; procedure TfEditorFacturaCliente.SetFactura(const Value: IBizFacturaCliente); diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm index 776fd811..f52be68f 100644 --- a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm @@ -1,6 +1,6 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente - Width = 862 - Height = 390 + Width = 674 + Height = 407 Align = alClient OnCreate = CustomViewCreate OnDestroy = CustomViewDestroy @@ -9,8 +9,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente object dxLayoutControl1: TdxLayoutControl Left = 0 Top = 0 - Width = 862 - Height = 390 + Width = 674 + Height = 407 Align = alClient ParentBackground = True TabOrder = 0 @@ -20,10 +20,10 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente ExplicitWidth = 451 ExplicitHeight = 304 DesignSize = ( - 862 - 390) + 674 + 407) object Label1: TLabel - Left = 458 + Left = 373 Top = 193 Width = 311 Height = 26 @@ -100,13 +100,13 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.SkinName = '' - TabOrder = 8 + TabOrder = 9 Height = 345 Width = 355 end object cbFormaPago: TcxDBLookupComboBox - Left = 124 - Top = 84 + Left = 146 + Top = 103 DataBinding.DataField = 'ID_FORMA_PAGO' DataBinding.DataSource = DADataSource Properties.ImmediatePost = True @@ -120,6 +120,7 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Properties.ListOptions.SyncMode = True Properties.ListSource = dsFormaPago Properties.PostPopupValueOnTab = True + Properties.OnEditValueChanged = edtFechaVemcimientoPropertiesEditValueChanged Style.BorderColor = clWindowFrame Style.BorderStyle = ebs3D Style.HotTrack = False @@ -141,8 +142,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Width = 269 end object bFormasPago: TButton - Left = 287 - Top = 84 + Left = 191 + Top = 103 Width = 132 Height = 23 Caption = 'Ver las formas de pago...' @@ -150,11 +151,12 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente OnClick = bFormasPagoClick end object cbCuentaBancaria: TcxDBComboBox - Left = 124 - Top = 113 + Left = 146 + Top = 159 DataBinding.DataField = 'DATOS_BANCARIOS' DataBinding.DataSource = DADataSource Properties.DropDownListStyle = lsFixedList + Properties.DropDownRows = 12 Properties.ImmediatePost = True Properties.ImmediateUpdateText = True Properties.PostPopupValueOnTab = True @@ -167,11 +169,11 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - TabOrder = 4 + TabOrder = 5 Width = 165 end object cbClienteFinal: TcxDBTextEdit - Left = 458 + Left = 373 Top = 227 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'CLIENTE_FINAL' @@ -195,19 +197,19 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.SkinName = '' - TabOrder = 6 + TabOrder = 7 Width = 339 end object bElegirClienteFinal: TButton - Left = 806 + Left = 618 Top = 225 Width = 23 Height = 25 Action = actElegirClienteFinal - TabOrder = 7 + TabOrder = 8 end inline frViewDatosYSeleccionClienteFacturaCliente1: TfrViewDatosYSeleccionClienteFacturaCliente - Left = 447 + Left = 362 Top = 30 Width = 505 Height = 138 @@ -217,9 +219,9 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 5 + TabOrder = 6 ReadOnly = False - ExplicitLeft = 447 + ExplicitLeft = 362 ExplicitTop = 30 inherited dxLayoutControl1: TdxLayoutControl inherited edtlNombre: TcxDBTextEdit @@ -231,16 +233,16 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Width = 224 end inherited edtNIFCIF: TcxDBTextEdit - Left = 280 + Left = 177 Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 280 + ExplicitLeft = 177 end inherited Button3: TBitBtn - Left = 191 - ExplicitLeft = 191 + Left = 88 + ExplicitLeft = 88 end inherited edtDireccion: TcxTextEdit Style.LookAndFeel.SkinName = '' @@ -251,8 +253,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Width = 121 end inherited Button4: TButton - Left = 360 - ExplicitLeft = 360 + Left = 257 + ExplicitLeft = 257 end end inherited ActionList1: TActionList @@ -268,6 +270,32 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Top = 48 end end + object edtFechaVemcimiento: TcxDBDateEdit + Left = 146 + Top = 132 + Anchors = [akLeft, akTop, akRight] + DataBinding.DataField = 'FECHA_VENCIMIENTO' + DataBinding.DataSource = DADataSource + Properties.OnEditValueChanged = edtFechaVemcimientoPropertiesEditValueChanged + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.Color = clInfoBk + Style.HotTrack = False + Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' + Style.Shadow = False + Style.ButtonStyle = bts3D + Style.ButtonTransparency = ebtNone + Style.PopupBorderStyle = epbsFrame3D + StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 4 + Width = 275 + end object dxLayoutControl1Group_Root: TdxLayoutGroup ShowCaption = False Hidden = True @@ -295,25 +323,33 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Control = edtFecha ControlOptions.ShowBorder = False end - object dxLayoutControl1Group3: TdxLayoutGroup - ShowCaption = False - Hidden = True - ShowBorder = False + object dxLayoutControl1Group6: TdxLayoutGroup + Caption = 'Forma de pago' object dxLayoutControl1Group4: TdxLayoutGroup ShowCaption = False Hidden = True - LayoutDirection = ldHorizontal ShowBorder = False - object dxLayoutControl1Item4: TdxLayoutItem - AutoAligns = [aaVertical] - AlignHorz = ahClient - Caption = 'Forma de pago:' - Control = cbFormaPago - ControlOptions.ShowBorder = False - end - object dxLayoutControl1Item10: TdxLayoutItem + object dxLayoutControl1Group3: TdxLayoutGroup ShowCaption = False - Control = bFormasPago + Hidden = True + LayoutDirection = ldHorizontal + ShowBorder = False + object dxLayoutControl1Item4: TdxLayoutItem + AutoAligns = [aaVertical] + AlignHorz = ahClient + Caption = 'Forma de pago:' + Control = cbFormaPago + ControlOptions.ShowBorder = False + end + object dxLayoutControl1Item10: TdxLayoutItem + ShowCaption = False + Control = bFormasPago + ControlOptions.ShowBorder = False + end + end + object ledtFechaVencimiento: TdxLayoutItem + Caption = 'Fecha de vencimiento:' + Control = edtFechaVemcimiento ControlOptions.ShowBorder = False end end diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas index 035bc3c7..999d3a87 100644 --- a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas @@ -10,7 +10,7 @@ uses cxMemo, cxMaskEdit, cxDropDownEdit, cxCalendar, cxSpinEdit, StdCtrls, Mask, DBCtrls, cxGraphics, dxLayoutLookAndFeels, cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, uFormasPagoController, uDAInterfaces, uBizFormasPago, - ActnList, uViewDatosYSeleccionClienteFacturaCliente; + ActnList, uViewDatosYSeleccionClienteFacturaCliente, uFacturasClienteController; type IViewFacturaCliente = interface(IViewBase) @@ -18,6 +18,9 @@ type function GetFactura: IBizFacturaCliente; procedure SetFactura(const Value: IBizFacturaCliente); property Factura: IBizFacturaCliente read GetFactura write SetFactura; + function GetController : IFacturasClienteController; + procedure SetController (const Value : IFacturasClienteController); + property Controller : IFacturasClienteController read GetController write SetController; function GetViewClienteFactura: IViewDatosYSeleccionClienteFacturaCliente; property ViewClienteFactura: IViewDatosYSeleccionClienteFacturaCliente read GetViewClienteFactura; @@ -44,10 +47,8 @@ type cbFormaPago: TcxDBLookupComboBox; dxLayoutControl1Item10: TdxLayoutItem; bFormasPago: TButton; - dxLayoutControl1Group3: TdxLayoutGroup; dxLayoutControl1Item3: TdxLayoutItem; cbCuentaBancaria: TcxDBComboBox; - dxLayoutControl1Group4: TdxLayoutGroup; dxLayoutControl1Item7: TdxLayoutItem; Label1: TLabel; dxLayoutControl1Item8: TdxLayoutItem; @@ -60,23 +61,33 @@ type actElegirClienteFinal: TAction; frViewDatosYSeleccionClienteFacturaCliente1: TfrViewDatosYSeleccionClienteFacturaCliente; dxLayoutControl1Group9: TdxLayoutGroup; + dxLayoutControl1Group6: TdxLayoutGroup; + dxLayoutControl1Group4: TdxLayoutGroup; + ledtFechaVencimiento: TdxLayoutItem; + edtFechaVemcimiento: TcxDBDateEdit; + dxLayoutControl1Group3: TdxLayoutGroup; procedure bFormasPagoClick(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure CustomViewCreate(Sender: TObject); procedure actElegirClienteFinalExecute(Sender: TObject); procedure actElegirClienteFinalUpdate(Sender: TObject); + procedure edtFechaVemcimientoPropertiesEditValueChanged(Sender: TObject); protected FFactura : IBizFacturaCliente; + FController : IFacturasClienteController; FFormasPago : IBizFormaPago; FFormasPagoController : IFormasPagoController; FViewClienteFactura : IViewDatosYSeleccionClienteFacturaCliente; function GetFactura: IBizFacturaCliente; procedure SetFactura(const Value: IBizFacturaCliente); + function GetController : IFacturasClienteController; + procedure SetController (const Value : IFacturasClienteController); procedure RellenarCuentasBancarias; - function GetViewClienteFactura: IViewDatosYSeleccionClienteFacturaCliente; + public property Factura: IBizFacturaCliente read GetFactura write SetFactura; + property Controller : IFacturasClienteController read GetController write SetController; property ViewClienteFactura: IViewDatosYSeleccionClienteFacturaCliente read GetViewClienteFactura; end; @@ -146,6 +157,21 @@ begin FViewClienteFactura := NIL; end; +procedure TfrViewFacturaCliente.edtFechaVemcimientoPropertiesEditValueChanged( + Sender: TObject); +begin + if Assigned(FFormasPago) then + if (FFormasPago.Plazos.RecordCount = 0) then + ledtFechaVencimiento.Enabled := True + else + ledtFechaVencimiento.Enabled := False; +end; + +function TfrViewFacturaCliente.GetController: IFacturasClienteController; +begin + Result := FController; +end; + function TfrViewFacturaCliente.GetFactura: IBizFacturaCliente; begin Result := FFactura; @@ -161,12 +187,15 @@ var AController : IEmpresasController; ALista : TStringList; AListaIBAN : TStringList; + AListaCliente: TStringList; i : integer; begin AController := TEmpresasController.Create; try ALista := AController.DarListaCuentasBancarias(AppFactuGES.EmpresaActiva); AListaIBAN := AController.DarListaCuentasBancariasIBAN(AppFactuGES.EmpresaActiva); + AListaCliente := Controller.ClienteController.DarListaCuentasBancarias(FFactura.ID_CLIENTE); + try with cbCuentaBancaria.Properties.Items do begin @@ -183,6 +212,14 @@ begin for i := 0 to AListaIBAN.Count - 1 do Add(AListaIBAN.Names[i]); end; + + if AListaCliente.Count > 0 then + begin + Add('--------------'); + for i := 0 to AListaCliente.Count - 1 do + Add(AListaCliente.Names[i]); + end; + finally EndUpdate; end; @@ -196,6 +233,11 @@ begin end; end; +procedure TfrViewFacturaCliente.SetController(const Value: IFacturasClienteController); +begin + FController := Value; +end; + procedure TfrViewFacturaCliente.SetFactura(const Value: IBizFacturaCliente); var ACadena : String; @@ -214,6 +256,13 @@ begin dsFormaPago.DataTable := FFormasPago.DataTable; dsFormaPago.DataTable.Active := True; + //Posicionamos la tabla en la forma de pago que tiene la factura ya que no lo hace el componente por si solo + FFormasPago.DataTable.Locate(fld_FacturasClienteID, FFactura.ID_FORMA_PAGO, []); + if (FFormasPago.Plazos.RecordCount = 0) then + ledtFechaVencimiento.Enabled := True + else + ledtFechaVencimiento.Enabled := False; + if FFactura.TIPO = CTE_TIPO_ABONO then begin dxLayoutControl1Group1.Caption := 'Datos del abono:'; diff --git a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas index d82c761e..7e3da985 100644 --- a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas +++ b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas @@ -71,8 +71,10 @@ type function ValidarFactura(AFactura: IBizFacturaProveedor): Boolean; procedure GenerarRecibos(AFactura: IBizFacturaProveedor); + protected procedure RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); override; + public property ProveedorController: IProveedoresController read GetProveedorController write SetProveedorController; property DetallesController: IDetallesFacturaProveedorController read GetDetallesController write SetDetallesController; @@ -406,6 +408,9 @@ begin end; function TFacturasProveedorController.ValidarFactura(AFactura: IBizFacturaProveedor): Boolean; +var + AFormaPago: IBizFormaPago; + begin Result := False; @@ -437,6 +442,22 @@ begin { if (AFactura.ID_TIPO_IVA = 0) then raise Exception.Create('Debe indicar un tipo de IVA para esta factura');} + //De esta forma obligaremos siempre a tener un recibo asociado a la factura, + //porque si la forma de pago no tiene plazos es obligatorio la fecha de vencimiento + with TFormasPagoController.Create do + begin + try + AFormaPago := Buscar(AFactura.ID_FORMA_PAGO); + AFormaPago.DataTable.Active := True; + if (AFormaPago.Plazos.RecordCount = 0) + and (EsFechaVacia(AFactura.FECHA_VENCIMIENTO)) then + raise Exception.Create('Debe indicar una fecha de vencimiento para esta factura'); + finally + AFormaPago := NIL; + Free; + end; + end; + //En caso de ser un Abono no podra tener un importe total positivo if (AFactura.TIPO = CTE_TIPO_ABONO) then if (AFactura.IMPORTE_TOTAL >= 0) then @@ -884,7 +905,7 @@ var AFormaPago: IBizFormaPago; ARecibosProveedorController: IRecibosProveedorController; ARecibos: IBizRecibosProveedor; - AFechaVencimiento: TDateTime; + AFechaVencimiento: TDateTime; i: Integer; ADiaVencimiento: Integer; ADiasMas: Integer; @@ -897,9 +918,6 @@ begin AFormasPagoController := TFormasPagoController.Create; AFormaPago := AFormasPagoController.Buscar(AFactura.ID_FORMA_PAGO); AFormaPago.DataTable.Active := True; - if AFormaPago.DataTable.RecordCount <> 1 then - Exit; //No hay forma de pago en la factura y por lo tanto no se generan recibos - //raise Exception.Create('No existe la forma de pago de la factura'); ARecibosProveedorController := TRecibosProveedorController.Create; //Eliminamos todos los recibos que tuviera la factura porque sabemos que todos @@ -908,46 +926,56 @@ begin ARecibos := ARecibosProveedorController.BuscarRecibosFactura(AFactura.ID); ARecibosProveedorController.EliminarTodo(ARecibos); - //Vamos a generar todos los recibos necesarios para la factura + //Se cambia la lógica a peticion de tecsitel, en el caso de meter una fecha de vencimiento, + //los plazos de la forma de pago no tendrán efecto, se generará un recibo con el 100% y fecha de vencimiento + //de la factura. With AFormaPago.Plazos.DataTable do begin i := 1; First; - while not eof do - begin + repeat ARecibos := ARecibosProveedorController.Nuevo; ARecibos.Edit; ARecibos.ID_FACTURA := AFactura.ID; ARecibos.REFERENCIA := AFactura.REFERENCIA + ' - ' + IntToStr(i); ARecibos.FECHA_EMISION := AFactura.FECHA_FACTURA; - AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; - ADiasMas := 0; - if (AFactura.Proveedor.VENCIMIENTO_FACTURAS_1 <> 0) - or (AFactura.Proveedor.VENCIMIENTO_FACTURAS_2 <> 0) - or (AFactura.Proveedor.VENCIMIENTO_FACTURAS_3 <> 0) then + if AFormaPago.Plazos.RecordCount < 1 then begin - ADiaVencimiento := DayOf(AFechaVencimiento); - while (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_1) - and (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_2) - and (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_3) do + ARecibos.FECHA_VENCIMIENTO := AFactura.FECHA_VENCIMIENTO; + ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL; + end + else + begin + AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; + ADiasMas := 0; + if (AFactura.Proveedor.VENCIMIENTO_FACTURAS_1 <> 0) + or (AFactura.Proveedor.VENCIMIENTO_FACTURAS_2 <> 0) + or (AFactura.Proveedor.VENCIMIENTO_FACTURAS_3 <> 0) then begin - if ADiaVencimiento = DaysInMonth(AFechaVencimiento) then - ADiaVencimiento := 1 - else - Inc(ADiaVencimiento); - Inc(ADiasMas); + ADiaVencimiento := DayOf(AFechaVencimiento); + while (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_1) + and (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_2) + and (ADiaVencimiento <> AFactura.Proveedor.VENCIMIENTO_FACTURAS_3) do + begin + if ADiaVencimiento = DaysInMonth(AFechaVencimiento) then + ADiaVencimiento := 1 + else + Inc(ADiaVencimiento); + Inc(ADiasMas); + end; end; - end; - AFechaVencimiento := IncDay(AFechaVencimiento, ADiasMas); - ARecibos.FECHA_VENCIMIENTO := AFechaVencimiento; - ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL * (AFormaPago.Plazos.PORCENTAJE / 100); - ARecibos.DESCRIPCION := 'Pago de factura ' + AFactura.REFERENCIA + ': son ' + CifraToLetras(ARecibos.IMPORTE); + AFechaVencimiento := IncDay(AFechaVencimiento, ADiasMas); + ARecibos.FECHA_VENCIMIENTO := AFechaVencimiento; + ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL * (AFormaPago.Plazos.PORCENTAJE / 100); + end; + + ARecibos.DESCRIPCION := 'Pago de factura ' + AFactura.REFERENCIA + ': son ' + CifraToLetras(ARecibos.IMPORTE); ARecibosProveedorController.Guardar(ARecibos); Inc(i); Next; - end; + until (eof); end; //Liberamos diff --git a/Source/Modulos/Facturas de proveedor/Data/uDataModuleFacturasProveedor.dfm b/Source/Modulos/Facturas de proveedor/Data/uDataModuleFacturasProveedor.dfm index 110a2dc1..4d83f789 100644 --- a/Source/Modulos/Facturas de proveedor/Data/uDataModuleFacturasProveedor.dfm +++ b/Source/Modulos/Facturas de proveedor/Data/uDataModuleFacturasProveedor.dfm @@ -66,6 +66,11 @@ inherited DataModuleFacturasProveedor: TDataModuleFacturasProveedor DisplayLabel = 'Fecha de las factura' DictionaryEntry = 'FacturasProveedor_FECHA_FACTURA' end + item + Name = 'FECHA_VENCIMIENTO' + DataType = datDateTime + DisplayLabel = 'Fecha vto.' + end item Name = 'SITUACION' DataType = datString diff --git a/Source/Modulos/Facturas de proveedor/FacturasProveedor_Group.groupproj b/Source/Modulos/Facturas de proveedor/FacturasProveedor_Group.groupproj index 496c5175..054f7fc0 100644 --- a/Source/Modulos/Facturas de proveedor/FacturasProveedor_Group.groupproj +++ b/Source/Modulos/Facturas de proveedor/FacturasProveedor_Group.groupproj @@ -13,6 +13,7 @@ + @@ -251,14 +252,23 @@ + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas index dd8dcc63..fef37fd3 100644 --- a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas +++ b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas @@ -9,9 +9,9 @@ const { Data table rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } - RID_FacturasProveedor = '{EE9FBF74-DB1B-4B3C-93F6-B8A512067389}'; - RID_FacturasProveedor_Detalles = '{554F91EF-CCD5-46D5-9A25-64BDD41C19E6}'; - RID_FacturasProveedor_Pedidos = '{3EE7B732-A5CB-47B3-BB5A-32CA6600E3C3}'; + RID_FacturasProveedor = '{FF3B435F-FC16-4D50-A208-6783A0728850}'; + RID_FacturasProveedor_Detalles = '{20EEDDBF-D1E1-4000-975B-D59C7740F875}'; + RID_FacturasProveedor_Pedidos = '{2875F854-3655-4217-910B-6D4DE734817F}'; { Data table names } nme_FacturasProveedor = 'FacturasProveedor'; @@ -25,6 +25,7 @@ const fld_FacturasProveedorTIPO = 'TIPO'; fld_FacturasProveedorREFERENCIA_PROVEEDOR = 'REFERENCIA_PROVEEDOR'; fld_FacturasProveedorFECHA_FACTURA = 'FECHA_FACTURA'; + fld_FacturasProveedorFECHA_VENCIMIENTO = 'FECHA_VENCIMIENTO'; fld_FacturasProveedorSITUACION = 'SITUACION'; fld_FacturasProveedorBASE_IMPONIBLE = 'BASE_IMPONIBLE'; fld_FacturasProveedorDESCUENTO = 'DESCUENTO'; @@ -59,32 +60,33 @@ const idx_FacturasProveedorTIPO = 3; idx_FacturasProveedorREFERENCIA_PROVEEDOR = 4; idx_FacturasProveedorFECHA_FACTURA = 5; - idx_FacturasProveedorSITUACION = 6; - idx_FacturasProveedorBASE_IMPONIBLE = 7; - idx_FacturasProveedorDESCUENTO = 8; - idx_FacturasProveedorIMPORTE_DESCUENTO = 9; - idx_FacturasProveedorIVA = 10; - idx_FacturasProveedorIMPORTE_IVA = 11; - idx_FacturasProveedorRE = 12; - idx_FacturasProveedorIMPORTE_RE = 13; - idx_FacturasProveedorIMPORTE_TOTAL = 14; - idx_FacturasProveedorOBSERVACIONES = 15; - idx_FacturasProveedorID_PROVEEDOR = 16; - idx_FacturasProveedorNIF_CIF = 17; - idx_FacturasProveedorNOMBRE = 18; - idx_FacturasProveedorCALLE = 19; - idx_FacturasProveedorPOBLACION = 20; - idx_FacturasProveedorPROVINCIA = 21; - idx_FacturasProveedorCODIGO_POSTAL = 22; - idx_FacturasProveedorFECHA_ALTA = 23; - idx_FacturasProveedorFECHA_MODIFICACION = 24; - idx_FacturasProveedorUSUARIO = 25; - idx_FacturasProveedorID_FORMA_PAGO = 26; - idx_FacturasProveedorRECARGO_EQUIVALENCIA = 27; - idx_FacturasProveedorID_TIPO_IVA = 28; - idx_FacturasProveedorIMPORTE_NETO = 29; - idx_FacturasProveedorIMPORTE_PORTE = 30; - idx_FacturasProveedorDATOS_BANCARIOS = 31; + idx_FacturasProveedorFECHA_VENCIMIENTO = 6; + idx_FacturasProveedorSITUACION = 7; + idx_FacturasProveedorBASE_IMPONIBLE = 8; + idx_FacturasProveedorDESCUENTO = 9; + idx_FacturasProveedorIMPORTE_DESCUENTO = 10; + idx_FacturasProveedorIVA = 11; + idx_FacturasProveedorIMPORTE_IVA = 12; + idx_FacturasProveedorRE = 13; + idx_FacturasProveedorIMPORTE_RE = 14; + idx_FacturasProveedorIMPORTE_TOTAL = 15; + idx_FacturasProveedorOBSERVACIONES = 16; + idx_FacturasProveedorID_PROVEEDOR = 17; + idx_FacturasProveedorNIF_CIF = 18; + idx_FacturasProveedorNOMBRE = 19; + idx_FacturasProveedorCALLE = 20; + idx_FacturasProveedorPOBLACION = 21; + idx_FacturasProveedorPROVINCIA = 22; + idx_FacturasProveedorCODIGO_POSTAL = 23; + idx_FacturasProveedorFECHA_ALTA = 24; + idx_FacturasProveedorFECHA_MODIFICACION = 25; + idx_FacturasProveedorUSUARIO = 26; + idx_FacturasProveedorID_FORMA_PAGO = 27; + idx_FacturasProveedorRECARGO_EQUIVALENCIA = 28; + idx_FacturasProveedorID_TIPO_IVA = 29; + idx_FacturasProveedorIMPORTE_NETO = 30; + idx_FacturasProveedorIMPORTE_PORTE = 31; + idx_FacturasProveedorDATOS_BANCARIOS = 32; { FacturasProveedor_Detalles fields } fld_FacturasProveedor_DetallesID = 'ID'; @@ -143,7 +145,7 @@ const type { IFacturasProveedor } IFacturasProveedor = interface(IDAStronglyTypedDataTable) - ['{2B8A31E0-CC1A-432A-8ED5-FF8718B38A4A}'] + ['{890AD02A-06A6-4529-91FE-5FDB296787A3}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -169,6 +171,10 @@ type procedure SetFECHA_FACTURAValue(const aValue: DateTime); function GetFECHA_FACTURAIsNull: Boolean; procedure SetFECHA_FACTURAIsNull(const aValue: Boolean); + function GetFECHA_VENCIMIENTOValue: DateTime; + procedure SetFECHA_VENCIMIENTOValue(const aValue: DateTime); + function GetFECHA_VENCIMIENTOIsNull: Boolean; + procedure SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); function GetSITUACIONValue: String; procedure SetSITUACIONValue(const aValue: String); function GetSITUACIONIsNull: Boolean; @@ -287,6 +293,8 @@ type property REFERENCIA_PROVEEDORIsNull: Boolean read GetREFERENCIA_PROVEEDORIsNull write SetREFERENCIA_PROVEEDORIsNull; property FECHA_FACTURA: DateTime read GetFECHA_FACTURAValue write SetFECHA_FACTURAValue; property FECHA_FACTURAIsNull: Boolean read GetFECHA_FACTURAIsNull write SetFECHA_FACTURAIsNull; + property FECHA_VENCIMIENTO: DateTime read GetFECHA_VENCIMIENTOValue write SetFECHA_VENCIMIENTOValue; + property FECHA_VENCIMIENTOIsNull: Boolean read GetFECHA_VENCIMIENTOIsNull write SetFECHA_VENCIMIENTOIsNull; property SITUACION: String read GetSITUACIONValue write SetSITUACIONValue; property SITUACIONIsNull: Boolean read GetSITUACIONIsNull write SetSITUACIONIsNull; property BASE_IMPONIBLE: Currency read GetBASE_IMPONIBLEValue write SetBASE_IMPONIBLEValue; @@ -372,6 +380,10 @@ type procedure SetFECHA_FACTURAValue(const aValue: DateTime); virtual; function GetFECHA_FACTURAIsNull: Boolean; virtual; procedure SetFECHA_FACTURAIsNull(const aValue: Boolean); virtual; + function GetFECHA_VENCIMIENTOValue: DateTime; virtual; + procedure SetFECHA_VENCIMIENTOValue(const aValue: DateTime); virtual; + function GetFECHA_VENCIMIENTOIsNull: Boolean; virtual; + procedure SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); virtual; function GetSITUACIONValue: String; virtual; procedure SetSITUACIONValue(const aValue: String); virtual; function GetSITUACIONIsNull: Boolean; virtual; @@ -489,6 +501,8 @@ type property REFERENCIA_PROVEEDORIsNull: Boolean read GetREFERENCIA_PROVEEDORIsNull write SetREFERENCIA_PROVEEDORIsNull; property FECHA_FACTURA: DateTime read GetFECHA_FACTURAValue write SetFECHA_FACTURAValue; property FECHA_FACTURAIsNull: Boolean read GetFECHA_FACTURAIsNull write SetFECHA_FACTURAIsNull; + property FECHA_VENCIMIENTO: DateTime read GetFECHA_VENCIMIENTOValue write SetFECHA_VENCIMIENTOValue; + property FECHA_VENCIMIENTOIsNull: Boolean read GetFECHA_VENCIMIENTOIsNull write SetFECHA_VENCIMIENTOIsNull; property SITUACION: String read GetSITUACIONValue write SetSITUACIONValue; property SITUACIONIsNull: Boolean read GetSITUACIONIsNull write SetSITUACIONIsNull; property BASE_IMPONIBLE: Currency read GetBASE_IMPONIBLEValue write SetBASE_IMPONIBLEValue; @@ -550,7 +564,7 @@ type { IFacturasProveedor_Detalles } IFacturasProveedor_Detalles = interface(IDAStronglyTypedDataTable) - ['{719BD22D-DC5C-4EA5-83AD-3FE3BFCFACD8}'] + ['{84D37F36-0D2C-4509-83AC-5D2C4B5365DF}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -765,7 +779,7 @@ type { IFacturasProveedor_Pedidos } IFacturasProveedor_Pedidos = interface(IDAStronglyTypedDataTable) - ['{0EF668B9-36CD-49D2-98AA-73BC8A470306}'] + ['{ABC0DDB3-7231-4FF1-8AB7-5C99F75F480D}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1022,6 +1036,27 @@ begin DataTable.Fields[idx_FacturasProveedorFECHA_FACTURA].AsVariant := Null; end; +function TFacturasProveedorDataTableRules.GetFECHA_VENCIMIENTOValue: DateTime; +begin + result := DataTable.Fields[idx_FacturasProveedorFECHA_VENCIMIENTO].AsDateTime; +end; + +procedure TFacturasProveedorDataTableRules.SetFECHA_VENCIMIENTOValue(const aValue: DateTime); +begin + DataTable.Fields[idx_FacturasProveedorFECHA_VENCIMIENTO].AsDateTime := aValue; +end; + +function TFacturasProveedorDataTableRules.GetFECHA_VENCIMIENTOIsNull: boolean; +begin + result := DataTable.Fields[idx_FacturasProveedorFECHA_VENCIMIENTO].IsNull; +end; + +procedure TFacturasProveedorDataTableRules.SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_FacturasProveedorFECHA_VENCIMIENTO].AsVariant := Null; +end; + function TFacturasProveedorDataTableRules.GetSITUACIONValue: String; begin result := DataTable.Fields[idx_FacturasProveedorSITUACION].AsString; diff --git a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas index 39d5d77d..34bcb10f 100644 --- a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas +++ b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas @@ -9,14 +9,14 @@ const { Delta rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } - RID_FacturasProveedorDelta = '{DEDF4BE8-84F9-4301-B8D1-EDA6D80F4806}'; - RID_FacturasProveedor_DetallesDelta = '{5546A2C7-8888-4209-A16C-2CBD7F2F0445}'; - RID_FacturasProveedor_PedidosDelta = '{46AB77BB-35CB-4499-8923-289831F40490}'; + RID_FacturasProveedorDelta = '{2730D1DB-B404-41F5-BAFB-3C04F5CE8911}'; + RID_FacturasProveedor_DetallesDelta = '{9550F90F-A4DD-4C53-87E1-486C0B219348}'; + RID_FacturasProveedor_PedidosDelta = '{14838498-B2C3-4AF5-B92E-4B250F856A69}'; type { IFacturasProveedorDelta } IFacturasProveedorDelta = interface(IFacturasProveedor) - ['{DEDF4BE8-84F9-4301-B8D1-EDA6D80F4806}'] + ['{2730D1DB-B404-41F5-BAFB-3C04F5CE8911}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -24,6 +24,7 @@ type function GetOldTIPOValue : String; function GetOldREFERENCIA_PROVEEDORValue : String; function GetOldFECHA_FACTURAValue : DateTime; + function GetOldFECHA_VENCIMIENTOValue : DateTime; function GetOldSITUACIONValue : String; function GetOldBASE_IMPONIBLEValue : Currency; function GetOldDESCUENTOValue : Float; @@ -58,6 +59,7 @@ type property OldTIPO : String read GetOldTIPOValue; property OldREFERENCIA_PROVEEDOR : String read GetOldREFERENCIA_PROVEEDORValue; property OldFECHA_FACTURA : DateTime read GetOldFECHA_FACTURAValue; + property OldFECHA_VENCIMIENTO : DateTime read GetOldFECHA_VENCIMIENTOValue; property OldSITUACION : String read GetOldSITUACIONValue; property OldBASE_IMPONIBLE : Currency read GetOldBASE_IMPONIBLEValue; property OldDESCUENTO : Float read GetOldDESCUENTOValue; @@ -129,6 +131,12 @@ type function GetOldFECHA_FACTURAIsNull: Boolean; virtual; procedure SetFECHA_FACTURAValue(const aValue: DateTime); virtual; procedure SetFECHA_FACTURAIsNull(const aValue: Boolean); virtual; + function GetFECHA_VENCIMIENTOValue: DateTime; virtual; + function GetFECHA_VENCIMIENTOIsNull: Boolean; virtual; + function GetOldFECHA_VENCIMIENTOValue: DateTime; virtual; + function GetOldFECHA_VENCIMIENTOIsNull: Boolean; virtual; + procedure SetFECHA_VENCIMIENTOValue(const aValue: DateTime); virtual; + procedure SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); virtual; function GetSITUACIONValue: String; virtual; function GetSITUACIONIsNull: Boolean; virtual; function GetOldSITUACIONValue: String; virtual; @@ -310,6 +318,10 @@ type property FECHA_FACTURAIsNull : Boolean read GetFECHA_FACTURAIsNull write SetFECHA_FACTURAIsNull; property OldFECHA_FACTURA : DateTime read GetOldFECHA_FACTURAValue; property OldFECHA_FACTURAIsNull : Boolean read GetOldFECHA_FACTURAIsNull; + property FECHA_VENCIMIENTO : DateTime read GetFECHA_VENCIMIENTOValue write SetFECHA_VENCIMIENTOValue; + property FECHA_VENCIMIENTOIsNull : Boolean read GetFECHA_VENCIMIENTOIsNull write SetFECHA_VENCIMIENTOIsNull; + property OldFECHA_VENCIMIENTO : DateTime read GetOldFECHA_VENCIMIENTOValue; + property OldFECHA_VENCIMIENTOIsNull : Boolean read GetOldFECHA_VENCIMIENTOIsNull; property SITUACION : String read GetSITUACIONValue write SetSITUACIONValue; property SITUACIONIsNull : Boolean read GetSITUACIONIsNull write SetSITUACIONIsNull; property OldSITUACION : String read GetOldSITUACIONValue; @@ -423,7 +435,7 @@ type { IFacturasProveedor_DetallesDelta } IFacturasProveedor_DetallesDelta = interface(IFacturasProveedor_Detalles) - ['{5546A2C7-8888-4209-A16C-2CBD7F2F0445}'] + ['{9550F90F-A4DD-4C53-87E1-486C0B219348}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_FACTURAValue : Integer; @@ -637,7 +649,7 @@ type { IFacturasProveedor_PedidosDelta } IFacturasProveedor_PedidosDelta = interface(IFacturasProveedor_Pedidos) - ['{46AB77BB-35CB-4499-8923-289831F40490}'] + ['{14838498-B2C3-4AF5-B92E-4B250F856A69}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_FACTURAValue : Integer; @@ -954,6 +966,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorFECHA_FACTURA] := Null; end; +function TFacturasProveedorBusinessProcessorRules.GetFECHA_VENCIMIENTOValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorFECHA_VENCIMIENTO]; +end; + +function TFacturasProveedorBusinessProcessorRules.GetFECHA_VENCIMIENTOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorFECHA_VENCIMIENTO]); +end; + +function TFacturasProveedorBusinessProcessorRules.GetOldFECHA_VENCIMIENTOValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasProveedorFECHA_VENCIMIENTO]; +end; + +function TFacturasProveedorBusinessProcessorRules.GetOldFECHA_VENCIMIENTOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasProveedorFECHA_VENCIMIENTO]); +end; + +procedure TFacturasProveedorBusinessProcessorRules.SetFECHA_VENCIMIENTOValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorFECHA_VENCIMIENTO] := aValue; +end; + +procedure TFacturasProveedorBusinessProcessorRules.SetFECHA_VENCIMIENTOIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorFECHA_VENCIMIENTO] := Null; +end; + function TFacturasProveedorBusinessProcessorRules.GetSITUACIONValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorSITUACION]; diff --git a/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.dfm b/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.dfm index af6adb1a..a4dcbb0d 100644 --- a/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.dfm +++ b/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.dfm @@ -150,6 +150,10 @@ object srvFacturasProveedor: TsrvFacturasProveedor item DatasetField = 'DATOS_BANCARIOS' TableField = 'DATOS_BANCARIOS' + end + item + DatasetField = 'FECHA_VENCIMIENTO' + TableField = 'FECHA_VENCIMIENTO' end> end> Name = 'FacturasProveedor' @@ -190,6 +194,11 @@ object srvFacturasProveedor: TsrvFacturasProveedor DataType = datDateTime DictionaryEntry = 'FacturasProveedor_FECHA_FACTURA' end + item + Name = 'FECHA_VENCIMIENTO' + DataType = datDateTime + DisplayLabel = 'Fecha vto.' + end item Name = 'SITUACION' DataType = datString @@ -630,12 +639,6 @@ object srvFacturasProveedor: TsrvFacturasProveedor end item Params = < - item - Name = 'DATOS_BANCARIOS' - DataType = datString - Size = 255 - Value = '' - end item Name = 'ID' DataType = datAutoInc @@ -753,6 +756,14 @@ object srvFacturasProveedor: TsrvFacturasProveedor item Name = 'IMPORTE_PORTE' Value = '' + end + item + Name = 'DATOS_BANCARIOS' + Value = '' + end + item + Name = 'FECHA_VENCIMIENTO' + Value = '' end> Statements = < item @@ -767,14 +778,15 @@ object srvFacturasProveedor: TsrvFacturasProveedor ' NOMBRE, CALLE, POBLACION, PROVINCIA, CODIGO_POSTAL, '#10' FECH' + 'A_ALTA, FECHA_MODIFICACION, USUARIO, ID_FORMA_PAGO, '#10' RECARG' + 'O_EQUIVALENCIA, ID_TIPO_IVA, IMPORTE_NETO, IMPORTE_PORTE,'#10' D' + - 'ATOS_BANCARIOS)'#10' VALUES'#10' (:ID, :ID_EMPRESA, :REFERENCIA, :RE' + - 'FERENCIA_PROVEEDOR,'#10' :FECHA_FACTURA, :BASE_IMPONIBLE, :DESCU' + - 'ENTO,'#10' :IMPORTE_DESCUENTO, :IVA, :IMPORTE_IVA, :RE, :IMPORTE' + - '_RE, '#10' :IMPORTE_TOTAL, :OBSERVACIONES, :ID_PROVEEDOR, :NIF_C' + - 'IF, '#10' :NOMBRE, :CALLE, :POBLACION, :PROVINCIA, :CODIGO_POSTA' + - 'L, '#10' :FECHA_ALTA, :FECHA_MODIFICACION, :USUARIO, :ID_FORMA_P' + - 'AGO, '#10' :RECARGO_EQUIVALENCIA, :ID_TIPO_IVA, :IMPORTE_NETO, '#10 + - ' :IMPORTE_PORTE, :DATOS_BANCARIOS)'#10' '#10' '#10#10 + 'ATOS_BANCARIOS, FECHA_VENCIMIENTO)'#10' VALUES'#10' (:ID, :ID_EMPRES' + + 'A, :REFERENCIA, :REFERENCIA_PROVEEDOR,'#10' :FECHA_FACTURA, :BAS' + + 'E_IMPONIBLE, :DESCUENTO,'#10' :IMPORTE_DESCUENTO, :IVA, :IMPORTE' + + '_IVA, :RE, :IMPORTE_RE, '#10' :IMPORTE_TOTAL, :OBSERVACIONES, :I' + + 'D_PROVEEDOR, :NIF_CIF, '#10' :NOMBRE, :CALLE, :POBLACION, :PROVI' + + 'NCIA, :CODIGO_POSTAL, '#10' :FECHA_ALTA, :FECHA_MODIFICACION, :U' + + 'SUARIO, :ID_FORMA_PAGO, '#10' :RECARGO_EQUIVALENCIA, :ID_TIPO_IV' + + 'A, :IMPORTE_NETO, '#10' :IMPORTE_PORTE, :DATOS_BANCARIOS, :FECHA' + + '_VENCIMIENTO)'#10' '#10' '#10#10 StatementType = stSQL ColumnMappings = <> end> @@ -801,12 +813,6 @@ object srvFacturasProveedor: TsrvFacturasProveedor end item Params = < - item - Name = 'DATOS_BANCARIOS' - DataType = datString - Size = 255 - Value = '' - end item Name = 'ID' Value = '' @@ -923,6 +929,14 @@ object srvFacturasProveedor: TsrvFacturasProveedor Name = 'IMPORTE_PORTE' Value = '' end + item + Name = 'DATOS_BANCARIOS' + Value = '' + end + item + Name = 'FECHA_VENCIMIENTO' + Value = '' + end item Name = 'OLD_ID' Value = '' @@ -948,8 +962,8 @@ object srvFacturasProveedor: TsrvFacturasProveedor ' :USUARIO, '#10' ID_FORMA_PAGO = :ID_FORMA_PAGO, '#10' RECARGO_EQU' + 'IVALENCIA = :RECARGO_EQUIVALENCIA, '#10' ID_TIPO_IVA = :ID_TIPO_I' + 'VA, '#10' IMPORTE_NETO = :IMPORTE_NETO, '#10' IMPORTE_PORTE = :IMP' + - 'ORTE_PORTE,'#10' DATOS_BANCARIOS = :DATOS_BANCARIOS'#10' WHERE'#10' (' + - 'ID = :OLD_ID)'#10 + 'ORTE_PORTE,'#10' DATOS_BANCARIOS = :DATOS_BANCARIOS,'#10' FECHA_VE' + + 'NCIMIENTO = :FECHA_VENCIMIENTO'#10' WHERE'#10' (ID = :OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> diff --git a/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.dfm b/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.dfm index a3e6c3fe..5327addd 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.dfm +++ b/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.dfm @@ -224,8 +224,12 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 165 - Width = 165 + end + inherited edtFechaVencimiento: TcxDBDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' end end end @@ -256,9 +260,22 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor Height = 51 ExplicitWidth = 805 ExplicitHeight = 51 - inherited ToolButton14: TToolButton + inherited ToolButton3: TToolButton Wrap = False 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 Left = 399 Top = 0 @@ -273,7 +290,13 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor ExplicitTop = 0 ExplicitWidth = 168 end - inherited ToolButton13: TToolButton [7] + inherited UpDown1: TUpDown + Left = 712 + Top = 0 + ExplicitLeft = 712 + ExplicitTop = 0 + end + inherited ToolButton13: TToolButton Left = 0 Top = 0 Wrap = True @@ -281,54 +304,46 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor ExplicitTop = 0 ExplicitHeight = 27 end - inherited UpDown1: TUpDown [8] + inherited ToolButton6: TToolButton Left = 0 Top = 27 ExplicitLeft = 0 ExplicitTop = 27 end - inherited ToolButton6: TToolButton - Left = 17 - Top = 27 - ExplicitLeft = 17 - ExplicitTop = 27 - end inherited ToolButton7: TToolButton - Left = 83 + Left = 66 Top = 27 - ExplicitLeft = 83 + ExplicitLeft = 66 ExplicitTop = 27 end inherited ToolButton8: TToolButton - Left = 150 + Left = 133 Top = 27 - ExplicitLeft = 150 + ExplicitLeft = 133 ExplicitTop = 27 end inherited ToolButton12: TToolButton - Left = 233 + Left = 216 Top = 27 - Wrap = False - ExplicitLeft = 233 + ExplicitLeft = 216 ExplicitTop = 27 - ExplicitHeight = 22 end inherited ToolButton9: TToolButton - Left = 241 + Left = 224 Top = 27 - ExplicitLeft = 241 + ExplicitLeft = 224 ExplicitTop = 27 end inherited ToolButton10: TToolButton - Left = 386 + Left = 369 Top = 27 - ExplicitLeft = 386 + ExplicitLeft = 369 ExplicitTop = 27 end inherited ToolButton11: TToolButton - Left = 511 + Left = 494 Top = 27 - ExplicitLeft = 511 + ExplicitLeft = 494 ExplicitTop = 27 end end diff --git a/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.pas b/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.pas index 49fdadfb..80b43b29 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.pas +++ b/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.pas @@ -41,6 +41,7 @@ type procedure frViewTotales1ePortePropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean); procedure frViewTotales1ePorteEditing(Sender: TObject; var CanEdit: Boolean); + private procedure RecalcularPortePorUnidad; @@ -79,7 +80,7 @@ implementation {$R *.dfm} uses - cxDBEdit, uBizContactos, uDataModuleUsuarios, uFactuGES_App, + cxDBEdit, uBizContactos, uDataModuleUsuarios, uFactuGES_App, uDetallesFacturaProveedorController, uDialogUtils, uDataTableUtils, uGenerarAlbaranesProvFacProvUtils; @@ -94,7 +95,7 @@ begin inherited; pgPaginas.ActivePageIndex := 0; ViewFacturaProveedor := frViewFacturaProveedor1; - FTiposIVAController := TTiposIVAController.Create; + FTiposIVAController := TTiposIVAController.Create; end; procedure TfEditorFacturaProveedor.CustomEditorClose(Sender: TObject; @@ -373,7 +374,7 @@ begin if Assigned(FController) then begin - frViewFacturaProveedor1.frViewProveedorFactura.Controller := Controller.ProveedorController; + ViewFacturaProveedor.Controller := Controller; frViewDetallesFacturaProveedor1.Controller := Controller.DetallesController; end; end; diff --git a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm index ab8d3495..2c91f1e0 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm +++ b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm @@ -1,5 +1,5 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor - Width = 451 + Width = 687 Height = 304 Align = alClient OnCreate = CustomViewCreate @@ -9,7 +9,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor object dxLayoutControl1: TdxLayoutControl Left = 0 Top = 0 - Width = 451 + Width = 687 Height = 304 Align = alClient ParentBackground = True @@ -17,8 +17,9 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor TabStop = False AutoContentSizes = [acsWidth, acsHeight] LookAndFeel = dxLayoutOfficeLookAndFeel1 + ExplicitWidth = 451 DesignSize = ( - 451 + 687 304) object eReferencia: TcxDBTextEdit Left = 136 @@ -72,7 +73,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor end object memObservaciones: TcxDBMemo Left = 22 - Top = 191 + Top = 242 Anchors = [akLeft, akTop, akRight, akBottom] DataBinding.DataField = 'OBSERVACIONES' DataBinding.DataSource = DADataSource @@ -88,13 +89,13 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.SkinName = '' - TabOrder = 6 + TabOrder = 7 Height = 159 Width = 301 end object cbFormaPago: TcxDBLookupComboBox Left = 136 - Top = 111 + Top = 135 DataBinding.DataField = 'ID_FORMA_PAGO' DataBinding.DataSource = DADataSource Properties.ImmediatePost = True @@ -107,6 +108,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Properties.ListOptions.ShowHeader = False Properties.ListOptions.SyncMode = True Properties.ListSource = dsFormaPago + Properties.OnEditValueChanged = cbFormaPagoPropertiesEditValueChanged Style.BorderColor = clWindowFrame Style.BorderStyle = ebs3D Style.HotTrack = False @@ -128,8 +130,8 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Width = 78 end object bFormasPago: TButton - Left = 162 - Top = 111 + Left = 204 + Top = 135 Width = 132 Height = 23 Caption = 'Ver las formas de pago...' @@ -161,7 +163,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Width = 158 end inline frViewProveedorFactura: TfrViewDatosYSeleccionProveedor - Left = 322 + Left = 364 Top = 30 Width = 350 Height = 202 @@ -171,9 +173,9 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 7 + TabOrder = 8 ReadOnly = False - ExplicitLeft = 322 + ExplicitLeft = 364 ExplicitTop = 30 inherited dxLayoutControl1: TdxLayoutControl inherited edtlNombre: TcxDBTextEdit @@ -215,25 +217,26 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Width = 327 end inherited edtCodigoPostal: TcxDBTextEdit - Left = 203 + Left = 209 Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 203 + ExplicitLeft = 209 end inherited Button3: TBitBtn - Left = 87 - ExplicitLeft = 87 + Left = 93 + ExplicitLeft = 93 end end end object cbCuentaBancaria: TcxDBComboBox Left = 136 - Top = 140 + Top = 191 DataBinding.DataField = 'DATOS_BANCARIOS' DataBinding.DataSource = DADataSource Properties.DropDownListStyle = lsFixedList + Properties.DropDownRows = 12 Properties.ImmediatePost = True Properties.ImmediateUpdateText = True Properties.PostPopupValueOnTab = True @@ -246,9 +249,34 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - TabOrder = 5 + TabOrder = 6 Width = 165 end + object edtFechaVencimiento: TcxDBDateEdit + Left = 136 + Top = 164 + Anchors = [akLeft, akTop, akRight] + DataBinding.DataField = 'FECHA_VENCIMIENTO' + DataBinding.DataSource = DADataSource + Style.BorderColor = clWindowFrame + Style.BorderStyle = ebs3D + Style.Color = clInfoBk + Style.HotTrack = False + Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' + Style.Shadow = False + Style.ButtonStyle = bts3D + Style.ButtonTransparency = ebtNone + Style.PopupBorderStyle = epbsFrame3D + StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 5 + Width = 251 + end object dxLayoutControl1Group_Root: TdxLayoutGroup ShowCaption = False Hidden = True @@ -279,11 +307,14 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Control = edtFecha ControlOptions.ShowBorder = False end + end + object dxLayoutControl1Group7: TdxLayoutGroup + Caption = 'Forma de pago' object dxLayoutControl1Group3: TdxLayoutGroup ShowCaption = False Hidden = True ShowBorder = False - object dxLayoutControl1Group4: TdxLayoutGroup + object dxLayoutControl1Group8: TdxLayoutGroup ShowCaption = False Hidden = True LayoutDirection = ldHorizontal @@ -301,12 +332,17 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor ControlOptions.ShowBorder = False end end - object dxLayoutControl1Item7: TdxLayoutItem - Caption = 'Cuenta bancaria:' - Control = cbCuentaBancaria + object ledtFechaVencimiento: TdxLayoutItem + Caption = 'Fecha vencimiento:' + Control = edtFechaVencimiento ControlOptions.ShowBorder = False end end + object dxLayoutControl1Item7: TdxLayoutItem + Caption = 'Cuenta bancaria:' + Control = cbCuentaBancaria + ControlOptions.ShowBorder = False + end end object dxLayoutControl1Group5: TdxLayoutGroup AutoAligns = [aaHorizontal] diff --git a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas index fcb8eff1..6cfb268a 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas +++ b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas @@ -10,7 +10,7 @@ uses cxMemo, cxMaskEdit, cxDropDownEdit, cxCalendar, cxSpinEdit, StdCtrls, Mask, DBCtrls, cxGraphics, dxLayoutLookAndFeels, cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, uFormasPagoController, uViewDatosYSeleccionProveedor, - uDAInterfaces, uBizFormasPago; + uDAInterfaces, uBizFormasPago, uFacturasProveedorController; type IViewFacturaProveedor = interface(IViewBase) @@ -18,6 +18,9 @@ type function GetFactura: IBizFacturaProveedor; procedure SetFactura(const Value: IBizFacturaProveedor); property Factura: IBizFacturaProveedor read GetFactura write SetFactura; + function GetController : IFacturasProveedorController; + procedure SetController (const Value : IFacturasProveedorController); + property Controller : IFacturasProveedorController read GetController write SetController; end; TfrViewFacturaProveedor = class(TfrViewBase, IViewFacturaProveedor) @@ -40,7 +43,6 @@ type cbFormaPago: TcxDBLookupComboBox; dxLayoutControl1Item10: TdxLayoutItem; bFormasPago: TButton; - dxLayoutControl1Group3: TdxLayoutGroup; dxLayoutControl1Group6: TdxLayoutGroup; dxLayoutControl1Item6: TdxLayoutItem; eReferenciaProveedor: TcxDBTextEdit; @@ -48,21 +50,32 @@ type frViewProveedorFactura: TfrViewDatosYSeleccionProveedor; dxLayoutControl1Item7: TdxLayoutItem; cbCuentaBancaria: TcxDBComboBox; - dxLayoutControl1Group4: TdxLayoutGroup; + dxLayoutControl1Group7: TdxLayoutGroup; + dxLayoutControl1Group3: TdxLayoutGroup; + ledtFechaVencimiento: TdxLayoutItem; + edtFechaVencimiento: TcxDBDateEdit; + dxLayoutControl1Group8: TdxLayoutGroup; procedure bFormasPagoClick(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure CustomViewCreate(Sender: TObject); procedure frViewProveedorFacturaButton1Click(Sender: TObject); procedure frViewProveedorFacturaButton2Click(Sender: TObject); + procedure cbFormaPagoPropertiesEditValueChanged(Sender: TObject); + protected FFactura : IBizFacturaProveedor; + FController : IFacturasProveedorController; FFormasPago : IBizFormaPago; FFormasPagoController : IFormasPagoController; function GetFactura: IBizFacturaProveedor; procedure SetFactura(const Value: IBizFacturaProveedor); - procedure RellenarCuentasBancarias; + function GetController : IFacturasProveedorController; + procedure SetController (const Value : IFacturasProveedorController); + procedure RellenarCuentasBancarias; + public property Factura: IBizFacturaProveedor read GetFactura write SetFactura; + property Controller : IFacturasProveedorController read GetController write SetController; end; @@ -83,6 +96,17 @@ begin FFormasPagoController.VerTodos(FFormasPago); end; +procedure TfrViewFacturaProveedor.cbFormaPagoPropertiesEditValueChanged( + Sender: TObject); +begin + inherited; + if Assigned(FFormasPago) then + if (FFormasPago.Plazos.RecordCount = 0) then + ledtFechaVencimiento.Enabled := True + else + ledtFechaVencimiento.Enabled := False; +end; + procedure TfrViewFacturaProveedor.CustomViewCreate(Sender: TObject); begin inherited; @@ -121,6 +145,11 @@ begin frViewProveedorFactura.actAnadirContacto.Execute; end; +function TfrViewFacturaProveedor.GetController: IFacturasProveedorController; +begin + Result := FController; +end; + function TfrViewFacturaProveedor.GetFactura: IBizFacturaProveedor; begin Result := FFactura; @@ -131,12 +160,15 @@ var AController : IEmpresasController; ALista : TStringList; AListaIBAN : TStringList; + AListaProveedor : TStringList; i : integer; begin AController := TEmpresasController.Create; try ALista := AController.DarListaCuentasBancarias(AppFactuGES.EmpresaActiva); AListaIBAN := AController.DarListaCuentasBancariasIBAN(AppFactuGES.EmpresaActiva); + AListaProveedor := Controller.ProveedorController.DarListaCuentasBancarias(FFactura.ID_PROVEEDOR); + try with cbCuentaBancaria.Properties.Items do begin @@ -153,6 +185,14 @@ begin for i := 0 to AListaIBAN.Count - 1 do Add(AListaIBAN.Names[i]); end; + + if AListaProveedor.Count > 0 then + begin + Add('--------------'); + for i := 0 to AListaProveedor.Count - 1 do + Add(AListaProveedor.Names[i]); + end; + finally EndUpdate; end; @@ -166,6 +206,14 @@ begin end; end; +procedure TfrViewFacturaProveedor.SetController(const Value: IFacturasProveedorController); +begin + FController := Value; + + if Assigned(FController) then + frViewProveedorFactura.Controller := Controller.ProveedorController; +end; + procedure TfrViewFacturaProveedor.SetFactura(const Value: IBizFacturaProveedor); begin FFactura := Value; @@ -180,6 +228,13 @@ begin dsFormaPago.DataTable := FFormasPago.DataTable; dsFormaPago.DataTable.Active := True; + //Posicionamos la tabla en la forma de pago que tiene la factura ya que no lo hace el componente por si solo + FFormasPago.DataTable.Locate(fld_FacturasProveedorID, FFactura.ID_FORMA_PAGO, []); + if (FFormasPago.Plazos.RecordCount = 0) then + ledtFechaVencimiento.Enabled := True + else + ledtFechaVencimiento.Enabled := False; + if FFactura.TIPO = CTE_TIPO_ABONO then begin dxLayoutControl1Item2.Caption := 'Fecha del abono:'; diff --git a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas index c2c98a53..45cb43c1 100644 --- a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas +++ b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas @@ -142,7 +142,7 @@ begin end; function TDataModuleGestorInformes.GenerarInformeListadoPresupuestos( - const IdEmpresa: Integer; const FechaInicio, FechaFin: TDateTime; + const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary; begin diff --git a/Source/Modulos/Gestor de informes/Views/uEditorInformePedidosReport.dfm b/Source/Modulos/Gestor de informes/Views/uEditorInformePedidosReport.dfm index 5e1dbb3e..ad6bcb1d 100644 --- a/Source/Modulos/Gestor de informes/Views/uEditorInformePedidosReport.dfm +++ b/Source/Modulos/Gestor de informes/Views/uEditorInformePedidosReport.dfm @@ -66,23 +66,11 @@ inherited fEditorInformePedidosReport: TfEditorInformePedidosReport ReadOnly = False ExplicitWidth = 188 ExplicitHeight = 136 - inherited TBXAlignmentPanel1: TTBXAlignmentPanel - Width = 182 - ExplicitWidth = 182 - inherited cbPeriodo: TcxComboBox - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 153 - Width = 153 - end - end inherited TBXAlignmentPanel2: TTBXAlignmentPanel Width = 182 ExplicitWidth = 182 inherited Label3: TLabel - Width = 85 + Width = 172 end inherited edtFechaFin: TcxDateEdit Style.LookAndFeel.SkinName = '' @@ -100,11 +88,48 @@ inherited fEditorInformePedidosReport: TfEditorInformePedidosReport ExplicitWidth = 97 Width = 97 end + inherited cbPeriodo: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + end end inherited TBXLabel2: TTBXLabel Width = 188 ExplicitWidth = 188 end + inherited TBXAlignmentPanel3: TTBXAlignmentPanel + Width = 182 + ExplicitWidth = 182 + inherited Label4: TLabel + Width = 172 + end + inherited edtFechaVenFin: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 99 + Width = 99 + end + inherited edtFechaVenIni: TcxDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 97 + Width = 97 + end + inherited cbPeriodo2: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 166 + Width = 166 + end + end end inherited TBXDockablePanel1: TTBXDockablePanel Top = 368 diff --git a/Source/Modulos/Gestor de informes/Views/uEditorInformePedidosReport.pas b/Source/Modulos/Gestor de informes/Views/uEditorInformePedidosReport.pas index 6210373c..134007cf 100644 --- a/Source/Modulos/Gestor de informes/Views/uEditorInformePedidosReport.pas +++ b/Source/Modulos/Gestor de informes/Views/uEditorInformePedidosReport.pas @@ -25,8 +25,8 @@ type procedure actRefrescarExecute(Sender: TObject); private FListaIDProveedores: TIntegerArray; - function GetFechaFin: TDateTime; - function GetFechaInicio: TDateTime; + function GetFechaFin: Variant; + function GetFechaInicio: Variant; function GetListaIDProveedores: TIntegerArray; function GetImporteMinimo: Currency; function GetDesglosadoProveedor: Boolean; @@ -34,8 +34,8 @@ type procedure RefrescarInforme; public - property FechaInicio: TDateTime read GetFechaInicio; - property FechaFin: TDateTime read GetFechaFin; + property FechaInicio: Variant read GetFechaInicio; + property FechaFin: Variant read GetFechaFin; property ListaIDProveedores: TIntegerArray read GetListaIDProveedores; property DesglosadoProveedor: Boolean read GetDesglosadoProveedor; property ImporteMinimo: Currency read GetImporteMinimo; @@ -79,14 +79,14 @@ begin Result := False; end; -function TfEditorInformePedidosReport.GetFechaFin: TDateTime; +function TfEditorInformePedidosReport.GetFechaFin: Variant; begin - Result := frViewPeriodoFechas1.edtFechaFin.Date; + Result := frViewPeriodoFechas1.edtFechaFin.EditValue; end; -function TfEditorInformePedidosReport.GetFechaInicio: TDateTime; +function TfEditorInformePedidosReport.GetFechaInicio: Variant; begin - Result := frViewPeriodoFechas1.edtFechaIni.Date; + Result := frViewPeriodoFechas1.edtFechaIni.EditValue; end; function TfEditorInformePedidosReport.GetImporteMinimo: Currency; diff --git a/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.res b/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.res index 1641339f..8b251f31 100644 Binary files a/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.res and b/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.res differ diff --git a/Source/Servidor/FactuGES_Server.RES b/Source/Servidor/FactuGES_Server.RES index adea870b..d1eb1241 100644 Binary files a/Source/Servidor/FactuGES_Server.RES and b/Source/Servidor/FactuGES_Server.RES differ diff --git a/Source/Servidor/FactuGES_Server.dpr b/Source/Servidor/FactuGES_Server.dpr index 8fbaa1d2..a928dfab 100644 --- a/Source/Servidor/FactuGES_Server.dpr +++ b/Source/Servidor/FactuGES_Server.dpr @@ -104,8 +104,6 @@ uses schPedidosProveedorClient_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorClient_Intf.pas', schPedidosProveedorServer_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorServer_Intf.pas', srvGestorDocumentos_Impl in '..\Modulos\Gestion de documentos\Servidor\srvGestorDocumentos_Impl.pas' {srvGestorDocumentos: TDataAbstractService}, - schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas', - schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas', schInventarioClient_Intf in '..\Modulos\Inventario\Model\schInventarioClient_Intf.pas', schInventarioServer_Intf in '..\Modulos\Inventario\Model\schInventarioServer_Intf.pas', schHistoricoMovimientosClient_Intf in '..\Modulos\Historico de movimientos\Model\schHistoricoMovimientosClient_Intf.pas', @@ -114,8 +112,6 @@ uses schAlbaranesClienteServer_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteServer_Intf.pas', schAlbaranesProveedorClient_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorClient_Intf.pas', schAlbaranesProveedorServer_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorServer_Intf.pas', - schFacturasClienteClient_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteClient_Intf.pas', - schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas', schUsuariosClient_Intf in '..\ApplicationBase\Usuarios\Model\schUsuariosClient_Intf.pas', schUsuariosServer_Intf in '..\ApplicationBase\Usuarios\Model\schUsuariosServer_Intf.pas', schContactosClient_Intf in '..\Modulos\Contactos\Model\schContactosClient_Intf.pas', @@ -132,7 +128,11 @@ uses schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas', schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas', schEmpresasClient_Intf in '..\ApplicationBase\Empresas\Model\schEmpresasClient_Intf.pas', - schEmpresasServer_Intf in '..\ApplicationBase\Empresas\Model\schEmpresasServer_Intf.pas'; + schEmpresasServer_Intf in '..\ApplicationBase\Empresas\Model\schEmpresasServer_Intf.pas', + schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas', + schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas', + schFacturasClienteClient_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteClient_Intf.pas', + schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas'; {$R *.res} {$R ..\Servicios\RODLFile.res} diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj index fe6c6056..61627ba3 100644 --- a/Source/Servidor/FactuGES_Server.dproj +++ b/Source/Servidor/FactuGES_Server.dproj @@ -1,327 +1,327 @@ - + - - {ebdcd25d-40d7-4146-91ec-a0ea4aa1dcd1} - FactuGES_Server.dpr - Debug - AnyCPU - DCC32 - ..\..\Output\Debug\Servidor\FactuGES_Server.exe - vcl;rtl;vclx;vclactnband;dbrtl;vcldb;vcldbx;bdertl;dsnap;dsnapcon;teeUI;teedb;tee;adortl;vclib;ibxpress;dbxcds;dbexpress;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;VclSmp;vclie;webdsnap;xmlrtl;inet;inetdbbde;inetdbxpress;RemObjects_BPDX_D11;RemObjects_RODX_D11;RemObjects_Indy_D11;RemObjects_Synapse_D11;RemObjects_WebBroker_D11;DataAbstract_Core_D11;DataAbstract_DBXDriver_D11;DataAbstract_IDE_D11;DataAbstract_Scripting_D11;DataAbstract_SDACDriver_D11;sdac105;dac105;DataAbstract_SQLiteDriver_D11;cxEditorsD10;cxLibraryD10;dxThemeD10;cxDataD10;cxExtEditorsD10;cxGridD10;cxPageControlD10;cxSchedulerD10;cxTreeListD10;cxVerticalGridD10;dxBarD10;dxComnD10;dxBarDBNavD10;dxBarExtDBItemsD10;dxBarExtItemsD10;dxDockingD10;dxLayoutControlD10;dxNavBarD10;dxPSCoreD10;dxsbD10;dxPScxCommonD10;dxPSLnksD10;vclshlctrls;dxPScxExtCommonD10;dxPScxGridLnkD10;dxPScxPCProdD10;dxPScxScheduler2LnkD10;dxPScxTLLnkD10;dxPSdxLCLnkD10;dxPsPrVwAdvD10;pckMD5;pckUCDataConnector;pckUserControl_RT;PluginSDK_D10R;PNG_D10;PngComponentsD10;tb2k_d10;tbx_d10;JclVcl;Jcl;JvXPCtrlsD11R;JvCoreD11R;JvSystemD11R;JvStdCtrlsD11R;JvAppFrmD11R;JvBandsD11R;JvDBD11R;JvDlgsD11R;JvBDED11R;JvCmpD11R;JvCryptD11R;JvCtrlsD11R;JvCustomD11R;JvDockingD11R;JvDotNetCtrlsD11R;JvEDID11R;JvGlobusD11R;JvHMID11R;JvInterpreterD11R;JvJansD11R;JvManagedThreadsD11R;JvMMD11R;JvNetD11R;JvPageCompsD11R;JvPluginD11R;JvPrintPreviewD11R;JvRuntimeDesignD11R;JvTimeFrameworkD11R;JvUIBD11R;JvValidatorsD11R;JvWizardD11R;pckUCADOConn;pckUCBDEConn;pckUCIBXConn;pckUCMidasConn;cxIntlPrintSys3D10;cxExportD10;cxIntl5D10;GUISDK_D11;ccpackD11;JSDialog100;fsTee11;fs11;frx11;frxADO11;frxBDE11;frxDB11;frxDBX11;frxe11;frxIBX11;frxTee11;fsADO11;fsBDE11;fsDB11;fsIBX11;websnap;soaprtl;IntrawebDB_90_100;Intraweb_90_100 - - - 7.0 - False - False - 0 - 3 - ..\..\Output\Release\Servidor - RELEASE - - - 7.0 - 3 - ..\..\Output\Debug\Servidor - DEBUG; - True - True - True - $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10 - $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10 - $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10 - $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10 - - - Delphi.Personality - - -FalseTrueFalse/standaloneTrueFalse1470FalseFalseFalseFalseFalse308212521.4.7.01.4.7.0jueves, 27 de noviembre de 2008 16:53FactuGES_Server.dpr - - - - - MainSource - - - - - -
srvEmpresas
- TDARemoteService -
- -
srvProvinciasPoblaciones_Impl
- TDataModule -
- - - -
srvUsuarios
- TDataAbstractService -
- - - - - - - -
RptAlbaranesCliente
- TDataModule -
- -
RptWordAlbaranCliente
- TDataModule -
- -
srvAlbaranesCliente
- TDataAbstractService -
- - - - -
srvAlbaranesProveedor
- TDataAbstractService -
- - - -
srvAlmacenes
- TDARemoteService -
- - - - -
srvArticulos
- TDARemoteService -
- - - - - - - -
RptEtiquetasContacto
- TDataModule -
- -
RptFichasEmpleado
- TDataModule -
- -
srvContactos
- TDARemoteService -
- - - -
srvFabricantes
- TDataAbstractService -
- - - - -
RptFacturasCliente
- TDataModule -
- -
RptWordFacturaCliente
- TDataModule -
- -
srvFacturasCliente
- TDataAbstractService -
- - - - -
RptFacturasProveedor
- TDataModule -
- -
srvFacturasProveedor
- TDataAbstractService -
- - - -
srvFamilias
- TDataAbstractService -
- - - -
srvFormasPago
- TDataAbstractService -
- -
srvGestorDocumentos
- TDataAbstractService -
- -
srvGestorInformes
- TDataAbstractService -
- - - -
srvHistoricoMovimientos
- TDataAbstractService -
- - - -
srvInventario
- TDataAbstractService -
- - - - -
srvObras
- TDataAbstractService -
- - - - -
RptPedidosProveedor
- TDataModule -
- -
RptWordPedidoProveedor
- TDataModule -
- -
srvPedidosProveedor
- TDataAbstractService -
- - - - -
RptPresupuestosCliente
- TDataModule -
- -
RptWordCertificadoTrabajo
- TDataModule -
- -
RptWordPresupuestoCliente
- TDataModule -
- -
srvPresupuestosCliente
- TDataAbstractService -
- - - -
RptRecibosCliente
- TDataModule -
- -
srvRecibosCliente
- TDataAbstractService -
- - - -
RptRecibosProveedor
- TDataModule -
- -
srvRecibosProveedor
- TDataAbstractService -
- - - -
srvReferencias
- TDataAbstractService -
- - - - -
srvRemesasCliente
- TDataAbstractService -
- - - - -
srvRemesasProveedor
- TDataAbstractService -
- - - -
srvTiposIVA
- TDataAbstractService -
- - - -
srvUnidadesMedida
- TDataAbstractService -
- - - -
srvConfiguracion
- TDataAbstractService -
- -
frConexionBD
- TFrame -
- -
frConfGeneral
- TFrame -
- -
fConfiguracion
- TForm -
- -
FrameConfiguracion
- TFrame -
- -
srvLogin
- TDARemoteService -
- -
fAcercaDe
-
- -
dmServer
- TDataModule -
- -
fServerForm
-
- - - - - - - - - -
+ + {ebdcd25d-40d7-4146-91ec-a0ea4aa1dcd1} + FactuGES_Server.dpr + Debug + AnyCPU + DCC32 + ..\..\Output\Debug\Servidor\FactuGES_Server.exe + vcl;rtl;vclx;vclactnband;dbrtl;vcldb;vcldbx;bdertl;dsnap;dsnapcon;teeUI;teedb;tee;adortl;vclib;ibxpress;dbxcds;dbexpress;DbxCommonDriver;IndyCore;IndySystem;IndyProtocols;VclSmp;vclie;webdsnap;xmlrtl;inet;inetdbbde;inetdbxpress;RemObjects_BPDX_D11;RemObjects_RODX_D11;RemObjects_Indy_D11;RemObjects_Synapse_D11;RemObjects_WebBroker_D11;DataAbstract_Core_D11;DataAbstract_DBXDriver_D11;DataAbstract_IDE_D11;DataAbstract_Scripting_D11;DataAbstract_SDACDriver_D11;sdac105;dac105;DataAbstract_SQLiteDriver_D11;cxEditorsD10;cxLibraryD10;dxThemeD10;cxDataD10;cxExtEditorsD10;cxGridD10;cxPageControlD10;cxSchedulerD10;cxTreeListD10;cxVerticalGridD10;dxBarD10;dxComnD10;dxBarDBNavD10;dxBarExtDBItemsD10;dxBarExtItemsD10;dxDockingD10;dxLayoutControlD10;dxNavBarD10;dxPSCoreD10;dxsbD10;dxPScxCommonD10;dxPSLnksD10;vclshlctrls;dxPScxExtCommonD10;dxPScxGridLnkD10;dxPScxPCProdD10;dxPScxScheduler2LnkD10;dxPScxTLLnkD10;dxPSdxLCLnkD10;dxPsPrVwAdvD10;pckMD5;pckUCDataConnector;pckUserControl_RT;PluginSDK_D10R;PNG_D10;PngComponentsD10;tb2k_d10;tbx_d10;JclVcl;Jcl;JvXPCtrlsD11R;JvCoreD11R;JvSystemD11R;JvStdCtrlsD11R;JvAppFrmD11R;JvBandsD11R;JvDBD11R;JvDlgsD11R;JvBDED11R;JvCmpD11R;JvCryptD11R;JvCtrlsD11R;JvCustomD11R;JvDockingD11R;JvDotNetCtrlsD11R;JvEDID11R;JvGlobusD11R;JvHMID11R;JvInterpreterD11R;JvJansD11R;JvManagedThreadsD11R;JvMMD11R;JvNetD11R;JvPageCompsD11R;JvPluginD11R;JvPrintPreviewD11R;JvRuntimeDesignD11R;JvTimeFrameworkD11R;JvUIBD11R;JvValidatorsD11R;JvWizardD11R;pckUCADOConn;pckUCBDEConn;pckUCIBXConn;pckUCMidasConn;cxIntlPrintSys3D10;cxExportD10;cxIntl5D10;GUISDK_D11;ccpackD11;JSDialog100;fsTee11;fs11;frx11;frxADO11;frxBDE11;frxDB11;frxDBX11;frxe11;frxIBX11;frxTee11;fsADO11;fsBDE11;fsDB11;fsIBX11;websnap;soaprtl;IntrawebDB_90_100;Intraweb_90_100 + + + 7.0 + False + False + 0 + 3 + ..\..\Output\Release\Servidor + RELEASE + + + 7.0 + 3 + ..\..\Output\Debug\Servidor + DEBUG; + True + True + True + $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10 + $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10 + $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10 + $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10 + + + Delphi.Personality + + + FalseTrueFalse/standaloneTrueFalse1470FalseFalseFalseFalseFalse308212521.4.7.01.4.7.0jueves, 27 de noviembre de 2008 16:53FactuGES_Server.dpr + + + + + MainSource + + + + + +
srvEmpresas
+ TDARemoteService +
+ +
srvProvinciasPoblaciones_Impl
+ TDataModule +
+ + + +
srvUsuarios
+ TDataAbstractService +
+ + + + + + + +
RptAlbaranesCliente
+ TDataModule +
+ +
RptWordAlbaranCliente
+ TDataModule +
+ +
srvAlbaranesCliente
+ TDataAbstractService +
+ + + + +
srvAlbaranesProveedor
+ TDataAbstractService +
+ + + +
srvAlmacenes
+ TDARemoteService +
+ + + + +
srvArticulos
+ TDARemoteService +
+ + + + + + + +
RptEtiquetasContacto
+ TDataModule +
+ +
RptFichasEmpleado
+ TDataModule +
+ +
srvContactos
+ TDARemoteService +
+ + + +
srvFabricantes
+ TDataAbstractService +
+ + + + +
RptFacturasCliente
+ TDataModule +
+ +
RptWordFacturaCliente
+ TDataModule +
+ +
srvFacturasCliente
+ TDataAbstractService +
+ + + + +
RptFacturasProveedor
+ TDataModule +
+ +
srvFacturasProveedor
+ TDataAbstractService +
+ + + +
srvFamilias
+ TDataAbstractService +
+ + + +
srvFormasPago
+ TDataAbstractService +
+ +
srvGestorDocumentos
+ TDataAbstractService +
+ +
srvGestorInformes
+ TDataAbstractService +
+ + + +
srvHistoricoMovimientos
+ TDataAbstractService +
+ + + +
srvInventario
+ TDataAbstractService +
+ + + + +
srvObras
+ TDataAbstractService +
+ + + + +
RptPedidosProveedor
+ TDataModule +
+ +
RptWordPedidoProveedor
+ TDataModule +
+ +
srvPedidosProveedor
+ TDataAbstractService +
+ + + + +
RptPresupuestosCliente
+ TDataModule +
+ +
RptWordCertificadoTrabajo
+ TDataModule +
+ +
RptWordPresupuestoCliente
+ TDataModule +
+ +
srvPresupuestosCliente
+ TDataAbstractService +
+ + + +
RptRecibosCliente
+ TDataModule +
+ +
srvRecibosCliente
+ TDataAbstractService +
+ + + +
RptRecibosProveedor
+ TDataModule +
+ +
srvRecibosProveedor
+ TDataAbstractService +
+ + + +
srvReferencias
+ TDataAbstractService +
+ + + + +
srvRemesasCliente
+ TDataAbstractService +
+ + + + +
srvRemesasProveedor
+ TDataAbstractService +
+ + + +
srvTiposIVA
+ TDataAbstractService +
+ + + +
srvUnidadesMedida
+ TDataAbstractService +
+ + + +
srvConfiguracion
+ TDataAbstractService +
+ +
frConexionBD
+ TFrame +
+ +
frConfGeneral
+ TFrame +
+ +
fConfiguracion
+ TForm +
+ +
FrameConfiguracion
+ TFrame +
+ +
srvLogin
+ TDARemoteService +
+ +
fAcercaDe
+
+ +
dmServer
+ TDataModule +
+ +
fServerForm
+
+ + + + + + + + + +