From 4ceb42909991494158bdef43915ac88add0282c9 Mon Sep 17 00:00:00 2001 From: roberto Date: Sat, 23 Feb 2008 22:16:47 +0000 Subject: [PATCH] =?UTF-8?q?Arreglo=20de=20recibos=20para=20que=20funcionen?= =?UTF-8?q?=20de=20forma=20aut=C3=B3noma=20sin=20necesidad=20de=20Facturas?= =?UTF-8?q?=20de=20(Primera=20parte)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@138 f4e31baf-9722-1c47-927c-6f952f962d4b --- Database/scripts/factuges.sql | 25 +++-- .../Empresas/Views/uViewTienda.dfm | 47 ++------- .../Empresas/Views/uViewTienda.pas | 4 +- .../Controller/uFacturasClienteController.pas | 4 + .../Views/uEditorFacturaCliente.dfm | 70 ++++++++----- .../Views/uViewFacturaCliente.dfm | 38 +++---- .../Views/uViewFacturaCliente.pas | 2 +- .../Data/RecibosCliente_data.res | Bin 384 -> 4748 bytes .../Data/uDataModuleRecibosCliente.dfm | 4 + .../Model/schRecibosClienteClient_Intf.pas | 55 ++++++++-- .../Model/schRecibosClienteServer_Intf.pas | 55 ++++++++-- .../Servidor/srvRecibosCliente_Impl.dfm | 99 ++++++++---------- .../Views/uEditorRecibosCliente.dfm | 4 +- .../Views/uEditorRecibosCliente.pas | 7 +- Source/Servidor/uDataModuleServer.dfm | 5 +- 15 files changed, 241 insertions(+), 178 deletions(-) diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 35cc657f..47195c96 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -1246,20 +1246,23 @@ CREATE TABLE PROVEEDORES_GRUPOS ( CREATE TABLE RECIBOS_CLIENTE ( - ID TIPO_ID NOT NULL, - ID_FACTURA TIPO_ID, + ID TIPO_ID NOT NULL /* TIPO_ID = INTEGER */, + ID_EMPRESA TIPO_ID /* TIPO_ID = INTEGER */, + ID_CLIENTE TIPO_ID /* TIPO_ID = INTEGER */, + ID_FACTURA TIPO_ID /* TIPO_ID = INTEGER */, REFERENCIA VARCHAR(255), FECHA_EMISION DATE, FECHA_VENCIMIENTO DATE, DESCRIPCION VARCHAR(255), OBSERVACIONES VARCHAR(255), - IMPORTE TIPO_IMPORTE, - OTROS_GASTOS TIPO_IMPORTE, + IMPORTE TIPO_IMPORTE /* TIPO_IMPORTE = NUMERIC(11,2) */, + OTROS_GASTOS TIPO_IMPORTE /* TIPO_IMPORTE = NUMERIC(11,2) */, FECHA_ALTA DATE, FECHA_MODIFICACION DATE, - USUARIO TIPO_USUARIO, - ID_REMESA TIPO_ID, - ID_RECIBO_COMPENSADO INTEGER + USUARIO TIPO_USUARIO /* TIPO_USUARIO = VARCHAR(30) */, + ID_REMESA TIPO_ID /* TIPO_ID = INTEGER */, + ID_RECIBO_COMPENSADO INTEGER, + ID_TIENDA TIPO_ID /* TIPO_ID = INTEGER */ ); @@ -3333,7 +3336,8 @@ CREATE VIEW V_RECIBOS_CLIENTE( CUENTA_CLIENTE, FECHA_ALTA, FECHA_MODIFICACION, - USUARIO) + USUARIO, + ID_TIENDA) AS SELECT RECIBOS_CLIENTE.ID, RECIBOS_CLIENTE.ID_RECIBO_COMPENSADO, @@ -3358,7 +3362,8 @@ SELECT RECIBOS_CLIENTE.ID, RECIBOS_CLIENTE.FECHA_ALTA, RECIBOS_CLIENTE.FECHA_MODIFICACION, - RECIBOS_CLIENTE.USUARIO + RECIBOS_CLIENTE.USUARIO, + RECIBOS_CLIENTE.ID_TIENDA FROM RECIBOS_CLIENTE LEFT JOIN V_REC_CLI_SITUACION @@ -3368,7 +3373,7 @@ ON (FACTURAS_CLIENTE.ID = RECIBOS_CLIENTE.ID_FACTURA) LEFT JOIN FORMAS_PAGO ON (FORMAS_PAGO.ID = FACTURAS_CLIENTE.ID_FORMA_PAGO) LEFT JOIN CONTACTOS -ON (CONTACTOS.ID = FACTURAS_CLIENTE.ID_CLIENTE) +ON (CONTACTOS.ID = RECIBOS_CLIENTE.ID_CLIENTE) LEFT JOIN CONTACTOS_DATOS_BANCO ON (CONTACTOS_DATOS_BANCO.ID_CONTACTO = CONTACTOS.ID) LEFT JOIN REMESAS_CLIENTE diff --git a/Source/ApplicationBase/Empresas/Views/uViewTienda.dfm b/Source/ApplicationBase/Empresas/Views/uViewTienda.dfm index f9593862..40e854f5 100644 --- a/Source/ApplicationBase/Empresas/Views/uViewTienda.dfm +++ b/Source/ApplicationBase/Empresas/Views/uViewTienda.dfm @@ -1,29 +1,29 @@ inherited frViewTienda: TfrViewTienda Width = 451 - Height = 72 + Height = 180 Align = alBottom OnCreate = CustomViewCreate OnDestroy = CustomViewDestroy ExplicitWidth = 451 - ExplicitHeight = 72 + ExplicitHeight = 180 object dxLayoutControl1: TdxLayoutControl Left = 0 Top = 0 Width = 451 - Height = 72 + Height = 73 Margins.Left = 0 Margins.Top = 0 Margins.Right = 0 Margins.Bottom = 0 - Align = alClient + Align = alTop ParentBackground = True TabOrder = 0 AutoContentSizes = [acsWidth, acsHeight] DesignSize = ( 451 - 72) + 73) object cbTienda: TcxDBComboBox - Left = 65 + Left = 51 Top = 10 Anchors = [akLeft, akTop, akRight] DataBinding.DataField = 'TIENDA' @@ -45,36 +45,6 @@ inherited frViewTienda: TfrViewTienda TabOrder = 0 Width = 376 end - object cbVendedor: TcxDBLookupComboBox - Left = 65 - Top = 37 - DataBinding.DataField = 'ID_VENDEDOR' - Properties.DropDownListStyle = lsFixedList - Properties.KeyFieldNames = 'ID' - Properties.ListColumns = < - item - FieldName = 'NOMBRE' - end> - Properties.ListOptions.GridLines = glNone - Properties.ListOptions.ShowHeader = False - Properties.ListOptions.SyncMode = True - Properties.ListSource = dsVendedores - Style.BorderColor = clWindowFrame - Style.BorderStyle = ebs3D - Style.HotTrack = False - Style.LookAndFeel.Kind = lfStandard - Style.LookAndFeel.NativeStyle = True - Style.ButtonStyle = bts3D - Style.PopupBorderStyle = epbsFrame3D - StyleDisabled.LookAndFeel.Kind = lfStandard - StyleDisabled.LookAndFeel.NativeStyle = True - StyleFocused.LookAndFeel.Kind = lfStandard - StyleFocused.LookAndFeel.NativeStyle = True - StyleHot.LookAndFeel.Kind = lfStandard - StyleHot.LookAndFeel.NativeStyle = True - TabOrder = 1 - Width = 376 - end object dxLayoutControl1Group_Root: TdxLayoutGroup ShowCaption = False Hidden = True @@ -84,11 +54,6 @@ inherited frViewTienda: TfrViewTienda Control = cbTienda ControlOptions.ShowBorder = False end - object dxLayoutControl1Item2: TdxLayoutItem - Caption = 'Vendedor:' - Control = cbVendedor - ControlOptions.ShowBorder = False - end end end object dsVendedores: TDADataSource diff --git a/Source/ApplicationBase/Empresas/Views/uViewTienda.pas b/Source/ApplicationBase/Empresas/Views/uViewTienda.pas index 0ccd9284..52b819f0 100644 --- a/Source/ApplicationBase/Empresas/Views/uViewTienda.pas +++ b/Source/ApplicationBase/Empresas/Views/uViewTienda.pas @@ -9,7 +9,7 @@ uses cxContainer, cxEdit, cxLabel, cxDBLabel, cxCurrencyEdit, cxSpinEdit, cxCheckBox, cxMemo, uDAInterfaces, cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, dxLayoutControl, uTiendasEmpresaController, - uIntegerListUtils; + uIntegerListUtils, uUsuariosController; type TfrViewTienda = class(TfrViewBase) @@ -17,8 +17,6 @@ type dxLayoutControl1Group_Root: TdxLayoutGroup; dxLayoutControl1: TdxLayoutControl; dxLayoutControl1Item1: TdxLayoutItem; - dxLayoutControl1Item2: TdxLayoutItem; - cbVendedor: TcxDBLookupComboBox; dsVendedores: TDADataSource; procedure CustomViewCreate(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas index 7ec6ba49..033f89fd 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas @@ -71,6 +71,7 @@ type function ValidarFactura(AFactura: IBizFacturaCliente): Boolean; procedure GenerarRecibos(AFactura: IBizFacturaCliente); + protected procedure RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); override; public @@ -1086,6 +1087,9 @@ begin ARecibos := ARecibosClienteController.Nuevo; ARecibos.Edit; ARecibos.ID_FACTURA := AFactura.ID; + ARecibos.ID_EMPRESA := AFactura.ID_EMPRESA; + ARecibos.ID_CLIENTE := AFactura.ID_CLIENTE; + ARecibos.ID_TIENDA := AFactura.ID_TIENDA; ARecibos.REFERENCIA := AFactura.REFERENCIA + ' - ' + IntToStr(i); AFechaVencimiento := AFactura.FECHA_FACTURA + AFormaPago.Plazos.NUM_DIAS; diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm index c603c99b..ccd78929 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm @@ -13,7 +13,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente inherited JvNavPanelHeader: TJvNavPanelHeader Width = 950 Caption = 'Nueva factura de cliente' - ExplicitWidth = 788 + ExplicitWidth = 950 inherited Image1: TImage Left = 923 Picture.Data = { @@ -40,7 +40,7 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente end inherited TBXDock: TTBXDock Width = 950 - ExplicitWidth = 788 + ExplicitWidth = 950 inherited tbxMain: TTBXToolbar ExplicitWidth = 488 inherited TBXItem2: TTBXItem @@ -74,13 +74,13 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente OnChanging = pgPaginasChanging ExplicitLeft = 3 ExplicitTop = 79 - ExplicitWidth = 782 - ExplicitHeight = 311 + ExplicitWidth = 944 + ExplicitHeight = 378 inherited pagGeneral: TTabSheet ExplicitLeft = 4 ExplicitTop = 24 - ExplicitWidth = 774 - ExplicitHeight = 283 + ExplicitWidth = 936 + ExplicitHeight = 350 inline frViewFacturaCliente1: TfrViewFacturaCliente Left = 0 Top = 0 @@ -95,13 +95,13 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente ParentFont = False TabOrder = 0 ReadOnly = False - ExplicitWidth = 774 - ExplicitHeight = 283 + ExplicitWidth = 936 + ExplicitHeight = 350 inherited dxLayoutControl1: TdxLayoutControl Width = 936 Height = 350 - ExplicitWidth = 774 - ExplicitHeight = 283 + ExplicitWidth = 936 + ExplicitHeight = 350 DesignSize = ( 936 350) @@ -130,27 +130,37 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente inherited edtlNombre: TcxDBTextEdit DataBinding.DataSource = frViewFacturaCliente1.DADataSource Properties.OnChange = frViewClienteFacturaedtlNombrePropertiesChange + ExplicitWidth = 224 + Width = 224 end inherited edtNIFCIF: TcxDBTextEdit DataBinding.DataSource = frViewFacturaCliente1.DADataSource + ExplicitWidth = 562 + Width = 562 end inherited edtCalle: TcxDBTextEdit DataBinding.DataSource = frViewFacturaCliente1.DADataSource + ExplicitWidth = 562 + Width = 562 end inherited edtPoblacion: TcxDBTextEdit DataBinding.DataSource = frViewFacturaCliente1.DADataSource + ExplicitWidth = 177 + Width = 177 end inherited edtProvincia: TcxDBTextEdit DataBinding.DataSource = frViewFacturaCliente1.DADataSource + ExplicitWidth = 327 + Width = 327 end inherited edtCodigoPostal: TcxDBTextEdit - Left = 277 + Left = 261 DataBinding.DataSource = frViewFacturaCliente1.DADataSource - ExplicitLeft = 277 + ExplicitLeft = 261 end inherited Button3: TBitBtn - Left = 167 - ExplicitLeft = 167 + Left = 151 + ExplicitLeft = 151 end end end @@ -164,10 +174,15 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente end inherited frViewTienda1: TfrViewTienda Left = 556 + Width = 729 ExplicitLeft = 556 + ExplicitWidth = 729 inherited dxLayoutControl1: TdxLayoutControl + Width = 729 inherited cbTienda: TcxDBComboBox DataBinding.DataSource = frViewFacturaCliente1.DADataSource + ExplicitWidth = 376 + Width = 376 end end end @@ -177,8 +192,6 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente object pagContenido: TTabSheet Caption = 'Contenido' ImageIndex = 1 - ExplicitWidth = 774 - ExplicitHeight = 283 inline frViewDetallesFacturaCliente1: TfrViewDetallesFacturaCliente Left = 0 Top = 0 @@ -195,12 +208,13 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente ParentFont = False TabOrder = 0 ReadOnly = False - ExplicitWidth = 774 - ExplicitHeight = 283 + ExplicitWidth = 936 + ExplicitHeight = 350 inherited ToolBar1: TToolBar Width = 936 Height = 24 - ExplicitWidth = 774 + ExplicitWidth = 936 + ExplicitHeight = 24 inherited ToolButton4: TToolButton Wrap = False end @@ -283,13 +297,15 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente Top = 50 Width = 936 Height = 300 - ExplicitWidth = 774 - ExplicitHeight = 211 + ExplicitTop = 50 + ExplicitWidth = 936 + ExplicitHeight = 300 end inherited TBXDock1: TTBXDock Top = 24 Width = 936 - ExplicitWidth = 774 + ExplicitTop = 24 + ExplicitWidth = 936 inherited TBXToolbar1: TTBXToolbar ExplicitWidth = 548 end @@ -335,8 +351,8 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente item Width = 200 end> - ExplicitTop = 556 - ExplicitWidth = 788 + ExplicitTop = 623 + ExplicitWidth = 950 end inline frViewTotales1: TfrViewTotales [4] Left = 0 @@ -352,13 +368,13 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente ParentFont = False TabOrder = 4 ReadOnly = False - ExplicitTop = 393 - ExplicitWidth = 788 + ExplicitTop = 460 + ExplicitWidth = 950 ExplicitHeight = 163 inherited dxLayoutControl1: TdxLayoutControl Width = 950 LookAndFeel = frViewFacturaCliente1.dxLayoutOfficeLookAndFeel1 - ExplicitWidth = 788 + ExplicitWidth = 950 inherited Bevel1: TBevel Top = 111 Width = 73 diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm index c8c55763..b59c61e4 100644 --- a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm @@ -1,6 +1,6 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente - Width = 729 - Height = 351 + Width = 896 + Height = 476 Align = alClient OnCreate = CustomViewCreate OnDestroy = CustomViewDestroy @@ -9,8 +9,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente object dxLayoutControl1: TdxLayoutControl Left = 0 Top = 0 - Width = 729 - Height = 351 + Width = 896 + Height = 476 Align = alClient ParentBackground = True TabOrder = 0 @@ -19,8 +19,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente ExplicitWidth = 451 ExplicitHeight = 304 DesignSize = ( - 729 - 351) + 896 + 476) object eReferencia: TcxDBTextEdit Left = 124 Top = 30 @@ -128,13 +128,13 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente Width = 327 end inherited edtCodigoPostal: TcxDBTextEdit - Left = 247 + Left = 414 DataBinding.DataSource = DADataSource - ExplicitLeft = 247 + ExplicitLeft = 414 end inherited Button3: TBitBtn - Left = 137 - ExplicitLeft = 137 + Left = 304 + ExplicitLeft = 304 end end end @@ -181,8 +181,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente inline frViewTienda1: TfrViewTienda Left = 379 Top = 270 - Width = 819 - Height = 46 + Width = 729 + Height = 180 Align = alBottom Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -194,15 +194,15 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente ReadOnly = False ExplicitLeft = 379 ExplicitTop = 270 - ExplicitWidth = 819 + ExplicitWidth = 729 inherited dxLayoutControl1: TdxLayoutControl - Width = 819 - ExplicitWidth = 819 + Width = 729 + ExplicitWidth = 729 inherited cbTienda: TcxDBComboBox DataBinding.DataSource = DADataSource Properties.OnChange = frViewTienda1cbTiendaPropertiesChange - ExplicitWidth = 412 - Width = 412 + ExplicitWidth = 376 + Width = 376 end end end @@ -273,8 +273,10 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente ControlOptions.ShowBorder = False end object dxLayoutControl1Group4: TdxLayoutGroup - Caption = 'La factura pertenece a la tienda' + Caption = 'New Group' object dxLayoutControl1Item3: TdxLayoutItem + Caption = 'New Item' + ShowCaption = False Control = frViewTienda1 ControlOptions.AutoColor = True ControlOptions.ShowBorder = False diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas index ba691aa5..da194899 100644 --- a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.pas @@ -48,9 +48,9 @@ type bFormasPago: TButton; dxLayoutControl1Group3: TdxLayoutGroup; dxLayoutControl1Group6: TdxLayoutGroup; - dxLayoutControl1Item3: TdxLayoutItem; frViewTienda1: TfrViewTienda; dxLayoutControl1Group4: TdxLayoutGroup; + dxLayoutControl1Item3: TdxLayoutItem; procedure bFormasPagoClick(Sender: TObject); procedure CustomViewDestroy(Sender: TObject); procedure CustomViewCreate(Sender: TObject); diff --git a/Source/Modulos/Recibos de cliente/Data/RecibosCliente_data.res b/Source/Modulos/Recibos de cliente/Data/RecibosCliente_data.res index 8b251f312bcccec5485024f6fe8d80e1cdf25746..1641339fcc482e7e3492d1b45813a86619622c33 100644 GIT binary patch literal 4748 zcmbW5&ub)A5XUPdpe&2#;C*uNAUVhgd+&(4um@dnom`vXF9g}ZuHJ;se=<3UNdFJg zbCw+UD9j$byGIXV`~6hC>h4S?F|k9X-j90q{Z_qtZ<;nUJCO8!h?p${kR>3GhM`oH*q zk=UsjOCIgA_4!`B+Gb&`I84R)bT4dy-BQV<-SyFz?R8ILEQ(+JB$u{sEXE@j@B*7W zT;iZH#|OJ<&DO$RCkM6VbK3(B(k{nbdv1lpc;E$xz9as|v3uE1V{hw2w~g3eD0an7 z{BT%G%irdMe*|oDJmgvJaA2`9B<6Xi*?M~Q;)@Sbfwf3uf zVaWkbUjU=;sL{BlYemIZXv%qZ{SZw{-TCU+;!nH6KDDIJumU+9{E0zXW4>7T)y|>$DQlv zRJe?TjSp{c!DqeayAnSMTtZZT;>LN7J0Rls+5m@q)MbyB*eL%Eu@(+$Cw}Pd@q7N| z%Q0*AHpCP^b9v`@jx-l_FD>khpW2W8(OU2&V5TrnoAY-m_hlcV?zq3;7{2gF{J#Hc z6R+o~mVenX?>@W0@_DVzyOFs(5464CY{!q9ChoF#_*eXi@4gFuV8?vhl=_w5$iKL0 zEV0nMBcN08xtRmsgJrqjh@s#|{?*ssnsG)mH*wa6{efF0JFWHok@kA5%b661{B38= zCcgJ|*ZFTpV$8<-&+AWpa)Q8*`wL&hMeNQ^v6I7$HSdLZhZ^&+6<@Uw_Zsml9^v3W zVvPDBKHh;i=RU4J_ta3E;)Mn>Y+L zKLZ0UQ+*km9FO-b?U4gmn-62iwzH6&*duKGo~aUV)bYDla8wWZ9+^7p-F<8lP@i!m z@vhbD_${F}h>^T;C(?(b*OJDk?{dEXB?nuehoON3HAb!7Mr7-ls!84-5V-jJugbu<_$}mU=Yd9!?TOX;|B-#B)+0x#9q*yqJiqS!`49d=7ztk$O+9=1i;?K_|J<8T z?0b7=-`Z3A#vV$4XJ5(lQ~TOZHUFdA%oWvK5zg&_IKXIbughQBA8XAsd#=@|TFLXC zy(^m((;DnQmDQKatmw!@c`| G?EMQ&4NnpP delta 11 ScmeBCZD5|Duvteife`=|>;pCc diff --git a/Source/Modulos/Recibos de cliente/Data/uDataModuleRecibosCliente.dfm b/Source/Modulos/Recibos de cliente/Data/uDataModuleRecibosCliente.dfm index ababc983..be3563a7 100644 --- a/Source/Modulos/Recibos de cliente/Data/uDataModuleRecibosCliente.dfm +++ b/Source/Modulos/Recibos de cliente/Data/uDataModuleRecibosCliente.dfm @@ -303,6 +303,10 @@ inherited DataModuleRecibosCliente: TDataModuleRecibosCliente DataType = datString Size = 20 DictionaryEntry = 'RecibosCliente_USUARIO' + end + item + Name = 'ID_TIENDA' + DataType = datInteger end> Params = <> StreamingOptions = [soDisableEventsWhileStreaming] diff --git a/Source/Modulos/Recibos de cliente/Model/schRecibosClienteClient_Intf.pas b/Source/Modulos/Recibos de cliente/Model/schRecibosClienteClient_Intf.pas index 4bee1402..4c2ab6f7 100644 --- a/Source/Modulos/Recibos de cliente/Model/schRecibosClienteClient_Intf.pas +++ b/Source/Modulos/Recibos de cliente/Model/schRecibosClienteClient_Intf.pas @@ -3,15 +3,15 @@ unit schRecibosClienteClient_Intf; interface uses - Classes, DB, schBase_Intf, SysUtils, uROClasses, uDADataTable, FmtBCD, uROXMLIntf; + Classes, DB, SysUtils, uROClasses, uDADataTable, FmtBCD, uROXMLIntf; 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_RecibosCliente = '{08D48C16-47F6-4396-B402-DCB79C0CF5E3}'; - RID_PagosCliente = '{782F3802-B17C-4448-9C21-5A971E79CA34}'; - RID_RecibosCompensadosCli = '{ABA4E332-F32B-4501-BAB6-388F1C2E5F90}'; + RID_RecibosCliente = '{7A055B0C-024A-4296-BEFF-634E1169F389}'; + RID_PagosCliente = '{99182515-443D-46E2-B64A-567FECC2F0C6}'; + RID_RecibosCompensadosCli = '{DAB1DFE3-FD78-4B4E-89AC-9C28047797BA}'; { Data table names } nme_RecibosCliente = 'RecibosCliente'; @@ -48,6 +48,7 @@ const fld_RecibosClienteFECHA_ALTA = 'FECHA_ALTA'; fld_RecibosClienteFECHA_MODIFICACION = 'FECHA_MODIFICACION'; fld_RecibosClienteUSUARIO = 'USUARIO'; + fld_RecibosClienteID_TIENDA = 'ID_TIENDA'; { RecibosCliente field indexes } idx_RecibosClienteID = 0; @@ -79,6 +80,7 @@ const idx_RecibosClienteFECHA_ALTA = 26; idx_RecibosClienteFECHA_MODIFICACION = 27; idx_RecibosClienteUSUARIO = 28; + idx_RecibosClienteID_TIENDA = 29; { PagosCliente fields } fld_PagosClienteID = 'ID'; @@ -175,7 +177,7 @@ const type { IRecibosCliente } IRecibosCliente = interface(IDAStronglyTypedDataTable) - ['{B1690FE5-2752-4154-948C-AD438BDDC48B}'] + ['{A3E27870-5581-46F4-82B4-7B83E1642BF9}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -293,6 +295,10 @@ type procedure SetUSUARIOValue(const aValue: String); function GetUSUARIOIsNull: Boolean; procedure SetUSUARIOIsNull(const aValue: Boolean); + function GetID_TIENDAValue: Integer; + procedure SetID_TIENDAValue(const aValue: Integer); + function GetID_TIENDAIsNull: Boolean; + procedure SetID_TIENDAIsNull(const aValue: Boolean); { Properties } @@ -354,10 +360,12 @@ type property FECHA_MODIFICACIONIsNull: Boolean read GetFECHA_MODIFICACIONIsNull write SetFECHA_MODIFICACIONIsNull; property USUARIO: String read GetUSUARIOValue write SetUSUARIOValue; property USUARIOIsNull: Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull; + property ID_TIENDA: Integer read GetID_TIENDAValue write SetID_TIENDAValue; + property ID_TIENDAIsNull: Boolean read GetID_TIENDAIsNull write SetID_TIENDAIsNull; end; { TRecibosClienteDataTableRules } - TRecibosClienteDataTableRules = class(TIntfObjectDADataTableRules, IRecibosCliente) + TRecibosClienteDataTableRules = class(TDADataTableRules, IRecibosCliente) private protected { Property getters and setters } @@ -477,6 +485,10 @@ type procedure SetUSUARIOValue(const aValue: String); virtual; function GetUSUARIOIsNull: Boolean; virtual; procedure SetUSUARIOIsNull(const aValue: Boolean); virtual; + function GetID_TIENDAValue: Integer; virtual; + procedure SetID_TIENDAValue(const aValue: Integer); virtual; + function GetID_TIENDAIsNull: Boolean; virtual; + procedure SetID_TIENDAIsNull(const aValue: Boolean); virtual; { Properties } property ID: Integer read GetIDValue write SetIDValue; @@ -537,6 +549,8 @@ type property FECHA_MODIFICACIONIsNull: Boolean read GetFECHA_MODIFICACIONIsNull write SetFECHA_MODIFICACIONIsNull; property USUARIO: String read GetUSUARIOValue write SetUSUARIOValue; property USUARIOIsNull: Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull; + property ID_TIENDA: Integer read GetID_TIENDAValue write SetID_TIENDAValue; + property ID_TIENDAIsNull: Boolean read GetID_TIENDAIsNull write SetID_TIENDAIsNull; public constructor Create(aDataTable: TDADataTable); override; @@ -546,7 +560,7 @@ type { IPagosCliente } IPagosCliente = interface(IDAStronglyTypedDataTable) - ['{4A5990E2-A1FC-4839-8463-25AB1AFC1CD2}'] + ['{E7CE898E-3C5F-4CE5-90C5-27D8F0307938}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -632,7 +646,7 @@ type end; { TPagosClienteDataTableRules } - TPagosClienteDataTableRules = class(TIntfObjectDADataTableRules, IPagosCliente) + TPagosClienteDataTableRules = class(TDADataTableRules, IPagosCliente) private protected { Property getters and setters } @@ -725,7 +739,7 @@ type { IRecibosCompensadosCli } IRecibosCompensadosCli = interface(IDAStronglyTypedDataTable) - ['{F4602DC2-1B70-438C-A14E-D92C55A26766}'] + ['{B605691F-6F27-4081-8D8F-8D0904CFD103}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -907,7 +921,7 @@ type end; { TRecibosCompensadosCliDataTableRules } - TRecibosCompensadosCliDataTableRules = class(TIntfObjectDADataTableRules, IRecibosCompensadosCli) + TRecibosCompensadosCliDataTableRules = class(TDADataTableRules, IRecibosCompensadosCli) private protected { Property getters and setters } @@ -1718,6 +1732,27 @@ begin DataTable.Fields[idx_RecibosClienteUSUARIO].AsVariant := Null; end; +function TRecibosClienteDataTableRules.GetID_TIENDAValue: Integer; +begin + result := DataTable.Fields[idx_RecibosClienteID_TIENDA].AsInteger; +end; + +procedure TRecibosClienteDataTableRules.SetID_TIENDAValue(const aValue: Integer); +begin + DataTable.Fields[idx_RecibosClienteID_TIENDA].AsInteger := aValue; +end; + +function TRecibosClienteDataTableRules.GetID_TIENDAIsNull: boolean; +begin + result := DataTable.Fields[idx_RecibosClienteID_TIENDA].IsNull; +end; + +procedure TRecibosClienteDataTableRules.SetID_TIENDAIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_RecibosClienteID_TIENDA].AsVariant := Null; +end; + { TPagosClienteDataTableRules } constructor TPagosClienteDataTableRules.Create(aDataTable: TDADataTable); diff --git a/Source/Modulos/Recibos de cliente/Model/schRecibosClienteServer_Intf.pas b/Source/Modulos/Recibos de cliente/Model/schRecibosClienteServer_Intf.pas index 04fd6f20..72bf9b18 100644 --- a/Source/Modulos/Recibos de cliente/Model/schRecibosClienteServer_Intf.pas +++ b/Source/Modulos/Recibos de cliente/Model/schRecibosClienteServer_Intf.pas @@ -9,14 +9,14 @@ 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_RecibosClienteDelta = '{5808EEBF-877B-4662-AE1D-C5D3E222230D}'; - RID_PagosClienteDelta = '{4BC06FA3-E27C-4E39-AC4E-03E78C1E25C3}'; - RID_RecibosCompensadosCliDelta = '{B414ABD6-606E-458D-A58F-ABAB88906CE9}'; + RID_RecibosClienteDelta = '{F6A6EE27-AC85-4EB3-91FC-F60E7A7F60CE}'; + RID_PagosClienteDelta = '{33802118-3685-400C-8464-916D54DF6FB6}'; + RID_RecibosCompensadosCliDelta = '{51FD7C5D-49D0-477F-8720-4C91AD9E3497}'; type { IRecibosClienteDelta } IRecibosClienteDelta = interface(IRecibosCliente) - ['{5808EEBF-877B-4662-AE1D-C5D3E222230D}'] + ['{F6A6EE27-AC85-4EB3-91FC-F60E7A7F60CE}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_RECIBO_COMPENSADOValue : Integer; @@ -47,6 +47,7 @@ type function GetOldFECHA_ALTAValue : DateTime; function GetOldFECHA_MODIFICACIONValue : DateTime; function GetOldUSUARIOValue : String; + function GetOldID_TIENDAValue : Integer; { Properties } property OldID : Integer read GetOldIDValue; @@ -78,6 +79,7 @@ type property OldFECHA_ALTA : DateTime read GetOldFECHA_ALTAValue; property OldFECHA_MODIFICACION : DateTime read GetOldFECHA_MODIFICACIONValue; property OldUSUARIO : String read GetOldUSUARIOValue; + property OldID_TIENDA : Integer read GetOldID_TIENDAValue; end; { TRecibosClienteBusinessProcessorRules } @@ -259,6 +261,12 @@ type function GetOldUSUARIOIsNull: Boolean; virtual; procedure SetUSUARIOValue(const aValue: String); virtual; procedure SetUSUARIOIsNull(const aValue: Boolean); virtual; + function GetID_TIENDAValue: Integer; virtual; + function GetID_TIENDAIsNull: Boolean; virtual; + function GetOldID_TIENDAValue: Integer; virtual; + function GetOldID_TIENDAIsNull: Boolean; virtual; + procedure SetID_TIENDAValue(const aValue: Integer); virtual; + procedure SetID_TIENDAIsNull(const aValue: Boolean); virtual; { Properties } property ID : Integer read GetIDValue write SetIDValue; @@ -377,6 +385,10 @@ type property USUARIOIsNull : Boolean read GetUSUARIOIsNull write SetUSUARIOIsNull; property OldUSUARIO : String read GetOldUSUARIOValue; property OldUSUARIOIsNull : Boolean read GetOldUSUARIOIsNull; + property ID_TIENDA : Integer read GetID_TIENDAValue write SetID_TIENDAValue; + property ID_TIENDAIsNull : Boolean read GetID_TIENDAIsNull write SetID_TIENDAIsNull; + property OldID_TIENDA : Integer read GetOldID_TIENDAValue; + property OldID_TIENDAIsNull : Boolean read GetOldID_TIENDAIsNull; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; @@ -386,7 +398,7 @@ type { IPagosClienteDelta } IPagosClienteDelta = interface(IPagosCliente) - ['{4BC06FA3-E27C-4E39-AC4E-03E78C1E25C3}'] + ['{33802118-3685-400C-8464-916D54DF6FB6}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_RECIBOValue : Integer; @@ -564,7 +576,7 @@ type { IRecibosCompensadosCliDelta } IRecibosCompensadosCliDelta = interface(IRecibosCompensadosCli) - ['{B414ABD6-606E-458D-A58F-ABAB88906CE9}'] + ['{51FD7C5D-49D0-477F-8720-4C91AD9E3497}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_RECIBO_COMPENSADOValue : Integer; @@ -1847,6 +1859,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_RecibosClienteUSUARIO] := Null; end; +function TRecibosClienteBusinessProcessorRules.GetID_TIENDAValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_RecibosClienteID_TIENDA]; +end; + +function TRecibosClienteBusinessProcessorRules.GetID_TIENDAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_RecibosClienteID_TIENDA]); +end; + +function TRecibosClienteBusinessProcessorRules.GetOldID_TIENDAValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_RecibosClienteID_TIENDA]; +end; + +function TRecibosClienteBusinessProcessorRules.GetOldID_TIENDAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_RecibosClienteID_TIENDA]); +end; + +procedure TRecibosClienteBusinessProcessorRules.SetID_TIENDAValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_RecibosClienteID_TIENDA] := aValue; +end; + +procedure TRecibosClienteBusinessProcessorRules.SetID_TIENDAIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_RecibosClienteID_TIENDA] := Null; +end; + { TPagosClienteBusinessProcessorRules } constructor TPagosClienteBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); diff --git a/Source/Modulos/Recibos de cliente/Servidor/srvRecibosCliente_Impl.dfm b/Source/Modulos/Recibos de cliente/Servidor/srvRecibosCliente_Impl.dfm index 6a920682..5ff83245 100644 --- a/Source/Modulos/Recibos de cliente/Servidor/srvRecibosCliente_Impl.dfm +++ b/Source/Modulos/Recibos de cliente/Servidor/srvRecibosCliente_Impl.dfm @@ -137,6 +137,10 @@ object srvRecibosCliente: TsrvRecibosCliente item DatasetField = 'USUARIO' TableField = 'USUARIO' + end + item + DatasetField = 'ID_TIENDA' + TableField = 'ID_TIENDA' end> end> Name = 'RecibosCliente' @@ -300,6 +304,10 @@ object srvRecibosCliente: TsrvRecibosCliente DataType = datString Size = 20 DictionaryEntry = 'RecibosCliente_USUARIO' + end + item + Name = 'ID_TIENDA' + DataType = datInteger end> end item @@ -756,76 +764,66 @@ object srvRecibosCliente: TsrvRecibosCliente DataType = datAutoInc GeneratorName = 'GEN_RECIBOS_CLIENTE_ID' Value = '' - ParamType = daptInput + end + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ID_CLIENTE' + Value = '' end item Name = 'ID_FACTURA' - DataType = datInteger Value = '' - ParamType = daptInput end item Name = 'REFERENCIA' - DataType = datString - Size = 255 Value = '' - ParamType = daptInput end item Name = 'FECHA_EMISION' - DataType = datDateTime Value = '' - ParamType = daptInput end item Name = 'FECHA_VENCIMIENTO' - DataType = datDateTime Value = '' - ParamType = daptInput end item Name = 'DESCRIPCION' - DataType = datString - Size = 255 Value = '' - ParamType = daptInput end item Name = 'OBSERVACIONES' - DataType = datString - Size = 255 Value = '' - ParamType = daptInput end item Name = 'IMPORTE' - DataType = datFloat Value = '' - ParamType = daptInput end item Name = 'OTROS_GASTOS' - DataType = datFloat Value = '' - ParamType = daptInput end item Name = 'USUARIO' - DataType = datString - Size = 20 Value = '' - ParamType = daptInput + end + item + Name = 'ID_TIENDA' + Value = '' end> Statements = < item Connection = 'IBX' TargetTable = 'RECIBOS_CLIENTE' SQL = - 'INSERT'#10' INTO RECIBOS_CLIENTE'#10' (ID, ID_FACTURA, REFERENCIA, F' + - 'ECHA_EMISION, FECHA_VENCIMIENTO, DESCRIPCION, OBSERVACIONES,'#10' ' + - ' IMPORTE, OTROS_GASTOS, USUARIO)'#10' VALUES'#10' (:ID, :ID_FACTURA,' + - ' :REFERENCIA, :FECHA_EMISION, :FECHA_VENCIMIENTO, :DESCRIPCION, ' + - ':OBSERVACIONES,'#10' :IMPORTE, :OTROS_GASTOS, :USUARIO)' + 'INSERT'#10' INTO RECIBOS_CLIENTE'#10' (ID, ID_EMPRESA, ID_CLIENTE, I' + + 'D_FACTURA, REFERENCIA, FECHA_EMISION, FECHA_VENCIMIENTO, DESCRIP' + + 'CION, OBSERVACIONES,'#10' IMPORTE, OTROS_GASTOS, USUARIO, ID_TIEN' + + 'DA)'#10' VALUES'#10' (:ID, :ID_EMPRESA, :ID_CLIENTE, :ID_FACTURA, :R' + + 'EFERENCIA, :FECHA_EMISION, :FECHA_VENCIMIENTO, :DESCRIPCION, :OB' + + 'SERVACIONES,'#10' :IMPORTE, :OTROS_GASTOS, :USUARIO, :ID_TIENDA)'#10 StatementType = stSQL ColumnMappings = <> end> @@ -853,71 +851,64 @@ object srvRecibosCliente: TsrvRecibosCliente Params = < item Name = 'ID_REMESA' - DataType = datInteger Value = '' - ParamType = daptInput + end + item + Name = 'ID_EMPRESA' + Value = '' + end + item + Name = 'ID_CLIENTE' + Value = '' end item Name = 'FECHA_EMISION' - DataType = datDateTime Value = '' - ParamType = daptInput end item Name = 'FECHA_VENCIMIENTO' - DataType = datDateTime Value = '' - ParamType = daptInput end item Name = 'DESCRIPCION' - DataType = datString - Size = 255 Value = '' - ParamType = daptInput end item Name = 'OBSERVACIONES' - DataType = datString - Size = 255 Value = '' - ParamType = daptInput end item Name = 'IMPORTE' - DataType = datFloat Value = '' - ParamType = daptInput end item Name = 'OTROS_GASTOS' - DataType = datFloat Value = '' - ParamType = daptInput end item Name = 'USUARIO' - DataType = datString - Size = 20 Value = '' - ParamType = daptInput + end + item + Name = 'ID_TIENDA' + Value = '' end item Name = 'OLD_ID' - DataType = datInteger Value = '' - ParamType = daptInput end> Statements = < item Connection = 'IBX' TargetTable = 'RECIBOS_CLIENTE' SQL = - 'UPDATE Recibos_CLIENTE'#10' SET '#10' ID_REMESA = :ID_REMESA,'#10' FE' + - 'CHA_EMISION = :FECHA_EMISION,'#10' FECHA_VENCIMIENTO = :FECHA_VEN' + - 'CIMIENTO,'#10' DESCRIPCION = :DESCRIPCION,'#10' OBSERVACIONES = :O' + - 'BSERVACIONES,'#10' IMPORTE = :IMPORTE,'#10' OTROS_GASTOS = :OTROS_' + - 'GASTOS,'#10' USUARIO = :USUARIO'#10' WHERE'#10' (ID = :OLD_ID)' + 'UPDATE Recibos_CLIENTE'#10' SET '#10' ID_REMESA = :ID_REMESA,'#10' ID' + + '_EMPRESA = :ID_EMPRESA,'#10' ID_CLIENTE = :ID_CLIENTE,'#10' FECHA_' + + 'EMISION = :FECHA_EMISION,'#10' FECHA_VENCIMIENTO = :FECHA_VENCIMI' + + 'ENTO,'#10' DESCRIPCION = :DESCRIPCION,'#10' OBSERVACIONES = :OBSER' + + 'VACIONES,'#10' IMPORTE = :IMPORTE,'#10' OTROS_GASTOS = :OTROS_GAST' + + 'OS,'#10' USUARIO = :USUARIO,'#10' ID_TIENDA = :ID_TIENDA'#10' WHERE'#10' ' + + ' (ID = :OLD_ID)'#10 StatementType = stSQL ColumnMappings = <> end> diff --git a/Source/Modulos/Recibos de cliente/Views/uEditorRecibosCliente.dfm b/Source/Modulos/Recibos de cliente/Views/uEditorRecibosCliente.dfm index 6834a382..6e7875ec 100644 --- a/Source/Modulos/Recibos de cliente/Views/uEditorRecibosCliente.dfm +++ b/Source/Modulos/Recibos de cliente/Views/uEditorRecibosCliente.dfm @@ -41,7 +41,7 @@ inherited fEditorRecibosCliente: TfEditorRecibosCliente Width = 645 ExplicitWidth = 645 inherited tbxMain: TTBXToolbar - ExplicitWidth = 434 + ExplicitWidth = 498 end inherited tbxMenu: TTBXToolbar ExplicitWidth = 645 @@ -174,9 +174,7 @@ inherited fEditorRecibosCliente: TfEditorRecibosCliente Left = 136 Top = 176 inherited actNuevo: TAction - Enabled = False ImageIndex = 22 - Visible = False end inherited actEliminar: TAction Enabled = False diff --git a/Source/Modulos/Recibos de cliente/Views/uEditorRecibosCliente.pas b/Source/Modulos/Recibos de cliente/Views/uEditorRecibosCliente.pas index ee7c4fea..8f302305 100644 --- a/Source/Modulos/Recibos de cliente/Views/uEditorRecibosCliente.pas +++ b/Source/Modulos/Recibos de cliente/Views/uEditorRecibosCliente.pas @@ -180,8 +180,11 @@ end; procedure TfEditorRecibosCliente.NuevoInterno; begin -// inherited; -//No se pueden añadir recibos nuevos + inherited; +//Se pueden añadir recibos nuevos sin tener factura asociada, ya que acana emite recibos independientes a las facturas +//por ser particulares en lugar de empresas el cliente final. + FController.Anadir(FRecibosCliente); + FController.Ver(FRecibosCliente); end; procedure TfEditorRecibosCliente.PonerTitulos(const ATitulo: string); diff --git a/Source/Servidor/uDataModuleServer.dfm b/Source/Servidor/uDataModuleServer.dfm index e51525e9..269792d9 100644 --- a/Source/Servidor/uDataModuleServer.dfm +++ b/Source/Servidor/uDataModuleServer.dfm @@ -39,9 +39,8 @@ object dmServer: TdmServer item Name = 'IBX' ConnectionString = - 'IBX?Server=localhost;Database=C:\Codigo Acana\Output\Debug\Datab' + - 'ase\FACTUGES.FDB;UserID=sysdba;Password=masterkey;Dialect=3;Char' + - 'set=ISO8859_1;' + 'IBX?Server=localhost;Database=C:\Codigo Acana\Database\ACANA.FDB' + + ';UserID=sysdba;Password=masterkey;Dialect=3;Charset=ISO8859_1;' ConnectionType = 'Interbase' Default = True end>