diff --git a/Build/Build.fbp5 b/Build/Build.fbp5 index 6ff531f2..0100bc96 100644 --- a/Build/Build.fbp5 +++ b/Build/Build.fbp5 @@ -46,6 +46,31 @@ 1000 False + + + + 0 + + False + + + True + True + True + ftString + False + True + False + + 0 + smNone + %FBPROJECTDIR% + False + 0 + 1000 + False + project_path + # 16711680 @@ -82,31 +107,6 @@ 1000 False - - - - 0 - - False - - - True - True - True - ftString - False - True - False - - 0 - smNone - %FBPROJECTDIR% - False - 0 - 1000 - False - project_path - @@ -604,7 +604,7 @@ source_path 0 %source_path%\Servidor\FactuGES_Server.dpr True - 3 + 9 rcBorland @@ -619,15 +619,15 @@ source_path True @@ -6053,7 +6053,7 @@ Comments= False False False - False + True True False False @@ -6063,7 +6063,7 @@ Comments= False False False - 3081 + 3082 1 @@ -6086,7 +6086,16 @@ Comments= [usPackages,usCompiler,usLinker,usVersionInfo] False False - @@ -6171,7 +6180,7 @@ Comments= False False False - False + True True False False @@ -6181,7 +6190,7 @@ Comments= False False False - 3081 + 3082 1 @@ -6204,7 +6213,16 @@ Comments= [usPackages,usCompiler,usLinker,usVersionInfo] False False - @@ -6289,7 +6307,7 @@ Comments= False False False - False + True True False False @@ -6299,7 +6317,7 @@ Comments= False False False - 3081 + 3082 1 @@ -6322,7 +6340,16 @@ Comments= [usPackages,usCompiler,usLinker,usVersionInfo] False False - @@ -12901,7 +12928,7 @@ Comments= False False False - False + True True False False @@ -12911,7 +12938,7 @@ Comments= False False False - 3081 + 3082 1 @@ -12935,7 +12962,16 @@ Comments= [usPackages,usCompiler,usLinker,usVersionInfo] False False - @@ -14397,7 +14433,7 @@ Comments= False 3081 - 0 + 1 0 0 @@ -14419,16 +14455,7 @@ Comments= [usPackages,usCompiler,usLinker,usVersionInfo] False False - @@ -14441,17 +14468,14 @@ Comments= False False %package_path% - + False %modules_dcp_path% - True + False - True + False False True @@ -14465,7 +14489,7 @@ Comments= True %library_path% 0 - True + False 0 1048576 16384 @@ -14477,7 +14501,7 @@ Comments= False fa8 - True + False False True @@ -14651,7 +14675,7 @@ Comments= False False False - False + True True False False @@ -14661,9 +14685,9 @@ Comments= False False False - 3081 + 3082 - 0 + 1 0 0 @@ -14687,13 +14711,13 @@ Comments= False @@ -14707,17 +14731,14 @@ Comments= False False %package_path% - + False %modules_dcp_path% - True + False - True + False False True @@ -14731,7 +14752,7 @@ Comments= True %library_path% 0 - True + False 0 1048576 16384 @@ -14743,7 +14764,7 @@ Comments= False fa8 - True + False False True @@ -14796,7 +14817,7 @@ Comments= False 3081 - 0 + 1 0 0 @@ -14818,16 +14839,7 @@ Comments= [usPackages,usCompiler,usLinker,usVersionInfo] False False - @@ -14840,17 +14852,14 @@ Comments= False False %package_path% - + False %modules_dcp_path% - True + False - True + False False True @@ -14864,7 +14873,7 @@ Comments= True %library_path% 0 - True + False 0 1048576 16384 @@ -14876,7 +14885,7 @@ Comments= False fa8 - True + False False True @@ -15311,7 +15320,7 @@ Comments= False False False - False + True True False False @@ -15321,9 +15330,9 @@ Comments= False False False - 3081 + 3082 - 0 + 1 0 0 @@ -15347,13 +15356,13 @@ Comments= False @@ -15367,17 +15376,14 @@ Comments= False False %package_path% - + False %modules_dcp_path% - True + False - True + False False True @@ -15391,7 +15397,7 @@ Comments= True %library_path% 0 - True + False 0 1048576 16384 @@ -15403,7 +15409,7 @@ Comments= False fa8 - True + False False True @@ -18180,7 +18186,7 @@ Comments= 0 %source_path%\Cliente\FactuGES.dpr True - 2 + 9 rcBorland @@ -18195,13 +18201,13 @@ Comments= False @@ -18222,7 +18228,7 @@ Comments= .\ True - True + False False True diff --git a/Database/scripts/factuges.sql b/Database/scripts/factuges.sql index 5f98b266..d11f7136 100644 --- a/Database/scripts/factuges.sql +++ b/Database/scripts/factuges.sql @@ -100,6 +100,9 @@ SET GENERATOR GEN_ALMACENES_ID TO 1; CREATE GENERATOR GEN_ARTICULOS_ID; SET GENERATOR GEN_ARTICULOS_ID TO 1; +CREATE GENERATOR GEN_ARTICULOS_PROVEEDORES_ID; +SET GENERATOR GEN_ARTICULOS_PROVEEDORES_ID TO 1; + CREATE GENERATOR GEN_CATEGORIAS_ID; SET GENERATOR GEN_CATEGORIAS_ID TO 1; @@ -391,12 +394,6 @@ CREATE TABLE ARTICULOS ( UNIDAD_MEDIDA VARCHAR(255), IMAGEN TIPO_BINARIO, COMISIONABLE TIPO_BOOLEANO, - ID_PROVEEDOR TIPO_ID, - REFERENCIA_PROV VARCHAR(255), - PRECIO_COSTE TIPO_IMPORTE, - DESCUENTO TIPO_PORCENTAJE, - PRECIO_NETO TIPO_IMPORTE, - PRECIO_PORTE TIPO_IMPORTE, FABRICANTE VARCHAR(255), REFERENCIA_FABR VARCHAR(255), FECHA_ALTA TIMESTAMP, @@ -405,13 +402,23 @@ CREATE TABLE ARTICULOS ( INVENTARIABLE TIPO_BOOLEANO, ELIMINADO TIPO_BOOLEANO, PARAM_MARGEN FLOAT, - PRECIO_PVP_VENTA TIPO_IMPORTE, TIEMPO INTEGER, PARAM_TIEMPO FLOAT, - MANO_OBRA TIPO_IMPORTE, - PRECIO_PVP_TOTAL TIPO_IMPORTE + MANO_OBRA TIPO_IMPORTE ); +CREATE TABLE ARTICULOS_PROVEEDORES ( + ID TIPO_ID NOT NULL, + ID_ARTICULO TIPO_ID, + ID_PROVEEDOR TIPO_ID, + REFERENCIA_PROV VARCHAR(255), + PRECIO_COSTE TIPO_IMPORTE, + DESCUENTO TIPO_PORCENTAJE, + PRECIO_NETO TIPO_IMPORTE, + PRECIO_PORTE TIPO_IMPORTE, + PRECIO_PVP_VENTA TIPO_IMPORTE, + PRECIO_PVP_TOTAL TIPO_IMPORTE +); CREATE TABLE CATEGORIAS ( ID TIPO_ID NOT NULL, @@ -1489,62 +1496,130 @@ WHERE ALMACENES.TIPO_ALMACEN = 'ALMACEN' ; -/* View: V_ARTICULOS */ -CREATE VIEW V_ARTICULOS( - ID, - ID_EMPRESA, - REFERENCIA, - DESCRIPCION, - UNIDAD_MEDIDA, - FAMILIA, - IMAGEN, - COMISIONABLE, - FECHA_ALTA, - FECHA_MODIFICACION, - USUARIO, - REFERENCIA_PROV, - PRECIO_COSTE, - PRECIO_PORTE, - DESCUENTO, - PRECIO_NETO, - INVENTARIABLE, - ID_PROVEEDOR, - NOMBRE_PROVEEDOR, - ELIMINADO, - FABRICANTE, - REFERENCIA_FABR, - PARAM_MARGEN, - PRECIO_PVP_VENTA, - TIEMPO, - PARAM_TIEMPO, - MANO_OBRA, - PRECIO_PVP_TOTAL) -AS -SELECT ARTICULOS.ID, ARTICULOS.ID_EMPRESA, ARTICULOS.REFERENCIA, ARTICULOS.DESCRIPCION, +CREATE VIEW V_ARTICULOS_PARA_COMPRA( +ID, +ID_EMPRESA, +REFERENCIA, +DESCRIPCION, +UNIDAD_MEDIDA, +FAMILIA, +IMAGEN, +COMISIONABLE, +FECHA_ALTA, +FECHA_MODIFICACION, +USUARIO, +REFERENCIA_PROV, +PRECIO_COSTE, +PRECIO_PORTE, +DESCUENTO, +PRECIO_NETO, +INVENTARIABLE, +ID_PROVEEDOR, +NOMBRE_PROVEEDOR, +ELIMINADO, +FABRICANTE, +REFERENCIA_FABR, +PARAM_MARGEN, +PRECIO_PVP_VENTA, +TIEMPO, +PARAM_TIEMPO, +MANO_OBRA, +PRECIO_PVP_TOTAL, +ID_ARTICULO) + AS +SELECT ARTICULOS.ID || 0 || ARTICULOS_PROVEEDORES.ID_PROVEEDOR, + ARTICULOS.ID_EMPRESA, ARTICULOS.REFERENCIA, ARTICULOS.DESCRIPCION, ARTICULOS.UNIDAD_MEDIDA, ARTICULOS.FAMILIA, ARTICULOS.IMAGEN, ARTICULOS.COMISIONABLE, ARTICULOS.FECHA_ALTA, ARTICULOS.FECHA_MODIFICACION, ARTICULOS.USUARIO, - ARTICULOS.REFERENCIA_PROV, - ARTICULOS.PRECIO_COSTE, - ARTICULOS.PRECIO_PORTE, - ARTICULOS.DESCUENTO, - ARTICULOS.PRECIO_NETO, + ARTICULOS_PROVEEDORES.REFERENCIA_PROV, + ARTICULOS_PROVEEDORES.PRECIO_COSTE, + ARTICULOS_PROVEEDORES.PRECIO_PORTE, + ARTICULOS_PROVEEDORES.DESCUENTO, + ARTICULOS_PROVEEDORES.PRECIO_NETO, ARTICULOS.INVENTARIABLE, - ARTICULOS.ID_PROVEEDOR, + ARTICULOS_PROVEEDORES.ID_PROVEEDOR, CONTACTOS.NOMBRE AS NOMBRE_PROVEEDOR, ARTICULOS.ELIMINADO, ARTICULOS.FABRICANTE, ARTICULOS.REFERENCIA_FABR, ARTICULOS.PARAM_MARGEN, - ARTICULOS.PRECIO_PVP_VENTA, + ARTICULOS_PROVEEDORES.PRECIO_PVP_VENTA, ARTICULOS.TIEMPO, ARTICULOS.PARAM_TIEMPO, ARTICULOS.MANO_OBRA, - ARTICULOS.PRECIO_PVP_TOTAL + ARTICULOS_PROVEEDORES.PRECIO_PVP_TOTAL, + ARTICULOS.ID FROM ARTICULOS -LEFT OUTER JOIN CONTACTOS ON (CONTACTOS.ID = ARTICULOS.ID_PROVEEDOR) -WHERE (ARTICULOS.ELIMINADO = 0) -; +LEFT OUTER JOIN ARTICULOS_PROVEEDORES ON (ARTICULOS_PROVEEDORES.ID_ARTICULO = ARTICULOS.ID) +LEFT OUTER JOIN CONTACTOS ON (CONTACTOS.ID = ARTICULOS_PROVEEDORES.ID_PROVEEDOR) +WHERE (ARTICULOS.ELIMINADO = 0); + + +CREATE VIEW V_ARTICULOS_PVP_MAX( + ID_ARTICULO, + PRECIO_PVP_VENTA, + PRECIO_PVP_TOTAL) +AS +select +ID_ARTICULO, MAX(COALESCE(PRECIO_PVP_VENTA,0)) as PRECIO_PVP_VENTA, MAX(COALESCE(PRECIO_PVP_TOTAL,0)) as PRECIO_PVP_TOTAL +from ARTICULOS_PROVEEDORES +group by 1; + +CREATE VIEW V_ARTICULOS_PARA_VENTA( +ID, +ID_EMPRESA, +REFERENCIA, +DESCRIPCION, +UNIDAD_MEDIDA, +FAMILIA, +IMAGEN, +COMISIONABLE, +FECHA_ALTA, +FECHA_MODIFICACION, +USUARIO, +REFERENCIA_PROV, +PRECIO_COSTE, +PRECIO_PORTE, +DESCUENTO, +PRECIO_NETO, +INVENTARIABLE, +ELIMINADO, +FABRICANTE, +REFERENCIA_FABR, +PARAM_MARGEN, +PRECIO_PVP_VENTA, +TIEMPO, +PARAM_TIEMPO, +MANO_OBRA, +PRECIO_PVP_TOTAL) + AS +SELECT ARTICULOS.ID, ARTICULOS.ID_EMPRESA, ARTICULOS.REFERENCIA, ARTICULOS.DESCRIPCION, + ARTICULOS.UNIDAD_MEDIDA, ARTICULOS.FAMILIA, ARTICULOS.IMAGEN, + ARTICULOS.COMISIONABLE, ARTICULOS.FECHA_ALTA, + ARTICULOS.FECHA_MODIFICACION, ARTICULOS.USUARIO, + +/*Estos Campos se necesitan para que no se tenga que tocar la lógica de selección de articulos de toda la aplicación*/ + '' as REFERENCIA_PROV, + 0 as PRECIO_COSTE, + 0 as PRECIO_PORTE, + 0 as DESCUENTO, + 0 as PRECIO_NETO, + + ARTICULOS.INVENTARIABLE, + ARTICULOS.ELIMINADO, + ARTICULOS.FABRICANTE, + ARTICULOS.REFERENCIA_FABR, + ARTICULOS.PARAM_MARGEN, + V_ARTICULOS_PVP_MAX.PRECIO_PVP_VENTA, + ARTICULOS.TIEMPO, + ARTICULOS.PARAM_TIEMPO, + ARTICULOS.MANO_OBRA, + V_ARTICULOS_PVP_MAX.PRECIO_PVP_TOTAL + +FROM ARTICULOS +LEFT OUTER JOIN V_ARTICULOS_PVP_MAX ON (V_ARTICULOS_PVP_MAX.ID_ARTICULO = ARTICULOS.ID) +WHERE (ARTICULOS.ELIMINADO = 0); /* View: V_CONTACTOS */ @@ -2383,23 +2458,21 @@ FROM V_INV_RESERVAS -/* View: V_INVENTARIO */ +/* View: V_INVENTARIO desactivamos costes porque se traslada a detalles del articulo*/ CREATE VIEW V_INVENTARIO( - ID_ALMACEN, - ID_EMPRESA, - NOMBRE, - ID_ARTICULO, - REFERENCIA, - FAMILIA, - DESCRIPCION, - REFERENCIA_PROV, - PRECIO_NETO, - STOCK, - UNIDADES_ALMACEN, - COSTE_UNIDADES, - RESERVA, - PENDIENTE_RECEPCION) -AS +ID_ALMACEN, +ID_EMPRESA, +NOMBRE, +ID_ARTICULO, +REFERENCIA, +FAMILIA, +DESCRIPCION, +REFERENCIA_FAB, +STOCK, +UNIDADES_ALMACEN, +RESERVA, +PENDIENTE_RECEPCION) + AS SELECT ID_ALMACEN, ALMACENES.ID_EMPRESA, ALMACENES.NOMBRE, @@ -2407,16 +2480,16 @@ SELECT ID_ALMACEN, ARTICULOS.REFERENCIA, ARTICULOS.FAMILIA, ARTICULOS.DESCRIPCION, - ARTICULOS.REFERENCIA_PROV, - COALESCE(ARTICULOS.PRECIO_NETO,0) as PRECIO_NETO, + ARTICULOS.REFERENCIA_FABR, +/* COALESCE(ARTICULOS.PRECIO_NETO,0) as PRECIO_NETO,*/ (SUM(STOCK) - SUM(RESERVA)) as STOCK, SUM(STOCK) as UNIDADES_ALMACEN, /*Si las unidades son negativas no se tiene en cuenta el coste*/ - CASE WHEN (SUM(STOCK) < 0) THEN 0 +/* CASE WHEN (SUM(STOCK) < 0) THEN 0 ELSE (COALESCE(ARTICULOS.PRECIO_NETO,0) * SUM(STOCK)) END as COSTE_UNIDADES, - +*/ SUM(RESERVA) as RESERVA, SUM(PENDIENTE_RECEPCION) as PENDIENTE_RECEPCION @@ -2437,10 +2510,8 @@ GROUP BY ID_ALMACEN, ARTICULOS.REFERENCIA, ARTICULOS.FAMILIA, ARTICULOS.DESCRIPCION, - ARTICULOS.REFERENCIA_PROV, - ARTICULOS.PRECIO_NETO -; - + ARTICULOS.REFERENCIA_FABR +/* ARTICULOS.PRECIO_NETO*/; /* View: V_OBRAS */ @@ -2947,6 +3018,7 @@ ALTER TABLE ALBARANES_PROVEEDOR ADD CONSTRAINT PK_ALBARAN_PROVEEDOR PRIMARY KEY ALTER TABLE ALBARANES_PROVEEDOR_DETALLES ADD CONSTRAINT PK_ALBARANES_PROVEEDOR_DETALLES PRIMARY KEY (ID); ALTER TABLE ALMACENES ADD CONSTRAINT PK_ALMACENES PRIMARY KEY (ID); ALTER TABLE ARTICULOS ADD CONSTRAINT PK_ARTICULOS PRIMARY KEY (ID); +ALTER TABLE ARTICULOS_PROVEEDORES ADD CONSTRAINT PK_ARTICULOS_PROVEEDORES PRIMARY KEY (ID); ALTER TABLE CATEGORIAS ADD CONSTRAINT PK_CATEGORIAS PRIMARY KEY (ID); ALTER TABLE CLIENTES_DATOS ADD CONSTRAINT PK_CLIENTES_DATOS PRIMARY KEY (ID_CLIENTE); ALTER TABLE CLIENTES_DTOS_PROVEEDORES ADD CONSTRAINT PK_CLIENTES_DTOS_PROV PRIMARY KEY (ID); @@ -3052,7 +3124,8 @@ CREATE INDEX IDX_ALBARANES_PROVEEDOR2 ON ALBARANES_PROVEEDOR (ID_FORMA_PAGO); CREATE INDEX IDX_ALBARANES_PROVEEDOR3 ON ALBARANES_PROVEEDOR (TIPO); CREATE INDEX IDX_ALBARANES_PROV_DETALLES ON ALBARANES_PROVEEDOR_DETALLES (ID_ALBARAN); CREATE INDEX IDX_ALBARANES_PROV_DETALLES1 ON ALBARANES_PROVEEDOR_DETALLES (ID_ARTICULO); -CREATE INDEX IDX_ARTICULOS ON ARTICULOS (ID_PROVEEDOR); +CREATE INDEX ARTICULOS_PROVEEDORES_IDX1 ON ARTICULOS_PROVEEDORES (ID_ARTICULO); +CREATE INDEX ARTICULOS_PROVEEDORES_IDX2 ON ARTICULOS_PROVEEDORES (ID_PROVEEDOR); CREATE INDEX IDX_CLIENTES_DATOS ON CLIENTES_DATOS (ID_TIPO_IVA); CREATE INDEX IDX_CLIENTES_DATOS1 ON CLIENTES_DATOS (ID_FORMA_PAGO); CREATE INDEX IDX_CLIENTES_DATOS_ID_AGENTE ON CLIENTES_DATOS (ID_AGENTE); @@ -3197,7 +3270,9 @@ end^ SET TERM ; ^ GRANT SELECT ON PRESUPUESTOS_CLIENTE_DETALLES TO PROCEDURE PRO_PRES_CAPITULOS; + GRANT EXECUTE ON PROCEDURE PRO_PRES_CAPITULOS TO "PUBLIC"; +GRANT EXECUTE ON PROCEDURE PRO_PRES_CAPITULOS TO SYSDBA; SET TERM ^ ; @@ -3250,8 +3325,11 @@ end^ SET TERM ; ^ GRANT SELECT ON PRESUPUESTOS_CLIENTE_DETALLES TO PROCEDURE PRO_PRES_CAPITULOS_CONCEPTOS; + GRANT SELECT ON ARTICULOS TO PROCEDURE PRO_PRES_CAPITULOS_CONCEPTOS; + GRANT EXECUTE ON PROCEDURE PRO_PRES_CAPITULOS_CONCEPTOS TO "PUBLIC"; +GRANT EXECUTE ON PROCEDURE PRO_PRES_CAPITULOS_CONCEPTOS TO SYSDBA; SET TERM ^ ; @@ -3318,7 +3396,7 @@ begin contador = contador + 1; if ((tipo_detalle <> 'Concepto') or (contador = num_filas)) then begin - total_acumulado = total_acumulado + importe_total; + total_acumulado = total_acumulado + importe_total; importe_total = total_acumulado; tipo_detalle = 'Titulo'; concepto = 'General'; @@ -3351,4 +3429,45 @@ end^ SET TERM ; ^ GRANT SELECT ON PRESUPUESTOS_CLIENTE_DETALLES TO PROCEDURE PRO_PRES_RESUMEN; + GRANT EXECUTE ON PROCEDURE PRO_PRES_RESUMEN TO "PUBLIC"; +GRANT EXECUTE ON PROCEDURE PRO_PRES_RESUMEN TO SYSDBA; + +SET TERM ^ ; + +CREATE PROCEDURE PRO_ART_RECALCULAR_PVP ( + id_empresa integer, + param_margen float, + param_tiempo numeric(11,2)) +as +declare variable id_articulo integer; +declare variable mano_obra numeric(11,2); +begin + UPDATE ARTICULOS + SET PARAM_TIEMPO = :PARAM_TIEMPO, + PARAM_MARGEN = :PARAM_MARGEN, + MANO_OBRA = (TIEMPO * :PARAM_TIEMPO) + WHERE ID_EMPRESA = :ID_EMPRESA; + + for select ID, MANO_OBRA + from articulos + where ID_EMPRESA = :ID_EMPRESA + into :ID_ARTICULO, :MANO_OBRA + do + begin + update articulos_proveedores + set PRECIO_PVP_VENTA = (PRECIO_NETO + PRECIO_PORTE) * (((:PARAM_MARGEN) / 100) + 1), + PRECIO_PVP_TOTAL = ((PRECIO_NETO + PRECIO_PORTE) * (((:PARAM_MARGEN) / 100) + 1)) + :MANO_OBRA + where id_articulo = :ID_ARTICULO; + end + + suspend; +end^ + +SET TERM ; ^ + +GRANT SELECT,UPDATE ON ARTICULOS TO PROCEDURE PRO_ART_RECALCULAR_PVP; + +GRANT SELECT,UPDATE ON ARTICULOS_PROVEEDORES TO PROCEDURE PRO_ART_RECALCULAR_PVP; + +GRANT EXECUTE ON PROCEDURE PRO_ART_RECALCULAR_PVP TO SYSDBA; \ No newline at end of file diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index af58df49..1a96a865 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -53,58 +53,58 @@ MainSource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fConfigurarConexion
TForm diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index 32493b06..dfd84cc9 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -54,7 +54,7 @@ Delphi.Personality VCLApplication -FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1090FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.0.9.0FactuGESFactuGES1.0.9.0 +FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse1100FalseFalseFalseFalseFalse30821252Rodax Software S.L.1.1.0.0FactuGESFactuGES1.1.0.0 diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc index d1f17f22..de70c028 100644 --- a/Source/Cliente/FactuGES.rc +++ b/Source/Cliente/FactuGES.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Tecsitel\Resources\Iconos\Factuges.ico" 1 VERSIONINFO -FILEVERSION 1,0,9,0 -PRODUCTVERSION 1,0,9,0 +FILEVERSION 1,1,0,0 +PRODUCTVERSION 1,1,0,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "1.0.9.0\0" + VALUE "FileVersion", "1.1.0.0\0" VALUE "InternalName", "FactuGES\0" VALUE "ProductName", "FactuGES\0" - VALUE "ProductVersion", "1.0.9.0\0" + VALUE "ProductVersion", "1.1.0.0\0" END END BLOCK "VarFileInfo" diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res index c994dcb6..29941151 100644 Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ diff --git a/Source/GUIBase/GUIBase.dproj b/Source/GUIBase/GUIBase.dproj index 3c4c88ad..d352233f 100644 --- a/Source/GUIBase/GUIBase.dproj +++ b/Source/GUIBase/GUIBase.dproj @@ -58,52 +58,52 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fDialogBase
diff --git a/Source/GUIBase/uViewGrid.dfm b/Source/GUIBase/uViewGrid.dfm index 0921a002..330a2d07 100644 --- a/Source/GUIBase/uViewGrid.dfm +++ b/Source/GUIBase/uViewGrid.dfm @@ -75,6 +75,7 @@ inherited frViewGrid: TfrViewGrid TabOrder = 1 Visible = False ExplicitWidth = 607 + ExplicitHeight = 102 inherited TBXDockablePanel1: TTBXDockablePanel ExplicitWidth = 607 ExplicitHeight = 102 @@ -82,31 +83,23 @@ inherited frViewGrid: TfrViewGrid Width = 607 ExplicitWidth = 607 inherited txtFiltroTodo: TcxTextEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 510 Width = 510 end inherited edtFechaIniFiltro: TcxDateEdit - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitWidth = 272 Width = 272 end inherited edtFechaFinFiltro: TcxDateEdit Left = 376 - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 376 ExplicitWidth = 221 Width = 221 end + inherited eLista: TcxComboBox + Left = 634 + ExplicitLeft = 634 + end end inherited TBXAlignmentPanel1: TTBXAlignmentPanel Width = 607 @@ -130,6 +123,7 @@ inherited frViewGrid: TfrViewGrid SupportedDocks = [dkStandardDock, dkMultiDock] TabOrder = 2 Visible = False + ExplicitWidth = 128 object TBXAlignmentPanel1: TTBXAlignmentPanel Left = 0 Top = 0 @@ -179,7 +173,7 @@ inherited frViewGrid: TfrViewGrid PrinterPage.ScaleMode = smFit PrinterPage._dxMeasurementUnits_ = 0 PrinterPage._dxLastMU_ = 2 - ReportDocument.CreationDate = 39601.798944490740000000 + ReportDocument.CreationDate = 39646.545284641200000000 StyleManager = dmBase.dxPrintStyleManager1 OptionsCards.Shadow.Depth = 0 OptionsExpanding.ExpandGroupRows = True diff --git a/Source/GUIBase/uViewGrid.pas b/Source/GUIBase/uViewGrid.pas index 99e24869..463a38c8 100644 --- a/Source/GUIBase/uViewGrid.pas +++ b/Source/GUIBase/uViewGrid.pas @@ -151,16 +151,19 @@ end; procedure TfrViewGrid.actQuitarAgrupacionesExecute(Sender: TObject); var Columna: TcxGridDBColumn; - i: Integer; + i,j: Integer; begin inherited; - for i := 0 to cxGridView.ColumnCount - 1 do + for j := 0 to cxGrid.ViewCount - 1 do begin - Columna := (cxGridView as TcxGridDBTableView).Columns[i]; - if not (Columna.GroupIndex < 0) then + for i := 0 to (cxGrid.Views[j] as tcxGridDBTableView).ColumnCount - 1 do begin - Columna.GroupIndex := -1; - Columna.Visible := True; + Columna := (cxGrid.Views[j] as TcxGridDBTableView).Columns[i]; + if not (Columna.GroupIndex < 0) then + begin + Columna.GroupIndex := -1; + Columna.Visible := True; + end; end; end; end; diff --git a/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteClient_Intf.pas b/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteClient_Intf.pas index 2ce72a77..0bbbadfa 100644 --- a/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteClient_Intf.pas +++ b/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteClient_Intf.pas @@ -9,8 +9,8 @@ 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_AlbaranesCliente = '{179EC550-0441-420C-A5A6-2645AD5DF320}'; - RID_AlbaranesCliente_Detalles = '{0C3A4CC7-5E16-455A-9B47-71EFAF0230F2}'; + RID_AlbaranesCliente = '{FCCE9431-F9AF-47FC-827F-3B80548952DB}'; + RID_AlbaranesCliente_Detalles = '{6BE5CCD5-B3AA-464D-9FE1-694242071E0E}'; { Data table names } nme_AlbaranesCliente = 'AlbaranesCliente'; @@ -135,7 +135,7 @@ const type { IAlbaranesCliente } IAlbaranesCliente = interface(IDAStronglyTypedDataTable) - ['{ADC392F2-58E1-4B5C-9A26-B6FF6A0A1910}'] + ['{9D9C017D-A65F-430D-9903-3724A7FA2AA7}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -626,7 +626,7 @@ type { IAlbaranesCliente_Detalles } IAlbaranesCliente_Detalles = interface(IDAStronglyTypedDataTable) - ['{E2A542CA-3048-41D1-B2C5-BEB5BBB159F6}'] + ['{C6B6C302-E6F3-44D6-8C18-B8EE3F64EBED}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); diff --git a/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteServer_Intf.pas b/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteServer_Intf.pas index 6cd958c2..92752756 100644 --- a/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteServer_Intf.pas +++ b/Source/Modulos/Albaranes de cliente/Model/schAlbaranesClienteServer_Intf.pas @@ -9,13 +9,13 @@ 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_AlbaranesClienteDelta = '{A0247A1C-8D8E-4287-81FB-B19EABA7591B}'; - RID_AlbaranesCliente_DetallesDelta = '{D0788BB3-1048-42C6-A38C-93E893A5748A}'; + RID_AlbaranesClienteDelta = '{A0E14879-92D0-49C8-A6D1-3A73C272869D}'; + RID_AlbaranesCliente_DetallesDelta = '{9E3B92BA-F5F8-42DB-BC6F-E85CA27897BF}'; type { IAlbaranesClienteDelta } IAlbaranesClienteDelta = interface(IAlbaranesCliente) - ['{A0247A1C-8D8E-4287-81FB-B19EABA7591B}'] + ['{A0E14879-92D0-49C8-A6D1-3A73C272869D}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -507,7 +507,7 @@ type { IAlbaranesCliente_DetallesDelta } IAlbaranesCliente_DetallesDelta = interface(IAlbaranesCliente_Detalles) - ['{D0788BB3-1048-42C6-A38C-93E893A5748A}'] + ['{9E3B92BA-F5F8-42DB-BC6F-E85CA27897BF}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_ALBARANValue : Integer; diff --git a/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.dfm b/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.dfm index c42b0753..da303328 100644 --- a/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.dfm +++ b/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.dfm @@ -349,25 +349,24 @@ object RptAlbaranesCliente: TRptAlbaranesCliente 'LIENTE_DETALLES.CONCEPTO) as CONCEPTO, ALBARANES_CLIENTE_DETALLE' + 'S.CANTIDAD,'#10' ALBARANES_CLIENTE_DETALLES.IMPORTE_UNIDAD, AL' + 'BARANES_CLIENTE_DETALLES.IMPORTE_TOTAL,'#10' ARTICULOS.REFEREN' + - 'CIA, ARTICULOS.FAMILIA, ARTICULOS.REFERENCIA_PROV as REFERENCIA_' + - 'PROVEEDOR'#10#10#10'FROM ALBARANES_CLIENTE_DETALLES'#10'LEFT JOIN ARTICULOS ' + - 'ON (ALBARANES_CLIENTE_DETALLES.ID_ARTICULO = ARTICULOS.ID)'#10'WHERE' + - ' (ID_ALBARAN = :ID_ALBARAN)'#10'AND (ARTICULOS.INVENTARIABLE = 1)'#10'OR' + - 'DER BY POSICION' + 'CIA, ARTICULOS.FAMILIA'#10#10#10'FROM ALBARANES_CLIENTE_DETALLES'#10'LEFT JO' + + 'IN ARTICULOS ON (ALBARANES_CLIENTE_DETALLES.ID_ARTICULO = ARTICU' + + 'LOS.ID)'#10'WHERE (ID_ALBARAN = :ID_ALBARAN)'#10'AND (ARTICULOS.INVENTAR' + + 'IABLE = 1)'#10'ORDER BY POSICION'#10 StatementType = stSQL ColumnMappings = < item - DatasetField = 'CANTIDAD' - TableField = 'CANTIDAD' + DatasetField = 'ID' + TableField = 'ID' + end + item + DatasetField = 'ID_ALBARAN' + TableField = 'ID_ALBARAN' end item DatasetField = 'POSICION' TableField = 'POSICION' end - item - DatasetField = 'ID' - TableField = 'ID' - end item DatasetField = 'TIPO_DETALLE' TableField = 'TIPO_DETALLE' @@ -376,6 +375,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente DatasetField = 'CONCEPTO' TableField = 'CONCEPTO' end + item + DatasetField = 'CANTIDAD' + TableField = 'CANTIDAD' + end item DatasetField = 'IMPORTE_UNIDAD' TableField = 'IMPORTE_UNIDAD' @@ -386,19 +389,13 @@ object RptAlbaranesCliente: TRptAlbaranesCliente end item DatasetField = 'REFERENCIA' - TableField = 'REFERENCIA' + TableField = '' + SQLOrigin = 'REFERENCIA' end item DatasetField = 'FAMILIA' - TableField = 'FAMILIA' - end - item - DatasetField = 'REFERENCIA_PROVEEDOR' - TableField = 'REFERENCIA_PROVEEDOR' - end - item - DatasetField = 'ID_ALBARAN' - TableField = 'ID_ALBARAN' + TableField = '' + SQLOrigin = 'FAMILIA' end> end> Name = 'Informe_Detalles_Etiquetas' @@ -420,15 +417,10 @@ object RptAlbaranesCliente: TRptAlbaranesCliente DataType = datString Size = 10 end - item - Name = 'REFERENCIA' - DataType = datString - Size = 255 - end item Name = 'CONCEPTO' DataType = datString - Size = 2000 + Size = 254 end item Name = 'CANTIDAD' @@ -436,19 +428,19 @@ object RptAlbaranesCliente: TRptAlbaranesCliente end item Name = 'IMPORTE_UNIDAD' - DataType = datFloat + DataType = datCurrency end item Name = 'IMPORTE_TOTAL' - DataType = datFloat + DataType = datCurrency end item - Name = 'FAMILIA' + Name = 'REFERENCIA' DataType = datString Size = 255 end item - Name = 'REFERENCIA_PROVEEDOR' + Name = 'FAMILIA' DataType = datString Size = 255 end> diff --git a/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.pas b/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.pas index d4cdc713..a2f9b748 100644 --- a/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.pas +++ b/Source/Modulos/Albaranes de cliente/Reports/uRptAlbaranesCliente_Server.pas @@ -57,10 +57,10 @@ type detallesIMPORTE_UNIDAD: TIBBCDField; detallesIMPORTE_TOTAL: TIBBCDField; detallesREFERENCIA: TIBStringField; - schReport: TDASchema; - DataDictionary: TDADataDictionary; tbl_Cabecera: TDAMemDataTable; tbl_Detalles: TDAMemDataTable; + schReport: TDASchema; + DataDictionary: TDADataDictionary; procedure DataModuleCreate(Sender: TObject); private FConnection: IDAConnection; diff --git a/Source/Modulos/Albaranes de cliente/Servidor/srvAlbaranesCliente_Impl.dfm b/Source/Modulos/Albaranes de cliente/Servidor/srvAlbaranesCliente_Impl.dfm index 8dca466b..8698b93b 100644 --- a/Source/Modulos/Albaranes de cliente/Servidor/srvAlbaranesCliente_Impl.dfm +++ b/Source/Modulos/Albaranes de cliente/Servidor/srvAlbaranesCliente_Impl.dfm @@ -415,10 +415,12 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente 'ENTO,'#10' ALBARANES_CLIENTE_DETALLES.IMPORTE_PORTE, ALBARANES_CL' + 'IENTE_DETALLES.IMPORTE_TOTAL,'#10' ALBARANES_CLIENTE_DETALLES.VIS' + 'IBLE,'#10' ALBARANES_CLIENTE_DETALLES.ID_ARTICULO, ARTICULOS.REFE' + - 'RENCIA, ARTICULOS.REFERENCIA_PROV as REFERENCIA_PROVEEDOR,'#10' A' + - 'LBARANES_CLIENTE_DETALLES.ID_PEDIDO'#10#10'FROM ALBARANES_CLIENTE_DETA' + - 'LLES'#10'LEFT JOIN ARTICULOS ON ALBARANES_CLIENTE_DETALLES.ID_ARTICU' + - 'LO = ARTICULOS.ID'#10'where {where}'#10'ORDER BY POSICION;'#10#10 + 'RENCIA,'#10' '#39#39' as REFERENCIA_PROVEEDOR, /*Es necesario para que ' + + 'no pete detalles porque tanto en la rama de cliente como de prov' + + 'eedor es comun*/'#10' ALBARANES_CLIENTE_DETALLES.ID_PEDIDO'#10#10'FROM ' + + 'ALBARANES_CLIENTE_DETALLES'#10'LEFT JOIN ARTICULOS ON ALBARANES_CLIE' + + 'NTE_DETALLES.ID_ARTICULO = ARTICULOS.ID'#10'where {where}'#10'ORDER BY P' + + 'OSICION;'#10#10 StatementType = stSQL ColumnMappings = < item @@ -557,6 +559,7 @@ object srvAlbaranesCliente: TsrvAlbaranesCliente Name = 'REFERENCIA_PROVEEDOR' DataType = datString Size = 255 + DictionaryEntry = 'AlbaranesCliente_Detalles_REFERENCIA_PROVEEDOR' end item Name = 'ID_PEDIDO' diff --git a/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dproj b/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dproj index 03b9e2c1..4e465868 100644 --- a/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dproj +++ b/Source/Modulos/Albaranes de cliente/Views/AlbaranesCliente_view.dproj @@ -43,10 +43,6 @@ Package FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0 - - - - File c:\archivos de programa\borland\delphi10\Bin\dclIntraweb_80_100.bpl not found File c:\archivos de programa\borland\delphi10\Bin\dclnet100.bpl not found File c:\archivos de programa\borland\delphi10\Bin\dclsoap100.bpl not found @@ -58,31 +54,31 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
fEditorAlbaranCliente
diff --git a/Source/Modulos/Albaranes de cliente/Views/uEditorElegirArticulosAlbaranCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uEditorElegirArticulosAlbaranCliente.pas index f24de4be..562c8edb 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uEditorElegirArticulosAlbaranCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uEditorElegirArticulosAlbaranCliente.pas @@ -9,12 +9,13 @@ uses StdActns, ActnList, uCustomView, uViewBase, uViewBarraSeleccion, ComCtrls, JvExComCtrls, JvStatusBar, TBX, TB2ExtItems, TBXExtItems, TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent, JvNavigationPane, - JvgWizardHeader, uIEditorElegirArticulosAlbaranesCliente, uDAInterfaces; + JvgWizardHeader, uIEditorElegirArticulosAlbaranesCliente, uDAInterfaces, + uViewGridBase, uViewGrid, uViewArticulos; type TfEditorElegirArticulosAlbaranCliente = class(TfEditorElegirArticulos, IEditorElegirArticulosAlbaranesCliente) - protected - procedure AsignarVista; override; + public + constructor Create(AOwner: TComponent); override; end; @@ -25,8 +26,9 @@ uses uViewElegirArticulosAlbaranesCliente; { TfEditorElegirArticulosAlbaranCliente } -procedure TfEditorElegirArticulosAlbaranCliente.AsignarVista; +constructor TfEditorElegirArticulosAlbaranCliente.Create(AOwner: TComponent); begin + inherited; ViewGrid := CreateView(TfrViewElegirArticulosAlbaranesCliente) as IViewElegirArticulosAlbaranesCliente; end; diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.dfm index 1cf030cf..2c0cf031 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.dfm @@ -1,51 +1,43 @@ inherited frViewDetallesAlbaranCliente: TfrViewDetallesAlbaranCliente inherited ToolBar1: TToolBar - Height = 73 - ExplicitHeight = 73 - inherited ToolButton3: TToolButton - Wrap = False - end - inherited ToolButton4: TToolButton - Left = 278 - Top = 0 - ExplicitLeft = 278 - ExplicitTop = 0 - end - inherited ToolButton14: TToolButton - Left = 334 - Top = 0 - ExplicitLeft = 334 - ExplicitTop = 0 - end - inherited FontName: TJvFontComboBox + Height = 95 + ExplicitHeight = 95 + inherited FontName: TJvFontComboBox [4] + Left = 56 Top = 22 + ExplicitLeft = 56 ExplicitTop = 22 end + inherited ToolButton14: TToolButton [5] + Left = 201 + Wrap = False + ExplicitLeft = 201 + end inherited FontSize: TEdit + Left = 266 Top = 22 + ExplicitLeft = 266 ExplicitTop = 22 end inherited UpDown1: TUpDown + Left = 308 Top = 22 + ExplicitLeft = 308 ExplicitTop = 22 end inherited ToolButton13: TToolButton + Left = 325 Top = 22 + ExplicitLeft = 325 ExplicitTop = 22 end - inherited ToolButton6: TToolButton + inherited ToolButton11: TToolButton [9] + Left = 333 Top = 22 + ExplicitLeft = 333 ExplicitTop = 22 end - inherited ToolButton7: TToolButton - Top = 22 - ExplicitTop = 22 - end - inherited ToolButton8: TToolButton - Top = 22 - ExplicitTop = 22 - end - inherited ToolButton12: TToolButton + inherited ToolButton12: TToolButton [10] Left = 0 Top = 22 Wrap = True @@ -53,29 +45,41 @@ inherited frViewDetallesAlbaranCliente: TfrViewDetallesAlbaranCliente ExplicitTop = 22 ExplicitHeight = 27 end - inherited ToolButton9: TToolButton + inherited ToolButton9: TToolButton [11] Left = 0 Top = 49 ExplicitLeft = 0 ExplicitTop = 49 end - inherited ToolButton10: TToolButton + inherited ToolButton10: TToolButton [12] Left = 145 Top = 49 ExplicitLeft = 145 ExplicitTop = 49 end - inherited ToolButton11: TToolButton + inherited ToolButton6: TToolButton [13] Left = 270 Top = 49 ExplicitLeft = 270 ExplicitTop = 49 end + inherited ToolButton7: TToolButton [14] + Left = 336 + Top = 49 + Wrap = True + ExplicitLeft = 336 + ExplicitTop = 49 + end + inherited ToolButton8: TToolButton [15] + Left = 0 + Top = 71 + ExplicitLeft = 0 + ExplicitTop = 71 + end end inherited cxGrid: TcxGrid - Top = 99 - Height = 205 - ExplicitWidth = 451 + Top = 121 + Height = 183 inherited cxGridView: TcxGridDBTableView inherited cxGridViewTIPO: TcxGridDBColumn Visible = False @@ -84,8 +88,7 @@ inherited frViewDetallesAlbaranCliente: TfrViewDetallesAlbaranCliente end end inherited TBXDock1: TTBXDock - Top = 73 - ExplicitWidth = 451 + Top = 95 inherited TBXToolbar1: TTBXToolbar DockPos = 0 inherited TBXSubmenuItem1: TTBXSubmenuItem diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.pas index a3940399..02f2ef59 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uViewDetallesAlbaranCliente.pas @@ -20,7 +20,8 @@ uses dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinSilver, dxSkinStardust, dxSkinsDefaultPainters, dxSkinValentine, dxSkinXmas2008Blue, - dxSkinscxPCPainter, Menus, cxGridCustomPopupMenu, cxGridPopupMenu; + dxSkinscxPCPainter, Menus, cxGridCustomPopupMenu, cxGridPopupMenu, uViewDetallesArticulosParaVenta, + cxEditRepositoryItems; type IViewDetallesAlbaranCliente = interface(IViewDetallesArticulos) @@ -30,7 +31,7 @@ type property Albaran: IBizAlbaranCliente read GetAlbaran write SetAlbaran; end; - TfrViewDetallesAlbaranCliente = class(TfrViewDetallesArticulos, IViewDetallesAlbaranCliente) + TfrViewDetallesAlbaranCliente = class(TfrViewDetallesArticulosParaVenta, IViewDetallesAlbaranCliente) N2: TMenuItem; Aadirartculos1: TMenuItem; TBXItem18: TTBXItem; diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewElegirArticulosAlbaranesCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewElegirArticulosAlbaranesCliente.dfm index c520a4ca..05a03b22 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewElegirArticulosAlbaranesCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uViewElegirArticulosAlbaranesCliente.dfm @@ -1,22 +1,4 @@ inherited frViewElegirArticulosAlbaranesCliente: TfrViewElegirArticulosAlbaranesCliente - inherited cxGrid: TcxGrid - inherited cxGridView: TcxGridDBTableView - inherited cxGridViewPRECIO_COSTE: TcxGridDBColumn - Visible = False - VisibleForCustomization = False - end - inherited cxGridViewDESCUENTO: TcxGridDBColumn - Visible = False - VisibleForCustomization = False - end - inherited cxGridViewPRECIO_NETO: TcxGridDBColumn - Visible = False - end - inherited cxGridViewPRECIO_PORTE: TcxGridDBColumn - Visible = False - end - end - end inherited frViewFiltroBase1: TfrViewFiltroBase inherited TBXDockablePanel1: TTBXDockablePanel inherited dxLayoutControl1: TdxLayoutControl diff --git a/Source/Modulos/Albaranes de proveedor/Controller/uDetallesAlbaranProveedorController.pas b/Source/Modulos/Albaranes de proveedor/Controller/uDetallesAlbaranProveedorController.pas index bbc02d18..f85db022 100644 --- a/Source/Modulos/Albaranes de proveedor/Controller/uDetallesAlbaranProveedorController.pas +++ b/Source/Modulos/Albaranes de proveedor/Controller/uDetallesAlbaranProveedorController.pas @@ -6,6 +6,9 @@ uses uDADataTable, uControllerDetallesArticulos, uBizDetallesAlbaranProveedor, uIDataModuleAlbaranesProveedor, uBizArticulos, uBizContactos; +const + CAMPO_REFERENCIA_FABRICANTE = 'REFERENCIA_FABRICANTE'; + type IDetallesAlbaranProveedorController = interface(IControllerDetallesArticulos) ['{6E35D49A-C78D-481D-93E9-859CD27EB79F}'] @@ -40,7 +43,7 @@ type implementation uses Variants, uDialogUtils, uControllerDetallesBase, uDataModuleAlbaranesProveedor, uArticulosAlbaranProveedorController, - uDataTableUtils, uCalculosUtils; + uDataTableUtils, uCalculosUtils, schArticulosClient_Intf; { TDetallesAlbaranProveedorController } @@ -68,7 +71,7 @@ begin if Assigned(ADetalles) then begin try - AArticulos := (FArticulosController.BuscarTodos as IBizArticulo); + AArticulos := (FArticulosController.BuscarTodosPorProveedor as IBizArticulo); //Si nueva fila es false, quiere decir que se sustituye un determinado artículo, por ello la lista a seleccionar no debe ser multiselect if ANuevaFila then @@ -128,6 +131,12 @@ begin ADetalles.DataTable.FieldByName(CAMPO_DESCUENTO).AsFloat := AArticulos.DESCUENTO else ADetalles.DataTable.FieldByName(CAMPO_DESCUENTO).AsFloat := 0; + + //Sobreescribimos el id del articulo por el campo ID_ARTICULO que nos hemos tenido que crear para + //almacenar el codigo de artículo ya que ID esta destinado a ID_ARTICULO||ID_PROVEEDOR, para identificar de forma + //unica los articulos desglosados por proveedor. + ADetalles.DataTable.FieldByName(CAMPO_ID_ARTICULOS).AsVariant := AArticulos.DataTable.FieldByName(CAMPO_ID_ARTICULOS).AsVariant; + ADetalles.DataTable.FieldByName(CAMPO_REFERENCIA_FABRICANTE).AsVariant := AArticulos.DataTable.FieldByName(fld_ArticulosREFERENCIA_FABR).AsVariant; end; procedure TDetallesAlbaranProveedorController.RellenarImportes(ADetalles: IDAStronglyTypedDataTable; AArticulos: IBizArticulo); diff --git a/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.dfm b/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.dfm index 4e5ce230..128e1896 100644 --- a/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.dfm +++ b/Source/Modulos/Albaranes de proveedor/Data/uDataModuleAlbaranesProveedor.dfm @@ -373,6 +373,11 @@ inherited DataModuleAlbaranesProveedor: TDataModuleAlbaranesProveedor item Name = 'ID_PEDIDO' DataType = datInteger + end + item + Name = 'REFERENCIA_FABRICANTE' + DataType = datString + Size = 255 end> Params = <> MasterMappingMode = mmWhere diff --git a/Source/Modulos/Albaranes de proveedor/Model/schAlbaranesProveedorClient_Intf.pas b/Source/Modulos/Albaranes de proveedor/Model/schAlbaranesProveedorClient_Intf.pas index d8f60bcd..6ed42258 100644 --- a/Source/Modulos/Albaranes de proveedor/Model/schAlbaranesProveedorClient_Intf.pas +++ b/Source/Modulos/Albaranes de proveedor/Model/schAlbaranesProveedorClient_Intf.pas @@ -9,8 +9,8 @@ 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_AlbaranesProveedor = '{DC4BC11F-D327-4E71-BD98-E2221D403DCD}'; - RID_AlbaranesProveedor_Detalles = '{7E3C0C28-6CDC-44EC-B9B3-FA0D6E04B704}'; + RID_AlbaranesProveedor = '{1FB6A9A8-C798-46A8-9224-D616CD25C983}'; + RID_AlbaranesProveedor_Detalles = '{88D37566-EF0B-4C02-8C06-0A90970BE427}'; { Data table names } nme_AlbaranesProveedor = 'AlbaranesProveedor'; @@ -108,6 +108,7 @@ const fld_AlbaranesProveedor_DetallesREFERENCIA = 'REFERENCIA'; fld_AlbaranesProveedor_DetallesREFERENCIA_PROVEEDOR = 'REFERENCIA_PROVEEDOR'; fld_AlbaranesProveedor_DetallesID_PEDIDO = 'ID_PEDIDO'; + fld_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE = 'REFERENCIA_FABRICANTE'; { AlbaranesProveedor_Detalles field indexes } idx_AlbaranesProveedor_DetallesID = 0; @@ -125,11 +126,12 @@ const idx_AlbaranesProveedor_DetallesREFERENCIA = 12; idx_AlbaranesProveedor_DetallesREFERENCIA_PROVEEDOR = 13; idx_AlbaranesProveedor_DetallesID_PEDIDO = 14; + idx_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE = 15; type { IAlbaranesProveedor } IAlbaranesProveedor = interface(IDAStronglyTypedDataTable) - ['{4A11793E-3535-4087-BAF4-4A6D47B4FB51}'] + ['{141F98AE-9887-4D24-9EA0-F828297F85CD}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -584,7 +586,7 @@ type { IAlbaranesProveedor_Detalles } IAlbaranesProveedor_Detalles = interface(IDAStronglyTypedDataTable) - ['{F72E89B1-361B-44F9-A166-02D428B67E07}'] + ['{E15A8B06-496C-4A7B-AFF5-EA9F396B6C7A}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); @@ -646,6 +648,10 @@ type procedure SetID_PEDIDOValue(const aValue: Integer); function GetID_PEDIDOIsNull: Boolean; procedure SetID_PEDIDOIsNull(const aValue: Boolean); + function GetREFERENCIA_FABRICANTEValue: String; + procedure SetREFERENCIA_FABRICANTEValue(const aValue: String); + function GetREFERENCIA_FABRICANTEIsNull: Boolean; + procedure SetREFERENCIA_FABRICANTEIsNull(const aValue: Boolean); { Properties } @@ -679,6 +685,8 @@ type property REFERENCIA_PROVEEDORIsNull: Boolean read GetREFERENCIA_PROVEEDORIsNull write SetREFERENCIA_PROVEEDORIsNull; property ID_PEDIDO: Integer read GetID_PEDIDOValue write SetID_PEDIDOValue; property ID_PEDIDOIsNull: Boolean read GetID_PEDIDOIsNull write SetID_PEDIDOIsNull; + property REFERENCIA_FABRICANTE: String read GetREFERENCIA_FABRICANTEValue write SetREFERENCIA_FABRICANTEValue; + property REFERENCIA_FABRICANTEIsNull: Boolean read GetREFERENCIA_FABRICANTEIsNull write SetREFERENCIA_FABRICANTEIsNull; end; { TAlbaranesProveedor_DetallesDataTableRules } @@ -746,6 +754,10 @@ type procedure SetID_PEDIDOValue(const aValue: Integer); virtual; function GetID_PEDIDOIsNull: Boolean; virtual; procedure SetID_PEDIDOIsNull(const aValue: Boolean); virtual; + function GetREFERENCIA_FABRICANTEValue: String; virtual; + procedure SetREFERENCIA_FABRICANTEValue(const aValue: String); virtual; + function GetREFERENCIA_FABRICANTEIsNull: Boolean; virtual; + procedure SetREFERENCIA_FABRICANTEIsNull(const aValue: Boolean); virtual; { Properties } property ID: Integer read GetIDValue write SetIDValue; @@ -778,6 +790,8 @@ type property REFERENCIA_PROVEEDORIsNull: Boolean read GetREFERENCIA_PROVEEDORIsNull write SetREFERENCIA_PROVEEDORIsNull; property ID_PEDIDO: Integer read GetID_PEDIDOValue write SetID_PEDIDOValue; property ID_PEDIDOIsNull: Boolean read GetID_PEDIDOIsNull write SetID_PEDIDOIsNull; + property REFERENCIA_FABRICANTE: String read GetREFERENCIA_FABRICANTEValue write SetREFERENCIA_FABRICANTEValue; + property REFERENCIA_FABRICANTEIsNull: Boolean read GetREFERENCIA_FABRICANTEIsNull write SetREFERENCIA_FABRICANTEIsNull; public constructor Create(aDataTable: TDADataTable); override; @@ -1895,6 +1909,27 @@ begin DataTable.Fields[idx_AlbaranesProveedor_DetallesID_PEDIDO].AsVariant := Null; end; +function TAlbaranesProveedor_DetallesDataTableRules.GetREFERENCIA_FABRICANTEValue: String; +begin + result := DataTable.Fields[idx_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE].AsString; +end; + +procedure TAlbaranesProveedor_DetallesDataTableRules.SetREFERENCIA_FABRICANTEValue(const aValue: String); +begin + DataTable.Fields[idx_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE].AsString := aValue; +end; + +function TAlbaranesProveedor_DetallesDataTableRules.GetREFERENCIA_FABRICANTEIsNull: boolean; +begin + result := DataTable.Fields[idx_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE].IsNull; +end; + +procedure TAlbaranesProveedor_DetallesDataTableRules.SetREFERENCIA_FABRICANTEIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE].AsVariant := Null; +end; + initialization RegisterDataTableRules(RID_AlbaranesProveedor, TAlbaranesProveedorDataTableRules); diff --git a/Source/Modulos/Albaranes de proveedor/Model/schAlbaranesProveedorServer_Intf.pas b/Source/Modulos/Albaranes de proveedor/Model/schAlbaranesProveedorServer_Intf.pas index ad789a70..15f86beb 100644 --- a/Source/Modulos/Albaranes de proveedor/Model/schAlbaranesProveedorServer_Intf.pas +++ b/Source/Modulos/Albaranes de proveedor/Model/schAlbaranesProveedorServer_Intf.pas @@ -9,13 +9,13 @@ 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_AlbaranesProveedorDelta = '{3E80524F-4D76-4027-AD93-F08F2B616B77}'; - RID_AlbaranesProveedor_DetallesDelta = '{BCE53CF1-BA9D-4944-8EB8-529E2AE826B9}'; + RID_AlbaranesProveedorDelta = '{1BCA1CCB-00EC-4FCE-8444-9D6C87B77754}'; + RID_AlbaranesProveedor_DetallesDelta = '{FF6EDFFA-2EFB-4B00-B095-7CAB514D7BD1}'; type { IAlbaranesProveedorDelta } IAlbaranesProveedorDelta = interface(IAlbaranesProveedor) - ['{3E80524F-4D76-4027-AD93-F08F2B616B77}'] + ['{1BCA1CCB-00EC-4FCE-8444-9D6C87B77754}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; @@ -471,7 +471,7 @@ type { IAlbaranesProveedor_DetallesDelta } IAlbaranesProveedor_DetallesDelta = interface(IAlbaranesProveedor_Detalles) - ['{BCE53CF1-BA9D-4944-8EB8-529E2AE826B9}'] + ['{FF6EDFFA-2EFB-4B00-B095-7CAB514D7BD1}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_ALBARANValue : Integer; @@ -488,6 +488,7 @@ type function GetOldREFERENCIAValue : String; function GetOldREFERENCIA_PROVEEDORValue : String; function GetOldID_PEDIDOValue : Integer; + function GetOldREFERENCIA_FABRICANTEValue : String; { Properties } property OldID : Integer read GetOldIDValue; @@ -505,6 +506,7 @@ type property OldREFERENCIA : String read GetOldREFERENCIAValue; property OldREFERENCIA_PROVEEDOR : String read GetOldREFERENCIA_PROVEEDORValue; property OldID_PEDIDO : Integer read GetOldID_PEDIDOValue; + property OldREFERENCIA_FABRICANTE : String read GetOldREFERENCIA_FABRICANTEValue; end; { TAlbaranesProveedor_DetallesBusinessProcessorRules } @@ -602,6 +604,12 @@ type function GetOldID_PEDIDOIsNull: Boolean; virtual; procedure SetID_PEDIDOValue(const aValue: Integer); virtual; procedure SetID_PEDIDOIsNull(const aValue: Boolean); virtual; + function GetREFERENCIA_FABRICANTEValue: String; virtual; + function GetREFERENCIA_FABRICANTEIsNull: Boolean; virtual; + function GetOldREFERENCIA_FABRICANTEValue: String; virtual; + function GetOldREFERENCIA_FABRICANTEIsNull: Boolean; virtual; + procedure SetREFERENCIA_FABRICANTEValue(const aValue: String); virtual; + procedure SetREFERENCIA_FABRICANTEIsNull(const aValue: Boolean); virtual; { Properties } property ID : Integer read GetIDValue write SetIDValue; @@ -664,6 +672,10 @@ type property ID_PEDIDOIsNull : Boolean read GetID_PEDIDOIsNull write SetID_PEDIDOIsNull; property OldID_PEDIDO : Integer read GetOldID_PEDIDOValue; property OldID_PEDIDOIsNull : Boolean read GetOldID_PEDIDOIsNull; + property REFERENCIA_FABRICANTE : String read GetREFERENCIA_FABRICANTEValue write SetREFERENCIA_FABRICANTEValue; + property REFERENCIA_FABRICANTEIsNull : Boolean read GetREFERENCIA_FABRICANTEIsNull write SetREFERENCIA_FABRICANTEIsNull; + property OldREFERENCIA_FABRICANTE : String read GetOldREFERENCIA_FABRICANTEValue; + property OldREFERENCIA_FABRICANTEIsNull : Boolean read GetOldREFERENCIA_FABRICANTEIsNull; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; @@ -2294,6 +2306,37 @@ begin BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesProveedor_DetallesID_PEDIDO] := Null; end; +function TAlbaranesProveedor_DetallesBusinessProcessorRules.GetREFERENCIA_FABRICANTEValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE]; +end; + +function TAlbaranesProveedor_DetallesBusinessProcessorRules.GetREFERENCIA_FABRICANTEIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE]); +end; + +function TAlbaranesProveedor_DetallesBusinessProcessorRules.GetOldREFERENCIA_FABRICANTEValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE]; +end; + +function TAlbaranesProveedor_DetallesBusinessProcessorRules.GetOldREFERENCIA_FABRICANTEIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE]); +end; + +procedure TAlbaranesProveedor_DetallesBusinessProcessorRules.SetREFERENCIA_FABRICANTEValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE] := aValue; +end; + +procedure TAlbaranesProveedor_DetallesBusinessProcessorRules.SetREFERENCIA_FABRICANTEIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_AlbaranesProveedor_DetallesREFERENCIA_FABRICANTE] := Null; +end; + initialization RegisterBusinessProcessorRules(RID_AlbaranesProveedorDelta, TAlbaranesProveedorBusinessProcessorRules); diff --git a/Source/Modulos/Albaranes de proveedor/Servidor/srvAlbaranesProveedor_Impl.dfm b/Source/Modulos/Albaranes de proveedor/Servidor/srvAlbaranesProveedor_Impl.dfm index f13e492c..d425d28c 100644 --- a/Source/Modulos/Albaranes de proveedor/Servidor/srvAlbaranesProveedor_Impl.dfm +++ b/Source/Modulos/Albaranes de proveedor/Servidor/srvAlbaranesProveedor_Impl.dfm @@ -387,11 +387,16 @@ object srvAlbaranesProveedor: TsrvAlbaranesProveedor 'R_DETALLES.IMPORTE_TOTAL,'#10' ALBARANES_PROVEEDOR_DETALLES.VISIB' + 'LE,'#10#10' ALBARANES_PROVEEDOR_DETALLES.ID_ARTICULO, ALBARANES_PRO' + 'VEEDOR_DETALLES.DESCUENTO,'#10' ALBARANES_PROVEEDOR_DETALLES.IMPO' + - 'RTE_PORTE,'#10' ARTICULOS.REFERENCIA, ARTICULOS.REFERENCIA_PROV a' + - 's REFERENCIA_PROVEEDOR,'#10' ALBARANES_PROVEEDOR_DETALLES.ID_PEDI' + - 'DO'#10#10'FROM ALBARANES_PROVEEDOR_DETALLES'#10'LEFT JOIN ARTICULOS ON ALB' + - 'ARANES_PROVEEDOR_DETALLES.ID_ARTICULO = ARTICULOS.ID'#10'WHERE {wher' + - 'e}'#10'ORDER BY POSICION;'#10 + 'RTE_PORTE,'#10' ARTICULOS.REFERENCIA, ARTICULOS_PROVEEDORES.REFER' + + 'ENCIA_PROV as REFERENCIA_PROVEEDOR,'#10' ALBARANES_PROVEEDOR_DETA' + + 'LLES.ID_PEDIDO,'#10' ARTICULOS.REFERENCIA_FABR as REFERENCIA_FABR' + + 'ICANTE'#10#10'FROM ALBARANES_PROVEEDOR_DETALLES'#10'LEFT JOIN ARTICULOS ON' + + ' ALBARANES_PROVEEDOR_DETALLES.ID_ARTICULO = ARTICULOS.ID'#10'LEFT JO' + + 'IN ALBARANES_PROVEEDOR ON (ALBARANES_PROVEEDOR.ID = ALBARANES_PR' + + 'OVEEDOR_DETALLES.ID_ALBARAN)'#10'LEFT JOIN ARTICULOS_PROVEEDORES ON ' + + '((ARTICULOS_PROVEEDORES.ID_ARTICULO = ARTICULOS.ID) AND (ARTICUL' + + 'OS_PROVEEDORES.ID_PROVEEDOR = ALBARANES_PROVEEDOR.ID_PROVEEDOR))' + + #10'WHERE {where}'#10'ORDER BY POSICION;'#10#10#10#10 StatementType = stSQL ColumnMappings = < item @@ -453,6 +458,10 @@ object srvAlbaranesProveedor: TsrvAlbaranesProveedor item DatasetField = 'ID_PEDIDO' TableField = 'ID_PEDIDO' + end + item + DatasetField = 'REFERENCIA_FABRICANTE' + TableField = 'REFERENCIA_FABRICANTE' end> end> Name = 'AlbaranesProveedor_Detalles' @@ -537,6 +546,11 @@ object srvAlbaranesProveedor: TsrvAlbaranesProveedor item Name = 'ID_PEDIDO' DataType = datInteger + end + item + Name = 'REFERENCIA_FABRICANTE' + DataType = datString + Size = 255 end> end> JoinDataTables = <> diff --git a/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranDevProveedor.dfm b/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranDevProveedor.dfm index ff88d54d..a1991955 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranDevProveedor.dfm +++ b/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranDevProveedor.dfm @@ -1,7 +1,5 @@ inherited fEditorAlbaranDevProveedor: TfEditorAlbaranDevProveedor Caption = 'Nueva orden de devoluci'#243'n de proveedor' - ExplicitWidth = 320 - ExplicitHeight = 653 PixelsPerInch = 96 TextHeight = 13 inherited JvNavPanelHeader: TJvNavPanelHeader @@ -38,135 +36,66 @@ inherited fEditorAlbaranDevProveedor: TfEditorAlbaranDevProveedor end end inherited pgPaginas: TPageControl - inherited pagGeneral: TTabSheet - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 751 - ExplicitHeight = 426 - end inherited pagContenido: TTabSheet - ExplicitLeft = 4 - ExplicitTop = 24 - ExplicitWidth = 751 - ExplicitHeight = 426 inherited frViewDetallesAlbaranProveedor1: TfrViewDetallesAlbaranProveedor inherited ToolBar1: TToolBar - Height = 73 - ExplicitHeight = 73 - inherited ToolButton13: TToolButton [1] - Left = 109 + inherited UpDown1: TUpDown [7] + Left = 602 Top = 0 - ExplicitLeft = 109 + ExplicitLeft = 602 ExplicitTop = 0 end - inherited ToolButton12: TToolButton [2] + inherited ToolButton13: TToolButton [8] + end + inherited ToolButton11: TToolButton Left = 0 - Top = 0 - Wrap = True ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitHeight = 30 end - inherited ToolButton2: TToolButton [3] - Left = 0 - Top = 30 - ExplicitLeft = 0 - ExplicitTop = 30 + inherited ToolButton12: TToolButton + Left = 141 + ExplicitLeft = 141 end - inherited ToolButton3: TToolButton [4] - Left = 114 - Top = 30 - Wrap = False - ExplicitLeft = 114 - ExplicitTop = 30 + inherited ToolButton9: TToolButton + Left = 149 + ExplicitLeft = 149 end - inherited ToolButton4: TToolButton [5] - Left = 169 - Top = 30 - ExplicitLeft = 169 - ExplicitTop = 30 - end - inherited FontName: TJvFontComboBox [6] - Left = 225 - Top = 30 - ExplicitLeft = 225 - ExplicitTop = 30 - end - inherited ToolButton11: TToolButton [7] - Left = 370 - Top = 30 - Wrap = True - ExplicitLeft = 370 - ExplicitTop = 30 - end - inherited ToolButton14: TToolButton [8] - Left = 0 - Top = 52 - ExplicitLeft = 0 - ExplicitTop = 52 - end - inherited FontSize: TEdit [9] - Left = 65 - Top = 52 - ExplicitLeft = 65 - ExplicitTop = 52 - end - inherited ToolButton9: TToolButton [10] - Left = 107 - Top = 52 - ExplicitLeft = 107 - ExplicitTop = 52 - end - inherited ToolButton8: TToolButton [11] - Left = 252 - Top = 52 - ExplicitLeft = 252 - ExplicitTop = 52 - end - inherited ToolButton7: TToolButton [12] - Left = 335 - Top = 52 - ExplicitLeft = 335 - ExplicitTop = 52 + inherited ToolButton10: TToolButton + Left = 294 + ExplicitLeft = 294 end inherited ToolButton6: TToolButton - Left = 402 - Top = 52 - ExplicitLeft = 402 - ExplicitTop = 52 + Left = 419 + ExplicitLeft = 419 end - inherited UpDown1: TUpDown [14] - Left = 468 - Top = 52 - ExplicitLeft = 468 - ExplicitTop = 52 - end - inherited ToolButton10: TToolButton [15] + inherited ToolButton7: TToolButton Left = 485 - Top = 52 ExplicitLeft = 485 - ExplicitTop = 52 + end + inherited ToolButton8: TToolButton + Left = 552 + ExplicitLeft = 552 end end inherited cxGrid: TcxGrid - Top = 99 - Height = 327 ExplicitTop = 99 + ExplicitHeight = 327 end inherited TBXDock1: TTBXDock - Top = 73 + ExplicitTop = 73 + end + inherited cxGridPopupMenu: TcxGridPopupMenu + PopupMenus = < + item + GridView = frViewDetallesAlbaranProveedor1.cxGridView + HitTypes = [gvhtNone, gvhtCell, gvhtRecord, gvhtRowIndicator] + Index = 0 + PopupMenu = frViewDetallesAlbaranProveedor1.GridGeneralPopupMenu + end> end end end inherited pagInicidencias: TTabSheet - ExplicitLeft = 4 - ExplicitTop = 24 - ExplicitWidth = 751 - ExplicitHeight = 426 inherited frViewIncidenciasCli: TfrViewIncidencias - inherited pnlSup: TPanel - ExplicitWidth = 751 - end inherited GroupBox1: TGroupBox inherited eIncidencias: TcxDBMemo ExplicitWidth = 726 @@ -194,104 +123,34 @@ inherited fEditorAlbaranDevProveedor: TfEditorAlbaranDevProveedor ExplicitWidth = 21 end inherited ImporteDto: TcxDBCurrencyEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 93 - Width = 93 end inherited ImporteIVA: TcxDBCurrencyEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 137 - Width = 137 end inherited ImporteTotal: TcxDBCurrencyEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 137 - Width = 137 end inherited edtDescuento: TcxDBSpinEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' end inherited edtIVA: TcxDBSpinEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' end inherited ImporteBase: TcxDBCurrencyEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 92 - Width = 92 end inherited edtRE: TcxDBSpinEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' end inherited ImporteRE: TcxDBCurrencyEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 56 - Width = 56 end inherited eImporteNeto: TcxDBCurrencyEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 147 - Width = 147 end inherited ePorte: TcxDBCurrencyEdit - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 147 - Width = 147 - end - inherited eIVA: TcxDBLookupComboBox - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 81 - Width = 81 - end - inherited cbRecargoEquivalencia: TcxDBCheckBox - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' - ExplicitWidth = 219 - Width = 219 end inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group1: TdxLayoutGroup diff --git a/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranProveedor.dfm b/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranProveedor.dfm index f2e5df28..ec5e42ed 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranProveedor.dfm +++ b/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranProveedor.dfm @@ -6,7 +6,7 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor ClientWidth = 765 OnClose = CustomEditorClose ExplicitWidth = 773 - ExplicitHeight = 646 + ExplicitHeight = 653 PixelsPerInch = 96 TextHeight = 13 inherited JvNavPanelHeader: TJvNavPanelHeader @@ -129,7 +129,7 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor Width = 765 ExplicitWidth = 765 inherited tbxMain: TTBXToolbar - ExplicitWidth = 488 + ExplicitWidth = 330 inherited TBXItem2: TTBXItem Visible = False end @@ -147,7 +147,6 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor inherited pgPaginas: TPageControl Width = 759 Height = 454 - ActivePage = pagContenido TabOrder = 1 OnChanging = pgPaginasChanging ExplicitWidth = 759 @@ -155,16 +154,12 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor inherited pagGeneral: TTabSheet ExplicitLeft = 4 ExplicitTop = 24 - ExplicitWidth = 757 - ExplicitHeight = 432 + ExplicitWidth = 751 + ExplicitHeight = 426 end object pagContenido: TTabSheet Caption = 'Contenido' ImageIndex = 1 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 inline frViewDetallesAlbaranProveedor1: TfrViewDetallesAlbaranProveedor Left = 0 Top = 0 @@ -185,54 +180,105 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor ExplicitHeight = 426 inherited ToolBar1: TToolBar Width = 751 - Height = 46 + Height = 51 ExplicitWidth = 751 - ExplicitHeight = 46 - inherited ToolButton12: TToolButton - Left = 474 + ExplicitHeight = 51 + inherited ToolButton3: TToolButton Wrap = False - ExplicitLeft = 474 + end + inherited ToolButton4: TToolButton + Left = 278 + Top = 0 + ExplicitLeft = 278 + ExplicitTop = 0 + end + inherited FontName: TJvFontComboBox + Left = 334 + Top = 0 + ExplicitLeft = 334 + ExplicitTop = 0 + end + inherited ToolButton14: TToolButton + Left = 479 + Top = 0 + ExplicitLeft = 479 + ExplicitTop = 0 + end + inherited FontSize: TEdit + Left = 544 + Top = 0 + Width = 58 + ExplicitLeft = 544 + ExplicitTop = 0 + ExplicitWidth = 58 + end + inherited ToolButton13: TToolButton [7] + Left = 0 + Top = 0 + Wrap = True + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitHeight = 27 + end + inherited UpDown1: TUpDown [8] + Left = 0 + Top = 27 + ExplicitLeft = 0 + ExplicitTop = 27 + end + inherited ToolButton11: TToolButton + Left = 17 + Top = 27 + ExplicitLeft = 17 + ExplicitTop = 27 + end + inherited ToolButton12: TToolButton + Left = 158 + Top = 27 + Wrap = False + ExplicitLeft = 158 + ExplicitTop = 27 ExplicitHeight = 22 end inherited ToolButton9: TToolButton - Left = 482 - Top = 22 - ExplicitLeft = 482 - ExplicitTop = 22 + Left = 166 + Top = 27 + ExplicitLeft = 166 + ExplicitTop = 27 end inherited ToolButton10: TToolButton - Left = 627 - Top = 22 - ExplicitLeft = 627 - ExplicitTop = 22 + Left = 311 + Top = 27 + ExplicitLeft = 311 + ExplicitTop = 27 end inherited ToolButton6: TToolButton - Left = 752 - Top = 22 - ExplicitLeft = 752 - ExplicitTop = 22 + Left = 436 + Top = 27 + ExplicitLeft = 436 + ExplicitTop = 27 end inherited ToolButton7: TToolButton - Left = 818 - Top = 22 + Left = 502 + Top = 27 Wrap = False - ExplicitLeft = 818 - ExplicitTop = 22 + ExplicitLeft = 502 + ExplicitTop = 27 end inherited ToolButton8: TToolButton - Left = 885 - Top = 22 - ExplicitLeft = 885 - ExplicitTop = 22 + Left = 569 + Top = 27 + ExplicitLeft = 569 + ExplicitTop = 27 end end inherited cxGrid: TcxGrid - Top = 72 + Top = 77 Width = 751 - Height = 354 - ExplicitTop = 72 + Height = 349 + ExplicitTop = 77 ExplicitWidth = 751 - ExplicitHeight = 354 + ExplicitHeight = 349 inherited cxGridView: TcxGridDBTableView inherited cxGridViewIMPORTENETO: TcxGridDBColumn Options.Editing = True @@ -240,23 +286,28 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor end end inherited TBXDock1: TTBXDock - Top = 46 + Top = 51 Width = 751 ExplicitTop = 51 ExplicitWidth = 751 inherited TBXToolbar1: TTBXToolbar - ExplicitWidth = 626 + ExplicitWidth = 745 end end + inherited cxGridPopupMenu: TcxGridPopupMenu + PopupMenus = < + item + GridView = frViewDetallesAlbaranProveedor1.cxGridView + HitTypes = [gvhtNone, gvhtCell, gvhtRecord, gvhtRowIndicator] + Index = 0 + PopupMenu = frViewDetallesAlbaranProveedor1.GridGeneralPopupMenu + end> + end end end object pagInicidencias: TTabSheet Caption = 'Incidencias' ImageIndex = 2 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 inline frViewIncidenciasCli: TfrViewIncidencias Left = 0 Top = 0 @@ -275,7 +326,7 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor ExplicitHeight = 426 inherited pnlSup: TPanel Width = 751 - ExplicitWidth = 757 + ExplicitWidth = 751 inherited eIncidenciaActiva: TcxDBCheckBox ExplicitHeight = 21 end @@ -353,51 +404,35 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor inherited ImporteDto: TcxDBCurrencyEdit Left = 164 Top = 112 - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 164 ExplicitTop = 112 - ExplicitWidth = 93 - Width = 93 + ExplicitWidth = 199 + Width = 199 end inherited ImporteIVA: TcxDBCurrencyEdit Left = 562 Top = 38 - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 562 ExplicitTop = 38 - ExplicitWidth = 137 - Width = 137 + ExplicitWidth = 192 + Width = 192 end inherited ImporteTotal: TcxDBCurrencyEdit Left = 492 Top = 112 - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 492 ExplicitTop = 112 - ExplicitWidth = 137 - Width = 137 + ExplicitWidth = 262 + Width = 262 end inherited edtDescuento: TcxDBSpinEdit Left = 93 Top = 112 Properties.OnValidate = frViewTotales1edtDescuentoPropertiesValidate - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 93 ExplicitTop = 112 end @@ -405,37 +440,25 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor Left = 491 Top = 38 Properties.OnValidate = frViewTotales1edtIVAPropertiesValidate - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 491 ExplicitTop = 38 end inherited ImporteBase: TcxDBCurrencyEdit Left = 491 Top = 11 - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 491 ExplicitTop = 11 - ExplicitWidth = 92 - Width = 92 + ExplicitWidth = 263 + Width = 263 end inherited edtRE: TcxDBSpinEdit Left = 491 Top = 65 DataBinding.DataField = '' DataBinding.DataSource = nil - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 491 ExplicitTop = 65 end @@ -444,56 +467,40 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor Top = 65 DataBinding.DataField = '' DataBinding.DataSource = nil - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 562 ExplicitTop = 65 - ExplicitWidth = 56 - Width = 56 + ExplicitWidth = 192 + Width = 192 end inherited eImporteNeto: TcxDBCurrencyEdit Left = 93 Top = 11 - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 93 ExplicitTop = 11 - ExplicitWidth = 147 - Width = 147 + ExplicitWidth = 270 + Width = 270 end inherited ePorte: TcxDBCurrencyEdit Left = 93 Top = 139 Properties.OnValidate = frViewTotales1ePortePropertiesValidate - Style.LookAndFeel.SkinName = '' Style.IsFontAssigned = True - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 93 ExplicitTop = 139 - ExplicitWidth = 147 - Width = 147 + ExplicitWidth = 270 + Width = 270 end inherited eIVA: TcxDBLookupComboBox Left = 93 Top = 38 DataBinding.DataField = '' DataBinding.DataSource = nil - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 93 ExplicitTop = 38 - ExplicitWidth = 81 - Width = 81 + ExplicitWidth = 132 + Width = 132 end inherited bTiposIVA: TButton Left = 231 @@ -505,14 +512,10 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor Left = 93 Top = 65 DataBinding.DataField = '' - Style.LookAndFeel.SkinName = '' - StyleDisabled.LookAndFeel.SkinName = '' - StyleFocused.LookAndFeel.SkinName = '' - StyleHot.LookAndFeel.SkinName = '' ExplicitLeft = 93 ExplicitTop = 65 - ExplicitWidth = 219 - Width = 219 + ExplicitWidth = 270 + Width = 270 end inherited dxLayoutControl1Group_Root: TdxLayoutGroup inherited dxLayoutControl1Group1: TdxLayoutGroup @@ -562,6 +565,14 @@ inherited fEditorAlbaranProveedor: TfEditorAlbaranProveedor inherited actConfPagina: TAction Visible = False end + inherited actPrevisualizar: TAction + Enabled = False + Visible = False + end + inherited actImprimir: TAction + Enabled = False + Visible = False + end end inherited SmallImages: TPngImageList [6] end diff --git a/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranProveedor.pas b/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranProveedor.pas index 15a1afd1..e3734eb3 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranProveedor.pas +++ b/Source/Modulos/Albaranes de proveedor/Views/uEditorAlbaranProveedor.pas @@ -242,7 +242,8 @@ end; procedure TfEditorAlbaranProveedor.pgPaginasChanging(Sender: TObject; var AllowChange: Boolean); begin inherited; - if (not Assigned(FAlbaran)) or (FAlbaran.ID_PROVEEDOR = ID_NULO) then + if (not Assigned(FAlbaran)) + or (FAlbaran.ID_PROVEEDOR = 0) then begin ShowWarningMessage('Antes de introducir conceptos debe elegir un proveedor para este albarán'); AllowChange := False; diff --git a/Source/Modulos/Albaranes de proveedor/Views/uEditorElegirArticulosAlbaranProveedor.dfm b/Source/Modulos/Albaranes de proveedor/Views/uEditorElegirArticulosAlbaranProveedor.dfm index 9071445e..e34b8b62 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uEditorElegirArticulosAlbaranProveedor.dfm +++ b/Source/Modulos/Albaranes de proveedor/Views/uEditorElegirArticulosAlbaranProveedor.dfm @@ -1,6 +1,5 @@ inherited fEditorElegirArticulosAlbaranProveedor: TfEditorElegirArticulosAlbaranProveedor Caption = 'fEditorElegirArticulosAlbaranProveedor' - ExplicitWidth = 320 PixelsPerInch = 96 TextHeight = 13 end diff --git a/Source/Modulos/Albaranes de proveedor/Views/uEditorElegirArticulosAlbaranProveedor.pas b/Source/Modulos/Albaranes de proveedor/Views/uEditorElegirArticulosAlbaranProveedor.pas index 3cc1679e..7533f94b 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uEditorElegirArticulosAlbaranProveedor.pas +++ b/Source/Modulos/Albaranes de proveedor/Views/uEditorElegirArticulosAlbaranProveedor.pas @@ -10,7 +10,7 @@ uses JvExComCtrls, JvStatusBar, TBX, TB2ExtItems, TBXExtItems, TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent, JvNavigationPane, JvgWizardHeader, uIEditorElegirArticulosAlbaranesProveedor, uBizContactos, - uDAInterfaces; + uDAInterfaces, uViewGridBase, uViewGrid, uViewArticulos; type TfEditorElegirArticulosAlbaranProveedor = class(TfEditorElegirArticulos, IEditorElegirArticulosAlbaranesProveedor) @@ -20,11 +20,9 @@ type function GetProveedor: IBizProveedor; procedure SetProveedor(const Value: IBizProveedor); - protected - procedure AsignarVista; override; - public property Proveedor: IBizProveedor read GetProveedor write SetProveedor; + constructor Create(AOwner: TComponent); override; end; @@ -36,8 +34,9 @@ uses uViewElegirArticulosAlbaranesProveedor; { TfEditorElegirArticulosAlbaranProveedor } -procedure TfEditorElegirArticulosAlbaranProveedor.AsignarVista; +constructor TfEditorElegirArticulosAlbaranProveedor.Create(AOwner: TComponent); begin + inherited; ViewGrid := CreateView(TfrViewElegirArticulosAlbaranesProveedor) as IViewElegirArticulosAlbaranesProveedor; end; diff --git a/Source/Modulos/Albaranes de proveedor/Views/uViewDetallesAlbaranProveedor.dfm b/Source/Modulos/Albaranes de proveedor/Views/uViewDetallesAlbaranProveedor.dfm index b36f8ffa..67369256 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uViewDetallesAlbaranProveedor.dfm +++ b/Source/Modulos/Albaranes de proveedor/Views/uViewDetallesAlbaranProveedor.dfm @@ -75,16 +75,51 @@ inherited frViewDetallesAlbaranProveedor: TfrViewDetallesAlbaranProveedor inherited cxGrid: TcxGrid Top = 99 Height = 205 - ExplicitWidth = 451 inherited cxGridView: TcxGridDBTableView + inherited cxGridViewREFERENCIA: TcxGridDBColumn + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + Visible = False + end> + Properties.ReadOnly = True + Properties.OnButtonClick = nil + end + inherited cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + Visible = False + end> + Properties.ReadOnly = True + Properties.OnButtonClick = nil + end + inherited cxGridViewREFERENCIA_FABRICANTE: TcxGridDBColumn + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + Visible = False + end> + Properties.ReadOnly = True + Properties.OnButtonClick = nil + end + inherited cxGridViewIMPORTEUNIDAD: TcxGridDBColumn + Visible = False + VisibleForCustomization = False + end inherited cxGridViewIMPORTENETO: TcxGridDBColumn + Caption = 'Importe coste' Properties.ReadOnly = False + Visible = True end end end inherited TBXDock1: TTBXDock Top = 73 - ExplicitWidth = 451 + ExplicitTop = 73 inherited TBXToolbar1: TTBXToolbar inherited TBXSubmenuItem1: TTBXSubmenuItem Visible = False diff --git a/Source/Modulos/Albaranes de proveedor/Views/uViewDetallesAlbaranProveedor.pas b/Source/Modulos/Albaranes de proveedor/Views/uViewDetallesAlbaranProveedor.pas index d11468c2..7cdb5b11 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uViewDetallesAlbaranProveedor.pas +++ b/Source/Modulos/Albaranes de proveedor/Views/uViewDetallesAlbaranProveedor.pas @@ -18,7 +18,8 @@ uses dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinSilver, dxSkinStardust, dxSkinsDefaultPainters, dxSkinValentine, dxSkinXmas2008Blue, - dxSkinscxPCPainter, Menus, cxGridCustomPopupMenu, cxGridPopupMenu; + dxSkinscxPCPainter, Menus, cxGridCustomPopupMenu, cxGridPopupMenu, + cxEditRepositoryItems, uViewDetallesArticulosParaVenta; type IViewDetallesAlbaranProveedor = interface(IViewDetallesArticulos) diff --git a/Source/Modulos/Albaranes de proveedor/Views/uViewElegirArticulosAlbaranesProveedor.dfm b/Source/Modulos/Albaranes de proveedor/Views/uViewElegirArticulosAlbaranesProveedor.dfm index ccbc53ee..4c90ea7a 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uViewElegirArticulosAlbaranesProveedor.dfm +++ b/Source/Modulos/Albaranes de proveedor/Views/uViewElegirArticulosAlbaranesProveedor.dfm @@ -4,10 +4,20 @@ inherited frViewElegirArticulosAlbaranesProveedor: TfrViewElegirArticulosAlbaran inherited cxGrid: TcxGrid Height = 286 RootLevelOptions.DetailTabsPosition = dtpTop - OnActiveTabChanged = cxGridActiveTabChanged ExplicitHeight = 286 + inherited cxGridView: TcxGridDBTableView + inherited cxGridViewPRECIO_PVP_VENTA: TcxGridDBColumn + Visible = False + end + inherited cxGridViewPRECIO_PVP_TOTAL: TcxGridDBColumn + Visible = False + end + end + inherited cxGridLevel: TcxGridLevel + Caption = '' + end object cxGridLevel1: TcxGridLevel - Caption = 'Otros proveedores' + Caption = 'Generales' end end inherited frViewFiltroBase1: TfrViewFiltroBase @@ -18,12 +28,16 @@ inherited frViewElegirArticulosAlbaranesProveedor: TfrViewElegirArticulosAlbaran Width = 121 end inherited edtFechaFinFiltro: TcxDateEdit + Left = 225 + ExplicitLeft = 225 ExplicitWidth = 121 Width = 121 end inherited eLista: TcxComboBox Left = 383 ExplicitLeft = 383 + ExplicitWidth = 322 + Width = 322 end end end diff --git a/Source/Modulos/Albaranes de proveedor/Views/uViewElegirArticulosAlbaranesProveedor.pas b/Source/Modulos/Albaranes de proveedor/Views/uViewElegirArticulosAlbaranesProveedor.pas index 4d4b5d2c..05bb22bf 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uViewElegirArticulosAlbaranesProveedor.pas +++ b/Source/Modulos/Albaranes de proveedor/Views/uViewElegirArticulosAlbaranesProveedor.pas @@ -4,7 +4,7 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, uViewArticulos, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, + Dialogs, uViewArticulosPorProveedor, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, cxImageComboBox, cxCurrencyEdit, cxSpinEdit, dxPSGlbl, dxPSUtl, dxPSEngn, dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns, dxPSEdgePatterns, ImgList, PngImageList, @@ -18,7 +18,7 @@ uses dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinSilver, dxSkinStardust, dxSkinsDefaultPainters, dxSkinValentine, dxSkinXmas2008Blue, - dxSkinscxPCPainter, uDAInterfaces; + dxSkinscxPCPainter, uDAInterfaces, uViewArticulos; type IViewElegirArticulosAlbaranesProveedor = interface(IViewArticulos) @@ -28,7 +28,7 @@ type property Proveedor: IBizProveedor read GetProveedor write SetProveedor; end; - TfrViewElegirArticulosAlbaranesProveedor = class(TfrViewArticulos, IViewElegirArticulosAlbaranesProveedor) + TfrViewElegirArticulosAlbaranesProveedor = class(TfrViewArticulosPorProveedor, IViewElegirArticulosAlbaranesProveedor) cxGridLevel1: TcxGridLevel; procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel: TcxGridLevel); @@ -63,7 +63,7 @@ begin 0 : if Assigned(FProveedor) then FFiltro.AddItem(cxGridViewID_PROVEEDOR, foEqual, FProveedor.ID, FProveedor.NOMBRE); 1 : if Assigned(FProveedor) then - FFiltro.AddItem(cxGridViewID_PROVEEDOR, foNotEqual, FProveedor.ID, FProveedor.NOMBRE); + FFiltro.AddItem(cxGridViewID_PROVEEDOR, foEqual, Null, 'ARTICULOS SIN PROVEEDOR'); end; end; diff --git a/Source/Modulos/Almacenes/Model/schAlmacenesClient_Intf.pas b/Source/Modulos/Almacenes/Model/schAlmacenesClient_Intf.pas index 2a6f8490..18da1ddc 100644 --- a/Source/Modulos/Almacenes/Model/schAlmacenesClient_Intf.pas +++ b/Source/Modulos/Almacenes/Model/schAlmacenesClient_Intf.pas @@ -9,7 +9,7 @@ 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_Almacenes = '{EFF5A6F0-C500-4F72-8D24-5BD12C92E40E}'; + RID_Almacenes = '{0C3FFC55-67A2-4BDA-9EAA-F90ED49C4DE7}'; { Data table names } nme_Almacenes = 'Almacenes'; @@ -51,7 +51,7 @@ const type { IAlmacenes } IAlmacenes = interface(IDAStronglyTypedDataTable) - ['{104709AF-567B-415E-B54F-03C0A1BF65CA}'] + ['{7C12ADCA-C970-4251-BDFC-7227CE755A91}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); diff --git a/Source/Modulos/Almacenes/Model/schAlmacenesServer_Intf.pas b/Source/Modulos/Almacenes/Model/schAlmacenesServer_Intf.pas index fd7bf111..f8f95d57 100644 --- a/Source/Modulos/Almacenes/Model/schAlmacenesServer_Intf.pas +++ b/Source/Modulos/Almacenes/Model/schAlmacenesServer_Intf.pas @@ -9,12 +9,12 @@ 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_AlmacenesDelta = '{C73B6766-E3E1-4A09-8FFD-B9B7A7750CF1}'; + RID_AlmacenesDelta = '{3AC4736D-AB9F-4DAB-B2A2-D9EABF8D0C8C}'; type { IAlmacenesDelta } IAlmacenesDelta = interface(IAlmacenes) - ['{C73B6766-E3E1-4A09-8FFD-B9B7A7750CF1}'] + ['{3AC4736D-AB9F-4DAB-B2A2-D9EABF8D0C8C}'] { Property getters and setters } function GetOldIDValue : Integer; function GetOldID_EMPRESAValue : Integer; diff --git a/Source/Modulos/Articulos/Controller/Articulos_controller.dpk b/Source/Modulos/Articulos/Controller/Articulos_controller.dpk index f859d181..56cc15ce 100644 Binary files a/Source/Modulos/Articulos/Controller/Articulos_controller.dpk and b/Source/Modulos/Articulos/Controller/Articulos_controller.dpk differ diff --git a/Source/Modulos/Articulos/Controller/Articulos_controller.dproj b/Source/Modulos/Articulos/Controller/Articulos_controller.dproj index ca28a1ca..e11913f5 100644 --- a/Source/Modulos/Articulos/Controller/Articulos_controller.dproj +++ b/Source/Modulos/Articulos/Controller/Articulos_controller.dproj @@ -55,11 +55,22 @@ MainSource - - - - - + + + + + + + + + + + + + + + + diff --git a/Source/Modulos/Articulos/Controller/View/uIEditorElegirArticulos.pas b/Source/Modulos/Articulos/Controller/View/uIEditorElegirArticulos.pas index 4d11ca77..16030c11 100644 --- a/Source/Modulos/Articulos/Controller/View/uIEditorElegirArticulos.pas +++ b/Source/Modulos/Articulos/Controller/View/uIEditorElegirArticulos.pas @@ -3,11 +3,19 @@ unit uIEditorElegirArticulos; interface uses - uIEditorArticulos, uBizArticulos, uGUIBase; + uIEditorArticulos, uBizArticulos, uArticulosController, uGUIBase; type IEditorElegirArticulos = interface(IEditorArticulos) ['{549F3B97-46E2-4D40-8080-566065735FA0}'] + function GetArticulos: IBizArticulo; + procedure SetArticulos(const Value: IBizArticulo); + property Articulos: IBizArticulo read GetArticulos write SetArticulos; + + function GetController : IArticulosController; + procedure SetController (const Value : IArticulosController); + property Controller : IArticulosController read GetController write SetController; + function GetArticulosSeleccionados: IBizArticulo; property ArticulosSeleccionados: IBizArticulo read GetArticulosSeleccionados; @@ -18,7 +26,6 @@ type procedure SetMensaje (const AValue: String); function GetMensaje: String; property Mensaje : String read GetMensaje write SetMensaje; - end; diff --git a/Source/Modulos/Articulos/Controller/uArticulosController.pas b/Source/Modulos/Articulos/Controller/uArticulosController.pas index e4c39a1a..961ab8ea 100644 --- a/Source/Modulos/Articulos/Controller/uArticulosController.pas +++ b/Source/Modulos/Articulos/Controller/uArticulosController.pas @@ -11,15 +11,16 @@ uses type IArticulosController = interface(IObservador) ['{C7EA6486-7BE4-468E-A27A-621E1BA13430}'] - function Buscar(const ID: Integer; AClienteID: Integer = -1): IBizArticulo; + function Buscar(const ID: Integer; AClienteID: Integer = -1): IBizArticulo; overload; function BuscarInventariables: IBizArticulo; function BuscarTodos: IBizArticulo; overload; + function BuscarTodosPorProveedor: IBizArticulo; overload; function BuscarTodos(ACliente: IBizCliente): IBizArticulo; overload; function BuscarTodos(AProveedor: IBizProveedor): IBizArticulo; overload; function BuscarReferencia(const Ref: String; AClienteID: Integer): IBizArticulo; function BuscarReferenciaProveedor(const Ref: String; AClienteID: Integer): IBizArticulo; procedure Ver(AArticulo : IBizArticulo); - procedure VerTodos(AArticulos: IBizArticulo); + procedure VerTodos; function Nuevo : IBizArticulo; procedure Anadir(AArticulo : IBizArticulo); function Eliminar(const ID : Integer): Boolean; overload; @@ -75,6 +76,7 @@ type procedure Anadir(AArticulo : IBizArticulo); virtual; function Buscar(const ID: Integer; AClienteID: Integer = -1): IBizArticulo; virtual; function BuscarTodos: IBizArticulo; overload; + function BuscarTodosPorProveedor: IBizArticulo; overload; function BuscarInventariables: IBizArticulo; function BuscarTodos(ACliente: IBizCliente): IBizArticulo; overload; function BuscarTodos(ACliente: Integer): IBizArticulo; overload; @@ -83,7 +85,7 @@ type function BuscarReferenciaProveedor(const Ref: String; AClienteID: Integer): IBizArticulo; virtual; function Nuevo : IBizArticulo; virtual; procedure Ver(AArticulo : IBizArticulo); virtual; - procedure VerTodos(AArticulos: IBizArticulo); virtual; + procedure VerTodos; virtual; function Duplicar(AArticulo: IBizArticulo): IBizArticulo; virtual; procedure Preview(AArticulo : IBizArticulo); virtual; procedure Print(AArticulo : IBizArticulo); virtual; @@ -118,7 +120,7 @@ var AProveedor : IBizContacto; begin inherited; - AProveedor := (FProveedoresController.Nuevo as IBizProveedor); +{ AProveedor := (FProveedoresController.Nuevo as IBizProveedor); FProveedoresController.Ver(AProveedor); if Assigned(AProveedor) then begin @@ -128,6 +130,7 @@ begin AArticulo.NOMBRE_PROVEEDOR := AProveedor.NOMBRE; end; AProveedor := Nil; +} end; procedure TArticulosController.AsignarDataModule; @@ -138,10 +141,11 @@ end; function TArticulosController.Buscar(const ID: Integer; AClienteID: Integer = -1): IBizArticulo; begin - if (AClienteID = -1) then - Result := (FDataModule as IDataModuleArticulos).GetItem(ID) - else - Result := (FDataModule as IDataModuleArticulos).GetItem(ID, AClienteID); +//Quitamos la funcionalidad de poder dar una lista de articulos particular de los clientes +// if (AClienteID = -1) then + Result := (FDataModule as IDataModuleArticulos).GetItem(ID); +// else +// Result := (FDataModule as IDataModuleArticulos).GetItem(ID, AClienteID); FiltrarEmpresa(Result); end; @@ -177,10 +181,11 @@ function TArticulosController.BuscarReferencia(const Ref: String; AClienteID: In begin ShowHourglassCursor; try - if (AClienteID = -1) then - Result := BuscarTodos - else - Result := BuscarTodos(AClienteID); +//En tecsitel se desactiva el sacar una lista de articulos personalizada por cliente +// if (AClienteID = -1) then + Result := BuscarTodos; +// else +// Result := BuscarTodos(AClienteID); // Filtrar por referencia, se cambia por el where anterior porque luego no nos reconoce bien la cadena, al contener UPPER with Result.DataTable.Where do @@ -211,10 +216,11 @@ function TArticulosController.BuscarReferenciaProveedor(const Ref: String; AClie begin ShowHourglassCursor; try - if (AClienteID = -1) then - Result := BuscarTodos - else - Result := BuscarTodos(AClienteID); +//En tecsitel se desactiva el sacar una lista de articulos personalizada por cliente +// if (AClienteID = -1) then + Result := BuscarTodosPorProveedor; +// else +// Result := BuscarTodos(AClienteID); // Filtrar por referencia, se cambia por el where anterior porque luego no nos reconoce bien la cadena, al contener UPPER with Result.DataTable.Where do @@ -240,16 +246,17 @@ end; function TArticulosController.BuscarTodos(ACliente: Integer): IBizArticulo; begin - Result := FDataModule.GetItems(ACliente); + Result := FDataModule.GetItems(txArticulo); //ACliente); FiltrarEmpresa(Result); end; function TArticulosController.BuscarTodos(ACliente: IBizCliente): IBizArticulo; begin - if not Assigned(ACliente) then - raise Exception.Create('Falta ACliente: BuscarTodos'); +//En tecsitel se desactiva el sacar una lista de articulos personalizada por cliente +// if not Assigned(ACliente) then +// raise Exception.Create('Falta ACliente: BuscarTodos'); - Result := BuscarTodos(ACliente.ID); + Result := BuscarTodos; //(ACliente.ID); end; function TArticulosController.BuscarTodos(AProveedor: IBizProveedor): IBizArticulo; @@ -260,13 +267,13 @@ begin begin ShowHourglassCursor; try - Result := BuscarTodos; + Result := BuscarTodosPorProveedor; // Filtrar los articulos del proveedor with Result.DataTable.DynamicWhere do begin // (ID_PROVEEDOR = ID) - Condicion := NewBinaryExpression(NewField('', fld_ArticulosID_PROVEEDOR), NewConstant(AProveedor.ID, datInteger), dboEqual); + Condicion := NewBinaryExpression(NewField('', fld_ArticulosParaCompraID_PROVEEDOR), NewConstant(AProveedor.ID, datInteger), dboEqual); if IsEmpty then Expression := Condicion @@ -279,9 +286,15 @@ begin end; end; +function TArticulosController.BuscarTodosPorProveedor: IBizArticulo; +begin + Result := FDataModule.GetItems(txProveedor); + FiltrarEmpresa(Result); +end; + function TArticulosController.BuscarTodos: IBizArticulo; begin - Result := FDataModule.GetItems; + Result := FDataModule.GetItems(txArticulo); FiltrarEmpresa(Result); end; @@ -289,6 +302,7 @@ procedure TArticulosController.CalcularPrecioNeto(AArticulos: IBizArticulo); var lPrecioNeto: Double; begin +{ if Assigned(AArticulos) then begin with AArticulos do @@ -312,6 +326,7 @@ begin end; end; end; +} end; constructor TArticulosController.Create; @@ -444,6 +459,7 @@ procedure TArticulosController.VerProveedor(AArticulo: IBizArticulo); var AProveedor : IBizContacto; begin +{ AProveedor := FProveedoresController.Buscar(AArticulo.ID_PROVEEDOR); FProveedoresController.Ver(AProveedor); if Assigned(AProveedor) then @@ -454,23 +470,21 @@ begin AArticulo.NOMBRE_PROVEEDOR := AProveedor.NOMBRE; end; AProveedor := Nil; +} end; -procedure TArticulosController.VerTodos(AArticulos: IBizArticulo); +procedure TArticulosController.VerTodos; var AEditor : IEditorArticulos; begin AEditor := NIL; ShowHourglassCursor; try - RecuperarObjetos(AArticulos); - CreateEditor('EditorArticulos', IEditorArticulos, AEditor); if Assigned(AEditor) then with (AEditor as IEditorArticulos) do begin Controller := Self; //OJO ORDEN MUY IMPORTANTE - Articulos := AArticulos; ShowEmbedded; end; finally @@ -493,6 +507,7 @@ begin if not Assigned(AArticulo) then raise Exception.Create(Format('No se ha encontrado el artículo con ID = %d', [ID])); + AArticulo.DataTable.Active := True; Result := Eliminar(AArticulo); AArticulo := NIL; end; @@ -527,6 +542,7 @@ var AProveedor : IBizContacto; begin inherited; +{ AProveedor := (FProveedoresController.ElegirContacto(FProveedoresController.BuscarTodos, '', False) as IBizProveedor); if Assigned(AProveedor) then begin @@ -536,6 +552,7 @@ begin AArticulo.NOMBRE_PROVEEDOR := AProveedor.NOMBRE; end; AProveedor := Nil; +} end; function TArticulosController.Eliminar(AArticulo: IBizArticulo): Boolean; @@ -630,10 +647,22 @@ begin begin ShowHourglassCursor; try + //Para que no salten los eventos de calculo de PVP que daría un pete importante + AArticulo.DataTable.DisableControls; + AArticulo.Proveedores.DataTable.DisableControls; + AArticulo.DataTable.DisableEventHandlers; + AArticulo.Proveedores.DataTable.DisableEventHandlers; + AArticulo.DataTable.ApplyUpdates; - - Result := True; + + Result := True; finally + //Para que no salten los eventos de calculo de PVP que daría un pete importante + AArticulo.DataTable.EnableControls; + AArticulo.DataTable.EnableEventHandlers; + AArticulo.Proveedores.Datatable.EnableControls; + AArticulo.Proveedores.Datatable.EnableEventHandlers; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Articulos/Data/Articulos_data.dproj b/Source/Modulos/Articulos/Data/Articulos_data.dproj index 59e770bf..12340c6b 100644 --- a/Source/Modulos/Articulos/Data/Articulos_data.dproj +++ b/Source/Modulos/Articulos/Data/Articulos_data.dproj @@ -47,9 +47,7 @@ Delphi.Personality Package -FalseTrueFalseTrueFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0Articulos_data.dpk - - +FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0Articulos_data.dpk Microsoft Office 2000 Sample Automation Server Wrapper Components Microsoft Office XP Sample Automation Server Wrapper Components @@ -59,7 +57,7 @@ MainSource - +
DataModuleArticulos
diff --git a/Source/Modulos/Articulos/Data/uDataModuleArticulos.dfm b/Source/Modulos/Articulos/Data/uDataModuleArticulos.dfm index 01c7452a..8c2060fb 100644 --- a/Source/Modulos/Articulos/Data/uDataModuleArticulos.dfm +++ b/Source/Modulos/Articulos/Data/uDataModuleArticulos.dfm @@ -1,7 +1,7 @@ inherited DataModuleArticulos: TDataModuleArticulos OnCreate = DAClientDataModuleCreate - Height = 289 - Width = 518 + Height = 468 + Width = 619 object RORemoteService: TRORemoteService Message = dmConexion.ROMessage Channel = dmConexion.ROChannel @@ -124,6 +124,8 @@ inherited DataModuleArticulos: TDataModuleArticulos item Name = 'PRECIO_NETO' DataType = datCurrency + DecimalPrecision = 2 + DecimalScale = 2 DisplayLabel = 'Precio neto' DictionaryEntry = 'Articulos_PRECIO_NETO' end @@ -133,18 +135,6 @@ inherited DataModuleArticulos: TDataModuleArticulos DisplayLabel = 'Inventariable' DictionaryEntry = 'Articulos_INVENTARIABLE' end - item - Name = 'ID_PROVEEDOR' - DataType = datInteger - DictionaryEntry = 'Articulos_ID_PROVEEDOR' - end - item - Name = 'NOMBRE_PROVEEDOR' - DataType = datString - Size = 255 - DisplayLabel = 'Nombre' - DictionaryEntry = 'Articulos_NOMBRE_PROVEEDOR' - end item Name = 'ELIMINADO' DataType = datSmallInt @@ -168,21 +158,18 @@ inherited DataModuleArticulos: TDataModuleArticulos item Name = 'PARAM_MARGEN' DataType = datFloat - DisplayLabel = 'Margen' - DictionaryEntry = 'Articulos_PARAM_MARGEN' end item Name = 'PRECIO_PVP_VENTA' DataType = datCurrency DisplayLabel = 'Precio PVP (Solo suministro)' Alignment = taRightJustify + ServerAutoRefresh = True DictionaryEntry = 'Articulos_PRECIO_PVP_VENTA' end item Name = 'TIEMPO' DataType = datInteger - DisplayLabel = 'Tiempo' - DictionaryEntry = 'Articulos_TIEMPO' end item Name = 'PARAM_TIEMPO' @@ -203,6 +190,7 @@ inherited DataModuleArticulos: TDataModuleArticulos DataType = datCurrency DisplayLabel = 'Precio P.V.P (Total)' Alignment = taRightJustify + ServerAutoRefresh = True DictionaryEntry = 'Articulos_PRECIO_PVP_TOTAL' end> Params = <> @@ -212,8 +200,8 @@ inherited DataModuleArticulos: TDataModuleArticulos MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] LogicalName = 'Articulos' IndexDefs = <> - Left = 224 - Top = 120 + Left = 232 + Top = 96 end object ds_Articulos: TDADataSource DataSet = tbl_Articulos.Dataset @@ -221,7 +209,124 @@ inherited DataModuleArticulos: TDataModuleArticulos Left = 232 Top = 32 end - object tbl_ArticulosParaCliente: TDAMemDataTable + object tbl_ProveedoresConArticulos: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ID_PROVEEDOR' + DataType = datInteger + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + end> + Params = < + item + Name = 'ID_EMPRESA' + Value = '' + ParamType = daptInput + end> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rda_Articulos + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'ProveedoresConArticulos' + IndexDefs = <> + Left = 232 + Top = 248 + end + object ds_ProveedoresConArticulos: TDADataSource + DataSet = tbl_ProveedoresConArticulos.Dataset + DataTable = tbl_ProveedoresConArticulos + Left = 232 + Top = 192 + end + object tbl_Articulos_Proveedores: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ID' + DataType = datAutoInc + GeneratorName = 'GEN_ARTICULOS_PROVEEDORES_ID' + Required = True + InPrimaryKey = True + end + item + Name = 'ID_ARTICULO' + DataType = datInteger + end + item + Name = 'ID_PROVEEDOR' + DataType = datInteger + end + item + Name = 'REFERENCIA_PROV' + DataType = datString + Size = 255 + DisplayLabel = 'Ref. proveedor' + DictionaryEntry = 'Articulos_REFERENCIA_PROVEEDOR' + end + item + Name = 'PRECIO_COSTE' + DataType = datCurrency + DisplayLabel = 'Importe' + DictionaryEntry = 'Articulos_PRECIO_COSTE' + end + item + Name = 'DESCUENTO' + DataType = datFloat + DisplayLabel = 'Descuento' + DictionaryEntry = 'Articulos_DESCUENTO' + end + item + Name = 'PRECIO_NETO' + DataType = datCurrency + DecimalPrecision = 2 + DecimalScale = 2 + DisplayLabel = 'Precio neto' + DictionaryEntry = 'Articulos_PRECIO_NETO' + end + item + Name = 'PRECIO_PORTE' + DataType = datCurrency + DisplayLabel = 'Precio porte' + DictionaryEntry = 'Articulos_PRECIO_PORTE' + end + item + Name = 'PRECIO_PVP_VENTA' + DataType = datCurrency + DisplayLabel = 'Precio PVP (Solo suministro)' + Alignment = taRightJustify + ServerAutoRefresh = True + DictionaryEntry = 'Articulos_PRECIO_PVP_VENTA' + end + item + Name = 'PRECIO_PVP_TOTAL' + DataType = datCurrency + ServerAutoRefresh = True + end> + Params = <> + MasterMappingMode = mmWhere + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rda_Articulos + MasterSource = ds_Articulos + MasterFields = 'ID' + DetailFields = 'ID_ARTICULO' + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Articulos_Proveedores' + IndexDefs = <> + Left = 368 + Top = 88 + end + object ds_Articulos_Proveedores: TDADataSource + DataSet = tbl_Articulos_Proveedores.Dataset + DataTable = tbl_Articulos_Proveedores + Left = 368 + Top = 32 + end + object tbl_ArticulosParaCompra: TDAMemDataTable RemoteUpdatesOptions = [] Fields = < item @@ -322,6 +427,8 @@ inherited DataModuleArticulos: TDataModuleArticulos item Name = 'PRECIO_NETO' DataType = datCurrency + DecimalPrecision = 2 + DecimalScale = 2 DisplayLabel = 'Precio neto' DictionaryEntry = 'Articulos_PRECIO_NETO' end @@ -334,14 +441,11 @@ inherited DataModuleArticulos: TDataModuleArticulos item Name = 'ID_PROVEEDOR' DataType = datInteger - DictionaryEntry = 'Articulos_ID_PROVEEDOR' end item Name = 'NOMBRE_PROVEEDOR' DataType = datString Size = 255 - DisplayLabel = 'Nombre' - DictionaryEntry = 'Articulos_NOMBRE_PROVEEDOR' end item Name = 'ELIMINADO' @@ -370,8 +474,10 @@ inherited DataModuleArticulos: TDataModuleArticulos item Name = 'PRECIO_PVP_VENTA' DataType = datCurrency - DisplayLabel = 'Precio P.V.P (Solo suministro)' + DisplayLabel = 'Precio PVP (Solo suministro)' Alignment = taRightJustify + ServerAutoRefresh = True + DictionaryEntry = 'Articulos_PRECIO_PVP_VENTA' end item Name = 'TIEMPO' @@ -380,71 +486,43 @@ inherited DataModuleArticulos: TDataModuleArticulos item Name = 'PARAM_TIEMPO' DataType = datFloat + DisplayLabel = 'Precio min' + Alignment = taRightJustify + DictionaryEntry = 'Articulos_PARAM_TIEMPO' end item Name = 'MANO_OBRA' DataType = datCurrency DisplayLabel = 'Mano de obra' Alignment = taRightJustify + DictionaryEntry = 'Articulos_MANO_OBRA' end item Name = 'PRECIO_PVP_TOTAL' DataType = datCurrency - DisplayLabel = 'Precio P.V.P. (Total)' + DisplayLabel = 'Precio P.V.P (Total)' Alignment = taRightJustify - end> - Params = < - item - Name = 'ID_CLIENTE' - Value = '2' - ParamType = daptInput - end> - StreamingOptions = [soDisableEventsWhileStreaming] - RemoteDataAdapter = rda_Articulos - DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] - MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] - LogicalName = 'ArticulosParaCliente' - IndexDefs = <> - Left = 400 - Top = 112 - end - object ds_ArticulosParaCliente: TDADataSource - DataSet = tbl_ArticulosParaCliente.Dataset - DataTable = tbl_ArticulosParaCliente - Left = 400 - Top = 32 - end - object tbl_ProveedoresConArticulos: TDAMemDataTable - RemoteUpdatesOptions = [] - Fields = < - item - Name = 'ID_PROVEEDOR' - DataType = datInteger + ServerAutoRefresh = True + DictionaryEntry = 'Articulos_PRECIO_PVP_TOTAL' end item - Name = 'NOMBRE' - DataType = datString - Size = 255 - end> - Params = < - item - Name = 'ID_EMPRESA' - Value = '' - ParamType = daptInput + Name = 'ID_ARTICULO' + DataType = datInteger end> + Params = <> StreamingOptions = [soDisableEventsWhileStreaming] RemoteDataAdapter = rda_Articulos DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] - LogicalName = 'ProveedoresConArticulos' + LogicalName = 'ArticulosParaCompra' IndexDefs = <> - Left = 304 - Top = 208 + Left = 416 + Top = 240 end - object ds_ProveedoresConArticulos: TDADataSource - DataSet = tbl_ProveedoresConArticulos.Dataset - DataTable = tbl_ProveedoresConArticulos - Left = 304 - Top = 152 + object ds_ArticulosParaCompra: TDADataSource + DataSet = tbl_ArticulosParaCompra.Dataset + DataTable = tbl_ArticulosParaCompra + Left = 416 + Top = 192 end end diff --git a/Source/Modulos/Articulos/Data/uDataModuleArticulos.pas b/Source/Modulos/Articulos/Data/uDataModuleArticulos.pas index adbbf7c8..2cdfecc6 100644 --- a/Source/Modulos/Articulos/Data/uDataModuleArticulos.pas +++ b/Source/Modulos/Articulos/Data/uDataModuleArticulos.pas @@ -8,7 +8,8 @@ uses uRORemoteService, uROClient, uROBinMessage, uDADesigntimeCall, uIDataModuleArticulos, uBizArticulos, uDataModuleBase, uDARemoteDataAdapter, - uDADataStreamer, uDABin2DataStreamer, uDAInterfaces, uDAMemDataTable; + uDADataStreamer, uDABin2DataStreamer, uDAInterfaces, uDAMemDataTable, + uBizArticulosProveedores; type TDataModuleArticulos = class(TDataModuleBase, IDataModuleArticulos) @@ -17,19 +18,22 @@ type rda_Articulos: TDARemoteDataAdapter; tbl_Articulos: TDAMemDataTable; ds_Articulos: TDADataSource; - tbl_ArticulosParaCliente: TDAMemDataTable; - ds_ArticulosParaCliente: TDADataSource; tbl_ProveedoresConArticulos: TDAMemDataTable; ds_ProveedoresConArticulos: TDADataSource; + tbl_Articulos_Proveedores: TDAMemDataTable; + ds_Articulos_Proveedores: TDADataSource; + tbl_ArticulosParaCompra: TDAMemDataTable; + ds_ArticulosParaCompra: TDADataSource; procedure DAClientDataModuleCreate(Sender: TObject); + private + function _GetProveedores : IBizArticulosProveedores; protected procedure AsignarClaseNegocio(AArticulo: TDADataTable); virtual; public - function GetItems : IBizArticulo; overload; - function GetItems (IDCliente: Integer) : IBizArticulo; overload; - function GetItem(const ID : Integer; AClienteID: Integer = -1) : IBizArticulo; + function GetItems (const Tipo: TEnumArticulos) : IBizArticulo; + function GetItem(const ID : Integer) : IBizArticulo; function NewItem : IBizArticulo; function DarListaProveedoresConArticulos(const IDEmpresa: Integer) : TStringList; end; @@ -66,16 +70,32 @@ begin Result := GetItem(ID_NULO) end; -function TDataModuleArticulos.GetItem(const ID: Integer; AClienteID: Integer = -1): IBizArticulo; +function TDataModuleArticulos._GetProveedores: IBizArticulosProveedores; +var + AProveedores : TDAMemDataTable; +begin + ShowHourglassCursor; + try + AProveedores := CloneDataTable(tbl_Articulos_Proveedores); + with AProveedores do + begin + BusinessRulesID := BIZ_CLIENT_ARTICULOS_PROVEEDORES; + DetailOptions := DetailOptions - [dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates]; + end; + Result := (AProveedores as IBizArticulosProveedores); + finally + HideHourglassCursor; + end; + +end; + +function TDataModuleArticulos.GetItem(const ID: Integer): IBizArticulo; var Condicion: TDAWhereExpression; begin ShowHourglassCursor; try - if (AClienteID = -1) then - Result := Self.GetItems - else - Result := Self.GetItems(AClienteID); + Result := Self.GetItems(txArticulo); with Result.DataTable.DynamicWhere do begin @@ -93,36 +113,23 @@ begin end; end; -function TDataModuleArticulos.GetItems(IDCliente: Integer): IBizArticulo; -var - AArticulo : TDAMemDataTable; -begin - - ShowHourglassCursor; - try - AArticulo := CloneDataTable(tbl_ArticulosParaCliente); - AsignarClaseNegocio(AArticulo); - - AArticulo.ParamByName('ID_CLIENTE').AsInteger := IdCliente; - - Result := (AArticulo as IBizArticulo); - - finally - HideHourglassCursor; - end; - -end; - -function TDataModuleArticulos.GetItems: IBizArticulo; +function TDataModuleArticulos.GetItems(const Tipo: TEnumArticulos): IBizArticulo; var AArticulo : TDAMemDataTable; begin ShowHourglassCursor; try - AArticulo := CloneDataTable(tbl_Articulos); + case Tipo of + txArticulo: AArticulo := CloneDataTable(tbl_Articulos); + txProveedor: AArticulo := CloneDataTable(tbl_ArticulosParaCompra); + end; AsignarClaseNegocio(AArticulo); + case Tipo of + txArticulo: TBizArticulo(AArticulo.BusinessEventsObj).Proveedores := _GetProveedores; + end; + Result := (AArticulo as IBizArticulo); finally @@ -130,5 +137,4 @@ begin end; end; - end. diff --git a/Source/Modulos/Articulos/Model/Articulos_model.dpk b/Source/Modulos/Articulos/Model/Articulos_model.dpk index d01960c4..0041dd53 100644 Binary files a/Source/Modulos/Articulos/Model/Articulos_model.dpk and b/Source/Modulos/Articulos/Model/Articulos_model.dpk differ diff --git a/Source/Modulos/Articulos/Model/Articulos_model.dproj b/Source/Modulos/Articulos/Model/Articulos_model.dproj index 44ae418b..c517ac19 100644 --- a/Source/Modulos/Articulos/Model/Articulos_model.dproj +++ b/Source/Modulos/Articulos/Model/Articulos_model.dproj @@ -1,4 +1,5 @@ - + + {e4f81792-84cf-4900-a6ab-18f6dd2c7ada} Articulos_model.dpk @@ -54,12 +55,21 @@ MainSource - - + + + + + + + + + + +