diff --git a/Source/Modulos/Recibos de proveedor/Controller/uPagosProveedorController.pas b/Source/Modulos/Recibos de proveedor/Controller/uPagosProveedorController.pas index db232352..e36fc5bc 100644 --- a/Source/Modulos/Recibos de proveedor/Controller/uPagosProveedorController.pas +++ b/Source/Modulos/Recibos de proveedor/Controller/uPagosProveedorController.pas @@ -32,8 +32,8 @@ uses type IPagosProveedorController = interface(ISujeto) ['{4F907D80-B184-4557-BAB7-9FDA23260E64}'] - function Anadir(APagosProveedor: IBizPagosProveedor; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0): Boolean; - procedure Modificar(APagosProveedor: IBizPagosProveedor; Const Fecha: String; Const IgnorarContabilidad: Integer; Const IdSubCuenta: Integer); + function Anadir(APagosProveedor: IBizPagosProveedor; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0; Const SubCuenta: String = ''): Boolean; + procedure Modificar(APagosProveedor: IBizPagosProveedor; Const Fecha: String; Const IgnorarContabilidad: Integer; Const IdSubCuenta: Integer; Const SubCuenta: String = ''); function Eliminar(APagoCliente : IBizPagosProveedor): Boolean; function EliminarTodo(APagossCliente : IBizPagosProveedor): Boolean; end; @@ -46,8 +46,8 @@ type public constructor Create; virtual; destructor Destroy; override; - function Anadir(APagosProveedor: IBizPagosProveedor; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0): Boolean; - procedure Modificar(APagosProveedor: IBizPagosProveedor; Const Fecha: String; Const IgnorarContabilidad: Integer; Const IdSubCuenta: Integer); + function Anadir(APagosProveedor: IBizPagosProveedor; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0; Const SubCuenta: String = ''): Boolean; + procedure Modificar(APagosProveedor: IBizPagosProveedor; Const Fecha: String; Const IgnorarContabilidad: Integer; Const IdSubCuenta: Integer; Const SubCuenta: String = ''); function Eliminar(APagoCliente : IBizPagosProveedor): Boolean; function EliminarTodo(APagosProveedor : IBizPagosProveedor): Boolean; end; @@ -62,7 +62,7 @@ uses { TPagosProveedorController } -function TPagosProveedorController.Anadir(APagosProveedor: IBizPagosProveedor; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0): Boolean; +function TPagosProveedorController.Anadir(APagosProveedor: IBizPagosProveedor; Const Fecha: String = ''; Const IgnorarContabilidad: Integer = 0; Const IdSubCuenta: Integer = 0; Const SubCuenta: String = ''): Boolean; { Si el pago introducido es un pago y no una devolución devolvemos true en caso de ser una devolución devolvemos false} begin @@ -80,6 +80,7 @@ begin APagosProveedor.IGNORAR_CONTABILIDAD := IgnorarContabilidad; APagosProveedor.CUENTA := IntToStr(IdSubCuenta); + APagosProveedor.SUBCUENTA := SubCuenta; Result := (APagosProveedor.TIPO = CTE_PAGO); APagosProveedor.Post; @@ -144,12 +145,13 @@ begin end; end; -procedure TPagosProveedorController.Modificar(APagosProveedor: IBizPagosProveedor; const Fecha: String; Const IgnorarContabilidad: Integer; Const IdSubCuenta: Integer); +procedure TPagosProveedorController.Modificar(APagosProveedor: IBizPagosProveedor; const Fecha: String; Const IgnorarContabilidad: Integer; Const IdSubCuenta: Integer; Const SubCuenta: String = ''); begin APagosProveedor.DataTable.Edit; APagosProveedor.FECHA_PAGO := StrToDate(Fecha); APagosProveedor.IGNORAR_CONTABILIDAD := IgnorarContabilidad; - APagosProveedor.CUENTA := IntToStr(IdSubCuenta); + APagosProveedor.CUENTA := IntToStr(IdSubCuenta); + APagosProveedor.SUBCUENTA := SubCuenta; APagosProveedor.DataTable.Post; end; diff --git a/Source/Modulos/Recibos de proveedor/Controller/uRecibosProveedorController.pas b/Source/Modulos/Recibos de proveedor/Controller/uRecibosProveedorController.pas index 29a398bb..b89d2adc 100644 --- a/Source/Modulos/Recibos de proveedor/Controller/uRecibosProveedorController.pas +++ b/Source/Modulos/Recibos de proveedor/Controller/uRecibosProveedorController.pas @@ -42,8 +42,8 @@ type property PagosController: IPagosProveedorController read GetPagosController write SetPagosController; procedure Anadir(ARecibosProveedor : IBizRecibosProveedor); - function AnadirPago(ARecibosProveedor : IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad: Integer = 1; ASubCuenta: Integer = 0): Boolean; - procedure ModificarPago(ARecibosProveedor : IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad : Integer = 1; ASubCuenta: Integer = 0); + function AnadirPago(ARecibosProveedor : IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad: Integer = 1; AIdSubCuenta: Integer = 0; ASubCuenta: String = ''): Boolean; + procedure ModificarPago(ARecibosProveedor : IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad : Integer = 1; AIdSubCuenta: Integer = 0; ASubCuenta: String = ''); function Eliminar(ARecibosProveedor : IBizRecibosProveedor; AllItems: Boolean = false): Boolean; function EliminarPago(ARecibosProveedor : IBizRecibosProveedor): Boolean; function EliminarTodo(ARecibosProveedor : IBizRecibosProveedor): Boolean; @@ -114,8 +114,8 @@ type procedure RecuperarProveedor(AReciboProveedor : IBizRecibosProveedor); procedure Anadir(ARecibosProveedor : IBizRecibosProveedor); - function AnadirPago(ARecibosProveedor : IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad: Integer = 1; ASubCuenta: Integer = 0): Boolean; - procedure ModificarPago(ARecibosProveedor : IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad : Integer = 1; ASubCuenta: Integer = 0); + function AnadirPago(ARecibosProveedor : IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad: Integer = 1; AIdSubCuenta: Integer = 0; ASubCuenta: String = ''): Boolean; + procedure ModificarPago(ARecibosProveedor : IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad : Integer = 1; AIdSubCuenta: Integer = 0; ASubCuenta: String = ''); function Eliminar(ARecibosProveedor : IBizRecibosProveedor; AllItems: Boolean = false): Boolean; function EliminarPago(ARecibosProveedor : IBizRecibosProveedor): Boolean; function EliminarTodo(ARecibosProveedor : IBizRecibosProveedor): Boolean; @@ -172,7 +172,7 @@ begin ARecibosProveedor.Insert; end; -function TRecibosProveedorController.AnadirPago(ARecibosProveedor: IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad: Integer = 1; ASubCuenta: Integer = 0): Boolean; +function TRecibosProveedorController.AnadirPago(ARecibosProveedor: IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad: Integer = 1; AIdSubCuenta: Integer = 0; ASubCuenta: String = ''): Boolean; begin Result := False; @@ -190,7 +190,7 @@ begin //Finalmente añadimos el pago (pago o devolucion) - if PagosController.Anadir(ARecibosProveedor.Pagos, FechaPago, AIgnorarContabilidad, ASubCuenta) then + if PagosController.Anadir(ARecibosProveedor.Pagos, FechaPago, AIgnorarContabilidad, AIdSubCuenta, ASubCuenta) then begin ARecibosProveedor.Edit; ARecibosProveedor.SITUACION := CTE_PAGADO; @@ -841,10 +841,10 @@ begin end; end; -procedure TRecibosProveedorController.ModificarPago(ARecibosProveedor: IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad : Integer = 1; ASubCuenta: Integer = 0); +procedure TRecibosProveedorController.ModificarPago(ARecibosProveedor: IBizRecibosProveedor; FechaPago: String =''; AIgnorarContabilidad : Integer = 1; AIdSubCuenta: Integer = 0; ASubCuenta: String = ''); begin if Length(FechaPago) > 0 then - PagosController.Modificar(ARecibosProveedor.Pagos, FechaPago, AIgnorarContabilidad, ASubCuenta); + PagosController.Modificar(ARecibosProveedor.Pagos, FechaPago, AIgnorarContabilidad, AIdSubCuenta, ASubCuenta); end; function TRecibosProveedorController.Nuevo: IBizRecibosProveedor; diff --git a/Source/Modulos/Recibos de proveedor/RecibosProveedor_Group.groupproj b/Source/Modulos/Recibos de proveedor/RecibosProveedor_Group.groupproj index 9c5c5fc0..9e37b545 100644 --- a/Source/Modulos/Recibos de proveedor/RecibosProveedor_Group.groupproj +++ b/Source/Modulos/Recibos de proveedor/RecibosProveedor_Group.groupproj @@ -9,6 +9,7 @@ + @@ -58,6 +59,15 @@ + + + + + + + + + @@ -122,13 +132,13 @@ - + - + - + \ No newline at end of file diff --git a/Source/Modulos/Recibos de proveedor/Views/uEditorFechaPagoProveedor.dfm b/Source/Modulos/Recibos de proveedor/Views/uEditorFechaPagoProveedor.dfm index f208bebd..7973675e 100644 --- a/Source/Modulos/Recibos de proveedor/Views/uEditorFechaPagoProveedor.dfm +++ b/Source/Modulos/Recibos de proveedor/Views/uEditorFechaPagoProveedor.dfm @@ -46,7 +46,7 @@ object fEditorFechaPagoProveedor: TfEditorFechaPagoProveedor object eFechaPago: TcxDateEdit Left = 129 Top = 80 - Properties.OnChange = eFechaPagoPropertiesChange + Properties.OnEditValueChanged = eFechaPagoPropertiesEditValueChanged Style.LookAndFeel.Kind = lfStandard Style.LookAndFeel.NativeStyle = True StyleDisabled.LookAndFeel.Kind = lfStandard @@ -65,8 +65,6 @@ object fEditorFechaPagoProveedor: TfEditorFechaPagoProveedor Height = 41 Align = alBottom TabOrder = 1 - ExplicitTop = 152 - ExplicitWidth = 510 object bAceptar: TButton Left = 368 Top = 6 @@ -100,11 +98,12 @@ object fEditorFechaPagoProveedor: TfEditorFechaPagoProveedor ParentFont = False TabOrder = 2 ReadOnly = False - ExplicitTop = 166 + ExplicitTop = 136 ExplicitWidth = 563 ExplicitHeight = 40 inherited dxLayoutControl1: TdxLayoutControl Width = 563 + ExplicitWidth = 563 inherited cbSubCuentas: TcxComboBox Left = 128 Style.LookAndFeel.SkinName = '' @@ -144,7 +143,6 @@ object fEditorFechaPagoProveedor: TfEditorFechaPagoProveedor ParentBackground = False TabOrder = 3 VerticalAlignment = taAlignTop - ExplicitWidth = 560 object lbComentario: TLabel AlignWithMargins = True Left = 6 diff --git a/Source/Modulos/Recibos de proveedor/Views/uEditorFechaPagoProveedor.pas b/Source/Modulos/Recibos de proveedor/Views/uEditorFechaPagoProveedor.pas index 225c00fe..70eb984d 100644 --- a/Source/Modulos/Recibos de proveedor/Views/uEditorFechaPagoProveedor.pas +++ b/Source/Modulos/Recibos de proveedor/Views/uEditorFechaPagoProveedor.pas @@ -22,9 +22,9 @@ type lbComentario: TLabel; Label3: TLabel; procedure FormShow(Sender: TObject); - procedure eFechaPagoPropertiesChange(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure FormCreate(Sender: TObject); + procedure eFechaPagoPropertiesEditValueChanged(Sender: TObject); private FFechaPago : TDateTime; @@ -61,7 +61,7 @@ begin frViewListaSubCuentas1.eContabilizar.Enabled := False; end; -procedure TfEditorFechaPagoProveedor.eFechaPagoPropertiesChange(Sender: TObject); +procedure TfEditorFechaPagoProveedor.eFechaPagoPropertiesEditValueChanged(Sender: TObject); begin FechaPago := eFechaPago.Date; end; diff --git a/Source/Modulos/Recibos de proveedor/Views/uEditorReciboProveedor.dfm b/Source/Modulos/Recibos de proveedor/Views/uEditorReciboProveedor.dfm index aa0533de..8b2b92e2 100644 --- a/Source/Modulos/Recibos de proveedor/Views/uEditorReciboProveedor.dfm +++ b/Source/Modulos/Recibos de proveedor/Views/uEditorReciboProveedor.dfm @@ -94,57 +94,101 @@ inherited fEditorReciboProveedor: TfEditorReciboProveedor 677 295) inherited eReferencia: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 112 Width = 112 end inherited eSituacion: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 112 Width = 112 end inherited edtFechaVencimiento: TcxDBDateEdit Left = 228 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 228 ExplicitWidth = 20 Width = 20 end inherited eFechaEmision: TcxDBTextEdit Left = 384 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 384 ExplicitWidth = 255 Width = 255 end inherited eImporteTotal: TcxDBCurrencyEdit Left = 384 + Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 384 ExplicitWidth = 255 Width = 255 end inherited eNombreCliente: TcxDBTextEdit Left = 384 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 384 ExplicitWidth = 255 Width = 255 end inherited eRemesa: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 112 Width = 112 end inherited edtFechaEmision: TcxDBDateEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 20 Width = 20 end inherited eReferenciaProveedor: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 112 Width = 112 end inherited rReferenciaFacturaProv: TcxDBTextEdit Left = 384 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 384 ExplicitWidth = 255 Width = 255 end inherited rRefReciboCompensado: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 112 Width = 112 end @@ -155,17 +199,29 @@ inherited fEditorReciboProveedor: TfEditorReciboProveedor Width = 112 ExplicitWidth = 112 inherited cbTienda: TcxComboBox + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 92 Width = 92 end end end inherited eDescripcion: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 112 Width = 112 end inherited eNifCif: TcxDBTextEdit Left = 384 + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 384 ExplicitWidth = 255 Width = 255 @@ -184,32 +240,56 @@ inherited fEditorReciboProveedor: TfEditorReciboProveedor end inherited edtlNombre: TcxDBTextEdit DataBinding.DataSource = frViewReciboProveedor1.DADataSource + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 283 Width = 283 end inherited edtNIFCIF: TcxDBTextEdit DataBinding.DataSource = frViewReciboProveedor1.DADataSource + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 283 Width = 283 end inherited edtCalle: TcxDBTextEdit DataBinding.DataSource = frViewReciboProveedor1.DADataSource + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 283 Width = 283 end inherited edtPoblacion: TcxDBTextEdit DataBinding.DataSource = frViewReciboProveedor1.DADataSource + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 165 Width = 165 end inherited edtProvincia: TcxDBTextEdit DataBinding.DataSource = frViewReciboProveedor1.DADataSource + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 283 Width = 283 end inherited edtCodigoPostal: TcxDBTextEdit Left = 282 DataBinding.DataSource = frViewReciboProveedor1.DADataSource + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 282 end inherited Button3: TBitBtn @@ -217,6 +297,10 @@ inherited fEditorReciboProveedor: TfEditorReciboProveedor ExplicitLeft = 166 end inherited cxDBTextEdit1: TcxDBTextEdit + Style.LookAndFeel.SkinName = '' + StyleDisabled.LookAndFeel.SkinName = '' + StyleFocused.LookAndFeel.SkinName = '' + StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 283 Width = 283 end @@ -229,6 +313,8 @@ inherited fEditorReciboProveedor: TfEditorReciboProveedor ExplicitHeight = 150 inherited memObservaciones: TcxDBMemo DataBinding.DataSource = frViewReciboProveedor1.DADataSource + ExplicitWidth = 226 + ExplicitHeight = 129 Height = 150 Width = 521 end diff --git a/Source/Modulos/Recibos de proveedor/Views/uEditorReciboProveedor.pas b/Source/Modulos/Recibos de proveedor/Views/uEditorReciboProveedor.pas index aad79aa8..56cc78c0 100644 --- a/Source/Modulos/Recibos de proveedor/Views/uEditorReciboProveedor.pas +++ b/Source/Modulos/Recibos de proveedor/Views/uEditorReciboProveedor.pas @@ -142,7 +142,8 @@ procedure TfEditorReciboProveedor.frViewPagosProveedor1actAnadirExecute(Sender: var AFechaPago: String; AIgnorarContabilidad: Integer; - ASubCuenta: Integer; + AIdSubCuenta: Integer; + ASubCuenta: String; begin inherited; @@ -152,19 +153,20 @@ begin begin with TfEditorFechaPagoProveedor.Create(Nil) do begin - + //En el caso de que el proveedor del recibo no tenga aignada subcuenta contable el pago no podrá contabilizar if (Recibo.Proveedor.SubCuentas.ID < 1) then begin IgnorarContabilidad := 1; DeshabilitarContabilidad; end; - + if (ShowModal = mrOk) then begin AFechaPago := DateToStr(FechaPago); AIgnorarContabilidad := IgnorarContabilidad; - ASubCuenta := IdSubcuenta; + AIdSubCuenta := IdSubcuenta; + ASubCuenta := frViewListaSubcuentas1.cbSubCuentas.Text; Release; end else @@ -176,7 +178,7 @@ begin end; end; - FController.AnadirPago(Recibo, AFechaPago, AIgnorarContabilidad, ASubCuenta); + FController.AnadirPago(Recibo, AFechaPago, AIgnorarContabilidad, AIdSubCuenta, ASubCuenta); //Solo podremos modificar el recibo si esta pendiente o devuelto if (Recibo.SITUACION = CTE_PAGADO) then @@ -222,7 +224,8 @@ procedure TfEditorReciboProveedor.frViewPagosProveedor1actModificarExecute(Sende var AFechaPago: String; AIgnorarContabilidad: Integer; - ASubCuenta: Integer; + AIdSubCuenta: Integer; + ASubCuenta: String; begin inherited; @@ -258,9 +261,10 @@ begin begin AFechaPago := DateToStr(FechaPago); AIgnorarContabilidad := IgnorarContabilidad; - ASubCuenta := IdSubcuenta; + AIdSubCuenta := IdSubcuenta; + ASubCuenta := frViewListaSubcuentas1.cbSubCuentas.Text; if not SoloLectura then - FController.ModificarPago(Recibo, AFechaPago, AIgnorarContabilidad, ASubCuenta); + FController.ModificarPago(Recibo, AFechaPago, AIgnorarContabilidad, AIdSubCuenta, ASubCuenta); end; Release;