diff --git a/Build/Build.fbl6 b/Build/Build.fbl6 index 47a8511..4806630 100644 Binary files a/Build/Build.fbl6 and b/Build/Build.fbl6 differ diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 005fda6..ef8fe6e 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -4332,6 +4332,7 @@ on (v_contratos_facturas_cliente.ID_CONTRATO = contratos_cliente.ID) /******************************************************************************/ ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT PK_ALBARANES_CLIENTE PRIMARY KEY (ID); +ALTER TABLE ALBARANES_CLIENTE ADD CONSTRAINT FK_ALBARANES_CLIENTE_1 FOREIGN KEY (ID_FACTURA) REFERENCES FACTURAS_CLIENTE (ID) ON DELETE SET NULL ON UPDATE CASCADE; ALTER TABLE ALBARANES_CLIENTE_DETALLES ADD CONSTRAINT PK_ALBARANES_CLIENTE_DETALLES PRIMARY KEY (ID); ALTER TABLE ALBARANES_PROVEEDOR ADD CONSTRAINT PK_ALBARAN_PROVEEDOR PRIMARY KEY (ID); ALTER TABLE ALBARANES_PROVEEDOR_DETALLES ADD CONSTRAINT PK_ALBARANES_PROVEEDOR_DETALLES PRIMARY KEY (ID); diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index adbdeae..6b391ad 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\TrueFalse2640FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.6.4.0FactuGESFactuGES2.6.4.0 +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse2650FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.6.5.0FactuGESFactuGES2.6.5.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 265f275..145d538 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/Informes/1/InfContratoCliente.fr3 b/Source/Informes/1/InfContratoCliente.fr3 index f10d4c2..ae7c0f0 100644 --- a/Source/Informes/1/InfContratoCliente.fr3 +++ b/Source/Informes/1/InfContratoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -30,15 +30,17 @@ - - - + + + + + - + @@ -60,7 +62,7 @@ - + @@ -68,7 +70,7 @@ - + diff --git a/Source/Informes/1/InfFacturaCliente.fr3 b/Source/Informes/1/InfFacturaCliente.fr3 index ab59760..329c187 100644 --- a/Source/Informes/1/InfFacturaCliente.fr3 +++ b/Source/Informes/1/InfFacturaCliente.fr3 @@ -1,43 +1,43 @@ - + - + - - - - - + + + + + - + - + - - - - - + + + + + + + + + - - - - - - - + + + - + @@ -55,19 +55,19 @@ - + - + - + diff --git a/Source/Informes/1/InfPresupuestoCliente.fr3 b/Source/Informes/1/InfPresupuestoCliente.fr3 index fc23b0f..1e179f6 100644 --- a/Source/Informes/1/InfPresupuestoCliente.fr3 +++ b/Source/Informes/1/InfPresupuestoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -30,15 +30,17 @@ - - - + + + + + - + @@ -63,10 +65,10 @@ - + - + diff --git a/Source/Informes/2/InfPresupuestoCliente.fr3 b/Source/Informes/2/InfPresupuestoCliente.fr3 index 3124678..140c77d 100644 --- a/Source/Informes/2/InfPresupuestoCliente.fr3 +++ b/Source/Informes/2/InfPresupuestoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@ - + diff --git a/Source/Informes/4/InfContratoCliente.fr3 b/Source/Informes/4/InfContratoCliente.fr3 index 1b96062..86e2d6d 100644 --- a/Source/Informes/4/InfContratoCliente.fr3 +++ b/Source/Informes/4/InfContratoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -28,15 +28,17 @@ - - - + + + + + - + @@ -58,7 +60,7 @@ - + diff --git a/Source/Informes/4/InfPresupuestoCliente.fr3 b/Source/Informes/4/InfPresupuestoCliente.fr3 index c937780..ce574a0 100644 --- a/Source/Informes/4/InfPresupuestoCliente.fr3 +++ b/Source/Informes/4/InfPresupuestoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -28,15 +28,17 @@ - - - + + + + + - + @@ -61,10 +63,10 @@ - + - + diff --git a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas index 3a99e16..9e99ae5 100644 --- a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas +++ b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas @@ -785,7 +785,7 @@ begin AContrato.PLAZO_ENTREGA.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_PLAZOS_ENTREGA_COCINA)); AContrato.OBSERVACIONES.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_OBSERVACIONES_COCINA)); - (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_C, 'MUEBLES DE COCINA ', False, AContrato.Detalles); + (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_C, 'MUEBLES DE COCINA ', True, AContrato.Detalles); (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_V, 'ENCIMERA ', True, AContrato.Detalles); (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_V, 'ELECTRODOMÉSTICOS ', True, AContrato.Detalles); (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_V, 'COMPLEMENTOS ', True, AContrato.Detalles); @@ -803,8 +803,8 @@ begin AContrato.FORMA_PAGO.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_FORMA_PAGO_ARMARIO)); AContrato.PLAZO_ENTREGA.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_PLAZOS_ENTREGA_ARMARIO)); AContrato.OBSERVACIONES.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_OBSERVACIONES_ARMARIO)); - (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_AF, 'FRENTE DE ARMARIO Nº ', False, AContrato.Detalles); - (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_AI, 'INTERIOR DE ARMARIO Nº ', False, AContrato.Detalles); + (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_AF, 'FRENTE DE ARMARIO Nº ', True, AContrato.Detalles); + (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_AI, 'INTERIOR DE ARMARIO Nº ', True, AContrato.Detalles); end; teBano: begin @@ -844,7 +844,7 @@ begin AContrato.FORMA_PAGO.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_FORMA_PAGO_VARIOS)); AContrato.PLAZO_ENTREGA.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_PLAZOS_ENTREGA_VARIOS)); AContrato.OBSERVACIONES.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_OBSERVACIONES_VARIOS)); - (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_V, 'VARIOS ', False, AContrato.Detalles); + (Self.DetallesController as IDetallesContratoClienteController).AnadirCapitulo(TIPO_CAPITULO_V, 'VARIOS ', True, AContrato.Detalles); end; end; diff --git a/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.dfm index 041760d..04a6b5f 100644 --- a/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.dfm +++ b/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.dfm @@ -132,6 +132,8 @@ inherited fEditorContratosCliente: TfEditorContratosCliente ImageIndex = 22 object bCocina: TTBXItem Caption = 'Contrato de cocina' + Enabled = False + Visible = False OnClick = bCocinaClick end object bArmario: TTBXItem @@ -140,6 +142,8 @@ inherited fEditorContratosCliente: TfEditorContratosCliente end object bBano: TTBXItem Caption = 'Contrato de ba'#241'o' + Enabled = False + Visible = False OnClick = bBanoClick end object bElectrodomestico: TTBXItem diff --git a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm index 427f518..438c681 100644 --- a/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm +++ b/Source/Modulos/Contratos de cliente/Views/uViewDetallesContratoCliente.dfm @@ -246,11 +246,15 @@ inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente object actCapituloBano: TAction Category = 'Operaciones' Caption = 'Capitulo de ba'#241'o' + Enabled = False + Visible = False OnExecute = actCapituloBanoExecute end object actCapituloCocina: TAction Category = 'Operaciones' Caption = 'Cap'#237'tulo de cocina' + Enabled = False + Visible = False OnExecute = actCapituloCocinaExecute end object actCapituloElectrodomesticos: TAction @@ -266,6 +270,8 @@ inherited frViewDetallesContratoCliente: TfrViewDetallesContratoCliente object actCapituloImportes: TAction Category = 'Operaciones' Caption = 'Capitulo de importes' + Enabled = False + Visible = False OnExecute = actCapituloImportesExecute end end diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas index 0b79af8..a06c0f4 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas @@ -272,7 +272,16 @@ begin begin AFacturaActual := AFacturas; RecuperarCliente(AFacturaActual); + AFacturaActual.Cliente.DataTable.Active := True; + //En este caso no queremos el descuento general del cliente asociado a su ficha, ya que partimos del valor que tengan las olbaranes + bEnEdicion := (AFacturaActual.DataTable.State in dsEditModes); + if not bEnEdicion then + AFacturaActual.Edit; + AFacturaActual.DESCUENTOIsNull := True; + AFacturaActual.Post; + if bEnEdicion then + AFacturaActual.Edit; end else begin // No hay factura de ese cliente. Creo una nueva @@ -280,6 +289,15 @@ begin AAlbaranesController.RecuperarCliente(AListaAlbaranes); AListaAlbaranes.Cliente.DataTable.Active := True; AFacturas.Cliente := AListaAlbaranes.Cliente; + //En este caso no queremos el descuento general del cliente asociado a su ficha, ya que partimos del valor que tengan las olbaranes + bEnEdicion := (AFacturas.DataTable.State in dsEditModes); + if not bEnEdicion then + AFacturas.Edit; + AFacturas.DESCUENTOIsNull := True; + AFacturas.Post; + if bEnEdicion then + AFacturas.Edit; + //Si el albaran es de tipo devolución hacemos la factura de tipo abono if (AListaAlbaranes.TIPO = CTE_TIPO_ALBARAN_DEV) then @@ -309,14 +327,32 @@ begin // Añado el contenido del albarán CopiarArticulosAlbaran(AListaAlbaranes.Detalles, AFacturaActual.Detalles); - Self.DetallesController.Add(AFacturaActual.Detalles, TIPO_DETALLE_CONCEPTO); - with AFacturaActual.Detalles do + //Sacamos el importe del porte en el caso de tener + if (AListaAlbaranes.IMPORTE_PORTE > 0) then begin - Edit; - CONCEPTO := 'Porte del albarán'; - CANTIDAD := 1; - IMPORTE_UNIDAD := AListaAlbaranes.IMPORTE_PORTE; - Post; + Self.DetallesController.Add(AFacturaActual.Detalles, TIPO_DETALLE_CONCEPTO); + with AFacturaActual.Detalles do + begin + Edit; + CONCEPTO := 'Porte del albarán'; + CANTIDAD := 1; + IMPORTE_UNIDAD := AListaAlbaranes.IMPORTE_PORTE; + Post; + end; + end; + + //Sacamos el descuento total del albaran en el caso de tener + if (AListaAlbaranes.IMPORTE_DESCUENTO > 0) then + begin + Self.DetallesController.Add(AFacturaActual.Detalles, TIPO_DETALLE_CONCEPTO); + with AFacturaActual.Detalles do + begin + Edit; + CONCEPTO := 'Descuento del albarán'; + CANTIDAD := -1; + IMPORTE_UNIDAD := AListaAlbaranes.IMPORTE_DESCUENTO; + Post; + end; end; // Añado el resumen diff --git a/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj b/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj index b81a759..06da0cc 100644 --- a/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj +++ b/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj @@ -9,6 +9,7 @@ + @@ -22,6 +23,7 @@ + @@ -271,14 +273,32 @@ + + + + + + + + + + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas index b5f7d2f..b190e26 100644 --- a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas +++ b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas @@ -992,7 +992,7 @@ begin APresupuesto.PLAZO_ENTREGA.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_PLAZOS_ENTREGA_VARIOS, AppFactuGES.EmpresaActiva.ID)); APresupuesto.OBSERVACIONES.Add(AppFactuGES.Configuracion.GetSettingAsString(teBD, CTE_OBSERVACIONES_VARIOS, AppFactuGES.EmpresaActiva.ID)); - (Self.DetallesController as IDetallesPresupuestoClienteController).AnadirCapitulo(TIPO_CAPITULO_V, 'VARIOS ', False, APresupuesto.Detalles); + (Self.DetallesController as IDetallesPresupuestoClienteController).AnadirCapitulo(TIPO_CAPITULO_V, 'VARIOS ', True, APresupuesto.Detalles); end; end; diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm index 640d586..8296f4a 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm +++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm @@ -133,6 +133,8 @@ inherited fEditorPresupuestosCliente: TfEditorPresupuestosCliente ImageIndex = 22 object bCocina: TTBXItem Caption = 'Presupuesto de cocina' + Enabled = False + Visible = False OnClick = bCocinaClick end object bArmario: TTBXItem @@ -141,6 +143,8 @@ inherited fEditorPresupuestosCliente: TfEditorPresupuestosCliente end object bBano: TTBXItem Caption = 'Presupuesto de ba'#241'o' + Enabled = False + Visible = False OnClick = bBanoClick end object bElectrodomestico: TTBXItem diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.dfm index cf006a8..1a41402 100644 --- a/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.dfm +++ b/Source/Modulos/Presupuestos de cliente/Views/uViewDetallesPresupuestoCliente.dfm @@ -258,11 +258,15 @@ inherited frViewDetallesPresupuestoCliente: TfrViewDetallesPresupuestoCliente object actCapituloBano: TAction Category = 'Operaciones' Caption = 'Capitulo de ba'#241'o' + Enabled = False + Visible = False OnExecute = actCapituloBanoExecute end object actCapituloCocina: TAction Category = 'Operaciones' Caption = 'Cap'#237'tulo de cocina' + Enabled = False + Visible = False OnExecute = actCapituloCocinaExecute end object actCapituloElectrodomesticos: TAction @@ -278,6 +282,8 @@ inherited frViewDetallesPresupuestoCliente: TfrViewDetallesPresupuestoCliente object actCapituloImportes: TAction Category = 'Operaciones' Caption = 'Capitulo de importes' + Enabled = False + Visible = False OnExecute = actCapituloImportesExecute end end diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj index c24442e..90d7ebb 100644 --- a/Source/Servidor/FactuGES_Server.dproj +++ b/Source/Servidor/FactuGES_Server.dproj @@ -28,7 +28,7 @@ Delphi.Personality - FalseTrueFalseTrueFalse2640FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.6.4.0FactuGES (Servidor)2.6.4.0jueves, 23 de enero de 2014 16:10 + FalseTrueFalseTrueFalse2650FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.6.5.0FactuGES (Servidor)2.6.5.0miércoles, 07 de mayo de 2014 12:33 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 bab3466..0c02fc8 100644 Binary files a/Source/Servidor/FactuGES_Server.res and b/Source/Servidor/FactuGES_Server.res differ