From d2bba12ad740cb788e0f44d6fca8323358d43ac6 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 17 Dec 2008 17:24:38 +0000 Subject: [PATCH] SE adaptan facturas de proveedor y facturas de cliente para la nueva politica de funcionamiento (si la forma de pago no tiene plazos asignados, meter fecha de vencimiento y en caso contrario se desactiva la fecha de vencimiento) git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@364 f4e31baf-9722-1c47-927c-6f952f962d4b --- Database/scripts/factuges.sql | 5 +- .../Controller/uFacturasClienteController.pas | 76 ++++++++---- .../Data/uDataModuleFacturasCliente.dfm | 4 + .../Model/schFacturasClienteClient_Intf.pas | 111 ++++++++++++------ .../Model/schFacturasClienteServer_Intf.pas | 51 +++++++- .../Servidor/srvFacturasCliente_Impl.dfm | 77 +++++++----- .../Views/uViewFacturaCliente.dfm | 110 +++++++++++++++-- .../Views/uViewFacturaCliente.pas | 22 +++- .../uFacturasProveedorController.pas | 13 +- .../FacturasProveedor_Group.groupproj | 78 +++++------- .../Model/schFacturasProveedorClient_Intf.pas | 8 +- .../Model/schFacturasProveedorServer_Intf.pas | 8 +- .../Views/uViewFacturaProveedor.dfm | 105 +++++++++++++---- .../Views/uViewFacturaProveedor.pas | 22 +++- .../GestorDocumentos_controller.drc | 2 +- .../Data/GestorDocumentos_data.drc | 2 +- Source/Servidor/FactuGES_Server.RES | Bin 23352 -> 23360 bytes Source/Servidor/FactuGES_Server.dpr | 10 +- Source/Servidor/FactuGES_Server.rc | 2 +- Source/Servidor/uDataModuleServer.dfm | 4 +- 20 files changed, 507 insertions(+), 203 deletions(-) diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 80acaadd..3c32f334 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -878,7 +878,8 @@ CREATE TABLE FACTURAS_CLIENTE ( RECARGO_EQUIVALENCIA TIPO_BOOLEANO, ID_COMISION_LIQUIDADA TIPO_ID, IGNORAR_CONTABILIDAD SMALLINT, - ID_TIENDA TIPO_ID + ID_TIENDA TIPO_ID, + FECHA_VENCIMIENTO DATE ); CREATE TABLE FACTURAS_CLIENTE_DETALLES ( @@ -2318,6 +2319,7 @@ REFERENCIA, TIPO, ID_COMISION_LIQUIDADA, FECHA_FACTURA, +FECHA_VENCIMIENTO, SITUACION, BASE_IMPONIBLE, DESCUENTO, @@ -2359,6 +2361,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, diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas index 58569d01..e2bec2fc 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas @@ -622,6 +622,9 @@ begin end; function TFacturasClienteController.ValidarFactura(AFactura: IBizFacturaCliente): Boolean; +var + AFormaPago: IBizFormaPago; + begin Result := False; @@ -648,6 +651,25 @@ begin if (AFactura.Detalles.DataTable.RecordCount = 0) then raise Exception.Create('La factura debe tener al menos un concepto en su contenido'); + if (AFactura.ID_FORMA_PAGO = 0) then + raise Exception.Create('Debe indicar una forma de pago 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; + if (AFactura.IGNORAR_CONTABILIDAD = 0) and ((AFactura.Cliente.SubCuentas.ID < 1) //REPASAR or (AFactura.Cliente.SubCuentas.ID_EJERCICIO <> AppFactuGES.EjercicioActivo.ID)) then @@ -1114,6 +1136,9 @@ var ARecibos: IBizRecibosCliente; AFechaVencimiento: TDateTime; i: Integer; + ADiaVencimiento: Integer; + ADiasMas: Integer; + begin if not Assigned(AFactura) then Exit; @@ -1132,13 +1157,14 @@ begin ARecibos := ARecibosClienteController.BuscarRecibosFactura(AFactura.ID); ARecibosClienteController.EliminarTodo(ARecibos); - //Vamos a generar todos los recibos necesarios para la factura + //Se cambia la lógica a peticion de acana, 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 := ARecibosClienteController.Nuevo; ARecibos.Edit; ARecibos.ID_FACTURA := AFactura.ID; @@ -1152,32 +1178,40 @@ begin ARecibos.POBLACION := AFactura.POBLACION; ARecibos.PROVINCIA := AFactura.PROVINCIA; ARecibos.CODIGO_POSTAL := AFactura.CODIGO_POSTAL; + ARecibos.FECHA_EMISION := AFactura.FECHA_FACTURA; - AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; - if (AFactura.Cliente.VENCIMIENTO_FACTURAS <> 0) then + if AFormaPago.Plazos.RecordCount < 1 then begin - if DayOf(AFechaVencimiento) > AFactura.Cliente.VENCIMIENTO_FACTURAS then - begin - AFechaVencimiento := IncDay(AFechaVencimiento, (DaysInMonth(AFechaVencimiento) - DayOf(AFechaVencimiento))); - AFechaVencimiento := IncDay(AFechaVencimiento, AFactura.Cliente.VENCIMIENTO_FACTURAS); - end - else - AFechaVencimiento := IncDay(AFechaVencimiento, (AFactura.Cliente.VENCIMIENTO_FACTURAS - DayOf(AFechaVencimiento))); + 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 <> 0) then + begin + ADiaVencimiento := DayOf(AFechaVencimiento); + while (ADiaVencimiento <> AFactura.Cliente.VENCIMIENTO_FACTURAS) 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; - //Comprobamos que la fecha de vencimiento no sea febrero si es asi hay que tratarlo - if (AFactura.Cliente.VENCIMIENTO_FACTURAS > 28) - and (MonthOf(AFechaVencimiento) = 3) and (DayOf(AFechaVencimiento) < 3) then - AFechaVencimiento := IncDay(AFechaVencimiento, - DayOf(AFechaVencimiento)); - - ARecibos.FECHA_VENCIMIENTO := AFechaVencimiento; - - ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL * (AFormaPago.Plazos.PORCENTAJE / 100); ARecibos.DESCRIPCION := 'RECIBO ' + ARecibos.REFERENCIA + ' - ' + 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 00c3289c..878e71a7 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 93a18b05..0533a344 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 = '{AE5A4A76-8A04-4005-A949-58C1F079D651}'; - RID_FacturasCliente_Detalles = '{A6BF3706-DC34-41F3-8469-835D382D23D8}'; + RID_FacturasCliente = '{0B1914D0-B113-4995-B702-5A94444CE70C}'; + RID_FacturasCliente_Detalles = '{44FAB69F-B375-47FE-8787-B5B1A305A0B6}'; { 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'; @@ -65,40 +66,41 @@ 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_FacturasClienteNOMBRE_CLIENTE = 17; - idx_FacturasClienteNOMBRE_COMERCIAL_CLIENTE = 18; - idx_FacturasClienteNIF_CIF = 19; - idx_FacturasClienteNOMBRE = 20; - idx_FacturasClienteCALLE = 21; - idx_FacturasClientePOBLACION = 22; - idx_FacturasClientePROVINCIA = 23; - idx_FacturasClienteCODIGO_POSTAL = 24; - idx_FacturasClienteFECHA_ALTA = 25; - idx_FacturasClienteFECHA_MODIFICACION = 26; - idx_FacturasClienteUSUARIO = 27; - idx_FacturasClienteID_FORMA_PAGO = 28; - idx_FacturasClienteRECARGO_EQUIVALENCIA = 29; - idx_FacturasClienteID_TIPO_IVA = 30; - idx_FacturasClienteIMPORTE_NETO = 31; - idx_FacturasClienteIMPORTE_PORTE = 32; - idx_FacturasClienteID_AGENTE = 33; - idx_FacturasClienteREFERENCIA_COMISION = 34; - idx_FacturasClienteIGNORAR_CONTABILIDAD = 35; - idx_FacturasClienteID_TIENDA = 36; - idx_FacturasClienteTIENDA = 37; - idx_FacturasClienteID_SUBCUENTA = 38; - idx_FacturasClienteSUBCUENTA = 39; + 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_FacturasClienteNOMBRE_CLIENTE = 18; + idx_FacturasClienteNOMBRE_COMERCIAL_CLIENTE = 19; + idx_FacturasClienteNIF_CIF = 20; + idx_FacturasClienteNOMBRE = 21; + idx_FacturasClienteCALLE = 22; + idx_FacturasClientePOBLACION = 23; + idx_FacturasClientePROVINCIA = 24; + idx_FacturasClienteCODIGO_POSTAL = 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_FacturasClienteIGNORAR_CONTABILIDAD = 36; + idx_FacturasClienteID_TIENDA = 37; + idx_FacturasClienteTIENDA = 38; + idx_FacturasClienteID_SUBCUENTA = 39; + idx_FacturasClienteSUBCUENTA = 40; { FacturasCliente_Detalles fields } fld_FacturasCliente_DetallesID = 'ID'; @@ -135,7 +137,7 @@ const type { IFacturasCliente } IFacturasCliente = interface(IDAStronglyTypedDataTable) - ['{89B45F34-48D2-4E4D-9C03-F1591EA6F05E}'] + ['{0BE79A41-1EC4-48B2-AD7A-BD802A3B9ED5}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -161,6 +163,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; @@ -311,6 +317,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; @@ -412,6 +420,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; @@ -561,6 +573,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; @@ -638,7 +652,7 @@ type { IFacturasCliente_Detalles } IFacturasCliente_Detalles = interface(IDAStronglyTypedDataTable) - ['{6C713963-6140-464C-8BE5-4E547A0336EC}'] + ['{B9257A51-DED8-42B0-82AD-2B683FCDCBE9}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -979,6 +993,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 1dabcdb4..dde303db 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 = '{E601804E-04A1-4309-8827-23A675659EC2}'; - RID_FacturasCliente_DetallesDelta = '{E26FF170-E793-4E14-86D0-6A5FCEAD94EB}'; + RID_FacturasClienteDelta = '{98AACC73-D363-4458-A0D0-D9FD4739FC3A}'; + RID_FacturasCliente_DetallesDelta = '{10944E21-F0F0-4154-9A06-F658143DE95A}'; type { IFacturasClienteDelta } IFacturasClienteDelta = interface(IFacturasCliente) - ['{E601804E-04A1-4309-8827-23A675659EC2}'] + ['{98AACC73-D363-4458-A0D0-D9FD4739FC3A}'] { 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; @@ -65,6 +66,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; @@ -144,6 +146,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; @@ -373,6 +381,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; @@ -518,7 +530,7 @@ type { IFacturasCliente_DetallesDelta } IFacturasCliente_DetallesDelta = interface(IFacturasCliente_Detalles) - ['{E26FF170-E793-4E14-86D0-6A5FCEAD94EB}'] + ['{10944E21-F0F0-4154-9A06-F658143DE95A}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_FACTURAValue : Integer; @@ -919,6 +931,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 1decb273..98bd7470 100644 --- a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm +++ b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm @@ -182,6 +182,10 @@ object srvFacturasCliente: TsrvFacturasCliente item DatasetField = 'NOMBRE_COMERCIAL_CLIENTE' TableField = 'NOMBRE_COMERCIAL_CLIENTE' + end + item + DatasetField = 'FECHA_VENCIMIENTO' + TableField = 'FECHA_VENCIMIENTO' end> end> Name = 'FacturasCliente' @@ -221,6 +225,10 @@ object srvFacturasCliente: TsrvFacturasCliente DataType = datDateTime DictionaryEntry = 'FacturasCliente_FECHA_FACTURA' end + item + Name = 'FECHA_VENCIMIENTO' + DataType = datDateTime + end item Name = 'SITUACION' DataType = datString @@ -853,6 +861,10 @@ object srvFacturasCliente: TsrvFacturasCliente Name = 'FECHA_FACTURA' Value = '' end + item + Name = 'FECHA_VENCIMIENTO' + Value = '' + end item Name = 'BASE_IMPONIBLE' Value = '' @@ -964,22 +976,23 @@ 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' CALLE,'#10' POBLACION,'#10' PROVINCIA,'#10' ' + - ' CODIGO_POSTAL,'#10' FECHA_ALTA,'#10' FECHA_MODIFICACION,'#10' USU' + - 'ARIO,'#10' ID_FORMA_PAGO,'#10' RECARGO_EQUIVALENCIA,'#10' ID_TIPO_I' + - 'VA,'#10' IMPORTE_NETO,'#10' IMPORTE_PORTE,'#10' IGNORAR_CONTABILIDA' + - 'D,'#10' ID_TIENDA)'#10' VALUES ('#10' :ID,'#10' :ID_EMPRESA,'#10' :REFE' + - 'RENCIA,'#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' :OBSERVACIONES,'#10' :ID_C' + - 'LIENTE,'#10' :NIF_CIF,'#10' :NOMBRE,'#10' :CALLE,'#10' :POBLACION,'#10' ' + - ' :PROVINCIA,'#10' :CODIGO_POSTAL,'#10' :FECHA_ALTA,'#10' :FECHA_M' + - 'ODIFICACION,'#10' :USUARIO,'#10' :ID_FORMA_PAGO,'#10' :RECARGO_EQUI' + - 'VALENCIA,'#10' :ID_TIPO_IVA,'#10' :IMPORTE_NETO,'#10' :IMPORTE_PORT' + - 'E,'#10' :IGNORAR_CONTABILIDAD,'#10' :ID_TIENDA);'#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' CALLE,'#10' POBLA' + + 'CION,'#10' PROVINCIA,'#10' CODIGO_POSTAL,'#10' FECHA_ALTA,'#10' FECH' + + 'A_MODIFICACION,'#10' USUARIO,'#10' ID_FORMA_PAGO,'#10' RECARGO_EQUI' + + 'VALENCIA,'#10' ID_TIPO_IVA,'#10' IMPORTE_NETO,'#10' IMPORTE_PORTE,'#10 + + ' IGNORAR_CONTABILIDAD,'#10' ID_TIENDA)'#10' VALUES ('#10' :ID,'#10' ' + + ' :ID_EMPRESA,'#10' :REFERENCIA,'#10' :FECHA_FACTURA,'#10' :FECHA_VE' + + 'NCIMIENTO,'#10' :BASE_IMPONIBLE,'#10' :DESCUENTO,'#10' :IMPORTE_DES' + + 'CUENTO,'#10' :IVA,'#10' :IMPORTE_IVA,'#10' :RE,'#10' :IMPORTE_RE,'#10' ' + + ' :IMPORTE_TOTAL,'#10' :OBSERVACIONES,'#10' :ID_CLIENTE,'#10' :NIF_' + + 'CIF,'#10' :NOMBRE,'#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' :IGNORAR_C' + + 'ONTABILIDAD,'#10' :ID_TIENDA);'#10 StatementType = stSQL ColumnMappings = <> end> @@ -999,6 +1012,10 @@ object srvFacturasCliente: TsrvFacturasCliente Name = 'FECHA_FACTURA' Value = '' end + item + Name = 'FECHA_VENCIMIENTO' + Value = '' + end item Name = 'BASE_IMPONIBLE' Value = '' @@ -1114,20 +1131,20 @@ 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' CALLE = :CALLE,'#10' POBLACION = ' + - ':POBLACION,'#10' PROVINCIA = :PROVINCIA,'#10' CODIGO_POSTAL = :COD' + - 'IGO_POSTAL,'#10' FECHA_ALTA = :FECHA_ALTA,'#10' FECHA_MODIFICACION' + - ' = :FECHA_MODIFICACION,'#10' USUARIO = :USUARIO,'#10' ID_FORMA_PAG' + - 'O = :ID_FORMA_PAGO,'#10' RECARGO_EQUIVALENCIA = :RECARGO_EQUIVALE' + - 'NCIA,'#10' ID_TIPO_IVA = :ID_TIPO_IVA,'#10' IMPORTE_NETO = :IMPORT' + - 'E_NETO,'#10' IMPORTE_PORTE = :IMPORTE_PORTE,'#10' IGNORAR_CONTABIL' + - 'IDAD = :IGNORAR_CONTABILIDAD,'#10' ID_TIENDA = :ID_TIENDA'#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' CALLE = :CALLE,'#10' POBLACION = :POBLACION,'#10' PROV' + + 'INCIA = :PROVINCIA,'#10' CODIGO_POSTAL = :CODIGO_POSTAL,'#10' FECH' + + 'A_ALTA = :FECHA_ALTA,'#10' FECHA_MODIFICACION = :FECHA_MODIFICACI' + + 'ON,'#10' USUARIO = :USUARIO,'#10' ID_FORMA_PAGO = :ID_FORMA_PAGO,'#10 + + ' RECARGO_EQUIVALENCIA = :RECARGO_EQUIVALENCIA,'#10' ID_TIPO_IV' + + 'A = :ID_TIPO_IVA,'#10' IMPORTE_NETO = :IMPORTE_NETO,'#10' IMPORTE_' + + 'PORTE = :IMPORTE_PORTE,'#10' IGNORAR_CONTABILIDAD = :IGNORAR_CONT' + + 'ABILIDAD,'#10' ID_TIENDA = :ID_TIENDA'#10' WHERE'#10' (ID = :OLD_ID);'#10 StatementType = stSQL ColumnMappings = <> end> diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm index 43148b70..eef9fe07 100644 --- a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm @@ -14,13 +14,14 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Align = alClient ParentBackground = True TabOrder = 0 + TabStop = False AutoContentSizes = [acsWidth, acsHeight] LookAndFeel = dxLayoutOfficeLookAndFeel1 DesignSize = ( 451 304) object eReferencia: TcxDBTextEdit - Left = 124 + Left = 135 Top = 30 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'REFERENCIA' @@ -32,16 +33,20 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Style.Color = clInfoBk Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.Color = clMenuBar StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleDisabled.TextColor = clWindowText StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 0 Width = 159 end object edtFecha: TcxDBDateEdit - Left = 124 + Left = 135 Top = 57 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'FECHA_FACTURA' @@ -51,13 +56,17 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente 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 = 1 Width = 159 end @@ -72,16 +81,20 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Style.BorderStyle = ebs3D Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 6 + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 7 Height = 159 Width = 301 end object cbFormaPago: TcxDBLookupComboBox - Left = 124 - Top = 84 + Left = 135 + Top = 108 DataBinding.DataField = 'ID_FORMA_PAGO' DataBinding.DataSource = DADataSource Properties.DropDownListStyle = lsFixedList @@ -95,25 +108,30 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Properties.ListOptions.ShowHeader = False Properties.ListOptions.SyncMode = True Properties.ListSource = dsFormaPago + Properties.OnEditValueChanged = edtFechaVencimientoPropertiesEditValueChanged Style.BorderColor = clWindowFrame Style.BorderStyle = ebs3D Style.HotTrack = False Style.LookAndFeel.Kind = lfStandard Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' Style.ButtonStyle = bts3D Style.PopupBorderStyle = epbsFrame3D StyleDisabled.LookAndFeel.Kind = lfStandard StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.Kind = lfStandard StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 2 Width = 78 end object bFormasPago: TButton - Left = 241 - Top = 84 + Left = 313 + Top = 108 Width = 132 Height = 23 Caption = 'Ver las formas de pago...' @@ -122,7 +140,7 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente end inline frViewTienda1: TfrViewTienda Left = 22 - Top = 137 + Top = 188 Width = 351 Height = 48 Font.Charset = DEFAULT_CHARSET @@ -131,10 +149,10 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 4 + TabOrder = 5 ReadOnly = False ExplicitLeft = 22 - ExplicitTop = 137 + ExplicitTop = 188 ExplicitWidth = 351 ExplicitHeight = 48 inherited dxLayoutControl1: TdxLayoutControl @@ -143,13 +161,17 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente ExplicitWidth = 351 ExplicitHeight = 63 inherited cbTienda: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 399 Width = 399 end end end inline frViewClienteFactura1: TfrViewClienteFactura - Left = 401 + Left = 473 Top = 30 Width = 398 Height = 265 @@ -159,9 +181,9 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 5 + TabOrder = 6 ReadOnly = False - ExplicitLeft = 401 + ExplicitLeft = 473 ExplicitTop = 30 ExplicitWidth = 398 ExplicitHeight = 265 @@ -171,27 +193,51 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente ExplicitWidth = 398 ExplicitHeight = 265 inherited edtlNombre: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 276 Width = 276 end inherited edtNIFCIF: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 276 Width = 276 end inherited edtCalle: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 276 Width = 276 end inherited edtPoblacion: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 158 Width = 158 end inherited edtProvincia: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 276 Width = 276 end inherited edtCodigoPostal: TcxDBTextEdit Left = 192 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 192 end inherited Button3: TBitBtn @@ -199,11 +245,41 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente ExplicitLeft = 82 end inherited cxDBTextEdit1: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 283 Width = 283 end end end + object edtFechaVencimiento: TcxDBDateEdit + Left = 135 + Top = 137 + Anchors = [akLeft, akTop, akRight] + DataBinding.DataField = 'FECHA_VENCIMIENTO' + DataBinding.DataSource = DADataSource + Properties.OnEditValueChanged = edtFechaVencimientoPropertiesEditValueChanged + 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 = 310 + end object dxLayoutControl1Group_Root: TdxLayoutGroup ShowCaption = False Hidden = True @@ -231,6 +307,9 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Control = edtFecha ControlOptions.ShowBorder = False end + end + object dxLayoutControl1Group8: TdxLayoutGroup + Caption = 'Forma de pago' object dxLayoutControl1Group3: TdxLayoutGroup ShowCaption = False Hidden = True @@ -249,6 +328,11 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente ControlOptions.ShowBorder = False end end + object ledtFechaVencimiento: TdxLayoutItem + Caption = 'Fecha de vencimiento:' + Control = edtFechaVencimiento + ControlOptions.ShowBorder = False + end end object dxLayoutControl1Group4: TdxLayoutGroup AutoAligns = [aaVertical] diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas index 8d87b9f9..981ebf4a 100644 --- a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas @@ -44,7 +44,6 @@ type cbFormaPago: TcxDBLookupComboBox; dxLayoutControl1Item10: TdxLayoutItem; bFormasPago: TButton; - dxLayoutControl1Group3: TdxLayoutGroup; dxLayoutControl1Group6: TdxLayoutGroup; frViewTienda1: TfrViewTienda; dxLayoutControl1Group4: TdxLayoutGroup; @@ -52,9 +51,14 @@ type dxLayoutControl1Group7: TdxLayoutGroup; dxLayoutControl1Item6: TdxLayoutItem; frViewClienteFactura1: TfrViewClienteFactura; + dxLayoutControl1Group8: TdxLayoutGroup; + ledtFechaVencimiento: TdxLayoutItem; + edtFechaVencimiento: TcxDBDateEdit; + dxLayoutControl1Group3: TdxLayoutGroup; procedure bFormasPagoClick(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure CustomViewCreate(Sender: TObject); + procedure edtFechaVencimientoPropertiesEditValueChanged(Sender: TObject); protected FFactura : IBizFacturaCliente; FController : IFacturasClienteController; @@ -100,6 +104,15 @@ begin FFormasPagoController := NIL; end; +procedure TfrViewFacturaCliente.edtFechaVencimientoPropertiesEditValueChanged(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; @@ -132,6 +145,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; + //Solo se deshabilita al insertar, luego la referencia será modificable //eReferencia.Enabled := (FFactura.DataTable.State = dsInsert); diff --git a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas index 2e023535..79dfb90e 100644 --- a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas +++ b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas @@ -127,7 +127,7 @@ uses uAlbaranesProveedorController, schAlbaranesProveedorClient_Intf, uDetallesAlbaranProveedorController, uBizDetallesAlbaranProveedor, Variants, uBizPedidosProveedor, uPedidosProveedorController, uBizDetallesPedidoProveedor, - uRecibosProveedorController, uBizRecibosProveedor, + uRecibosProveedorController, uBizRecibosProveedor, uNumUtils, uFacturasProveedorReportController, DateUtils, Forms, Dialogs, uFormasPagoController, uBizFormasPago; @@ -648,6 +648,8 @@ begin if (AFactura.ID_FORMA_PAGO = 0) then raise Exception.Create('Debe indicar una forma de pago 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 @@ -1134,9 +1136,9 @@ begin ARecibos := ARecibosProveedorController.BuscarRecibosFactura(AFactura.ID); ARecibosProveedorController.EliminarTodo(ARecibos); - //Se cambia la lógica para acana, en el caso de elegir una forma de pago sin plazos - //y meter una fecha de vencimiento se generará un recibo con el 100% y fecha de vencimiento - //de la factura, en el caso de elegir una forma de pago con plazos la logica será la misma que en clientes + //Se cambia la lógica a peticion de acana, 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; @@ -1156,6 +1158,7 @@ begin ARecibos.PROVINCIA := AFactura.PROVINCIA; ARecibos.CODIGO_POSTAL := AFactura.CODIGO_POSTAL; ARecibos.FECHA_EMISION := AFactura.FECHA_FACTURA; + if AFormaPago.Plazos.RecordCount < 1 then begin ARecibos.FECHA_VENCIMIENTO := AFactura.FECHA_VENCIMIENTO; @@ -1166,6 +1169,8 @@ begin ARecibos.FECHA_VENCIMIENTO := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; 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; diff --git a/Source/Modulos/Facturas de proveedor/FacturasProveedor_Group.groupproj b/Source/Modulos/Facturas de proveedor/FacturasProveedor_Group.groupproj index bbf8f4f2..83be711d 100644 --- a/Source/Modulos/Facturas de proveedor/FacturasProveedor_Group.groupproj +++ b/Source/Modulos/Facturas de proveedor/FacturasProveedor_Group.groupproj @@ -19,11 +19,9 @@ + + - - - - @@ -182,15 +180,6 @@ - - - - - - - - - @@ -236,6 +225,24 @@ + + + + + + + + + + + + + + + + + + @@ -245,50 +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 9b44660e..e7faa0d6 100644 --- a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas +++ b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_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_FacturasProveedor = '{0EF26853-CA11-423C-A717-4B46C60A1D1B}'; - RID_FacturasProveedor_Detalles = '{55ADC035-4592-4CDA-968B-F19217917CD1}'; + RID_FacturasProveedor = '{1486775D-D203-45FA-A947-C647563E9E7C}'; + RID_FacturasProveedor_Detalles = '{B0F1438F-E96D-4190-B2CE-2AE580895113}'; { Data table names } nme_FacturasProveedor = 'FacturasProveedor'; @@ -133,7 +133,7 @@ const type { IFacturasProveedor } IFacturasProveedor = interface(IDAStronglyTypedDataTable) - ['{83594315-B925-4468-8505-380368A507A6}'] + ['{A7AB33CE-569D-4132-A3CC-4E9534B46031}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -624,7 +624,7 @@ type { IFacturasProveedor_Detalles } IFacturasProveedor_Detalles = interface(IDAStronglyTypedDataTable) - ['{D0DDC85A-B7D6-4471-8F74-08884C18C78C}'] + ['{2CEF42D5-3F51-41E3-B52B-1F1ED8599905}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); diff --git a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas index def1e139..b0beaf88 100644 --- a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas +++ b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_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_FacturasProveedorDelta = '{0F97D038-E9E1-454B-9E40-B4E22FA5BDDE}'; - RID_FacturasProveedor_DetallesDelta = '{2DA1017B-00B9-4125-B47A-1D65D934DFE7}'; + RID_FacturasProveedorDelta = '{10FEC5CF-8C4F-41E2-8377-713BB2DA8E8A}'; + RID_FacturasProveedor_DetallesDelta = '{03628F84-FD1E-4A7B-A510-E235E361A432}'; type { IFacturasProveedorDelta } IFacturasProveedorDelta = interface(IFacturasProveedor) - ['{0F97D038-E9E1-454B-9E40-B4E22FA5BDDE}'] + ['{10FEC5CF-8C4F-41E2-8377-713BB2DA8E8A}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -506,7 +506,7 @@ type { IFacturasProveedor_DetallesDelta } IFacturasProveedor_DetallesDelta = interface(IFacturasProveedor_Detalles) - ['{2DA1017B-00B9-4125-B47A-1D65D934DFE7}'] + ['{03628F84-FD1E-4A7B-A510-E235E361A432}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_FACTURAValue : Integer; diff --git a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm index 7c24f7dd..af11c144 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm +++ b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm @@ -1,6 +1,6 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor - Width = 790 - Height = 496 + Width = 796 + Height = 415 Align = alClient OnCreate = CustomViewCreate OnDestroy = CustomViewDestroy @@ -9,18 +9,19 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor object dxLayoutControl1: TdxLayoutControl Left = 0 Top = 0 - Width = 790 - Height = 496 + Width = 796 + Height = 415 Align = alClient ParentBackground = True TabOrder = 0 + TabStop = False AutoContentSizes = [acsWidth, acsHeight] LookAndFeel = dxLayoutOfficeLookAndFeel1 ExplicitWidth = 451 ExplicitHeight = 304 DesignSize = ( - 790 - 496) + 796 + 415) object eReferencia: TcxDBTextEdit Left = 124 Top = 30 @@ -33,11 +34,15 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Style.Color = clInfoBk Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.Color = clMenuBar StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleDisabled.TextColor = clWindowText StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 0 Width = 159 end @@ -52,13 +57,17 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor 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 = 2 Width = 159 end @@ -73,16 +82,20 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Style.BorderStyle = ebs3D Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 8 Height = 170 Width = 754 end object cbFormaPago: TcxDBLookupComboBox Left = 124 - Top = 138 + Top = 135 DataBinding.DataField = 'ID_FORMA_PAGO' DataBinding.DataSource = DADataSource Properties.DropDownListStyle = lsFixedList @@ -96,29 +109,34 @@ 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 Style.LookAndFeel.Kind = lfStandard Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' Style.ButtonStyle = bts3D Style.PopupBorderStyle = epbsFrame3D StyleDisabled.LookAndFeel.Kind = lfStandard StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.Kind = lfStandard StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 4 + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 3 Width = 169 end object bFormasPago: TButton - Left = 296 - Top = 138 + Left = 302 + Top = 135 Width = 132 Height = 23 Caption = 'Ver las formas de pago...' - TabOrder = 5 + TabOrder = 4 OnClick = bFormasPagoClick end object eReferenciaProveedor: TcxDBTextEdit @@ -133,17 +151,21 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Style.Color = clInfoBk Style.HotTrack = False Style.LookAndFeel.NativeStyle = True + Style.LookAndFeel.SkinName = '' StyleDisabled.Color = clMenuBar StyleDisabled.LookAndFeel.NativeStyle = True + StyleDisabled.LookAndFeel.SkinName = '' StyleDisabled.TextColor = clWindowText StyleFocused.LookAndFeel.NativeStyle = True + StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.NativeStyle = True + StyleHot.LookAndFeel.SkinName = '' TabOrder = 1 Width = 316 end inline frViewTienda1: TfrViewTienda Left = 22 - Top = 191 + Top = 215 Width = 320 Height = 36 Font.Charset = DEFAULT_CHARSET @@ -155,13 +177,17 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor TabOrder = 6 ReadOnly = False ExplicitLeft = 22 - ExplicitTop = 191 + ExplicitTop = 215 ExplicitWidth = 320 ExplicitHeight = 36 inherited dxLayoutControl1: TdxLayoutControl Width = 320 ExplicitWidth = 320 inherited cbTienda: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 376 Width = 376 end @@ -169,7 +195,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor end object edtFechaVencimiento: TcxDBDateEdit Left = 124 - Top = 111 + Top = 164 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'FECHA_VENCIMIENTO' DataBinding.DataSource = DADataSource @@ -178,18 +204,22 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor 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 - TabOrder = 3 + StyleHot.LookAndFeel.SkinName = '' + TabOrder = 5 Width = 158 end inline frViewProveedorFactura1: TfrViewProveedorFactura - Left = 456 + Left = 462 Top = 30 Width = 312 Height = 260 @@ -201,7 +231,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor ParentFont = False TabOrder = 7 ReadOnly = False - ExplicitLeft = 456 + ExplicitLeft = 462 ExplicitTop = 30 ExplicitWidth = 312 ExplicitHeight = 260 @@ -213,27 +243,51 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor ExplicitWidth = 242 end inherited edtlNombre: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 276 Width = 276 end inherited edtNIFCIF: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 562 Width = 562 end inherited edtCalle: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 562 Width = 562 end inherited edtPoblacion: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 177 Width = 177 end inherited edtProvincia: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 327 Width = 327 end inherited edtCodigoPostal: TcxDBTextEdit Left = 220 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 220 end inherited Button3: TBitBtn @@ -241,6 +295,10 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor ExplicitLeft = 104 end inherited cxDBTextEdit1: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 276 Width = 276 end @@ -281,11 +339,9 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Control = edtFecha ControlOptions.ShowBorder = False end - object dxLayoutControl1Item8: TdxLayoutItem - Caption = 'Fecha vencimiento:' - Control = edtFechaVencimiento - ControlOptions.ShowBorder = False - end + end + object dxLayoutControl1Group8: TdxLayoutGroup + Caption = 'Forma de pago' object dxLayoutControl1Group3: TdxLayoutGroup ShowCaption = False Hidden = True @@ -304,6 +360,11 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor ControlOptions.ShowBorder = False end end + object ledtFechaVencimiento: TdxLayoutItem + Caption = 'Fecha vencimiento:' + Control = edtFechaVencimiento + ControlOptions.ShowBorder = False + end end object dxLayoutControl1Group4: TdxLayoutGroup Caption = 'La factura pertenece a la tienda' diff --git a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas index 1302695e..05ea15e3 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas +++ b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas @@ -45,7 +45,6 @@ type cbFormaPago: TcxDBLookupComboBox; dxLayoutControl1Item10: TdxLayoutItem; bFormasPago: TButton; - dxLayoutControl1Group3: TdxLayoutGroup; dxLayoutControl1Group6: TdxLayoutGroup; dxLayoutControl1Item6: TdxLayoutItem; eReferenciaProveedor: TcxDBTextEdit; @@ -53,12 +52,14 @@ type dxLayoutControl1Item7: TdxLayoutItem; frViewTienda1: TfrViewTienda; dxLayoutControl1Group7: TdxLayoutGroup; - dxLayoutControl1Item8: TdxLayoutItem; + ledtFechaVencimiento: TdxLayoutItem; edtFechaVencimiento: TcxDBDateEdit; ActionList1: TActionList; actElegirDireccion: TAction; dxLayoutControl1Item3: TdxLayoutItem; frViewProveedorFactura1: TfrViewProveedorFactura; + dxLayoutControl1Group8: TdxLayoutGroup; + dxLayoutControl1Group3: TdxLayoutGroup; procedure bFormasPagoClick(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure CustomViewCreate(Sender: TObject); @@ -66,6 +67,7 @@ type procedure frViewProveedorFacturaButton2Click(Sender: TObject); procedure actElegirDireccionExecute(Sender: TObject); procedure actElegirDireccionUpdate(Sender: TObject); + procedure cbFormaPagoPropertiesEditValueChanged(Sender: TObject); protected FFactura : IBizFacturaProveedor; FFormasPago : IBizFormaPago; @@ -132,6 +134,15 @@ begin FFormasPagoController.VerTodos(FFormasPago); end; +procedure TfrViewFacturaProveedor.cbFormaPagoPropertiesEditValueChanged(Sender: TObject); +begin + 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; @@ -200,6 +211,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; + //Solo se deshabilita al insertar, luego la referencia será modificable //eReferencia.Enabled := (FFactura.DataTable.State = dsInsert); diff --git a/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.drc b/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.drc index 6edc7c0f..5a230bee 100644 --- a/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.drc +++ b/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.drc @@ -13,4 +13,4 @@ BEGIN END /* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Controller\GestorDocumentos_Controller.res */ -/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf59.tmp */ +/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf62.tmp */ diff --git a/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.drc b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.drc index b7d46fc6..8d4252df 100644 --- a/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.drc +++ b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.drc @@ -14,4 +14,4 @@ END /* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Data\uDataModuleGestorDocumentos.dfm */ /* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Data\GestorDocumentos_data.res */ -/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf57.tmp */ +/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf60.tmp */ diff --git a/Source/Servidor/FactuGES_Server.RES b/Source/Servidor/FactuGES_Server.RES index 2d94de470e043ab161dac861c91f9da67611979e..b73c16bbab7bd5e205227479bff897cb1a9a5ac9 100644 GIT binary patch delta 82 zcmdn7jq$)X#tnBO7+ogcjgSYDe@5jHyMWj delta 74 zcmX@Gjd8~|#tnBO7;PrsjgSYDe