diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 2f7941d3..f3794038 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -4019,9 +4019,9 @@ end ^ ALTER PROCEDURE PROC_NEW_ASIENTO_FACTURA_CLI ( - IDFACTURA INTEGER, - ID_SUBCUENTA_VENTA INTEGER) -AS + idfactura integer, + id_subcuenta_venta integer) +as declare variable ignorarcontabilidad integer; declare variable referenciafactura varchar(255); declare variable razon varchar(255); @@ -4034,15 +4034,30 @@ declare variable orden integer; declare variable importetotal numeric(11,2); declare variable importeiva numeric(11,2); declare variable importere numeric(11,2); +declare variable idempresa integer; +declare variable idcontacto integer; begin /*BUSCAMOS LA FACTURA DE LA QUE COMPROBAR SI HACER ASIENTO*/ - SELECT FACTURAS_CLIENTE.IGNORAR_CONTABILIDAD, FACTURAS_CLIENTE.REFERENCIA, FACTURAS_CLIENTE.NOMBRE, FACTURAS_CLIENTE.FECHA_FACTURA, - FACTURAS_CLIENTE.BASE_IMPONIBLE, FACTURAS_CLIENTE.IMPORTE_IVA, FACTURAS_CLIENTE.IMPORTE_RE, FACTURAS_CLIENTE.IMPORTE_TOTAL, - CONT_SUBCUENTAS.ID, CONT_SUBCUENTAS.ID_EJERCICIO + SELECT FACTURAS_CLIENTE.ID_EMPRESA, FACTURAS_CLIENTE.IGNORAR_CONTABILIDAD, FACTURAS_CLIENTE.REFERENCIA, + FACTURAS_CLIENTE.ID_CLIENTE, FACTURAS_CLIENTE.NOMBRE, FACTURAS_CLIENTE.FECHA_FACTURA, + FACTURAS_CLIENTE.BASE_IMPONIBLE, FACTURAS_CLIENTE.IMPORTE_IVA, FACTURAS_CLIENTE.IMPORTE_RE, FACTURAS_CLIENTE.IMPORTE_TOTAL FROM FACTURAS_CLIENTE - LEFT JOIN CONT_SUBCUENTAS ON (CONT_SUBCUENTAS.ID_CONTACTO = FACTURAS_CLIENTE.ID_CLIENTE) - WHERE FACTURAS_CLIENTE.ID = :IDFACTURA INTO :IGNORARCONTABILIDAD, :REFERENCIAFACTURA, :RAZON, - :FECHAFACTURA, :BASEIMPONIBLE, :IMPORTEIVA, :IMPORTERE, :IMPORTETOTAL, :IDSUBCUENTA, :IDEJERCICIO; + WHERE FACTURAS_CLIENTE.ID = :IDFACTURA INTO :IDEMPRESA, :IGNORARCONTABILIDAD, :REFERENCIAFACTURA, + :IDCONTACTO, :RAZON, :FECHAFACTURA, :BASEIMPONIBLE, :IMPORTEIVA, :IMPORTERE, :IMPORTETOTAL; + + /*BUSCAMOS EL EJERCICIO ACTIVO PARA LA EMPRESA DE LA FACTURA*/ + SELECT ID + FROM CONT_EJERCICIOS + WHERE ID_EMPRESA = :IDEMPRESA + AND ACTIVO = 1 + INTO :IDEJERCICIO; + + /*BUSCAMOS LA SUBCUENTA DEL EJERCICIO ACTIVO DE LA EMPRESA DE LA FACTURA PARA EL CLIENTE DE LA FACTURA*/ + SELECT ID + FROM CONT_SUBCUENTAS + WHERE ID_CONTACTO = :IDCONTACTO + AND ID_EJERCICIO = :IDEJERCICIO + INTO :IDSUBCUENTA; SELECT ID FROM CONT_ASIENTOS WHERE ID_FACTURA = :IDFACTURA @@ -4160,9 +4175,9 @@ end ^ ALTER PROCEDURE PROC_NEW_ASIENTO_FACTURA_PROV ( - IDFACTURA INTEGER, - ID_SUBCUENTA_COMPRA INTEGER) -AS + idfactura integer, + id_subcuenta_compra integer) +as declare variable ignorarcontabilidad integer; declare variable referenciafactura varchar(255); declare variable razon varchar(255); @@ -4175,15 +4190,30 @@ declare variable orden integer; declare variable importetotal numeric(11,2); declare variable importeiva numeric(11,2); declare variable importere numeric(11,2); +declare variable idempresa integer; +declare variable idcontacto integer; begin /*BUSCAMOS LA FACTURA DE LA QUE COMPROBAR SI HACER ASIENTO*/ - SELECT FACTURAS_PROVEEDOR.IGNORAR_CONTABILIDAD, FACTURAS_PROVEEDOR.REFERENCIA, FACTURAS_PROVEEDOR.NOMBRE, FACTURAS_PROVEEDOR.FECHA_FACTURA, - FACTURAS_PROVEEDOR.BASE_IMPONIBLE, FACTURAS_PROVEEDOR.IMPORTE_IVA, FACTURAS_PROVEEDOR.IMPORTE_RE, FACTURAS_PROVEEDOR.IMPORTE_TOTAL, - CONT_SUBCUENTAS.ID, CONT_SUBCUENTAS.ID_EJERCICIO + SELECT FACTURAS_PROVEEDOR.ID_EMPRESA, FACTURAS_PROVEEDOR.IGNORAR_CONTABILIDAD, + FACTURAS_PROVEEDOR.REFERENCIA, FACTURAS_PROVEEDOR.ID_PROVEEDOR, FACTURAS_PROVEEDOR.NOMBRE, FACTURAS_PROVEEDOR.FECHA_FACTURA, + FACTURAS_PROVEEDOR.BASE_IMPONIBLE, FACTURAS_PROVEEDOR.IMPORTE_IVA, FACTURAS_PROVEEDOR.IMPORTE_RE, FACTURAS_PROVEEDOR.IMPORTE_TOTAL FROM FACTURAS_PROVEEDOR - LEFT JOIN CONT_SUBCUENTAS ON (CONT_SUBCUENTAS.ID_CONTACTO = FACTURAS_PROVEEDOR.ID_PROVEEDOR) - WHERE FACTURAS_PROVEEDOR.ID = :IDFACTURA INTO :IGNORARCONTABILIDAD, :REFERENCIAFACTURA, :RAZON, - :FECHAFACTURA, :BASEIMPONIBLE, :IMPORTEIVA, :IMPORTERE, :IMPORTETOTAL, :IDSUBCUENTA, :IDEJERCICIO; + WHERE FACTURAS_PROVEEDOR.ID = :IDFACTURA INTO :IDEMPRESA, :IGNORARCONTABILIDAD, :REFERENCIAFACTURA, + :IDCONTACTO, :RAZON, :FECHAFACTURA, :BASEIMPONIBLE, :IMPORTEIVA, :IMPORTERE, :IMPORTETOTAL; + + /*BUSCAMOS EL EJERCICIO ACTIVO PARA LA EMPRESA DE LA FACTURA*/ + SELECT ID + FROM CONT_EJERCICIOS + WHERE ID_EMPRESA = :IDEMPRESA + AND ACTIVO = 1 + INTO :IDEJERCICIO; + + /*BUSCAMOS LA SUBCUENTA DEL EJERCICIO ACTIVO DE LA EMPRESA DE LA FACTURA PARA EL CLIENTE DE LA FACTURA*/ + SELECT ID + FROM CONT_SUBCUENTAS + WHERE ID_CONTACTO = :IDCONTACTO + AND ID_EJERCICIO = :IDEJERCICIO + INTO :IDSUBCUENTA; SELECT ID FROM CONT_ASIENTOS WHERE ID_FACTURA = :IDFACTURA @@ -4301,9 +4331,9 @@ end ^ ALTER PROCEDURE PROC_NEW_ASIENTO_PAGO_CLI ( - IDPAGO INTEGER, - IDSUBCUENTAPAGO INTEGER) -AS + idpago integer, + idsubcuentapago integer) +as declare variable ignorarcontabilidad integer; declare variable referenciarecibo varchar(255); declare variable fechapago date; @@ -4315,19 +4345,34 @@ declare variable idejercicio integer; declare variable orden integer; declare variable debe numeric(11,2); declare variable haber numeric(11,2); +declare variable idempresa integer; +declare variable idcontacto integer; begin /*BUSCAMOS EL PAGO PARA COMPROBAR SI HACER ASIENTO*/ - SELECT PAGOS_CLIENTE.IGNORAR_CONTABILIDAD, + SELECT PAGOS_CLIENTE.IGNORAR_CONTABILIDAD, RECIBOS_CLIENTE.ID_EMPRESA, RECIBOS_CLIENTE.ID_CLIENTE, RECIBOS_CLIENTE.REFERENCIA || ': ' || RECIBOS_CLIENTE.NOMBRE, PAGOS_CLIENTE.FECHA_PAGO, PAGOS_CLIENTE.TIPO || ': ' || RECIBOS_CLIENTE.DESCRIPCION, - RECIBOS_CLIENTE.IMPORTE, CONT_SUBCUENTAS.ID, CONT_SUBCUENTAS.ID_EJERCICIO + RECIBOS_CLIENTE.IMPORTE FROM PAGOS_CLIENTE LEFT JOIN RECIBOS_CLIENTE ON (RECIBOS_CLIENTE.ID = PAGOS_CLIENTE.ID_RECIBO) -/* LEFT JOIN FACTURAS_CLIENTE ON (FACTURAS_CLIENTE.ID = RECIBOS_CLIENTE.ID_FACTURA) (ya no esta atado a las facturas)*/ - LEFT JOIN CONT_SUBCUENTAS ON (CONT_SUBCUENTAS.ID_CONTACTO = RECIBOS_CLIENTE.ID_CLIENTE) - WHERE PAGOS_CLIENTE.ID = :IDPAGO INTO :IGNORARCONTABILIDAD, :REFERENCIARECIBO, - :FECHAPAGO, :TIPOPAGO, :IMPORTE, :IDSUBCUENTA, :IDEJERCICIO; + WHERE PAGOS_CLIENTE.ID = :IDPAGO + INTO :IGNORARCONTABILIDAD, :IDEMPRESA, :IDCONTACTO, :REFERENCIARECIBO, :FECHAPAGO, :TIPOPAGO, :IMPORTE; + + /*BUSCAMOS EL EJERCICIO ACTIVO PARA LA EMPRESA DE LA FACTURA*/ + SELECT ID + FROM CONT_EJERCICIOS + WHERE ID_EMPRESA = :IDEMPRESA + AND ACTIVO = 1 + INTO :IDEJERCICIO; + + /*BUSCAMOS LA SUBCUENTA DEL EJERCICIO ACTIVO DE LA EMPRESA DE LA FACTURA PARA EL CLIENTE DE LA FACTURA*/ + SELECT ID + FROM CONT_SUBCUENTAS + WHERE ID_CONTACTO = :IDCONTACTO + AND ID_EJERCICIO = :IDEJERCICIO + INTO :IDSUBCUENTA; + SELECT ID FROM CONT_ASIENTOS WHERE ID_PAGO = :IDPAGO @@ -4391,9 +4436,9 @@ end ^ ALTER PROCEDURE PROC_NEW_ASIENTO_PAGO_PROV ( - IDPAGO INTEGER, - IDSUBCUENTAPAGO INTEGER) -AS + idpago integer, + idsubcuentapago integer) +as declare variable ignorarcontabilidad integer; declare variable referenciarecibo varchar(255); declare variable fechapago date; @@ -4405,19 +4450,33 @@ declare variable idejercicio integer; declare variable orden integer; declare variable debe numeric(11,2); declare variable haber numeric(11,2); +declare variable idempresa integer; +declare variable idcontacto integer; begin /*BUSCAMOS EL PAGO PARA COMPROBAR SI HACER ASIENTO*/ - SELECT PAGOS_PROVEEDOR.IGNORAR_CONTABILIDAD, + SELECT PAGOS_PROVEEDOR.IGNORAR_CONTABILIDAD, RECIBOS_PROVEEDOR.ID_EMPRESA, RECIBOS_PROVEEDOR.ID_PROVEEDOR, RECIBOS_PROVEEDOR.REFERENCIA || ': ' || RECIBOS_PROVEEDOR.NOMBRE, PAGOS_PROVEEDOR.FECHA_PAGO, PAGOS_PROVEEDOR.TIPO || ': ' || RECIBOS_PROVEEDOR.DESCRIPCION, - RECIBOS_PROVEEDOR.IMPORTE, CONT_SUBCUENTAS.ID, CONT_SUBCUENTAS.ID_EJERCICIO + RECIBOS_PROVEEDOR.IMPORTE FROM PAGOS_PROVEEDOR LEFT JOIN RECIBOS_PROVEEDOR ON (RECIBOS_PROVEEDOR.ID = PAGOS_PROVEEDOR.ID_RECIBO) -/* LEFT JOIN FACTURAS_PROVEEDOR ON (FACTURAS_PROVEEDOR.ID = RECIBOS_PROVEEDOR.ID_FACTURA) (ya no esta atado a las facturas)*/ - LEFT JOIN CONT_SUBCUENTAS ON (CONT_SUBCUENTAS.ID_CONTACTO = RECIBOS_PROVEEDOR.ID_PROVEEDOR) - WHERE PAGOS_PROVEEDOR.ID = :IDPAGO INTO :IGNORARCONTABILIDAD, :REFERENCIARECIBO, - :FECHAPAGO, :TIPOPAGO, :IMPORTE, :IDSUBCUENTA, :IDEJERCICIO; + WHERE PAGOS_PROVEEDOR.ID = :IDPAGO + INTO :IGNORARCONTABILIDAD, :IDEMPRESA, :IDCONTACTO, :REFERENCIARECIBO, :FECHAPAGO, :TIPOPAGO, :IMPORTE; + + /*BUSCAMOS EL EJERCICIO ACTIVO PARA LA EMPRESA DE LA FACTURA*/ + SELECT ID + FROM CONT_EJERCICIOS + WHERE ID_EMPRESA = :IDEMPRESA + AND ACTIVO = 1 + INTO :IDEJERCICIO; + + /*BUSCAMOS LA SUBCUENTA DEL EJERCICIO ACTIVO DE LA EMPRESA DE LA FACTURA PARA EL CLIENTE DE LA FACTURA*/ + SELECT ID + FROM CONT_SUBCUENTAS + WHERE ID_CONTACTO = :IDCONTACTO + AND ID_EJERCICIO = :IDEJERCICIO + INTO :IDSUBCUENTA; SELECT ID FROM CONT_ASIENTOS WHERE ID_PAGO = :IDPAGO diff --git a/Source/Modulos/Contactos/Contactos_Group.groupproj b/Source/Modulos/Contactos/Contactos_Group.groupproj index 8f0342d3..bbd5a85d 100644 --- a/Source/Modulos/Contactos/Contactos_Group.groupproj +++ b/Source/Modulos/Contactos/Contactos_Group.groupproj @@ -13,6 +13,7 @@ + @@ -151,14 +152,23 @@ + + + + + + + + + - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Contactos/Controller/uClientesController.pas b/Source/Modulos/Contactos/Controller/uClientesController.pas index d64dfbd5..9dc1494f 100644 --- a/Source/Modulos/Contactos/Controller/uClientesController.pas +++ b/Source/Modulos/Contactos/Controller/uClientesController.pas @@ -25,6 +25,8 @@ type protected FDireccionesController : IDireccionesContactoController; function ValidarContacto(AContacto: IBizContacto): Boolean; override; + procedure FiltrarEjercicio(AContacto : IBizContacto); virtual; + public constructor Create; override; destructor Destroy; override; @@ -54,7 +56,7 @@ implementation uses Forms, Classes, Windows, SysUtils, Controls, cxControls, uDialogUtils, uDataModuleClientes, uEditorRegistryUtils, uDataTableUtils, uDADataTable, DB, schContactosClient_Intf, uEtiquetasContactosReportController, - uIEditorElegirClientes, uEditorGridBase, + uIEditorElegirClientes, uEditorGridBase, uDAInterfaces, uFactuGES_App, Dialogs; { TClientesController } @@ -63,18 +65,21 @@ function TClientesController.Buscar(const ID: Integer): IBizContacto; begin Result := (FDataModule as IDataModuleClientes).GetItem(ID); FiltrarEmpresa(Result); + FiltrarEjercicio(Result); end; function TClientesController.BuscarTodos: IBizContacto; begin Result := (FDataModule as IDataModuleClientes).GetItems; FiltrarEmpresa(Result); + FiltrarEjercicio(Result); end; function TClientesController.BuscarTodosTiendaWeb: IBizCliente; begin Result := (FDataModule as IDataModuleClientes).GetItemsTiendaWeb; FiltrarEmpresa(Result); + FiltrarEjercicio(Result); end; constructor TClientesController.Create; @@ -184,6 +189,31 @@ begin Result := True; end; +procedure TClientesController.FiltrarEjercicio(AContacto: IBizContacto); +var + Condicion: TDAWhereExpression; + +begin + if Assigned(AContacto) + and Assigned((AContacto as IBizCliente).SubCuentas) then + begin + if (AContacto as IBizCliente).SubCuentas.DataTable.Active then + (AContacto as IBizCliente).SubCuentas.DataTable.Active := False; + + // Filtrar los presupuestos actuales por empresa + with (AContacto as IBizCliente).SubCuentas.DataTable.DynamicWhere do + begin + // (ID_EMPRESA >= ID) + Condicion := NewBinaryExpression(NewField('', fld_SubCuentasContactoID_EJERCICIO), NewConstant(AppFactuGES.EjercicioActivo.ID, datInteger), dboEqual); + + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + end; +end; + function TClientesController.Guardar(AContacto: IBizContacto): Boolean; begin Result := inherited Guardar(AContacto); @@ -196,6 +226,7 @@ var begin AContacto := (FDataModule as IDataModuleClientes).NewItem; FiltrarEmpresa(AContacto); + FiltrarEjercicio(Result); AContacto.DataTable.Active := True; AContacto.Insert; Result := AContacto; diff --git a/Source/Modulos/Contactos/Controller/uContactosController.pas b/Source/Modulos/Contactos/Controller/uContactosController.pas index fcdcaa4c..288f9578 100644 --- a/Source/Modulos/Contactos/Controller/uContactosController.pas +++ b/Source/Modulos/Contactos/Controller/uContactosController.pas @@ -68,7 +68,7 @@ type function ElegirDireccion(AContacto: IBizContacto; AMensaje: String): IBizDireccionesContacto; function ElegirPersonaContacto(APersonal: IBizContactoPersonal; AMensaje: String): IBizContactoPersonal; - function DarDireccionSocial(AContacto : IBizContacto): IBizDireccionesContacto; + function DarDireccionSocial(AContacto : IBizContacto): IBizDireccionesContacto; end; implementation diff --git a/Source/Modulos/Contactos/Controller/uProveedoresController.pas b/Source/Modulos/Contactos/Controller/uProveedoresController.pas index 5ee35e44..4e379a67 100644 --- a/Source/Modulos/Contactos/Controller/uProveedoresController.pas +++ b/Source/Modulos/Contactos/Controller/uProveedoresController.pas @@ -23,6 +23,7 @@ type protected FDireccionesController : IDireccionesContactoController; function ValidarContacto(AContacto: IBizContacto): Boolean; override; + procedure FiltrarEjercicio(AContacto : IBizContacto); virtual; public constructor Create; override; destructor Destroy; override; @@ -49,7 +50,8 @@ implementation uses Classes, SysUtils, cxControls, Dialogs, uDataModuleProveedores, uEditorRegistryUtils, uDataTableUtils, uDADataTable, DB, schContactosClient_Intf, uEtiquetasContactosReportController, - uIEditorElegirProveedores, Controls, uEditorGridBase, JSDialogs, JSDialog, Windows; + uIEditorElegirProveedores, Controls, uEditorGridBase, JSDialogs, JSDialog, + uDAInterfaces, uFactuGES_App, Windows; { TProveedoresController } @@ -57,18 +59,21 @@ function TProveedoresController.Buscar(const ID: Integer): IBizContacto; begin Result := (FDataModule as IDataModuleProveedores).GetItem(ID); FiltrarEmpresa(Result); + FiltrarEjercicio(Result); end; function TProveedoresController.BuscarTodos: IBizContacto; begin Result := (FDataModule as IDataModuleProveedores).GetItems; FiltrarEmpresa(Result); + FiltrarEjercicio(Result); end; function TProveedoresController.BuscarTodosTiendaWeb: IBizProveedor; begin Result := (FDataModule as IDataModuleProveedores).GetItemsTiendaWeb; FiltrarEmpresa(Result); + FiltrarEjercicio(Result); end; constructor TProveedoresController.Create; @@ -170,6 +175,31 @@ begin Result := True; end; +procedure TProveedoresController.FiltrarEjercicio(AContacto: IBizContacto); +var + Condicion: TDAWhereExpression; + +begin + if Assigned(AContacto) + and Assigned((AContacto as IBizProveedor).SubCuentas) then + begin + if (AContacto as IBizProveedor).SubCuentas.DataTable.Active then + (AContacto as IBizProveedor).SubCuentas.DataTable.Active := False; + + // Filtrar los presupuestos actuales por empresa + with (AContacto as IBizProveedor).SubCuentas.DataTable.DynamicWhere do + begin + // (ID_EMPRESA >= ID) + Condicion := NewBinaryExpression(NewField('', fld_SubCuentasContactoID_EJERCICIO), NewConstant(AppFactuGES.EjercicioActivo.ID, datInteger), dboEqual); + + if IsEmpty then + Expression := Condicion + else + Expression := NewBinaryExpression(Expression, Condicion, dboAnd); + end; + end; +end; + function TProveedoresController.Guardar(AContacto: IBizContacto): Boolean; begin Result := inherited Guardar(AContacto); @@ -181,7 +211,8 @@ var AContacto : IBizProveedor; begin AContacto := (FDataModule as IDataModuleProveedores).NewItem; - FiltrarEmpresa(AContacto); + FiltrarEmpresa(AContacto); + FiltrarEjercicio(Result); AContacto.DataTable.Active := True; AContacto.Insert; Result := AContacto; diff --git a/Source/Modulos/Contactos/Model/uBizClientesServer.pas b/Source/Modulos/Contactos/Model/uBizClientesServer.pas index 98362938..49a2cdb5 100644 --- a/Source/Modulos/Contactos/Model/uBizClientesServer.pas +++ b/Source/Modulos/Contactos/Model/uBizClientesServer.pas @@ -59,22 +59,45 @@ var Intf : IInterface; AClientID : TGUID; + ASchema : TDASchema; + ACurrentConn : IDAConnection; + dsData: IDADataset; + i: Integer; + ANombre: string; - AIDEmpresa: Integer; AIDCliente: Integer; AIDTienda: Integer; + begin AIDCliente := aChange.NewValueByName[fld_ClientesID]; AIDTienda := aChange.NewValueByName[fld_ClientesID_TIENDA]; - AIDEmpresa := aChange.NewValueByName[fld_ClientesID_EMPRESA]; ANombre := aChange.NewValueByName[fld_ClientesNOMBRE]; CreateGUID(AClientID); GetClassFactory('srvContabilidad').CreateInstance(AClientID, Intf); AContabilidadService := Intf as IsrvContabilidad; - if not AContabilidadService.TieneCuentaAsociada(AIDCliente, AIDEmpresa) then - AContabilidadService.AnadirSubCuentaCliente(AIDCliente, AIDTienda, AIDEmpresa, ANombre); + ASchema := BusinessProcessor.Schema; + ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor); + + try + dsData := ASchema.NewDataset(ACurrentConn, 'DarEmpresasContacto', ['ID_CONTACTO'], [AIDCliente]); + dsData.Active := True; + + if not AContabilidadService.TieneCuentaAsociada(AIDCliente, dsData.FieldValues[0]) then + begin + //Por cada ino de las empresas que tiene asociadas el contacto se añade una subcuenta en su ejercicio activo + while not dsData.EOF do + begin + AContabilidadService.AnadirSubCuentaCliente(AIDCliente, AIDTienda, dsData.FieldValues[0], ANombre); + dsData.Next; + end; + end; + + finally + dsData := NIL; + ACurrentConn := NIL; + end; end; procedure TBizClienteServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); diff --git a/Source/Modulos/Contactos/Model/uBizProveedoresServer.pas b/Source/Modulos/Contactos/Model/uBizProveedoresServer.pas index a5a34998..c33bae6e 100644 --- a/Source/Modulos/Contactos/Model/uBizProveedoresServer.pas +++ b/Source/Modulos/Contactos/Model/uBizProveedoresServer.pas @@ -58,7 +58,11 @@ var AIDProveedor: Integer; bEsAcreedor: Integer; ANombre: string; - AIDEmpresa: Integer; + + ASchema : TDASchema; + ACurrentConn : IDAConnection; + dsData: IDADataset; + i: Integer; Intf: IInterface; AContabilidadService: IsrvContabilidad; @@ -66,15 +70,33 @@ var begin AIDProveedor := aChange.NewValueByName[fld_ProveedoresID]; bEsAcreedor := aChange.NewValueByName[fld_ProveedoresES_ACREEDOR]; - AIDEmpresa := aChange.NewValueByName[fld_ProveedoresID_EMPRESA]; ANombre := aChange.NewValueByName[fld_ProveedoresNOMBRE]; CreateGUID(AClientID); GetClassFactory('srvContabilidad').CreateInstance(AClientID, Intf); AContabilidadService := Intf as IsrvContabilidad; - if not AContabilidadService.TieneCuentaAsociada(AIDProveedor, AIDEmpresa) then - AContabilidadService.AnadirSubCuentaProveedor(AIDProveedor, bEsAcreedor, AIDEmpresa, ANombre); + ASchema := BusinessProcessor.Schema; + ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor); + + try + dsData := ASchema.NewDataset(ACurrentConn, 'DarEmpresasContacto', ['ID_CONTACTO'], [AIDProveedor]); + dsData.Active := True; + + if not AContabilidadService.TieneCuentaAsociada(AIDProveedor, dsData.FieldValues[0]) then + begin + //Por cada ino de las empresas que tiene asociadas el contacto se añade una subcuenta en su ejercicio activo + while not dsData.EOF do + begin + AContabilidadService.AnadirSubCuentaProveedor(AIDProveedor, bEsAcreedor, dsData.FieldValues[0], ANombre); + dsData.Next; + end; + end; + + finally + dsData := NIL; + ACurrentConn := NIL; + end; end; diff --git a/Source/Modulos/Contactos/Servidor/srvContactos_Impl.dfm b/Source/Modulos/Contactos/Servidor/srvContactos_Impl.dfm index 71c083a2..ab697c7d 100644 --- a/Source/Modulos/Contactos/Servidor/srvContactos_Impl.dfm +++ b/Source/Modulos/Contactos/Servidor/srvContactos_Impl.dfm @@ -14,6 +14,36 @@ object srvContactos: TsrvContactos DataDictionary = DataDictionary Diagrams = Diagrams Datasets = < + item + Params = < + item + Name = 'ID_CONTACTO' + Value = '' + ParamType = daptInput + end> + Statements = < + item + Connection = 'IBX' + ConnectionType = 'Interbase' + Default = True + Name = 'IBX' + SQL = + 'select ID_EMPRESA'#10'from empresas_contactos'#10'where ID_CONTACTO = :I' + + 'D_CONTACTO'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ID_EMPRESA' + TableField = 'ID_EMPRESA' + end> + end> + Name = 'DarEmpresasContacto' + Fields = < + item + Name = 'ID_EMPRESA' + DataType = datInteger + end> + end item Params = <> Statements = < diff --git a/Source/Modulos/Contactos/Servidor/srvContactos_Impl.pas b/Source/Modulos/Contactos/Servidor/srvContactos_Impl.pas index 6fb56bbc..7128d2ac 100644 --- a/Source/Modulos/Contactos/Servidor/srvContactos_Impl.pas +++ b/Source/Modulos/Contactos/Servidor/srvContactos_Impl.pas @@ -16,8 +16,7 @@ uses {Ancestor Implementation:} DataAbstractService_Impl, {Used RODLs:} DataAbstract4_Intf, {Generated:} uDABusinessProcessor, uDABin2DataStreamer, uDADataStreamer, - uDAScriptingProvider, uDAClasses, - FactuGES_Intf, uDAInterfaces; + uDAScriptingProvider, uDAClasses, FactuGES_Intf, uDAInterfaces; type { TsrvContactos } diff --git a/Source/Modulos/Contactos/Views/uEditorCliente.dfm b/Source/Modulos/Contactos/Views/uEditorCliente.dfm index 19ee00cc..b7e9cb09 100644 --- a/Source/Modulos/Contactos/Views/uEditorCliente.dfm +++ b/Source/Modulos/Contactos/Views/uEditorCliente.dfm @@ -65,7 +65,7 @@ inherited fEditorCliente: TfEditorCliente inherited pgPaginas: TPageControl Width = 890 Height = 544 - ActivePage = pagDatosComerciales + ActivePage = pagContabilidad ExplicitWidth = 890 ExplicitHeight = 544 inherited pagGeneral: TTabSheet @@ -487,8 +487,22 @@ inherited fEditorCliente: TfEditorCliente ExplicitWidth = 882 ExplicitHeight = 193 inherited Label1: TLabel + Left = 575 + Top = 30 + Width = 277 + ExplicitLeft = 575 + ExplicitTop = 30 + ExplicitWidth = 277 end inherited eDiasVencimiento: TcxDBSpinEdit + Left = 647 + Top = 62 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitLeft = 647 + ExplicitTop = 62 end inherited cbRegimenIVA: TcxDBComboBox Top = 30 @@ -542,6 +556,26 @@ inherited fEditorCliente: TfEditorCliente ExplicitLeft = 415 ExplicitTop = 84 end + inherited cxDBSpinEdit1: TcxDBSpinEdit + Left = 647 + Top = 89 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitLeft = 647 + ExplicitTop = 89 + end + inherited cxDBSpinEdit2: TcxDBSpinEdit + Left = 647 + Top = 116 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' + ExplicitLeft = 647 + ExplicitTop = 116 + end inherited dxLayoutGroup1: TdxLayoutGroup inherited dxLayoutControl1Group5: TdxLayoutGroup inherited dxLayoutControl1Item2: TdxLayoutItem @@ -707,6 +741,19 @@ inherited fEditorCliente: TfEditorCliente end end end + object DBGrid1: TDBGrid + Left = 93 + Top = 192 + Width = 786 + Height = 120 + DataSource = frViewSubCuentaContacto1.DADataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'Tahoma' + TitleFont.Style = [] + end end end inherited StatusBar: TJvStatusBar diff --git a/Source/Modulos/Contactos/Views/uEditorCliente.pas b/Source/Modulos/Contactos/Views/uEditorCliente.pas index afc5677f..bee26340 100644 --- a/Source/Modulos/Contactos/Views/uEditorCliente.pas +++ b/Source/Modulos/Contactos/Views/uEditorCliente.pas @@ -15,7 +15,7 @@ uses uViewDireccionesEntrega, uViewDetallesGenerico, uViewClienteDescuentos, uViewContactoDatosBancarios, dxLayoutLookAndFeels, uViewClienteDatosComerciales, uDAInterfaces, uViewSubCuentaContacto, - uViewPersonalContacto; + uViewPersonalContacto, Grids, DBGrids; type TfEditorCliente = class(TfEditorContacto, IEditorCliente) @@ -30,6 +30,7 @@ type frViewClienteDatosComerciales1: TfrViewClienteDatosComerciales; pagContabilidad: TTabSheet; frViewSubCuentaContacto1: TfrViewSubCuentaContacto; + DBGrid1: TDBGrid; procedure FormShow(Sender: TObject); procedure actGruposClienteExecute(Sender: TObject); protected diff --git a/Source/Modulos/Contactos/Views/uEditorContacto.dfm b/Source/Modulos/Contactos/Views/uEditorContacto.dfm index 10bbe151..eeb38232 100644 --- a/Source/Modulos/Contactos/Views/uEditorContacto.dfm +++ b/Source/Modulos/Contactos/Views/uEditorContacto.dfm @@ -7,6 +7,7 @@ inherited fEditorContacto: TfEditorContacto ClientWidth = 632 Scaled = False ExplicitWidth = 640 + ExplicitHeight = 240 PixelsPerInch = 96 TextHeight = 13 inherited JvNavPanelHeader: TJvNavPanelHeader @@ -178,13 +179,29 @@ inherited fEditorContacto: TfEditorContacto ParentFont = False TabOrder = 0 ReadOnly = False - ExplicitTop = -134 + ExplicitWidth = 618 + ExplicitHeight = 330 inherited cxGrid: TcxGrid Width = 618 Height = 305 + ExplicitWidth = 618 + ExplicitHeight = 305 end inherited ToolBar1: TToolBar Width = 618 + ExplicitWidth = 618 + inherited ToolButton1: TToolButton + ExplicitWidth = 113 + end + inherited ToolButton4: TToolButton + ExplicitWidth = 113 + end + inherited ToolButton2: TToolButton + ExplicitWidth = 113 + end + inherited ToolButton7: TToolButton + ExplicitWidth = 113 + end end end end diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm index 0e755ca2..bf6bf4c1 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm @@ -136,6 +136,10 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente ExplicitWidth = 78 Width = 78 end + inherited bFormasPago: TButton + Left = 289 + ExplicitLeft = 289 + end inherited frViewTienda1: TfrViewTienda inherited dxLayoutControl1: TdxLayoutControl inherited cbTienda: TcxComboBox @@ -149,7 +153,9 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente end end inherited frViewClienteFactura1: TfrViewClienteFactura + Left = 449 Width = 398 + ExplicitLeft = 449 ExplicitWidth = 398 inherited dxLayoutControl1: TdxLayoutControl Width = 398 @@ -198,16 +204,16 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 276 end inherited edtCodigoPostal: TcxDBTextEdit - Left = 259 + Left = 283 Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitLeft = 259 + ExplicitLeft = 283 end inherited Button3: TBitBtn - Left = 149 - ExplicitLeft = 149 + Left = 173 + ExplicitLeft = 173 end inherited cxDBTextEdit1: TcxDBTextEdit Style.LookAndFeel.SkinName = '' @@ -224,6 +230,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' + ExplicitWidth = 310 + Width = 310 end end end @@ -278,57 +286,57 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente ExplicitWidth = 57 end inherited UpDown1: TUpDown - Left = 570 + Left = 586 Top = 0 - ExplicitLeft = 570 + ExplicitLeft = 586 ExplicitTop = 0 end inherited ToolButton13: TToolButton - Left = 587 + Left = 603 Top = 0 - ExplicitLeft = 587 + ExplicitLeft = 603 ExplicitTop = 0 end inherited ToolButton6: TToolButton - Left = 595 + Left = 611 Top = 0 - ExplicitLeft = 595 + ExplicitLeft = 611 ExplicitTop = 0 end inherited ToolButton7: TToolButton - Left = 629 + Left = 645 Top = 0 - ExplicitLeft = 629 + ExplicitLeft = 645 ExplicitTop = 0 end inherited ToolButton8: TToolButton - Left = 663 + Left = 679 Top = 0 - ExplicitLeft = 663 + ExplicitLeft = 679 ExplicitTop = 0 end inherited ToolButton12: TToolButton - Left = 697 + Left = 713 Top = 0 - ExplicitLeft = 697 + ExplicitLeft = 713 ExplicitTop = 0 end inherited ToolButton9: TToolButton - Left = 705 + Left = 721 Top = 0 - ExplicitLeft = 705 + ExplicitLeft = 721 ExplicitTop = 0 end inherited ToolButton10: TToolButton - Left = 739 + Left = 755 Top = 0 - ExplicitLeft = 739 + ExplicitLeft = 755 ExplicitTop = 0 end inherited ToolButton11: TToolButton - Left = 773 + Left = 789 Top = 0 - ExplicitLeft = 773 + ExplicitLeft = 789 ExplicitTop = 0 end end @@ -433,12 +441,6 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 860 LookAndFeel = frViewFacturaCliente1.dxLayoutOfficeLookAndFeel1 ExplicitWidth = 860 - inherited Bevel1: TBevel - Top = 111 - Width = 73 - ExplicitTop = 111 - ExplicitWidth = 73 - end inherited Bevel3: TBevel Left = 457 Top = 30 @@ -449,69 +451,69 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente end inherited Bevel4: TBevel Left = 569 - Top = 111 + Top = 72 Width = 186 ExplicitLeft = 569 - ExplicitTop = 111 + ExplicitTop = 72 ExplicitWidth = 186 end inherited ImporteDto: TcxDBCurrencyEdit - Top = 131 + Top = 57 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitTop = 131 + ExplicitTop = 57 ExplicitWidth = 220 Width = 220 end inherited ImporteIVA: TcxDBCurrencyEdit Left = 640 - Top = 57 + Top = 107 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 640 - ExplicitTop = 57 + ExplicitTop = 107 ExplicitWidth = 155 Width = 155 end inherited ImporteTotal: TcxDBCurrencyEdit Left = 570 - Top = 131 + Top = 161 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 570 - ExplicitTop = 131 + ExplicitTop = 161 ExplicitWidth = 225 Width = 225 end inherited edtDescuento: TcxDBSpinEdit - Top = 131 + Top = 57 Properties.OnValidate = frViewTotales1edtDescuentoPropertiesValidate Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitTop = 131 + ExplicitTop = 57 end inherited edtIVA: TcxDBSpinEdit Left = 569 - Top = 57 + Top = 107 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 569 - ExplicitTop = 57 + ExplicitTop = 107 end inherited ImporteBase: TcxDBCurrencyEdit Left = 569 @@ -528,7 +530,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente end inherited edtRE: TcxDBSpinEdit Left = 569 - Top = 84 + Top = 134 Properties.AssignedValues.MinValue = True Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True @@ -536,18 +538,18 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 569 - ExplicitTop = 84 + ExplicitTop = 134 end inherited ImporteRE: TcxDBCurrencyEdit Left = 640 - Top = 84 + Top = 134 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 640 - ExplicitTop = 84 + ExplicitTop = 134 ExplicitWidth = 155 Width = 155 end @@ -563,7 +565,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Width = 291 end inherited ePorte: TcxDBCurrencyEdit - Top = 158 + Top = 84 DataBinding.DataSource = dsDataTable Properties.OnValidate = frViewTotales1ePortePropertiesValidate Style.LookAndFeel.SkinName = '' @@ -572,47 +574,42 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' OnEditing = frViewTotales1ePorteEditing - ExplicitTop = 158 + ExplicitTop = 84 ExplicitWidth = 291 Width = 291 end inherited eIVA: TcxDBLookupComboBox - Top = 57 + Top = 111 Properties.OnValidate = frViewTotales1eIVAPropertiesValidate Style.Color = clInfoBk Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitTop = 57 + ExplicitTop = 111 ExplicitWidth = 153 Width = 153 end inherited bTiposIVA: TButton Left = 309 - Top = 57 + Top = 111 OnClick = frViewTotales1bTiposIVAClick ExplicitLeft = 309 - ExplicitTop = 57 + ExplicitTop = 111 end inherited cbRecargoEquivalencia: TcxDBCheckBox - Top = 84 + Top = 138 Properties.OnEditValueChanged = frViewTotales1cbRecargoEquivalenciaPropertiesEditValueChanged Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitTop = 84 + ExplicitTop = 138 ExplicitWidth = 291 Width = 291 end inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group1: TdxLayoutGroup - inherited dxLayoutControl1Group2: TdxLayoutGroup - inherited dxLayoutControl1Item10: TdxLayoutItem - Visible = False - end - end inherited dxLayoutControl1Group5: TdxLayoutGroup inherited dxLayoutControl1Group3: TdxLayoutGroup inherited dxLayoutControl1Group8: TdxLayoutGroup diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas index 9c1669ca..fc4e1f4e 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.pas @@ -324,12 +324,14 @@ begin if not (FFactura.DataTable.State in dsEditModes) then FFactura.DataTable.Edit; + //En el caso de Acana no se cambia para que el IVA y la FORMA DE PAGO por defecto sea el de la empresa. // Actualizar IVA y RE a partir del tipo de IVA del cliente. - Factura.IVA := FTiposIVA.IVA; //((frViewTotales1.dsTiposIVA.DataTable) as IBizTipoIVA).IVA; +{ Factura.IVA := FTiposIVA.IVA; //((frViewTotales1.dsTiposIVA.DataTable) as IBizTipoIVA).IVA; if FFactura.Cliente.RECARGO_EQUIVALENCIA = 1 then Factura.RE := FTiposIVA.RE else Factura.RE := 0; +} // En el caso de tener direcciones asociadas, se debe dar la posibilidad de elegir la dirección principal o las secundarias para la factura AClientesController := TClientesController.Create; diff --git a/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.dfm b/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.dfm index af0c3344..d7639e40 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.dfm +++ b/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.dfm @@ -71,7 +71,6 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor inherited pgPaginas: TPageControl Width = 740 Height = 342 - ActivePage = pagContabilidad OnChanging = pgPaginasChanging ExplicitLeft = 3 ExplicitTop = 79 @@ -434,12 +433,6 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor inherited dxLayoutControl1: TdxLayoutControl Width = 746 ExplicitWidth = 746 - inherited Bevel1: TBevel - Top = 111 - Width = 73 - ExplicitTop = 111 - ExplicitWidth = 73 - end inherited Bevel3: TBevel Left = 398 Top = 30 @@ -450,69 +443,69 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor end inherited Bevel4: TBevel Left = 510 - Top = 111 + Top = 72 Width = 186 ExplicitLeft = 510 - ExplicitTop = 111 + ExplicitTop = 72 ExplicitWidth = 186 end inherited ImporteDto: TcxDBCurrencyEdit - Top = 131 + Top = 57 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitTop = 131 + ExplicitTop = 57 ExplicitWidth = 207 Width = 207 end inherited ImporteIVA: TcxDBCurrencyEdit Left = 581 - Top = 57 + Top = 107 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 581 - ExplicitTop = 57 + ExplicitTop = 107 ExplicitWidth = 143 Width = 143 end inherited ImporteTotal: TcxDBCurrencyEdit Left = 511 - Top = 131 + Top = 161 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 511 - ExplicitTop = 131 + ExplicitTop = 161 ExplicitWidth = 213 Width = 213 end inherited edtDescuento: TcxDBSpinEdit - Top = 131 + Top = 57 Properties.OnValidate = frViewTotales1edtDescuentoPropertiesValidate Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitTop = 131 + ExplicitTop = 57 end inherited edtIVA: TcxDBSpinEdit Left = 510 - Top = 57 + Top = 107 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 510 - ExplicitTop = 57 + ExplicitTop = 107 end inherited ImporteBase: TcxDBCurrencyEdit Left = 510 @@ -529,7 +522,7 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor end inherited edtRE: TcxDBSpinEdit Left = 510 - Top = 84 + Top = 134 Properties.AssignedValues.MinValue = True Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True @@ -537,18 +530,18 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 510 - ExplicitTop = 84 + ExplicitTop = 134 end inherited ImporteRE: TcxDBCurrencyEdit Left = 581 - Top = 84 + Top = 134 Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 581 - ExplicitTop = 84 + ExplicitTop = 134 ExplicitWidth = 143 Width = 143 end @@ -564,7 +557,7 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor Width = 278 end inherited ePorte: TcxDBCurrencyEdit - Top = 158 + Top = 84 DataBinding.DataSource = dsDataTable Properties.OnValidate = frViewTotales1ePortePropertiesValidate Style.LookAndFeel.SkinName = '' @@ -573,37 +566,37 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' OnEditing = frViewTotales1ePorteEditing - ExplicitTop = 158 + ExplicitTop = 84 ExplicitWidth = 278 Width = 278 end inherited eIVA: TcxDBLookupComboBox - Top = 57 + Top = 111 Properties.OnValidate = frViewTotales1eIVAPropertiesValidate Style.Color = clInfoBk Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitTop = 57 + ExplicitTop = 111 ExplicitWidth = 140 Width = 140 end inherited bTiposIVA: TButton Left = 250 - Top = 57 + Top = 111 OnClick = frViewTotales1bTiposIVAClick ExplicitLeft = 250 - ExplicitTop = 57 + ExplicitTop = 111 end inherited cbRecargoEquivalencia: TcxDBCheckBox - Top = 84 + Top = 138 Properties.OnEditValueChanged = frViewTotales1cbRecargoEquivalenciaPropertiesEditValueChanged Style.LookAndFeel.SkinName = '' StyleDisabled.LookAndFeel.SkinName = '' StyleFocused.LookAndFeel.SkinName = '' StyleHot.LookAndFeel.SkinName = '' - ExplicitTop = 84 + ExplicitTop = 138 ExplicitWidth = 278 Width = 278 end @@ -611,16 +604,15 @@ inherited fEditorFacturaProveedor: TfEditorFacturaProveedor LookAndFeel = frViewFacturaProveedor1.dxLayoutOfficeLookAndFeel1 inherited dxLayoutControl1Group1: TdxLayoutGroup inherited dxLayoutControl1Group2: TdxLayoutGroup - inherited dxLayoutControl1Item10: TdxLayoutItem - Visible = False - end inherited dxLayoutControl1Group7: TdxLayoutGroup Visible = False - inherited dxLayoutControl1Item4: TdxLayoutItem - Visible = False - end - inherited dxLayoutControl1Item1: TdxLayoutItem - Visible = False + inherited dxLayoutControl1Group10: TdxLayoutGroup + inherited dxLayoutControl1Item4: TdxLayoutItem + Visible = False + end + inherited dxLayoutControl1Item1: TdxLayoutItem + Visible = False + end end end end diff --git a/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.pas b/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.pas index 57bec0ae..d21b4586 100644 --- a/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.pas +++ b/Source/Modulos/Facturas de proveedor/Views/uEditorFacturaProveedor.pas @@ -302,13 +302,14 @@ begin if not (FFactura.DataTable.State in dsEditModes) then FFactura.DataTable.Edit; + //En el caso de Acana no se cambia para que el IVA y la FORMA DE PAGO por defecto sea el de la empresa. // Actualizar IVA y RE a partir del tipo de IVA del proveedor. - Factura.IVA := FTiposIVA.IVA; //((frViewTotales1.dsTiposIVA.DataTable) as IBizTipoIVA).IVA; +{ Factura.IVA := FTiposIVA.IVA; //((frViewTotales1.dsTiposIVA.DataTable) as IBizTipoIVA).IVA; // if FFactura.Proveedor.RECARGO_EQUIVALENCIA = 1 then // Factura.RE := ((frViewTotales1.dsTiposIVA.DataTable) as IBizTipoIVA).RE // else // Factura.RE := 0; - +} // En el caso de tener direcciones asociadas, se debe dar la posibilidad de elegir la dirección principal o las secundarias para la factura AProveedoresController := TProveedoresController.Create; try diff --git a/Source/Servidor/FactuGES_Server.RES b/Source/Servidor/FactuGES_Server.RES index 14c2db77..7136cdcd 100644 Binary files a/Source/Servidor/FactuGES_Server.RES and b/Source/Servidor/FactuGES_Server.RES differ diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index 74706098..90c0912e 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -16,7 +16,7 @@ BEGIN VALUE "FileVersion", "2.2.8.0\0" VALUE "ProductName", "FactuGES (Servidor)\0" VALUE "ProductVersion", "2.2.8.0\0" - VALUE "CompileDate", "martes, 03 de febrero de 2009 20:01\0" + VALUE "CompileDate", "viernes, 06 de febrero de 2009 12:01\0" END END BLOCK "VarFileInfo"