diff --git a/Build/Build.fbl6 b/Build/Build.fbl6 index 69c559e..c6fd3b5 100644 Binary files a/Build/Build.fbl6 and b/Build/Build.fbl6 differ diff --git a/Source/ApplicationBase/uFactuGES_App.pas b/Source/ApplicationBase/uFactuGES_App.pas index e4ee693..b14fca5 100644 --- a/Source/ApplicationBase/uFactuGES_App.pas +++ b/Source/ApplicationBase/uFactuGES_App.pas @@ -9,7 +9,8 @@ uses const CTE_PERFIL_ADMINISTRADOR = 3; - CTE_PERFIL_VENDEDOR = 7; + CTE_PERFIL_VENDEDOR = 7; + CTE_PERFIL_USUARIO = 5; type TAppFactuGES_Event = procedure; diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 02d8390..6f57818 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -51,13 +51,6 @@ - - - - - - - VCL for the Web Design Package for CodeGear RAD Studio CodeGear WebSnap Components CodeGear SOAP Components @@ -73,54 +66,54 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fConfigurarConexion
TForm diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index 1e7ce24..5a7a106 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -51,7 +51,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2780FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.7.8.0FactuGESFactuGES2.7.8.0 +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2810FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.8.1.0FactuGESFactuGES2.8.1.0 File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found FactuGES.dprFalse diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index 8696ab2..f5d2af8 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/Cliente/uPantallaPrincipal.pas b/Source/Cliente/uPantallaPrincipal.pas index c109a7c..e417df5 100644 --- a/Source/Cliente/uPantallaPrincipal.pas +++ b/Source/Cliente/uPantallaPrincipal.pas @@ -198,11 +198,17 @@ begin if (AppFactuGES.UsuarioActivo.ID_PERFIL = CTE_PERFIL_VENDEDOR) then begin Informes1.Enabled := False; - Informes1.Visible := False; + Informes1.Visible := False; Contabilidad1.Enabled := False; Contabilidad1.Visible := False; Compras1.Enabled := False; Compras1.Visible := False; + end + //El usuario normal de uecko solo no verá los bancos + else if (AppFactuGES.UsuarioActivo.ID_PERFIL = CTE_PERFIL_USUARIO) then + begin + Contabilidad1.Enabled := False; + Contabilidad1.Visible := False; end; InicializarUI; diff --git a/Source/GUIBase/GUIBase.dproj b/Source/GUIBase/GUIBase.dproj index e1b15b8..958a997 100644 --- a/Source/GUIBase/GUIBase.dproj +++ b/Source/GUIBase/GUIBase.dproj @@ -58,34 +58,34 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fDialogBase
diff --git a/Source/Informes/1/InfContratoCliente.fr3 b/Source/Informes/1/InfContratoCliente.fr3 index a1247d0..bca7342 100644 --- a/Source/Informes/1/InfContratoCliente.fr3 +++ b/Source/Informes/1/InfContratoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ - + @@ -42,7 +42,7 @@ - + diff --git a/Source/Informes/1/InfFacturaCliente_original.fr3 b/Source/Informes/1/InfFacturaCliente_original.fr3 new file mode 100644 index 0000000..e3298d3 --- /dev/null +++ b/Source/Informes/1/InfFacturaCliente_original.fr3 @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/2/InfPresupuestoCliente.fr3 b/Source/Informes/2/InfPresupuestoCliente.fr3 index 7ffada8..fbb7249 100644 --- a/Source/Informes/2/InfPresupuestoCliente.fr3 +++ b/Source/Informes/2/InfPresupuestoCliente.fr3 @@ -1,5 +1,5 @@ - + diff --git a/Source/Informes/4/InfAlbaranCliente.fr3 b/Source/Informes/4/InfAlbaranCliente.fr3 new file mode 100644 index 0000000..5a1b13d --- /dev/null +++ b/Source/Informes/4/InfAlbaranCliente.fr3 @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/4/InfContratoCliente.fr3 b/Source/Informes/4/InfContratoCliente.fr3 new file mode 100644 index 0000000..40813c8 --- /dev/null +++ b/Source/Informes/4/InfContratoCliente.fr3 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/4/InfPresupuestoCliente.fr3 b/Source/Informes/4/InfPresupuestoCliente.fr3 new file mode 100644 index 0000000..dbb3375 --- /dev/null +++ b/Source/Informes/4/InfPresupuestoCliente.fr3 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Informes/4/InformeListadoFacturasRecibosCliente.fr3 b/Source/Informes/4/InformeListadoFacturasRecibosCliente.fr3 new file mode 100644 index 0000000..ca6cc93 --- /dev/null +++ b/Source/Informes/4/InformeListadoFacturasRecibosCliente.fr3 @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas index 4e77959..132dfcd 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas @@ -1386,7 +1386,6 @@ begin AFechaVencimiento := IncDay(AFechaVencimiento, ADiasMas); ARecibos.FECHA_VENCIMIENTO := AFechaVencimiento; - ARecibos.IMPORTE := RoundCurrency(RoundCurrency(AImporteTotal) * (AFormaPago.Plazos.PORCENTAJE / 100)); AImporteAcumulado := AImporteAcumulado + ARecibos.IMPORTE; @@ -1396,7 +1395,6 @@ begin ARecibos.IMPORTE := ARecibos.IMPORTE + (RoundCurrency(AImporteTotal) - AImporteAcumulado) else if (AImporteAcumulado > RoundCurrency(AImporteTotal)) then ARecibos.IMPORTE := ARecibos.IMPORTE - (AImporteAcumulado - RoundCurrency(AImporteTotal)); - end; end; diff --git a/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj b/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj index 983c9de..67616a6 100644 --- a/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj +++ b/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj @@ -18,6 +18,7 @@ + @@ -291,14 +292,23 @@ + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas index 3e2f306..5579614 100644 --- a/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas +++ b/Source/Modulos/Facturas de proveedor/Controller/uFacturasProveedorController.pas @@ -701,7 +701,9 @@ begin //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 + //OJO-----En facturas de proveedor para uecko no es obligatorio porque deben de poder generar facturas sin recibos asociados + //solicitado por Mónica el 23/01/2020 +{ with TFormasPagoController.Create do begin try AFormaPago := Buscar(AFactura.ID_FORMA_PAGO); @@ -714,6 +716,8 @@ begin Free; end; end; +} + //En caso de ser un Abono no podra tener un importe total positivo if (AFactura.TIPO = CTE_TIPO_ABONO) then @@ -1255,6 +1259,8 @@ var ADiaVencimiento: Integer; ADiasMas: Integer; BSemaforo: Boolean; + AImporteAcumulado : Double; + AImporteTotal: Double; begin if not Assigned(AFactura) then @@ -1271,82 +1277,127 @@ begin ARecibos := ARecibosProveedorController.BuscarRecibosFactura(AFactura.ID); ARecibosProveedorController.EliminarTodo(ARecibos); + //Si hay retención, se generará un recibo por ese importe, y el resto se generarán recibos + //según forma de pago + AImporteTotal := AFactura.IMPORTE_TOTAL; // - AFactura.IMPORTE_RETENCION; + //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; + AImporteAcumulado := 0; First; repeat - ARecibos := ARecibosProveedorController.Nuevo; - ARecibos.Edit; - ARecibos.ID_FACTURA := AFactura.ID; - ARecibos.ID_EMPRESA := AFactura.ID_EMPRESA; - ARecibos.ID_PROVEEDOR := AFactura.ID_PROVEEDOR; - ARecibos.ID_TIENDA := AFactura.ID_TIENDA; - ARecibos.REFERENCIA := AFactura.REFERENCIA + ' - ' + IntToStr(i); - ARecibos.NOMBRE := AFactura.NOMBRE; //Es la razon social de la factura - ARecibos.CALLE := AFactura.CALLE; - ARecibos.NIF_CIF := AFactura.NIF_CIF; - ARecibos.POBLACION := AFactura.POBLACION; - ARecibos.PROVINCIA := AFactura.PROVINCIA; - ARecibos.CODIGO_POSTAL := AFactura.CODIGO_POSTAL; - ARecibos.FECHA_EMISION := AFactura.FECHA_FACTURA; + //SOLO PARA ACANA (Leer comentario anterior + if (AFormaPago.Plazos.RecordCount > 0) + or (AFactura.FECHA_VENCIMIENTO <> 0) then + begin + ARecibos := ARecibosProveedorController.Nuevo; + ARecibos.Edit; + ARecibos.ID_FACTURA := AFactura.ID; + ARecibos.ID_EMPRESA := AFactura.ID_EMPRESA; + ARecibos.ID_PROVEEDOR := AFactura.ID_PROVEEDOR; + ARecibos.ID_TIENDA := AFactura.ID_TIENDA; + ARecibos.REFERENCIA := AFactura.REFERENCIA + ' - ' + IntToStr(i); + ARecibos.NOMBRE := AFactura.NOMBRE; //Es la razon social de la factura + ARecibos.CALLE := AFactura.CALLE; + ARecibos.NIF_CIF := AFactura.NIF_CIF; + ARecibos.POBLACION := AFactura.POBLACION; + 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; - ARecibos.IMPORTE := AFactura.IMPORTE_TOTAL; - end - else - begin - AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; - ADiasMas := 0; - BSemaforo := False; - 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 := AImporteTotal; + AImporteAcumulado := AImporteAcumulado + ARecibos.IMPORTE; + end + else + begin + AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; + ADiasMas := 0; + BSemaforo := False; + 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 := 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 - ADiaVencimiento := 1; - - //Controlamos con una variable semaforo que no nos quedemos en un bucle infinito - //intentando encontrar el dia de pago establecido para el cliente (es el caso de tener - //asignado el dia de pago 30 y llegar febrero en el que no se encuentra dicho dia, o - //tener como dia de pago los días 31 y en el caso de meses de 30 dias no encontrarlo. - if BSemaforo then + if ADiaVencimiento = DaysInMonth(AFechaVencimiento) then begin - ADiasMas := 0; - Break + ADiaVencimiento := 1; + + //Controlamos con una variable semaforo que no nos quedemos en un bucle infinito + //intentando encontrar el dia de pago establecido para el cliente (es el caso de tener + //asignado el dia de pago 30 y llegar febrero en el que no se encuentra dicho dia, o + //tener como dia de pago los días 31 y en el caso de meses de 30 dias no encontrarlo. + if BSemaforo then + begin + ADiasMas := 0; + Break + end + else + BSemaforo := True; end else - BSemaforo := True; - end - else - Inc(ADiaVencimiento); - Inc(ADiasMas); + Inc(ADiaVencimiento); + Inc(ADiasMas); + end; + end; + + AFechaVencimiento := IncDay(AFechaVencimiento, ADiasMas); + ARecibos.FECHA_VENCIMIENTO := AFechaVencimiento; + ARecibos.IMPORTE := RoundCurrency(RoundCurrency(AImporteTotal) * (AFormaPago.Plazos.PORCENTAJE / 100)); + AImporteAcumulado := AImporteAcumulado + ARecibos.IMPORTE; + + if (i = AFormaPago.Plazos.RecordCount) then + begin + if (AImporteAcumulado < RoundCurrency(AImporteTotal)) then + ARecibos.IMPORTE := ARecibos.IMPORTE + (RoundCurrency(AImporteTotal) - AImporteAcumulado) + else if (AImporteAcumulado > RoundCurrency(AImporteTotal)) then + ARecibos.IMPORTE := ARecibos.IMPORTE - (AImporteAcumulado - RoundCurrency(AImporteTotal)); 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); + ARecibosProveedorController.Guardar(ARecibos); end; - ARecibos.DESCRIPCION := 'Pago de factura ' + AFactura.REFERENCIA + ': son ' + CifraToLetras(ARecibos.IMPORTE); - ARecibosProveedorController.Guardar(ARecibos); Inc(i); Next; until (eof); end; + //Si hay retención generaremos un recibo para dicha retención +{ if AFactura.IMPORTE_RETENCION > 0 then + begin + ARecibos := ARecibosProveedorController.Nuevo; + ARecibos.Edit; + ARecibos.ID_FACTURA := AFactura.ID; + ARecibos.ID_EMPRESA := AFactura.ID_EMPRESA; + ARecibos.ID_PROVEEDOR := AFactura.ID_PROVEEDOR; + ARecibos.ID_TIENDA := AFactura.ID_TIENDA; + ARecibos.REFERENCIA := AFactura.REFERENCIA + ' - ' + IntToStr(i); + ARecibos.NOMBRE := AFactura.NOMBRE; //Es la razon social de la factura + ARecibos.CALLE := AFactura.CALLE; + ARecibos.NIF_CIF := AFactura.NIF_CIF; + ARecibos.POBLACION := AFactura.POBLACION; + ARecibos.PROVINCIA := AFactura.PROVINCIA; + ARecibos.CODIGO_POSTAL := AFactura.CODIGO_POSTAL; + ARecibos.FECHA_EMISION := AFactura.FECHA_FACTURA; + ARecibos.FECHA_VENCIMIENTO := AFactura.FECHA_RETENCION; + ARecibos.IMPORTE := AFactura.IMPORTE_RETENCION; + ARecibos.DESCRIPCION := 'Pago de factura de retención ' + AFactura.REFERENCIA + ': son ' + CifraToLetras(ARecibos.IMPORTE); + ARecibosProveedorController.Guardar(ARecibos); + end; +} + //Liberamos AFormasPagoController := Nil; AFormaPago := Nil; diff --git a/Source/Modulos/Facturas de proveedor/Data/uDataModuleFacturasProveedor.dfm b/Source/Modulos/Facturas de proveedor/Data/uDataModuleFacturasProveedor.dfm index f6cffc1..8197d4c 100644 --- a/Source/Modulos/Facturas de proveedor/Data/uDataModuleFacturasProveedor.dfm +++ b/Source/Modulos/Facturas de proveedor/Data/uDataModuleFacturasProveedor.dfm @@ -156,6 +156,11 @@ inherited DataModuleFacturasProveedor: TDataModuleFacturasProveedor DisplayLabel = 'FacturasProveedor_ID_PROVEEDOR' DictionaryEntry = 'FacturasProveedor_ID_PROVEEDOR' end + item + Name = 'REF_PROVEEDOR' + DataType = datString + Size = 255 + end item Name = 'NOMBRE_PROVEEDOR' DataType = datString diff --git a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas index 88eb725..8de25ff 100644 --- a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas +++ b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorClient_Intf.pas @@ -9,11 +9,11 @@ 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_ListaAnosFacturas = '{FC5567A2-A1E2-4B04-80E1-78F054593A8A}'; - RID_FacturasProveedor_Contratos = '{29528EAE-BE56-4F11-9BA7-4D564DFB73A2}'; - RID_TiposFacturaProveedor = '{EBFAFA25-E1DF-41CC-9478-0D55BDAF4A29}'; - RID_FacturasProveedor = '{05571997-AE29-4125-AC89-464BD8B0CF1A}'; - RID_FacturasProveedor_Detalles = '{B58D95A3-885C-4D7C-BE98-F1BA7442318B}'; + RID_ListaAnosFacturas = '{6729E1E3-4265-4D49-8B12-2F81677B2886}'; + RID_FacturasProveedor_Contratos = '{72EAC8B4-A97E-401A-B9EB-5469F8E5993D}'; + RID_TiposFacturaProveedor = '{54279454-FCC8-49A0-BC1A-31BE6343211F}'; + RID_FacturasProveedor = '{1C34D37D-89CF-434B-8655-E53A59A68925}'; + RID_FacturasProveedor_Detalles = '{A62BB94E-C5AF-41B8-B551-E948FB99B43E}'; { Data table names } nme_ListaAnosFacturas = 'ListaAnosFacturas'; @@ -75,6 +75,7 @@ const fld_FacturasProveedorIMPORTE_TOTAL = 'IMPORTE_TOTAL'; fld_FacturasProveedorOBSERVACIONES = 'OBSERVACIONES'; fld_FacturasProveedorID_PROVEEDOR = 'ID_PROVEEDOR'; + fld_FacturasProveedorREF_PROVEEDOR = 'REF_PROVEEDOR'; fld_FacturasProveedorNOMBRE_PROVEEDOR = 'NOMBRE_PROVEEDOR'; fld_FacturasProveedorNOMBRE_COMERCIAL_PROVEEDOR = 'NOMBRE_COMERCIAL_PROVEEDOR'; fld_FacturasProveedorNIF_CIF = 'NIF_CIF'; @@ -122,31 +123,32 @@ const idx_FacturasProveedorIMPORTE_TOTAL = 17; idx_FacturasProveedorOBSERVACIONES = 18; idx_FacturasProveedorID_PROVEEDOR = 19; - idx_FacturasProveedorNOMBRE_PROVEEDOR = 20; - idx_FacturasProveedorNOMBRE_COMERCIAL_PROVEEDOR = 21; - idx_FacturasProveedorNIF_CIF = 22; - idx_FacturasProveedorNOMBRE = 23; - idx_FacturasProveedorCALLE = 24; - idx_FacturasProveedorPOBLACION = 25; - idx_FacturasProveedorPROVINCIA = 26; - idx_FacturasProveedorCODIGO_POSTAL = 27; - idx_FacturasProveedorFECHA_ALTA = 28; - idx_FacturasProveedorFECHA_MODIFICACION = 29; - idx_FacturasProveedorUSUARIO = 30; - idx_FacturasProveedorID_FORMA_PAGO = 31; - idx_FacturasProveedorRECARGO_EQUIVALENCIA = 32; - idx_FacturasProveedorID_TIPO_IVA = 33; - idx_FacturasProveedorIMPORTE_NETO = 34; - idx_FacturasProveedorIMPORTE_PORTE = 35; - idx_FacturasProveedorIGNORAR_CONTABILIDAD = 36; - idx_FacturasProveedorID_TIENDA = 37; - idx_FacturasProveedorTIENDA = 38; - idx_FacturasProveedorID_SUBCUENTA = 39; - idx_FacturasProveedorSUBCUENTA = 40; - idx_FacturasProveedorID_EJERCICIO = 41; - idx_FacturasProveedorESTADO_EJERCICIO = 42; - idx_FacturasProveedorASIENTO_PUNTEADO = 43; - idx_FacturasProveedorID_TIPO_FACTURA = 44; + idx_FacturasProveedorREF_PROVEEDOR = 20; + idx_FacturasProveedorNOMBRE_PROVEEDOR = 21; + idx_FacturasProveedorNOMBRE_COMERCIAL_PROVEEDOR = 22; + idx_FacturasProveedorNIF_CIF = 23; + idx_FacturasProveedorNOMBRE = 24; + idx_FacturasProveedorCALLE = 25; + idx_FacturasProveedorPOBLACION = 26; + idx_FacturasProveedorPROVINCIA = 27; + idx_FacturasProveedorCODIGO_POSTAL = 28; + idx_FacturasProveedorFECHA_ALTA = 29; + idx_FacturasProveedorFECHA_MODIFICACION = 30; + idx_FacturasProveedorUSUARIO = 31; + idx_FacturasProveedorID_FORMA_PAGO = 32; + idx_FacturasProveedorRECARGO_EQUIVALENCIA = 33; + idx_FacturasProveedorID_TIPO_IVA = 34; + idx_FacturasProveedorIMPORTE_NETO = 35; + idx_FacturasProveedorIMPORTE_PORTE = 36; + idx_FacturasProveedorIGNORAR_CONTABILIDAD = 37; + idx_FacturasProveedorID_TIENDA = 38; + idx_FacturasProveedorTIENDA = 39; + idx_FacturasProveedorID_SUBCUENTA = 40; + idx_FacturasProveedorSUBCUENTA = 41; + idx_FacturasProveedorID_EJERCICIO = 42; + idx_FacturasProveedorESTADO_EJERCICIO = 43; + idx_FacturasProveedorASIENTO_PUNTEADO = 44; + idx_FacturasProveedorID_TIPO_FACTURA = 45; { FacturasProveedor_Detalles fields } fld_FacturasProveedor_DetallesID = 'ID'; @@ -185,7 +187,7 @@ const type { IListaAnosFacturas } IListaAnosFacturas = interface(IDAStronglyTypedDataTable) - ['{1B98F922-02A4-4E37-A61E-97750DAEEE50}'] + ['{B930F995-B70F-4766-AE7C-1A2E37882B9B}'] { Property getters and setters } function GetANOValue: String; procedure SetANOValue(const aValue: String); @@ -220,7 +222,7 @@ type { IFacturasProveedor_Contratos } IFacturasProveedor_Contratos = interface(IDAStronglyTypedDataTable) - ['{C52F44CF-0329-48CB-B738-0BB46696BA62}'] + ['{7646879D-719F-4F5A-B27F-5B6339AC373A}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -327,7 +329,7 @@ type { ITiposFacturaProveedor } ITiposFacturaProveedor = interface(IDAStronglyTypedDataTable) - ['{67E81F9E-6FB3-4D91-B33A-0A8664936D2A}'] + ['{BAFD0788-669F-481A-962A-F42B69A07D64}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -374,7 +376,7 @@ type { IFacturasProveedor } IFacturasProveedor = interface(IDAStronglyTypedDataTable) - ['{8553E2B5-4113-4209-96F6-131CC708C68F}'] + ['{94749DDD-49E7-4D75-9C30-E581CE1939F3}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -455,6 +457,10 @@ type procedure SetID_PROVEEDORValue(const aValue: Integer); function GetID_PROVEEDORIsNull: Boolean; procedure SetID_PROVEEDORIsNull(const aValue: Boolean); + function GetREF_PROVEEDORValue: String; + procedure SetREF_PROVEEDORValue(const aValue: String); + function GetREF_PROVEEDORIsNull: Boolean; + procedure SetREF_PROVEEDORIsNull(const aValue: Boolean); function GetNOMBRE_PROVEEDORValue: String; procedure SetNOMBRE_PROVEEDORValue(const aValue: String); function GetNOMBRE_PROVEEDORIsNull: Boolean; @@ -598,6 +604,8 @@ type property OBSERVACIONESIsNull: Boolean read GetOBSERVACIONESIsNull write SetOBSERVACIONESIsNull; property ID_PROVEEDOR: Integer read GetID_PROVEEDORValue write SetID_PROVEEDORValue; property ID_PROVEEDORIsNull: Boolean read GetID_PROVEEDORIsNull write SetID_PROVEEDORIsNull; + property REF_PROVEEDOR: String read GetREF_PROVEEDORValue write SetREF_PROVEEDORValue; + property REF_PROVEEDORIsNull: Boolean read GetREF_PROVEEDORIsNull write SetREF_PROVEEDORIsNull; property NOMBRE_PROVEEDOR: String read GetNOMBRE_PROVEEDORValue write SetNOMBRE_PROVEEDORValue; property NOMBRE_PROVEEDORIsNull: Boolean read GetNOMBRE_PROVEEDORIsNull write SetNOMBRE_PROVEEDORIsNull; property NOMBRE_COMERCIAL_PROVEEDOR: String read GetNOMBRE_COMERCIAL_PROVEEDORValue write SetNOMBRE_COMERCIAL_PROVEEDORValue; @@ -736,6 +744,10 @@ type procedure SetID_PROVEEDORValue(const aValue: Integer); virtual; function GetID_PROVEEDORIsNull: Boolean; virtual; procedure SetID_PROVEEDORIsNull(const aValue: Boolean); virtual; + function GetREF_PROVEEDORValue: String; virtual; + procedure SetREF_PROVEEDORValue(const aValue: String); virtual; + function GetREF_PROVEEDORIsNull: Boolean; virtual; + procedure SetREF_PROVEEDORIsNull(const aValue: Boolean); virtual; function GetNOMBRE_PROVEEDORValue: String; virtual; procedure SetNOMBRE_PROVEEDORValue(const aValue: String); virtual; function GetNOMBRE_PROVEEDORIsNull: Boolean; virtual; @@ -878,6 +890,8 @@ type property OBSERVACIONESIsNull: Boolean read GetOBSERVACIONESIsNull write SetOBSERVACIONESIsNull; property ID_PROVEEDOR: Integer read GetID_PROVEEDORValue write SetID_PROVEEDORValue; property ID_PROVEEDORIsNull: Boolean read GetID_PROVEEDORIsNull write SetID_PROVEEDORIsNull; + property REF_PROVEEDOR: String read GetREF_PROVEEDORValue write SetREF_PROVEEDORValue; + property REF_PROVEEDORIsNull: Boolean read GetREF_PROVEEDORIsNull write SetREF_PROVEEDORIsNull; property NOMBRE_PROVEEDOR: String read GetNOMBRE_PROVEEDORValue write SetNOMBRE_PROVEEDORValue; property NOMBRE_PROVEEDORIsNull: Boolean read GetNOMBRE_PROVEEDORIsNull write SetNOMBRE_PROVEEDORIsNull; property NOMBRE_COMERCIAL_PROVEEDOR: String read GetNOMBRE_COMERCIAL_PROVEEDORValue write SetNOMBRE_COMERCIAL_PROVEEDORValue; @@ -937,7 +951,7 @@ type { IFacturasProveedor_Detalles } IFacturasProveedor_Detalles = interface(IDAStronglyTypedDataTable) - ['{C2B60CD9-57CA-4576-BC3B-BDCECACA9F4C}'] + ['{E8E40975-C09C-44C0-B140-68139EB1A46E}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -1826,6 +1840,27 @@ begin DataTable.Fields[idx_FacturasProveedorID_PROVEEDOR].AsVariant := Null; end; +function TFacturasProveedorDataTableRules.GetREF_PROVEEDORValue: String; +begin + result := DataTable.Fields[idx_FacturasProveedorREF_PROVEEDOR].AsString; +end; + +procedure TFacturasProveedorDataTableRules.SetREF_PROVEEDORValue(const aValue: String); +begin + DataTable.Fields[idx_FacturasProveedorREF_PROVEEDOR].AsString := aValue; +end; + +function TFacturasProveedorDataTableRules.GetREF_PROVEEDORIsNull: boolean; +begin + result := DataTable.Fields[idx_FacturasProveedorREF_PROVEEDOR].IsNull; +end; + +procedure TFacturasProveedorDataTableRules.SetREF_PROVEEDORIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_FacturasProveedorREF_PROVEEDOR].AsVariant := Null; +end; + function TFacturasProveedorDataTableRules.GetNOMBRE_PROVEEDORValue: String; begin result := DataTable.Fields[idx_FacturasProveedorNOMBRE_PROVEEDOR].AsString; diff --git a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas index 333c872..cfc2cf4 100644 --- a/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas +++ b/Source/Modulos/Facturas de proveedor/Model/schFacturasProveedorServer_Intf.pas @@ -9,16 +9,16 @@ 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_ListaAnosFacturasDelta = '{F5649B1E-4A25-441C-A312-E5EB8EB2F301}'; - RID_FacturasProveedor_ContratosDelta = '{BB34419C-F523-4089-BD9A-6540AD02B8D7}'; - RID_TiposFacturaProveedorDelta = '{00848D4E-29B2-4289-A7F7-C7B622BC4B2D}'; - RID_FacturasProveedorDelta = '{BA0CE5CA-E565-449C-92F0-1DF87535AE38}'; - RID_FacturasProveedor_DetallesDelta = '{C5CE21F0-19EA-4F8A-BEEC-07C801C4420D}'; + RID_ListaAnosFacturasDelta = '{2EBFBEFA-3152-434B-B39C-9807F3626155}'; + RID_FacturasProveedor_ContratosDelta = '{E613D2E5-9C7A-430B-AE2A-FEFA37FB16FE}'; + RID_TiposFacturaProveedorDelta = '{016DF570-B13F-4802-9031-41E0276CAB8F}'; + RID_FacturasProveedorDelta = '{550969B3-4ED0-475E-A866-523730801CF9}'; + RID_FacturasProveedor_DetallesDelta = '{BA59804D-CC7B-43AA-BBF5-7C5ADA3DA67B}'; type { IListaAnosFacturasDelta } IListaAnosFacturasDelta = interface(IListaAnosFacturas) - ['{F5649B1E-4A25-441C-A312-E5EB8EB2F301}'] + ['{2EBFBEFA-3152-434B-B39C-9807F3626155}'] { Property getters and setters } function GetOldANOValue : String; @@ -52,7 +52,7 @@ type { IFacturasProveedor_ContratosDelta } IFacturasProveedor_ContratosDelta = interface(IFacturasProveedor_Contratos) - ['{BB34419C-F523-4089-BD9A-6540AD02B8D7}'] + ['{E613D2E5-9C7A-430B-AE2A-FEFA37FB16FE}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_FACTURAValue : Integer; @@ -158,7 +158,7 @@ type { ITiposFacturaProveedorDelta } ITiposFacturaProveedorDelta = interface(ITiposFacturaProveedor) - ['{00848D4E-29B2-4289-A7F7-C7B622BC4B2D}'] + ['{016DF570-B13F-4802-9031-41E0276CAB8F}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldDESCRIPCIONValue : String; @@ -204,7 +204,7 @@ type { IFacturasProveedorDelta } IFacturasProveedorDelta = interface(IFacturasProveedor) - ['{BA0CE5CA-E565-449C-92F0-1DF87535AE38}'] + ['{550969B3-4ED0-475E-A866-523730801CF9}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -226,6 +226,7 @@ type function GetOldIMPORTE_TOTALValue : Currency; function GetOldOBSERVACIONESValue : IROStrings; function GetOldID_PROVEEDORValue : Integer; + function GetOldREF_PROVEEDORValue : String; function GetOldNOMBRE_PROVEEDORValue : String; function GetOldNOMBRE_COMERCIAL_PROVEEDORValue : String; function GetOldNIF_CIFValue : String; @@ -273,6 +274,7 @@ type property OldIMPORTE_TOTAL : Currency read GetOldIMPORTE_TOTALValue; property OldOBSERVACIONES : IROStrings read GetOldOBSERVACIONESValue; property OldID_PROVEEDOR : Integer read GetOldID_PROVEEDORValue; + property OldREF_PROVEEDOR : String read GetOldREF_PROVEEDORValue; property OldNOMBRE_PROVEEDOR : String read GetOldNOMBRE_PROVEEDORValue; property OldNOMBRE_COMERCIAL_PROVEEDOR : String read GetOldNOMBRE_COMERCIAL_PROVEEDORValue; property OldNIF_CIF : String read GetOldNIF_CIFValue; @@ -426,6 +428,12 @@ type function GetOldID_PROVEEDORIsNull: Boolean; virtual; procedure SetID_PROVEEDORValue(const aValue: Integer); virtual; procedure SetID_PROVEEDORIsNull(const aValue: Boolean); virtual; + function GetREF_PROVEEDORValue: String; virtual; + function GetREF_PROVEEDORIsNull: Boolean; virtual; + function GetOldREF_PROVEEDORValue: String; virtual; + function GetOldREF_PROVEEDORIsNull: Boolean; virtual; + procedure SetREF_PROVEEDORValue(const aValue: String); virtual; + procedure SetREF_PROVEEDORIsNull(const aValue: Boolean); virtual; function GetNOMBRE_PROVEEDORValue: String; virtual; function GetNOMBRE_PROVEEDORIsNull: Boolean; virtual; function GetOldNOMBRE_PROVEEDORValue: String; virtual; @@ -658,6 +666,10 @@ type property ID_PROVEEDORIsNull : Boolean read GetID_PROVEEDORIsNull write SetID_PROVEEDORIsNull; property OldID_PROVEEDOR : Integer read GetOldID_PROVEEDORValue; property OldID_PROVEEDORIsNull : Boolean read GetOldID_PROVEEDORIsNull; + property REF_PROVEEDOR : String read GetREF_PROVEEDORValue write SetREF_PROVEEDORValue; + property REF_PROVEEDORIsNull : Boolean read GetREF_PROVEEDORIsNull write SetREF_PROVEEDORIsNull; + property OldREF_PROVEEDOR : String read GetOldREF_PROVEEDORValue; + property OldREF_PROVEEDORIsNull : Boolean read GetOldREF_PROVEEDORIsNull; property NOMBRE_PROVEEDOR : String read GetNOMBRE_PROVEEDORValue write SetNOMBRE_PROVEEDORValue; property NOMBRE_PROVEEDORIsNull : Boolean read GetNOMBRE_PROVEEDORIsNull write SetNOMBRE_PROVEEDORIsNull; property OldNOMBRE_PROVEEDOR : String read GetOldNOMBRE_PROVEEDORValue; @@ -767,7 +779,7 @@ type { IFacturasProveedor_DetallesDelta } IFacturasProveedor_DetallesDelta = interface(IFacturasProveedor_Detalles) - ['{C5CE21F0-19EA-4F8A-BEEC-07C801C4420D}'] + ['{BA59804D-CC7B-43AA-BBF5-7C5ADA3DA67B}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_FACTURAValue : Integer; @@ -1957,6 +1969,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorID_PROVEEDOR] := Null; end; +function TFacturasProveedorBusinessProcessorRules.GetREF_PROVEEDORValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorREF_PROVEEDOR]; +end; + +function TFacturasProveedorBusinessProcessorRules.GetREF_PROVEEDORIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorREF_PROVEEDOR]); +end; + +function TFacturasProveedorBusinessProcessorRules.GetOldREF_PROVEEDORValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasProveedorREF_PROVEEDOR]; +end; + +function TFacturasProveedorBusinessProcessorRules.GetOldREF_PROVEEDORIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_FacturasProveedorREF_PROVEEDOR]); +end; + +procedure TFacturasProveedorBusinessProcessorRules.SetREF_PROVEEDORValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorREF_PROVEEDOR] := aValue; +end; + +procedure TFacturasProveedorBusinessProcessorRules.SetREF_PROVEEDORIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorREF_PROVEEDOR] := Null; +end; + function TFacturasProveedorBusinessProcessorRules.GetNOMBRE_PROVEEDORValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_FacturasProveedorNOMBRE_PROVEEDOR]; diff --git a/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedor.pas b/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedor.pas index 512c004..8e4e113 100644 --- a/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedor.pas +++ b/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedor.pas @@ -299,9 +299,10 @@ begin ID_EMPRESA := AppFactuGES.EmpresaActiva.ID; USUARIO := AppFactuGES.UsuarioActivo.UserName; FECHA_FACTURA := DateOf(Now); - FECHA_VENCIMIENTO := DateOf(Now); +// FECHA_VENCIMIENTO := DateOf(Now); ID_PROVEEDOR := ID_NULO; TIPO := CTE_TIPO_FACTURA; + SITUACION := CTE_PENDIENTE; ID_FORMA_PAGO := AppFactuGES.EmpresaActiva.ID_FORMA_PAGO; ID_TIPO_IVA := AppFactuGES.EmpresaActiva.ID_TIPO_IVA; diff --git a/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.dfm b/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.dfm index ac9a310..ff50bf1 100644 --- a/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.dfm +++ b/Source/Modulos/Facturas de proveedor/Servidor/srvFacturasProveedor_Impl.dfm @@ -355,6 +355,10 @@ object srvFacturasProveedor: TsrvFacturasProveedor item DatasetField = 'ID_TIPO_FACTURA' TableField = 'ID_TIPO_FACTURA' + end + item + DatasetField = 'REF_PROVEEDOR' + TableField = 'REF_PROVEEDOR' end> end> Name = 'FacturasProveedor' @@ -465,6 +469,11 @@ object srvFacturasProveedor: TsrvFacturasProveedor DataType = datInteger DictionaryEntry = 'FacturasProveedor_ID_PROVEEDOR' end + item + Name = 'REF_PROVEEDOR' + DataType = datString + Size = 255 + end item Name = 'NOMBRE_PROVEEDOR' DataType = datString @@ -1008,6 +1017,12 @@ object srvFacturasProveedor: TsrvFacturasProveedor Name = 'ID_TIPO_FACTURA' DataType = datInteger Value = '' + end + item + Name = 'SITUACION' + DataType = datString + Size = 255 + Value = '' end> Statements = < item @@ -1023,15 +1038,15 @@ object srvFacturasProveedor: TsrvFacturasProveedor ', PROVINCIA, CODIGO_POSTAL, '#10' FECHA_ALTA, USUARIO, ID_FORMA_' + 'PAGO,'#10' RECARGO_EQUIVALENCIA, ID_TIPO_IVA, IMPORTE_NETO, IMPO' + 'RTE_PORTE, IGNORAR_CONTABILIDAD,'#10' ID_TIENDA, ID_TIPO_FACTURA' + - ')'#10' VALUES'#10' (:ID, :ID_EMPRESA, :REFERENCIA, :REFERENCIA_PROVE' + - 'EDOR,'#10' :FECHA_FACTURA, :FECHA_VENCIMIENTO, :BASE_IMPONIBLE, ' + - ':DESCUENTO,'#10' :IMPORTE_DESCUENTO, :IVA, :IMPORTE_IVA, :IRPF, ' + - ':IMPORTE_IRPF,'#10' :RE, :IMPORTE_RE, :IMPORTE_TOTAL, :OBSERVACI' + - 'ONES, :ID_PROVEEDOR, :NIF_CIF,'#10' :NOMBRE, :CALLE, :POBLACION,' + - ' :PROVINCIA, :CODIGO_POSTAL, '#10' CURRENT_TIMESTAMP, :USUARIO, ' + - ':ID_FORMA_PAGO,'#10' :RECARGO_EQUIVALENCIA, :ID_TIPO_IVA, :IMPOR' + - 'TE_NETO, '#10' :IMPORTE_PORTE, :IGNORAR_CONTABILIDAD, :ID_TIENDA' + - ', :ID_TIPO_FACTURA)'#10' '#10' '#10#10 + ', SITUACION)'#10' VALUES'#10' (:ID, :ID_EMPRESA, :REFERENCIA, :REFER' + + 'ENCIA_PROVEEDOR,'#10' :FECHA_FACTURA, :FECHA_VENCIMIENTO, :BASE_' + + 'IMPONIBLE, :DESCUENTO,'#10' :IMPORTE_DESCUENTO, :IVA, :IMPORTE_I' + + 'VA, :IRPF, :IMPORTE_IRPF,'#10' :RE, :IMPORTE_RE, :IMPORTE_TOTAL,' + + ' :OBSERVACIONES, :ID_PROVEEDOR, :NIF_CIF,'#10' :NOMBRE, :CALLE, ' + + ':POBLACION, :PROVINCIA, :CODIGO_POSTAL, '#10' CURRENT_TIMESTAMP,' + + ' :USUARIO, :ID_FORMA_PAGO,'#10' :RECARGO_EQUIVALENCIA, :ID_TIPO_' + + 'IVA, :IMPORTE_NETO, '#10' :IMPORTE_PORTE, :IGNORAR_CONTABILIDAD,' + + ' :ID_TIENDA, :ID_TIPO_FACTURA, :SITUACION)'#10' '#10' '#10#10 StatementType = stSQL ColumnMappings = <> end> @@ -1232,6 +1247,12 @@ object srvFacturasProveedor: TsrvFacturasProveedor DataType = datInteger Value = '' end + item + Name = 'SITUACION' + DataType = datString + Size = 255 + Value = '' + end item Name = 'OLD_ID' Value = '' @@ -1259,8 +1280,8 @@ object srvFacturasProveedor: TsrvFacturasProveedor 'LENCIA = :RECARGO_EQUIVALENCIA, '#10' ID_TIPO_IVA = :ID_TIPO_IVA,' + ' '#10' IMPORTE_NETO = :IMPORTE_NETO, '#10' IMPORTE_PORTE = :IMPORT' + 'E_PORTE,'#10' IGNORAR_CONTABILIDAD = :IGNORAR_CONTABILIDAD,'#10' I' + - 'D_TIENDA = :ID_TIENDA,'#10' ID_TIPO_FACTURA = :ID_TIPO_FACTURA'#10' ' + - 'WHERE'#10' (ID = :OLD_ID)'#10 + 'D_TIENDA = :ID_TIENDA,'#10' ID_TIPO_FACTURA = :ID_TIPO_FACTURA,'#10' ' + + ' SITUACION = :SITUACION'#10' WHERE'#10' (ID = :OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> diff --git a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm index e104376..3f76d50 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm +++ b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.dfm @@ -63,7 +63,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor end object cbFormaPago: TcxDBLookupComboBox Left = 124 - Top = 162 + Top = 189 DataBinding.DataField = 'ID_FORMA_PAGO' DataBinding.DataSource = DADataSource Properties.DropDownListStyle = lsFixedList @@ -90,16 +90,16 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.Kind = lfStandard StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 4 + TabOrder = 5 Width = 169 end object bFormasPago: TButton Left = 150 - Top = 162 + Top = 189 Width = 132 Height = 23 Caption = 'Ver las formas de pago...' - TabOrder = 5 + TabOrder = 6 OnClick = bFormasPagoClick end object eReferenciaProveedor: TcxDBTextEdit @@ -124,7 +124,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor end inline frViewTienda1: TfrViewTienda Left = 22 - Top = 242 + Top = 269 Width = 320 Height = 36 Enabled = False @@ -134,15 +134,15 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 7 + TabOrder = 8 ReadOnly = False ExplicitLeft = 22 - ExplicitTop = 242 + ExplicitTop = 269 ExplicitWidth = 320 ExplicitHeight = 36 inherited dxLayoutControl1: TdxLayoutControl Width = 320 - ExplicitWidth = 320 + ExplicitWidth = 260 inherited cbTienda: TcxComboBox ExplicitWidth = 376 Width = 376 @@ -151,10 +151,11 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor end object edtFechaVencimiento: TcxDBDateEdit Left = 124 - Top = 191 + Top = 218 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'FECHA_VENCIMIENTO' DataBinding.DataSource = DADataSource + Properties.OnEditValueChanged = edtFechaVencimientoPropertiesEditValueChanged Style.BorderColor = clWindowFrame Style.BorderStyle = ebs3D Style.Color = clInfoBk @@ -167,7 +168,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor StyleDisabled.LookAndFeel.NativeStyle = True StyleFocused.LookAndFeel.NativeStyle = True StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 6 + TabOrder = 7 Width = 158 end inline frViewProveedorFactura1: TfrViewProveedorFactura @@ -181,7 +182,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 8 + TabOrder = 9 ReadOnly = False ExplicitLeft = 310 ExplicitTop = 30 @@ -230,7 +231,7 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor end inline frViewObservaciones1: TfrViewObservaciones Left = 22 - Top = 320 + Top = 335 Width = 521 Height = 228 Font.Charset = DEFAULT_CHARSET @@ -239,15 +240,16 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Font.Name = 'Tahoma' Font.Style = [] ParentFont = False - TabOrder = 9 + TabOrder = 10 ReadOnly = False ExplicitLeft = 22 - ExplicitTop = 320 + ExplicitTop = 335 ExplicitHeight = 228 inherited memObservaciones: TcxDBMemo DataBinding.DataField = 'OBSERVACIONES' DataBinding.DataSource = DADataSource - ExplicitHeight = 228 + ExplicitWidth = 600 + ExplicitHeight = 20 Height = 228 end end @@ -284,6 +286,20 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor TabOrder = 3 Width = 209 end + object edtSituacion: TcxDBComboBox + Left = 124 + Top = 138 + DataBinding.DataField = 'SITUACION' + DataBinding.DataSource = DADataSource + Properties.DropDownListStyle = lsFixedList + Properties.ImmediatePost = True + Properties.Items.Strings = ( + 'PENDIENTE' + 'PARCIALMENTE PAGADA' + 'PAGADA') + TabOrder = 4 + Width = 294 + end object dxLayoutControl1Group_Root: TdxLayoutGroup ShowCaption = False Hidden = True @@ -324,6 +340,11 @@ inherited frViewFacturaProveedor: TfrViewFacturaProveedor Control = cbTipoFactura ControlOptions.ShowBorder = False end + object ledtSituacion: TdxLayoutItem + Caption = 'Situaci'#243'n:' + Control = edtSituacion + ControlOptions.ShowBorder = False + end end object dxLayoutControl1Group8: TdxLayoutGroup Caption = 'Forma de pago' diff --git a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas index 303d0f4..5607759 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas +++ b/Source/Modulos/Facturas de proveedor/Views/uViewFacturaProveedor.pas @@ -63,6 +63,8 @@ type dxLayoutControl1Item8: TdxLayoutItem; cbTipoFactura: TcxDBLookupComboBox; dsTiposFactura: TDADataSource; + ledtSituacion: TdxLayoutItem; + edtSituacion: TcxDBComboBox; procedure bFormasPagoClick(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure CustomViewCreate(Sender: TObject); @@ -71,6 +73,7 @@ type procedure actElegirDireccionExecute(Sender: TObject); procedure actElegirDireccionUpdate(Sender: TObject); procedure cbFormaPagoPropertiesEditValueChanged(Sender: TObject); + procedure edtFechaVencimientoPropertiesEditValueChanged(Sender: TObject); protected FFactura : IBizFacturaProveedor; FFormasPago : IBizFormaPago; @@ -145,14 +148,18 @@ begin if Assigned(FFormasPago) then if (FFormasPago.Plazos.RecordCount = 0) then begin - edtFechaVencimiento.EditValue := DateOf(Now); - ledtFechaVencimiento.Enabled := True +// edtFechaVencimiento.EditValue := DateOf(Now); + ledtFechaVencimiento.Enabled := True; + edtSituacion.EditValue := CTE_PENDIENTE; + ledtSituacion.Enabled := True; end else begin - Application.MessageBox('Ha elegido una forma de pago con plazos asignados, los vencimientos se regiran por dichos plazos', 'Atención', MB_OK); + Application.MessageBox('Ha elegido una forma de pago con plazos asignados, la situación de la factura vendrá dada por la situación de los recibos generados según los plazos', 'Atención', MB_OK); edtFechaVencimiento.EditValue := Null; ledtFechaVencimiento.Enabled := False; + edtSituacion.EditValue := CTE_PENDIENTE; + ledtSituacion.Enabled := False; end; end; end; @@ -176,6 +183,36 @@ begin inherited; end; +procedure TfrViewFacturaProveedor.edtFechaVencimientoPropertiesEditValueChanged( + Sender: TObject); +begin + inherited; + if Assigned(Factura) and (Factura.DataTable.State in dsEditModes) then + begin + if (edtFechaVencimiento.EditValue <> null) then + begin + if (edtFechaVencimiento.EditValue = 0) then + begin + Factura.DataTable.DisableEventHandlers; + try + Factura.DataTable.FieldByName(fld_FacturasProveedorFECHA_VENCIMIENTO).Clear; + finally + Factura.DataTable.EnableEventHandlers; + end; + end + else begin + Application.MessageBox('Ha elegido una fecha de vencimiento, la situación de la factura vendrá dada por la situación del recibo generado con el vencimiento dado', 'Atención', MB_OK); + edtSituacion.EditValue := CTE_PENDIENTE; + ledtSituacion.Enabled := False; + end; + end + else begin + // edtSituacion.EditValue := CTE_PENDIENTE; + ledtSituacion.Enabled := True; + end; + end; +end; + procedure TfrViewFacturaProveedor.frViewProveedorFacturaButton1Click(Sender: TObject); begin if Assigned(Factura) and Assigned(Factura.Proveedor) and @@ -231,10 +268,21 @@ begin //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 + if ((not FFactura.FECHA_VENCIMIENTOIsNull) or (FFormasPago.Plazos.RecordCount > 0)) then + begin + if (edtFechaVencimiento.EditingValue <> null) then + ledtSituacion.Enabled := False; + + if (FFormasPago.Plazos.RecordCount > 0) then + ledtFechaVencimiento.Enabled := False + else + ledtFechaVencimiento.Enabled := true; + end else - ledtFechaVencimiento.Enabled := False; + begin + ledtFechaVencimiento.Enabled := True; + ledtSituacion.Enabled := True; + end; FTiposFacturaProveedor := FController.darTiposFacturaProveedor; dsTiposFactura.DataTable := FTiposFacturaProveedor.DataTable; diff --git a/Source/Servidor/FactuGES_Server.dpr b/Source/Servidor/FactuGES_Server.dpr index 566b48c..6864d5b 100644 --- a/Source/Servidor/FactuGES_Server.dpr +++ b/Source/Servidor/FactuGES_Server.dpr @@ -115,8 +115,6 @@ uses schInventarioServer_Intf in '..\Modulos\Inventario\Model\schInventarioServer_Intf.pas', schPedidosProveedorClient_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorClient_Intf.pas', schPedidosProveedorServer_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorServer_Intf.pas', - schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas', - schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas', schArticulosClient_Intf in '..\Modulos\Articulos\Model\schArticulosClient_Intf.pas', schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas', srvSubfamilias_Impl in '..\Modulos\Subfamilias\Servidor\srvSubfamilias_Impl.pas' {srvSubfamilias: TDataAbstractService}, @@ -143,7 +141,9 @@ uses schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas', schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas', schContratosClienteClient_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteClient_Intf.pas', - schContratosClienteServer_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteServer_Intf.pas'; + schContratosClienteServer_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteServer_Intf.pas', + schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas', + schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas'; {$R *.res} {$R ..\Servicios\RODLFile.res} diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj index ca27d28..c49e7eb 100644 --- a/Source/Servidor/FactuGES_Server.dproj +++ b/Source/Servidor/FactuGES_Server.dproj @@ -28,7 +28,7 @@ Delphi.Personality - FalseTrueFalseTrueFalse2780FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.7.8.0FactuGES (Servidor)2.7.8.0lunes, 16 de septiembre de 2019 16:29 + FalseTrueFalseTrueFalse2810FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.8.1.0FactuGES (Servidor)2.8.1.0viernes, 14 de febrero de 2020 13:12 File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found FactuGES_Server.dpr diff --git a/Source/Servidor/FactuGES_Server.res b/Source/Servidor/FactuGES_Server.res index e6fb30f..18fed7e 100644 Binary files a/Source/Servidor/FactuGES_Server.res and b/Source/Servidor/FactuGES_Server.res differ