diff --git a/Source/Base/Utiles/uSistemaFunc.pas b/Source/Base/Utiles/uSistemaFunc.pas
index bc21f81a..573611df 100644
--- a/Source/Base/Utiles/uSistemaFunc.pas
+++ b/Source/Base/Utiles/uSistemaFunc.pas
@@ -48,8 +48,10 @@ function GetSpecialFolderPath(folder : integer) : string;
function PreguntarRuta(const ATitulo: String; const AComentario: String; var ARuta: String): Boolean;
function PreguntarFicheroWordExportar (var Fichero : String) : Boolean;
function PreguntarFicheroExcelExportar (var Fichero : String) : Boolean;
+function PreguntarFicheroPDFExportar (var Fichero : String) : Boolean;
function EscapeIllegalChars(AFileName: string): string;
function FindFile(const filespec: TFileName; attributes: integer = faReadOnly Or faHidden Or faSysFile Or faArchive): TStringList;
+function ExecAndWait(sCommandLine: string): Boolean;
function DarRutaFichero(const ARutaIni: String; const AFichero: String; const ADirectorio1: String = ''; const ADirectorio2: String = ''): Variant;
@@ -66,6 +68,34 @@ uses
StdCtrls, SHFolder, cxShellBrowserDialog,
cxLookAndFeels, uStringsUtils;
+function ExecAndWait(sCommandLine: string): Boolean;
+var
+ dwExitCode: DWORD;
+ tpiProcess: TProcessInformation;
+ tsiStartup: TStartupInfo;
+begin
+ Result := False;
+ FillChar(tsiStartup, SizeOf(TStartupInfo), 0);
+ tsiStartup.cb := SizeOf(TStartupInfo);
+ if CreateProcess(nil, PChar(sCommandLine), nil, nil, False, 0,
+ nil, nil, tsiStartup, tpiProcess) then
+ begin
+ if WAIT_OBJECT_0 = WaitForSingleObject(tpiProcess.hProcess, INFINITE) then
+ begin
+ if GetExitCodeProcess(tpiProcess.hProcess, dwExitCode) then
+ begin
+ if dwExitCode = 0 then
+ Result := True
+ else
+ SetLastError(dwExitCode + $2000);
+ end;
+ end;
+ dwExitCode := GetLastError;
+ CloseHandle(tpiProcess.hProcess);
+ CloseHandle(tpiProcess.hThread);
+ SetLastError(dwExitCode);
+ end;
+end;
function GetSpecialFolderPath(folder : integer) : string;
const
@@ -465,6 +495,27 @@ begin
end
end;
+function PreguntarFicheroPDFExportar (var Fichero : String) : Boolean;
+var
+ DialogoSalvar : TSaveDialog;
+begin
+ DialogoSalvar := TSaveDialog.Create(NIL);
+ try
+ with DialogoSalvar do
+ begin
+ DefaultExt := 'pdf';
+ Filter := 'Documento pdf (*.pdf)|*.pdf';
+ FileName := Fichero;
+ FilterIndex := 0;
+ Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist, ofEnableSizing];
+ end;
+ Result := DialogoSalvar.Execute;
+ if Result then
+ Fichero := DialogoSalvar.FileName;
+ finally
+ DialogoSalvar.Free;
+ end;
+end;
procedure SetDefaultFonts(const AFont: TFont);
diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj
index e5c0088e..fad65b67 100644
--- a/Source/Cliente/FactuGES.dproj
+++ b/Source/Cliente/FactuGES.dproj
@@ -52,7 +52,7 @@
Delphi.Personality
VCLApplication
-FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse3670FalseFalseFalseFalseFalse30821252Rodax Software S.L.3.6.7.0FactuGESFactuGES3.6.7.0
+FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse4000FalseFalseFalseFalseFalse30821252Rodax Software S.L.4.0.0.0FactuGESFactuGES4.0.0.0
File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found
FactuGES.dprFalse
diff --git a/Source/Cliente/FactuGES.rc b/Source/Cliente/FactuGES.rc
index 75046c1c..ed07e0c0 100644
--- a/Source/Cliente/FactuGES.rc
+++ b/Source/Cliente/FactuGES.rc
@@ -1,7 +1,7 @@
MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Factuges.ico"
1 VERSIONINFO
-FILEVERSION 3,6,7,0
-PRODUCTVERSION 3,6,7,0
+FILEVERSION 4,0,0,0
+PRODUCTVERSION 4,0,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", "3.6.7.0\0"
+ VALUE "FileVersion", "4.0.0.0\0"
VALUE "InternalName", "FactuGES\0"
VALUE "ProductName", "FactuGES\0"
- VALUE "ProductVersion", "3.6.7.0\0"
+ VALUE "ProductVersion", "4.0.0.0\0"
END
END
BLOCK "VarFileInfo"
diff --git a/Source/Cliente/FactuGES.res b/Source/Cliente/FactuGES.res
index eb60ce57..96e35ec4 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 f5d41b84..0edfe477 100644
--- a/Source/GUIBase/GUIBase.dproj
+++ b/Source/GUIBase/GUIBase.dproj
@@ -58,34 +58,34 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/5/1/InfContratoCliente.fr3 b/Source/Informes/5/1/InfContratoCliente.fr3
index 77fb8809..3d1fa07d 100644
--- a/Source/Informes/5/1/InfContratoCliente.fr3
+++ b/Source/Informes/5/1/InfContratoCliente.fr3
@@ -1,23 +1,23 @@
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
@@ -29,41 +29,41 @@
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
@@ -78,7 +78,7 @@
-
+
diff --git a/Source/Informes/5/1/InfPresupuestoCliente.fr3 b/Source/Informes/5/1/InfPresupuestoCliente.fr3
index 14390a5e..c9130051 100644
--- a/Source/Informes/5/1/InfPresupuestoCliente.fr3
+++ b/Source/Informes/5/1/InfPresupuestoCliente.fr3
@@ -1,15 +1,15 @@
-
+
-
-
-
+
+
+
-
+
diff --git a/Source/Informes/5/1/firma_contrato.bat b/Source/Informes/5/1/firma_contrato.bat
new file mode 100644
index 00000000..c438dda4
--- /dev/null
+++ b/Source/Informes/5/1/firma_contrato.bat
@@ -0,0 +1,48 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\Rodax\Servidor\Informes\5\1\log_factura.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28010
+set PositionOnPageLowerLeftX=30
+set PositionOnPageLowerLeftY=90
+set PositionOnPageUpperRightX=200
+set PositionOnPageUpperRigthY=170
+set signaturePage=-1
+set signatureRubricImage="D:\Rodax\Servidor\Informes\5\1\sello.jpg"
+set layer2text="Firmado digitalmente por $$ORGANIZATION$$ Fecha: $$SIGNDATE=dd/MM/yyyy$$"
+SET l2FontColor=black
+SET l2FontSize=7
+SET l2FontFamily=1
+SET l2FontStyle=0
+
+REM Asegura que autofirma no muestra ninguna GUI
+set headless=true
+
+REM incluir únicamente el certificado del firmante
+set "includeOnlySignningCertificate=true"
+
+REM Siempre creará una revisión al firmar. Requiere que el documento cumpla PDF 1.7 (ISO 32000-1:2008)
+REM "alwaysCreateRevision=true"
+
+REM set "CONFIG=signatureProductionCity=MADRID\nsignatureProductionProvince=MADRID\nsignatureProductionPostalCode=28053\nsignatureProductionCountry=ESPAÑA\nsignaturePage3=%signaturePage3%\nPositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nPositionPageLowerLeftY=%PositionPageLowerLeftY%\nPositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nPositionOnPageUpperRigthY=%PositionOnPageUpperRigthY%\nsignatureRubricImage=%signatureRubricImage%\nlayer2text=%layer2text=%"
+REM \nsignaturePage=%signaturePage%
+
+
+set "CONFIG=headless=%headless%\nlayer2Text=%layer2text%\nsignatureProductionCity=%city%\nsignatureProductionProvince=%province%\nsignatureProductionPostalCode=%postalcode%\nsignatureProductionCountry=ESPAÑA\nsignaturePositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nsignaturePositionOnPageLowerLeftY=%PositionOnPageLowerLeftY%\nsignaturePositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nsignaturePositionOnPageUpperRightY=%PositionOnPageUpperRigthY%\nsignaturePage=-1\nincludeOnlySignningCertificate=true\nsignatureRubricImage=%signatureRubricImage%"
+
+REM echo %CONFIG% > %LOGFILE%
+REM echo %ARCHIVO% > %LOGFILE%
+echo %TEMP% > %LOGFILE%
+echo %PASSCRIS% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\Rodax\Servidor\PDFS\cert-cris.pfx" -password %PASSCRIS% -filter subject.contains:59828 -config %CONFIG%
+
diff --git a/Source/Informes/5/1/firma_factura.bat b/Source/Informes/5/1/firma_factura.bat
new file mode 100644
index 00000000..a8141151
--- /dev/null
+++ b/Source/Informes/5/1/firma_factura.bat
@@ -0,0 +1,48 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\Rodax\Servidor\Informes\5\1\log_factura.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28010
+set PositionOnPageLowerLeftX=200
+set PositionOnPageLowerLeftY=80
+set PositionOnPageUpperRightX=370
+set PositionOnPageUpperRigthY=200
+set signaturePage=-1
+set signatureRubricImage="D:\Rodax\Servidor\Informes\5\1\sello.jpg"
+set layer2text="Firmado digitalmente por $$ORGANIZATION$$ Fecha: $$SIGNDATE=dd/MM/yyyy$$"
+SET l2FontColor=black
+SET l2FontSize=7
+SET l2FontFamily=1
+SET l2FontStyle=0
+
+REM Asegura que autofirma no muestra ninguna GUI
+set headless=true
+
+REM incluir únicamente el certificado del firmante
+set "includeOnlySignningCertificate=true"
+
+REM Siempre creará una revisión al firmar. Requiere que el documento cumpla PDF 1.7 (ISO 32000-1:2008)
+REM "alwaysCreateRevision=true"
+
+REM set "CONFIG=signatureProductionCity=MADRID\nsignatureProductionProvince=MADRID\nsignatureProductionPostalCode=28053\nsignatureProductionCountry=ESPAÑA\nsignaturePage3=%signaturePage3%\nPositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nPositionPageLowerLeftY=%PositionPageLowerLeftY%\nPositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nPositionOnPageUpperRigthY=%PositionOnPageUpperRigthY%\nsignatureRubricImage=%signatureRubricImage%\nlayer2text=%layer2text=%"
+REM \nsignaturePage=%signaturePage%
+
+
+set "CONFIG=headless=%headless%\nlayer2Text=%layer2text%\nsignatureProductionCity=%city%\nsignatureProductionProvince=%province%\nsignatureProductionPostalCode=%postalcode%\nsignatureProductionCountry=ESPAÑA\nsignaturePositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nsignaturePositionOnPageLowerLeftY=%PositionOnPageLowerLeftY%\nsignaturePositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nsignaturePositionOnPageUpperRightY=%PositionOnPageUpperRigthY%\nsignaturePage=-1\nincludeOnlySignningCertificate=true\nsignatureRubricImage=%signatureRubricImage%"
+
+REM echo %CONFIG% > %LOGFILE%
+REM echo %ARCHIVO% > %LOGFILE%
+echo %TEMP% > %LOGFILE%
+echo %PASSCRIS% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\Rodax\Servidor\PDFS\cert-cris.pfx" -password %PASSCRIS% -filter subject.contains:59828 -config %CONFIG%
+
diff --git a/Source/Informes/5/1/sello.jpg b/Source/Informes/5/1/sello.jpg
new file mode 100644
index 00000000..44d4e9c6
Binary files /dev/null and b/Source/Informes/5/1/sello.jpg differ
diff --git a/Source/Informes/5/3/InfContratoCliente.fr3 b/Source/Informes/5/3/InfContratoCliente.fr3
index cd04ba82..a7c447cd 100644
--- a/Source/Informes/5/3/InfContratoCliente.fr3
+++ b/Source/Informes/5/3/InfContratoCliente.fr3
@@ -1,13 +1,13 @@
-
+
-
+
-
-
+
+
@@ -103,9 +103,9 @@
-
+
-
+
diff --git a/Source/Informes/5/3/InfPresupuestoCliente.fr3 b/Source/Informes/5/3/InfPresupuestoCliente.fr3
index 74f577f6..14674108 100644
--- a/Source/Informes/5/3/InfPresupuestoCliente.fr3
+++ b/Source/Informes/5/3/InfPresupuestoCliente.fr3
@@ -1,17 +1,17 @@
-
+
-
+
-
+
-
+
-
+
diff --git a/Source/Informes/5/3/firma_contrato.bat b/Source/Informes/5/3/firma_contrato.bat
new file mode 100644
index 00000000..2be3b0ac
--- /dev/null
+++ b/Source/Informes/5/3/firma_contrato.bat
@@ -0,0 +1,47 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\Rodax\Servidor\Informes\5\3\log_contrato.txt
+
+set ARCHIVO=%1
+set city=RIVAS
+set province=MADRID
+set postalcode=28522
+set PositionOnPageLowerLeftX=80
+set PositionOnPageLowerLeftY=163
+set PositionOnPageUpperRightX=240
+set PositionOnPageUpperRigthY=253
+set signaturePage=-1
+set signatureRubricImage="D:\Rodax\Servidor\Informes\5\3\sello.jpg"
+set layer2text="Firmado digitalmente por $$ORGANIZATION$$ Fecha: $$SIGNDATE=dd/MM/yyyy$$"
+SET l2FontColor=black
+SET l2FontSize=7
+SET l2FontFamily=1
+SET l2FontStyle=0
+
+REM Asegura que autofirma no muestra ninguna GUI
+set headless=true
+
+REM incluir únicamente el certificado del firmante
+set "includeOnlySignningCertificate=true"
+
+REM Siempre creará una revisión al firmar. Requiere que el documento cumpla PDF 1.7 (ISO 32000-1:2008)
+REM "alwaysCreateRevision=true"
+
+REM set "CONFIG=signatureProductionCity=MADRID\nsignatureProductionProvince=MADRID\nsignatureProductionPostalCode=28053\nsignatureProductionCountry=ESPAÑA\nsignaturePage3=%signaturePage3%\nPositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nPositionPageLowerLeftY=%PositionPageLowerLeftY%\nPositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nPositionOnPageUpperRigthY=%PositionOnPageUpperRigthY%\nsignatureRubricImage=%signatureRubricImage%\nlayer2text=%layer2text=%"
+REM \nsignaturePage=%signaturePage%
+
+
+set "CONFIG=headless=%headless%\nlayer2Text=%layer2text%\nsignatureProductionCity=%city%\nsignatureProductionProvince=%province%\nsignatureProductionPostalCode=%postalcode%\nsignatureProductionCountry=ESPAÑA\nsignaturePositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nsignaturePositionOnPageLowerLeftY=%PositionOnPageLowerLeftY%\nsignaturePositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nsignaturePositionOnPageUpperRightY=%PositionOnPageUpperRigthY%\nsignaturePage=-1\nincludeOnlySignningCertificate=true\nsignatureRubricImage=%signatureRubricImage%"
+
+REM echo %CONFIG% > %LOGFILE%
+REM echo %ARCHIVO% > %LOGFILE%
+echo %TEMP% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\Rodax\Servidor\PDFS\cert-alis.pfx" -password %PASSALIS% -filter subject.contains:13910 -config %CONFIG%
+
diff --git a/Source/Informes/5/3/firma_factura.bat b/Source/Informes/5/3/firma_factura.bat
new file mode 100644
index 00000000..275fba95
--- /dev/null
+++ b/Source/Informes/5/3/firma_factura.bat
@@ -0,0 +1,47 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\Rodax\Servidor\Informes\5\3\log_factura.txt
+
+set ARCHIVO=%1
+set city=RIVAS
+set province=MADRID
+set postalcode=28522
+set PositionOnPageLowerLeftX=150
+set PositionOnPageLowerLeftY=100
+set PositionOnPageUpperRightX=310
+set PositionOnPageUpperRigthY=190
+set signaturePage=-1
+set signatureRubricImage="D:\Rodax\Servidor\Informes\5\3\sello.jpg"
+set layer2text="Firmado digitalmente por $$ORGANIZATION$$ Fecha: $$SIGNDATE=dd/MM/yyyy$$"
+SET l2FontColor=black
+SET l2FontSize=7
+SET l2FontFamily=1
+SET l2FontStyle=0
+
+REM Asegura que autofirma no muestra ninguna GUI
+set headless=true
+
+REM incluir únicamente el certificado del firmante
+set "includeOnlySignningCertificate=true"
+
+REM Siempre creará una revisión al firmar. Requiere que el documento cumpla PDF 1.7 (ISO 32000-1:2008)
+REM "alwaysCreateRevision=true"
+
+REM set "CONFIG=signatureProductionCity=MADRID\nsignatureProductionProvince=MADRID\nsignatureProductionPostalCode=28053\nsignatureProductionCountry=ESPAÑA\nsignaturePage3=%signaturePage3%\nPositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nPositionPageLowerLeftY=%PositionPageLowerLeftY%\nPositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nPositionOnPageUpperRigthY=%PositionOnPageUpperRigthY%\nsignatureRubricImage=%signatureRubricImage%\nlayer2text=%layer2text=%"
+REM \nsignaturePage=%signaturePage%
+
+
+set "CONFIG=headless=%headless%\nlayer2Text=%layer2text%\nsignatureProductionCity=%city%\nsignatureProductionProvince=%province%\nsignatureProductionPostalCode=%postalcode%\nsignatureProductionCountry=ESPAÑA\nsignaturePositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nsignaturePositionOnPageLowerLeftY=%PositionOnPageLowerLeftY%\nsignaturePositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nsignaturePositionOnPageUpperRightY=%PositionOnPageUpperRigthY%\nsignaturePage=-1\nincludeOnlySignningCertificate=true\nsignatureRubricImage=%signatureRubricImage%"
+
+REM echo %CONFIG% > %LOGFILE%
+REM echo %ARCHIVO% > %LOGFILE%
+echo %TEMP% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\Rodax\Servidor\PDFS\cert-alis.pfx" -password %PASSALIS% -filter subject.contains:13910 -config %CONFIG%
+
diff --git a/Source/Informes/5/3/sello.jpg b/Source/Informes/5/3/sello.jpg
new file mode 100644
index 00000000..e0ce2b70
Binary files /dev/null and b/Source/Informes/5/3/sello.jpg differ
diff --git a/Source/Informes/5/InformeListadoFacturasProveedorPendientes.fr3 b/Source/Informes/5/InformeListadoFacturasProveedorPendientes.fr3
index 6ea8d3ce..a5b90c5c 100644
--- a/Source/Informes/5/InformeListadoFacturasProveedorPendientes.fr3
+++ b/Source/Informes/5/InformeListadoFacturasProveedorPendientes.fr3
@@ -1,44 +1,46 @@
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
+
-
+
@@ -47,7 +49,7 @@
-
+
@@ -56,7 +58,7 @@
-
+
diff --git a/Source/Informes/5/InformeListadoFacturasProveedorPendientesDesglosado.fr3 b/Source/Informes/5/InformeListadoFacturasProveedorPendientesDesglosado.fr3
index 71f8c8ac..ec705179 100644
--- a/Source/Informes/5/InformeListadoFacturasProveedorPendientesDesglosado.fr3
+++ b/Source/Informes/5/InformeListadoFacturasProveedorPendientesDesglosado.fr3
@@ -1,5 +1,5 @@
-
+
@@ -9,40 +9,40 @@
-
+
-
-
-
-
-
+
+
+
+
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
-
+
@@ -51,7 +51,7 @@
-
+
@@ -60,7 +60,7 @@
-
+
diff --git a/Source/Informes/5/InformeListadoRecibosCliPendientes.fr3 b/Source/Informes/5/InformeListadoRecibosCliPendientes.fr3
index c01ba3fd..586e602c 100644
--- a/Source/Informes/5/InformeListadoRecibosCliPendientes.fr3
+++ b/Source/Informes/5/InformeListadoRecibosCliPendientes.fr3
@@ -1,5 +1,5 @@
-
+
@@ -11,29 +11,31 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
+
diff --git a/Source/Informes/5/InformeListadoRecibosCliPendientesDesglosado.fr3 b/Source/Informes/5/InformeListadoRecibosCliPendientesDesglosado.fr3
index 4ba051ab..873ece94 100644
--- a/Source/Informes/5/InformeListadoRecibosCliPendientesDesglosado.fr3
+++ b/Source/Informes/5/InformeListadoRecibosCliPendientesDesglosado.fr3
@@ -1,5 +1,5 @@
-
+
@@ -14,31 +14,31 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
+
diff --git a/Source/Informes/5/InformeListadoRecibosCliente.fr3 b/Source/Informes/5/InformeListadoRecibosCliente.fr3
index 230fedab..d19580df 100644
--- a/Source/Informes/5/InformeListadoRecibosCliente.fr3
+++ b/Source/Informes/5/InformeListadoRecibosCliente.fr3
@@ -1,5 +1,5 @@
-
+
@@ -11,29 +11,31 @@
-
+
-
-
-
-
-
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
diff --git a/Source/Informes/5/InformeListadoRecibosClienteDesglosado.fr3 b/Source/Informes/5/InformeListadoRecibosClienteDesglosado.fr3
index a232d8fb..435042fa 100644
--- a/Source/Informes/5/InformeListadoRecibosClienteDesglosado.fr3
+++ b/Source/Informes/5/InformeListadoRecibosClienteDesglosado.fr3
@@ -1,5 +1,5 @@
-
+
@@ -14,31 +14,31 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
+
diff --git a/Source/Informes/5/InformeListadoRecibosProvPendientes.fr3 b/Source/Informes/5/InformeListadoRecibosProvPendientes.fr3
index c002cb18..1b388e43 100644
--- a/Source/Informes/5/InformeListadoRecibosProvPendientes.fr3
+++ b/Source/Informes/5/InformeListadoRecibosProvPendientes.fr3
@@ -1,5 +1,5 @@
-
+
@@ -13,27 +13,29 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/Source/Informes/5/InformeListadoRecibosProvPendientesDesglosado.fr3 b/Source/Informes/5/InformeListadoRecibosProvPendientesDesglosado.fr3
index b22a7d96..6c8c39ba 100644
--- a/Source/Informes/5/InformeListadoRecibosProvPendientesDesglosado.fr3
+++ b/Source/Informes/5/InformeListadoRecibosProvPendientesDesglosado.fr3
@@ -1,5 +1,5 @@
-
+
@@ -12,27 +12,29 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/Source/Informes/5/InformeListadoRecibosProveedor.fr3 b/Source/Informes/5/InformeListadoRecibosProveedor.fr3
index b3721a41..3ac248f5 100644
--- a/Source/Informes/5/InformeListadoRecibosProveedor.fr3
+++ b/Source/Informes/5/InformeListadoRecibosProveedor.fr3
@@ -1,5 +1,5 @@
-
+
@@ -13,27 +13,29 @@
-
+
-
-
-
-
+
+
+
+
-
+
+
-
-
-
-
+
+
+
+
-
-
+
+
+
-
-
+
+
diff --git a/Source/Informes/5/InformeListadoRecibosProveedorDesglosado.fr3 b/Source/Informes/5/InformeListadoRecibosProveedorDesglosado.fr3
index e049eab4..fa24204d 100644
--- a/Source/Informes/5/InformeListadoRecibosProveedorDesglosado.fr3
+++ b/Source/Informes/5/InformeListadoRecibosProveedorDesglosado.fr3
@@ -1,5 +1,5 @@
-
+
@@ -13,27 +13,27 @@
-
-
-
-
-
-
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
diff --git a/Source/Informes/6/InfAlbaranCliente.fr3 b/Source/Informes/6/1/InfAlbaranCliente.fr3
similarity index 100%
rename from Source/Informes/6/InfAlbaranCliente.fr3
rename to Source/Informes/6/1/InfAlbaranCliente.fr3
diff --git a/Source/Informes/6/InfContratoCliente.fr3 b/Source/Informes/6/1/InfContratoCliente.fr3
similarity index 96%
rename from Source/Informes/6/InfContratoCliente.fr3
rename to Source/Informes/6/1/InfContratoCliente.fr3
index 77fb8809..a15f2835 100644
--- a/Source/Informes/6/InfContratoCliente.fr3
+++ b/Source/Informes/6/1/InfContratoCliente.fr3
@@ -1,23 +1,23 @@
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
@@ -29,41 +29,41 @@
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
@@ -78,7 +78,7 @@
-
+
diff --git a/Source/Informes/6/InfFacturaCliente.fr3 b/Source/Informes/6/1/InfFacturaCliente.fr3
similarity index 100%
rename from Source/Informes/6/InfFacturaCliente.fr3
rename to Source/Informes/6/1/InfFacturaCliente.fr3
diff --git a/Source/Informes/6/InfPedidoProveedor.fr3 b/Source/Informes/6/1/InfPedidoProveedor.fr3
similarity index 100%
rename from Source/Informes/6/InfPedidoProveedor.fr3
rename to Source/Informes/6/1/InfPedidoProveedor.fr3
diff --git a/Source/Informes/6/InfPresupuestoCliente.fr3 b/Source/Informes/6/1/InfPresupuestoCliente.fr3
similarity index 99%
rename from Source/Informes/6/InfPresupuestoCliente.fr3
rename to Source/Informes/6/1/InfPresupuestoCliente.fr3
index 14390a5e..4a950dc9 100644
--- a/Source/Informes/6/InfPresupuestoCliente.fr3
+++ b/Source/Informes/6/1/InfPresupuestoCliente.fr3
@@ -1,15 +1,15 @@
-
+
-
-
-
+
+
+
-
+
diff --git a/Source/Informes/6/InfReciboCliente.fr3 b/Source/Informes/6/1/InfReciboCliente.fr3
similarity index 100%
rename from Source/Informes/6/InfReciboCliente.fr3
rename to Source/Informes/6/1/InfReciboCliente.fr3
diff --git a/Source/Informes/6/1/firma_contrato.bat b/Source/Informes/6/1/firma_contrato.bat
new file mode 100644
index 00000000..77ef5700
--- /dev/null
+++ b/Source/Informes/6/1/firma_contrato.bat
@@ -0,0 +1,48 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\Rodax\Servidor\Informes\6\1\log_contrato.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28010
+set PositionOnPageLowerLeftX=30
+set PositionOnPageLowerLeftY=90
+set PositionOnPageUpperRightX=200
+set PositionOnPageUpperRigthY=170
+set signaturePage=-1
+set signatureRubricImage="D:\Rodax\Servidor\Informes\6\1\sello.jpg"
+set layer2text="Firmado digitalmente por $$ORGANIZATION$$ Fecha: $$SIGNDATE=dd/MM/yyyy$$"
+SET l2FontColor=black
+SET l2FontSize=7
+SET l2FontFamily=1
+SET l2FontStyle=0
+
+REM Asegura que autofirma no muestra ninguna GUI
+set headless=true
+
+REM incluir únicamente el certificado del firmante
+set "includeOnlySignningCertificate=true"
+
+REM Siempre creará una revisión al firmar. Requiere que el documento cumpla PDF 1.7 (ISO 32000-1:2008)
+REM "alwaysCreateRevision=true"
+
+REM set "CONFIG=signatureProductionCity=MADRID\nsignatureProductionProvince=MADRID\nsignatureProductionPostalCode=28053\nsignatureProductionCountry=ESPAÑA\nsignaturePage3=%signaturePage3%\nPositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nPositionPageLowerLeftY=%PositionPageLowerLeftY%\nPositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nPositionOnPageUpperRigthY=%PositionOnPageUpperRigthY%\nsignatureRubricImage=%signatureRubricImage%\nlayer2text=%layer2text=%"
+REM \nsignaturePage=%signaturePage%
+
+
+set "CONFIG=headless=%headless%\nlayer2Text=%layer2text%\nsignatureProductionCity=%city%\nsignatureProductionProvince=%province%\nsignatureProductionPostalCode=%postalcode%\nsignatureProductionCountry=ESPAÑA\nsignaturePositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nsignaturePositionOnPageLowerLeftY=%PositionOnPageLowerLeftY%\nsignaturePositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nsignaturePositionOnPageUpperRightY=%PositionOnPageUpperRigthY%\nsignaturePage=-1\nincludeOnlySignningCertificate=true\nsignatureRubricImage=%signatureRubricImage%"
+
+REM echo %CONFIG% > %LOGFILE%
+REM echo %ARCHIVO% > %LOGFILE%
+echo %TEMP% > %LOGFILE%
+echo %PASSCRIS% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\Rodax\Servidor\PDFS\cert-cris.pfx" -password %PASSCRIS% -filter subject.contains:59828 -config %CONFIG%
+
diff --git a/Source/Informes/6/1/firma_factura.bat b/Source/Informes/6/1/firma_factura.bat
new file mode 100644
index 00000000..7df9faf0
--- /dev/null
+++ b/Source/Informes/6/1/firma_factura.bat
@@ -0,0 +1,48 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\Rodax\Servidor\Informes\6\1\log_factura.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28010
+set PositionOnPageLowerLeftX=200
+set PositionOnPageLowerLeftY=80
+set PositionOnPageUpperRightX=370
+set PositionOnPageUpperRigthY=200
+set signaturePage=-1
+set signatureRubricImage="D:\Rodax\Servidor\Informes\6\1\sello.jpg"
+set layer2text="Firmado digitalmente por $$ORGANIZATION$$ Fecha: $$SIGNDATE=dd/MM/yyyy$$"
+SET l2FontColor=black
+SET l2FontSize=7
+SET l2FontFamily=1
+SET l2FontStyle=0
+
+REM Asegura que autofirma no muestra ninguna GUI
+set headless=true
+
+REM incluir únicamente el certificado del firmante
+set "includeOnlySignningCertificate=true"
+
+REM Siempre creará una revisión al firmar. Requiere que el documento cumpla PDF 1.7 (ISO 32000-1:2008)
+REM "alwaysCreateRevision=true"
+
+REM set "CONFIG=signatureProductionCity=MADRID\nsignatureProductionProvince=MADRID\nsignatureProductionPostalCode=28053\nsignatureProductionCountry=ESPAÑA\nsignaturePage3=%signaturePage3%\nPositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nPositionPageLowerLeftY=%PositionPageLowerLeftY%\nPositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nPositionOnPageUpperRigthY=%PositionOnPageUpperRigthY%\nsignatureRubricImage=%signatureRubricImage%\nlayer2text=%layer2text=%"
+REM \nsignaturePage=%signaturePage%
+
+
+set "CONFIG=headless=%headless%\nlayer2Text=%layer2text%\nsignatureProductionCity=%city%\nsignatureProductionProvince=%province%\nsignatureProductionPostalCode=%postalcode%\nsignatureProductionCountry=ESPAÑA\nsignaturePositionOnPageLowerLeftX=%PositionOnPageLowerLeftX%\nsignaturePositionOnPageLowerLeftY=%PositionOnPageLowerLeftY%\nsignaturePositionOnPageUpperRightX=%PositionOnPageUpperRightX%\nsignaturePositionOnPageUpperRightY=%PositionOnPageUpperRigthY%\nsignaturePage=-1\nincludeOnlySignningCertificate=true\nsignatureRubricImage=%signatureRubricImage%"
+
+REM echo %CONFIG% > %LOGFILE%
+REM echo %ARCHIVO% > %LOGFILE%
+echo %TEMP% > %LOGFILE%
+echo %PASSCRIS% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\Rodax\Servidor\PDFS\cert-cris.pfx" -password %PASSCRIS% -filter subject.contains:59828 -config %CONFIG%
+
diff --git a/Source/Informes/6/1/sello.jpg b/Source/Informes/6/1/sello.jpg
new file mode 100644
index 00000000..44d4e9c6
Binary files /dev/null and b/Source/Informes/6/1/sello.jpg differ
diff --git a/Source/Informes/InfPresupuestoCliente.fr3 b/Source/Informes/InfPresupuestoCliente.fr3
index 74f577f6..f4e96e7e 100644
--- a/Source/Informes/InfPresupuestoCliente.fr3
+++ b/Source/Informes/InfPresupuestoCliente.fr3
@@ -1,17 +1,17 @@
-
+
-
+
-
+
-
+
-
+
diff --git a/Source/Modulos/Albaranes de cliente/Model/uBizAlbaranClienteServer.pas b/Source/Modulos/Albaranes de cliente/Model/uBizAlbaranClienteServer.pas
index 99fdd017..8b29afdb 100644
--- a/Source/Modulos/Albaranes de cliente/Model/uBizAlbaranClienteServer.pas
+++ b/Source/Modulos/Albaranes de cliente/Model/uBizAlbaranClienteServer.pas
@@ -88,7 +88,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
@@ -108,7 +109,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
initialization
diff --git a/Source/Modulos/Albaranes de cliente/Model/uBizAlbaranesCliente.pas b/Source/Modulos/Albaranes de cliente/Model/uBizAlbaranesCliente.pas
index d9eff2d0..686c91dc 100644
--- a/Source/Modulos/Albaranes de cliente/Model/uBizAlbaranesCliente.pas
+++ b/Source/Modulos/Albaranes de cliente/Model/uBizAlbaranesCliente.pas
@@ -191,6 +191,7 @@ begin
SITUACION := SITUACION_ALBARAN_PENDIENTE;
REFERENCIA := '';
TIPO := CTE_TIPO_ALBARAN;
+
ID_TIENDA := AppFactuGES.TiendaActiva.ID;
TIENDA := AppFactuGES.TiendaActiva.NOMBRE;
@@ -241,13 +242,13 @@ begin
ID_CLIENTE := FCliente.ID;
if FCliente.ID_FORMA_PAGO > 0 then
ID_FORMA_PAGO := FCliente.ID_FORMA_PAGO;
-
+{
if FCliente.ID_TIENDA > 0 then
begin
ID_TIENDA := FCliente.ID_TIENDA;
TIENDA := FCliente.TIENDA;
end;
-
+}
DataTable.Post; //Muy importante ya que es necesario hacer un post de la cabecera antes de añadir detalles
//si se quita el id de la cabecera y los detalles se desincroniza
if bEnEdicion then
diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm
index 8447f0ca..f7e0ab66 100644
--- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm
+++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.dfm
@@ -239,6 +239,8 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 781
+ ExplicitWidth = 250
+ Width = 250
end
end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
@@ -276,6 +278,11 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
object TBXItem2: TTBXItem
Action = actAlmacenes
end
+ object TBXSeparatorItem3: TTBXSeparatorItem
+ end
+ object TBXItem4: TTBXItem
+ Action = actTienda
+ end
end
end
end
@@ -311,6 +318,11 @@ inherited frViewAlbaranesCliente: TfrViewAlbaranesCliente
OnExecute = actAlmacenesExecute
OnUpdate = actAlmacenesUpdate
end
+ object actTienda: TAction
+ Caption = 'Tienda'
+ OnExecute = actTiendaExecute
+ OnUpdate = actTiendaUpdate
+ end
end
inherited cxStyleRepositoryInforme: TcxStyleRepository
Left = 360
diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.pas
index 7dc50444..cd8d0462 100644
--- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.pas
+++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranesCliente.pas
@@ -61,6 +61,9 @@ type
cxGridViewTIENDA: TcxGridDBColumn;
cxGridViewREF_CONTRATO: TcxGridDBColumn;
cxGridViewLISTA_NOMBRES: TcxGridDBColumn;
+ actTienda: TAction;
+ TBXSeparatorItem3: TTBXSeparatorItem;
+ TBXItem4: TTBXItem;
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel:
TcxGridLevel);
procedure cxGridViewCODIGOCustomDrawCell(Sender: TcxCustomGridTableView;
@@ -76,6 +79,8 @@ type
procedure actAlmacenesUpdate(Sender: TObject);
procedure cxGridViewMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
+ procedure actTiendaExecute(Sender: TObject);
+ procedure actTiendaUpdate(Sender: TObject);
private
//Filtros relativos a la vista
@@ -140,6 +145,26 @@ begin
(Sender as TAction).Checked := not (cxGridViewNOMBRE.GroupIndex < 0);
end;
+procedure TfrViewAlbaranesCliente.actTiendaExecute(Sender: TObject);
+begin
+ if (cxGridViewTIENDA.GroupIndex < 0) then
+ begin
+ cxGridViewTIENDA.GroupIndex := cxGridView.GroupedColumnCount;
+ cxGridViewTIENDA.Visible := False;
+ end
+ else
+ begin
+ cxGridViewTIENDA.GroupIndex := -1;
+ cxGridViewTIENDA.Visible := True;
+ end;
+end;
+
+procedure TfrViewAlbaranesCliente.actTiendaUpdate(Sender: TObject);
+begin
+ inherited;
+ (Sender as TAction).Checked := not (cxGridViewTIENDA.GroupIndex < 0);
+end;
+
procedure TfrViewAlbaranesCliente.AnadirFiltroFechas;
var
Columna: TcxGridDBColumn;
diff --git a/Source/Modulos/Albaranes de proveedor/Model/uBizAlbaranProveedorServer.PAS b/Source/Modulos/Albaranes de proveedor/Model/uBizAlbaranProveedorServer.PAS
index 78762b68..d2457e6e 100644
--- a/Source/Modulos/Albaranes de proveedor/Model/uBizAlbaranProveedorServer.PAS
+++ b/Source/Modulos/Albaranes de proveedor/Model/uBizAlbaranProveedorServer.PAS
@@ -85,7 +85,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
function TBizAlbaranProveedorServer.IncrementarReferencia: Boolean;
@@ -104,7 +105,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
initialization
diff --git a/Source/Modulos/Albaranes de proveedor/Views/uViewAlbaranesProveedor.dfm b/Source/Modulos/Albaranes de proveedor/Views/uViewAlbaranesProveedor.dfm
index e75c9845..b0c75ce2 100644
--- a/Source/Modulos/Albaranes de proveedor/Views/uViewAlbaranesProveedor.dfm
+++ b/Source/Modulos/Albaranes de proveedor/Views/uViewAlbaranesProveedor.dfm
@@ -216,6 +216,11 @@ inherited frViewAlbaranesProveedor: TfrViewAlbaranesProveedor
object TBXItem2: TTBXItem
Action = actAlmacen
end
+ object TBXSeparatorItem3: TTBXSeparatorItem
+ end
+ object TBXItem4: TTBXItem
+ Action = actTienda
+ end
end
end
end
@@ -238,6 +243,11 @@ inherited frViewAlbaranesProveedor: TfrViewAlbaranesProveedor
OnExecute = actAlmacenExecute
OnUpdate = actAlmacenUpdate
end
+ object actTienda: TAction
+ Caption = 'Tienda'
+ OnExecute = actTiendaExecute
+ OnUpdate = actTiendaUpdate
+ end
end
inherited GridPNGImageList: TPngImageList
Left = 352
diff --git a/Source/Modulos/Albaranes de proveedor/Views/uViewAlbaranesProveedor.pas b/Source/Modulos/Albaranes de proveedor/Views/uViewAlbaranesProveedor.pas
index bad9d64c..fc34073b 100644
--- a/Source/Modulos/Albaranes de proveedor/Views/uViewAlbaranesProveedor.pas
+++ b/Source/Modulos/Albaranes de proveedor/Views/uViewAlbaranesProveedor.pas
@@ -47,6 +47,9 @@ type
cxGridViewREFERENCIA_PROVEEDOR: TcxGridDBColumn;
cxGridViewREF_FACTURA_PROV: TcxGridDBColumn;
cxGridViewTIENDA: TcxGridDBColumn;
+ actTienda: TAction;
+ TBXSeparatorItem3: TTBXSeparatorItem;
+ TBXItem4: TTBXItem;
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel:
TcxGridLevel);
procedure cxGridViewCODIGOCustomDrawCell(Sender: TcxCustomGridTableView;
@@ -61,6 +64,8 @@ type
procedure actAlmacenUpdate(Sender: TObject);
procedure cxGridViewMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
+ procedure actTiendaExecute(Sender: TObject);
+ procedure actTiendaUpdate(Sender: TObject);
private
//Filtros relativos a la vista
@@ -122,6 +127,26 @@ begin
(Sender as TAction).Checked := not (cxGridViewNOMBRE.GroupIndex < 0);
end;
+procedure TfrViewAlbaranesProveedor.actTiendaExecute(Sender: TObject);
+begin
+ if (cxGridViewTIENDA.GroupIndex < 0) then
+ begin
+ cxGridViewTIENDA.GroupIndex := cxGridView.GroupedColumnCount;
+ cxGridViewTIENDA.Visible := False;
+ end
+ else
+ begin
+ cxGridViewTIENDA.GroupIndex := -1;
+ cxGridViewTIENDA.Visible := True;
+ end;
+end;
+
+procedure TfrViewAlbaranesProveedor.actTiendaUpdate(Sender: TObject);
+begin
+ inherited;
+ (Sender as TAction).Checked := not (cxGridViewTIENDA.GroupIndex < 0);
+end;
+
procedure TfrViewAlbaranesProveedor.AnadirFiltroFechas;
var
Columna: TcxGridDBColumn;
diff --git a/Source/Modulos/Contactos/Controller/uContactosController.pas b/Source/Modulos/Contactos/Controller/uContactosController.pas
index b6761428..a878e43a 100644
--- a/Source/Modulos/Contactos/Controller/uContactosController.pas
+++ b/Source/Modulos/Contactos/Controller/uContactosController.pas
@@ -187,14 +187,13 @@ begin
JsDialog.Instruction.Text := 'Elija una direcci'#243'n.';
JsDialog.DialogOptions := [doCommandLinks, doModal];
JsDialog.ButtonBar.Buttons := [cbOk];
- JsDialog.Width := 600;
+ JsDialog.Width := 1280;
+ JsDialog.BorderStyle := bsSizeable;
//Añadimos la direccion principal del contacto
with JsDialog.CustomButtons.Add do
begin
- Caption := AContacto.NOMBRE + ' ' + AContacto.NIF_CIF;
- Info.Add(AContacto.CALLE);
- Info.Add(AContacto.CODIGO_POSTAL + ' ' + AContacto.POBLACION + ' ' + AContacto.PROVINCIA);
+ Caption := AContacto.NOMBRE + ' - ' + AContacto.NIF_CIF + ' - ' + AContacto.CALLE + ' ' + AContacto.POBLACION + ' ' + AContacto.PROVINCIA;
Value := -1;
Default := True;
end;
@@ -205,9 +204,7 @@ begin
begin
with JsDialog.CustomButtons.Add do
begin
- Caption := AContacto.Direcciones.NOMBRE + ' ' + AContacto.Direcciones.NIF_CIF;
- Info.Add(AContacto.Direcciones.CALLE);
- Info.Add(AContacto.Direcciones.CODIGO_POSTAL + ' ' + AContacto.Direcciones.POBLACION + ' ' + AContacto.Direcciones.PROVINCIA);
+ Caption := AContacto.Direcciones.NOMBRE + ' - ' + AContacto.Direcciones.NIF_CIF + ' - ' + AContacto.Direcciones.CALLE + ' ' + AContacto.Direcciones.POBLACION + ' ' + AContacto.Direcciones.PROVINCIA;
Value := AContacto.Direcciones.ID;
end;
AContacto.Direcciones.DataTable.Next;
diff --git a/Source/Modulos/Contactos/Views/uViewVendedores.dfm b/Source/Modulos/Contactos/Views/uViewVendedores.dfm
index 557674fa..f45040ce 100644
--- a/Source/Modulos/Contactos/Views/uViewVendedores.dfm
+++ b/Source/Modulos/Contactos/Views/uViewVendedores.dfm
@@ -24,16 +24,42 @@ inherited frViewVendedores: TfrViewVendedores
inherited frViewFiltroBase1: TfrViewFiltroBase
inherited TBXDockablePanel1: TTBXDockablePanel
inherited dxLayoutControl1: TdxLayoutControl
+ inherited txtFiltroTodo: TcxTextEdit
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
+ ExplicitWidth = 460
+ Width = 460
+ end
inherited edtFechaIniFiltro: TcxDateEdit
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 237
Width = 237
end
inherited edtFechaFinFiltro: TcxDateEdit
Left = 341
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 341
ExplicitWidth = 206
Width = 206
end
+ inherited txtFiltroTodo2: TcxTextEdit
+ Left = 397
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
+ ExplicitLeft = 397
+ ExplicitWidth = 223
+ Width = 223
+ end
end
end
end
diff --git a/Source/Modulos/Contactos/Views/uViewVendedores.pas b/Source/Modulos/Contactos/Views/uViewVendedores.pas
index f5fc28d0..5e35d8a8 100644
--- a/Source/Modulos/Contactos/Views/uViewVendedores.pas
+++ b/Source/Modulos/Contactos/Views/uViewVendedores.pas
@@ -11,7 +11,8 @@ uses
cxGridPopupMenu, dxPSCore, dxPScxCommon, dxPScxGrid6Lnk, uDADataTable,
cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxClasses, cxControls, cxGridCustomView, cxGrid, dxPgsDlg, ActnList, TB2Item,
- TBX, TB2Toolbar, TBXDkPanels, TB2Dock, uViewFiltroBase, uDAInterfaces;
+ TBX, TB2Toolbar, TBXDkPanels, TB2Dock, uViewFiltroBase, uDAInterfaces,
+ uCustomView, uViewBase;
type
IViewVendedores = interface(IViewContactos)
diff --git a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas
index c5d4a9f8..077370be 100644
--- a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas
+++ b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteController.pas
@@ -57,6 +57,7 @@ type
procedure Preview(AContrato : IBizContratoCliente; AllItems: Boolean = false);
procedure Print(AContrato : IBizContratoCliente; AllItems: Boolean = false);
+ procedure GenerarPDF(AContrato : IBizContratoCliente; AllItems: Boolean = false; AFirmado: Boolean = False);
procedure EnviarContratoPorEMail(AContrato : IBizContratoCliente);
function CambiarSituacion(AContrato : IBizContratoCliente; Situacion: String; FechaDecision: TDateTime; AllItems: Boolean = false): Boolean;
@@ -68,6 +69,7 @@ type
procedure VerBeneficio(const ID: Integer);
procedure CopiarDireccion (const ADireccion: IBizDireccionesContacto; AContrato: IBizContratoCliente);
+ procedure FechaUltimaActualizacionToday (AContrato: IBizContratoCliente);
end;
TContratosClienteController = class(TControllerBase, IContratosClienteController)
@@ -135,6 +137,7 @@ type
procedure Preview(AContrato : IBizContratoCliente; AllItems: Boolean = false);
procedure Print(AContrato : IBizContratoCliente; AllItems: Boolean = false);
+ procedure GenerarPDF(AContrato : IBizContratoCliente; AllItems: Boolean = false; AFirmado: Boolean = False);
procedure EnviarContratoPorEMail(AContrato : IBizContratoCliente);
function CambiarSituacion(AContrato : IBizContratoCliente; Situacion: String; FechaDecision: TDateTime; AllItems: Boolean = false): Boolean;
@@ -146,6 +149,7 @@ type
procedure VerBeneficio(const ID: Integer);
procedure CopiarDireccion (const ADireccion: IBizDireccionesContacto; AContrato: IBizContratoCliente);
+ procedure FechaUltimaActualizacionToday (AContrato: IBizContratoCliente);
end;
implementation
@@ -990,6 +994,32 @@ begin
Result := ASeleccionados;
end;
+procedure TContratosClienteController.FechaUltimaActualizacionToday(AContrato: IBizContratoCliente);
+var
+ bEnEdicion : Boolean;
+begin
+ if not Assigned(AContrato) then
+ raise Exception.Create ('Contrato no asignado (CopiarDireccion)');
+
+ if AContrato.DataTable.Active then
+ AContrato.DataTable.Active := True;
+
+ bEnEdicion := (AContrato.DataTable.State in dsEditModes);
+ if not bEnEdicion then
+ AContrato.Edit;
+
+ ShowHourglassCursor;
+ AContrato.Edit;
+ try
+ AContrato.FECHA_ULT_PRESENTACION_CLIENTE := DateOf(Date);
+
+ if not bEnEdicion then
+ AContrato.Post;
+ finally
+ HideHourglassCursor;
+ end;
+end;
+
procedure TContratosClienteController.FiltrarAno(AContrato: IBizContratoCliente; ADynWhereDataTable: WideString;const Ano: String);
var
Condicion: TDAWhereExpression;
@@ -1184,6 +1214,63 @@ begin
end;
end;
+procedure TContratosClienteController.GenerarPDF(AContrato: IBizContratoCliente; AllItems, AFirmado: Boolean);
+var
+ AReportController : IContratosClienteReportController;
+ AFile : String;
+ bEliminado: Boolean;
+ ACausa: Variant;
+
+begin
+ if not Assigned(AContrato) then
+ raise Exception.Create ('Factura no asignado (GenerarPDF)');
+
+ if AContrato.DataTable.Active then
+ AContrato.DataTable.Active := True;
+
+ //En el caso de querer eliminar todos los items del objeto AAlbaran
+ if AllItems then
+ begin
+ with AContrato.DataTable do
+ begin
+ First;
+ while not EOF do
+ begin
+ AFile := EscapeIllegalChars(AContrato.REFERENCIA + ' - ' + AContrato.NOMBRE_CLIENTE);
+ if (not PreguntarFicheroPDFExportar(AFile)) then
+ Next
+ else
+ begin
+ ShowHourglassCursor;
+ try
+ AReportController := TContratosClienteReportController.Create;
+ AReportController.ExportToPDF(AContrato.ID, AFile, AFirmado);
+ finally
+ AReportController := NIL;
+ HideHourglassCursor;
+ end;
+ Next;
+ end;
+ end;
+ end;
+ end
+ else
+ begin
+ AFile := EscapeIllegalChars(AContrato.REFERENCIA + ' - ' + AContrato.NOMBRE_CLIENTE);
+ if (not PreguntarFicheroPDFExportar(AFile)) then
+ Exit;
+
+ ShowHourglassCursor;
+ try
+ AReportController := TContratosClienteReportController.Create;
+ AReportController.ExportToPDF(AContrato.ID, AFile, AFirmado);
+ finally
+ AReportController := NIL;
+ HideHourglassCursor;
+ end;
+ end;
+end;
+
function TContratosClienteController.GetClienteController: IClientesController;
begin
Result := FClienteController;
diff --git a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteReportController.pas b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteReportController.pas
index 4376bf8b..32a95135 100644
--- a/Source/Modulos/Contratos de cliente/Controller/uContratosClienteReportController.pas
+++ b/Source/Modulos/Contratos de cliente/Controller/uContratosClienteReportController.pas
@@ -12,7 +12,7 @@ type
['{FEF47B69-26A3-462A-AF6D-4B2073D4F9DC}']
procedure Preview(const AListaID : TIntegerList);
procedure Print(const AListaID : TIntegerList);
- function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
+ function ExportToPDF(const AID: Integer; const AFileName : String = ''; const AFirmado: Boolean = False): Boolean;
end;
TContratosClienteReportController = class(TControllerBase, IContratosClienteReportController)
@@ -25,7 +25,7 @@ type
procedure Preview(const AListaID : TIntegerList);
procedure Print(const AListaID : TIntegerList);
- function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
+ function ExportToPDF(const AID: Integer; const AFileName : String = ''; const AFirmado: Boolean = False): Boolean;
end;
@@ -57,8 +57,7 @@ begin
inherited;
end;
-function TContratosClienteReportController.ExportToPDF(const AID: Integer;
- const AFileName: String): Boolean;
+function TContratosClienteReportController.ExportToPDF(const AID: Integer; const AFileName : String = ''; const AFirmado: Boolean = False): Boolean;
var
AStream: Binary;
begin
@@ -68,7 +67,7 @@ begin
ShowHourglassCursor;
try
- AStream := FDataModule.GetRptPDFContrato(AID);
+ AStream := FDataModule.GetRptPDFContrato(AID, AFirmado);
try
AStream.SaveToFile(AFileName);
Result := True;
diff --git a/Source/Modulos/Contratos de cliente/Data/ContratosCliente_data.dproj b/Source/Modulos/Contratos de cliente/Data/ContratosCliente_data.dproj
index 56e509c2..add048fd 100644
--- a/Source/Modulos/Contratos de cliente/Data/ContratosCliente_data.dproj
+++ b/Source/Modulos/Contratos de cliente/Data/ContratosCliente_data.dproj
@@ -49,18 +49,18 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.dfm b/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.dfm
index 3e7eb83d..4fa6bdd9 100644
--- a/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.dfm
+++ b/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.dfm
@@ -346,6 +346,10 @@ inherited DataModuleContratosCliente: TDataModuleContratosCliente
Size = 255
DisplayLabel = 'Otros nombres'
DictionaryEntry = 'ContratosCliente_LISTA_NOMBRES'
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
end>
Params = <>
StreamingOptions = [soDisableEventsWhileStreaming]
diff --git a/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.pas b/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.pas
index cdfbda2e..95f35297 100644
--- a/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.pas
+++ b/Source/Modulos/Contratos de cliente/Data/uDataModuleContratosCliente.pas
@@ -46,7 +46,7 @@ type
// Report
function GetRptContratos(const AListaID: TIntegerList): Binary;
- function GetRptPDFContrato(const AID: Integer): Binary;
+ function GetRptPDFContrato(const AID: Integer; const Firmado: Boolean): Binary;
function GetAnosItems : TStringList;
function GetContratosClienteBeneficios : IBizContratosClienteBeneficios;
@@ -58,7 +58,7 @@ implementation
{$R *.DFM}
uses
- cxControls, FactuGES_Intf, uDataModuleConexion, Dialogs, DataAbstract4_Intf,
+ cxControls, uFactuGES_App, FactuGES_Intf, uDataModuleConexion, Dialogs, DataAbstract4_Intf,
uDataTableUtils, schContratosClienteClient_Intf, uBizContactos;
{ TdmContratosCliente }
@@ -74,15 +74,14 @@ begin
RORemoteService.Message := dmConexion.Message;
end;
-function TDataModuleContratosCliente.GetRptPDFContrato(
- const AID: Integer): Binary;
+function TDataModuleContratosCliente.GetRptPDFContrato(const AID: Integer; const Firmado: Boolean): Binary;
var
AParam : TIntegerArray;
begin
AParam := TIntegerArray.Create;
try
AParam.Add(AID);
- Result := (RORemoteService as IsrvContratosCliente).GenerarInformeEnPDF(AParam)
+ Result := (RORemoteService as IsrvContratosCliente).GenerarInformeEnPDF(AParam, AppFactuGES.UsuarioActivo.USERNAME, Firmado)
finally
FreeANDNIL(AParam)
end;
diff --git a/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosClienteReport.pas b/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosClienteReport.pas
index a883e0fe..9844259a 100644
--- a/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosClienteReport.pas
+++ b/Source/Modulos/Contratos de cliente/Model/Data/uIDataModuleContratosClienteReport.pas
@@ -9,7 +9,7 @@ type
IDataModuleContratosClienteReport = interface
['{6AB7469B-842A-413E-AF33-9506477A9666}']
function GetRptContratos(const AListaID: TIntegerList): Binary;
- function GetRptPDFContrato(const AID: Integer): Binary;
+ function GetRptPDFContrato(const AID: Integer; const Firmado: Boolean): Binary;
end;
implementation
diff --git a/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas b/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas
index b8c0a05f..77edca9c 100644
--- a/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas
+++ b/Source/Modulos/Contratos de cliente/Model/schContratosClienteClient_Intf.pas
@@ -9,14 +9,14 @@ 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_Valores = '{4A855BE2-1E27-410A-8350-ACF29C53F151}';
- RID_Propiedades = '{41570D1D-ED23-49DE-9131-AE3093CC8765}';
- RID_ListaAnosContratos = '{D5EA6576-1B2F-4111-A91D-BFFC1FDF10F8}';
- RID_ContratosClienteBeneficios = '{F424B9B6-07F8-463E-B4A0-1BA7AA6ED4E0}';
- RID_ContratosCliente = '{15CCCCE9-CCB4-446E-BAEF-19862E2DFB78}';
- RID_TiposCapitulos = '{CBD0C09A-5DEA-4BCD-BFF4-D416AE6A10D4}';
- RID_ContratosCliente_Detalles = '{7875CEEB-1D15-46A1-93CD-1FF70AE1624F}';
- RID_ContratoClienteFacturasProv = '{F4C72497-51E7-4AA6-ADD6-A1B25CD1FA91}';
+ RID_Valores = '{07040A27-DD19-4D93-B5DA-C9C49C1822CA}';
+ RID_Propiedades = '{3006A5CE-2DB4-46FD-97B3-65E9CBA7AD2A}';
+ RID_ListaAnosContratos = '{09600C3F-3F5A-4DB6-87A9-12C67B9AC2F1}';
+ RID_ContratosClienteBeneficios = '{B58A588F-6D51-43FB-B318-5F9ABE371CBE}';
+ RID_ContratosCliente = '{AFEF7F44-F9AD-4DCC-82CE-A441F94C7B6E}';
+ RID_TiposCapitulos = '{C4F51BD4-AB1F-4564-8370-E83BDA635D61}';
+ RID_ContratosCliente_Detalles = '{E45B94F9-C284-41CE-A73F-69E835616CBC}';
+ RID_ContratoClienteFacturasProv = '{4884E75F-7CFE-4300-B53A-7F8F87745F99}';
{ Data table names }
nme_Valores = 'Valores';
@@ -140,6 +140,7 @@ const
fld_ContratosClienteCALIDADES = 'CALIDADES';
fld_ContratosClienteREFERENCIA_CLIENTE = 'REFERENCIA_CLIENTE';
fld_ContratosClienteLISTA_NOMBRES = 'LISTA_NOMBRES';
+ fld_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE = 'FECHA_ULT_PRESENTACION_CLIENTE';
{ ContratosCliente field indexes }
idx_ContratosClienteID = 0;
@@ -191,6 +192,7 @@ const
idx_ContratosClienteCALIDADES = 46;
idx_ContratosClienteREFERENCIA_CLIENTE = 47;
idx_ContratosClienteLISTA_NOMBRES = 48;
+ idx_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE = 49;
{ TiposCapitulos fields }
fld_TiposCapitulosID = 'ID';
@@ -267,7 +269,7 @@ const
type
{ IValores }
IValores = interface(IDAStronglyTypedDataTable)
- ['{13277775-D26C-4C37-8D1A-93F331210A30}']
+ ['{72662564-0D03-463E-94DA-D8D703FC7FFD}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -326,7 +328,7 @@ type
{ IPropiedades }
IPropiedades = interface(IDAStronglyTypedDataTable)
- ['{EEFEAABF-251E-4913-AC03-72EC40D49314}']
+ ['{F1B345B8-6699-4700-8097-BFC5BDFD8537}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -385,7 +387,7 @@ type
{ IListaAnosContratos }
IListaAnosContratos = interface(IDAStronglyTypedDataTable)
- ['{72262AA4-E2B8-4359-AB2E-ED2F1CE60AAF}']
+ ['{36FADA3D-628F-480A-B077-EA8D6676A7C1}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
@@ -420,7 +422,7 @@ type
{ IContratosClienteBeneficios }
IContratosClienteBeneficios = interface(IDAStronglyTypedDataTable)
- ['{B769A1EC-6BF4-4753-BD9D-33065C8BA7E5}']
+ ['{BBC61983-3B64-4845-A47B-F8511BBF7A73}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -635,7 +637,7 @@ type
{ IContratosCliente }
IContratosCliente = interface(IDAStronglyTypedDataTable)
- ['{1A06CC8E-8C33-4DF9-B6DB-55FBABAA3E21}']
+ ['{5ECD7363-96C7-4393-AADE-B82526538C1E}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -827,6 +829,10 @@ type
procedure SetLISTA_NOMBRESValue(const aValue: String);
function GetLISTA_NOMBRESIsNull: Boolean;
procedure SetLISTA_NOMBRESIsNull(const aValue: Boolean);
+ function GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime);
+ function GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean);
{ Properties }
@@ -928,6 +934,8 @@ type
property REFERENCIA_CLIENTEIsNull: Boolean read GetREFERENCIA_CLIENTEIsNull write SetREFERENCIA_CLIENTEIsNull;
property LISTA_NOMBRES: String read GetLISTA_NOMBRESValue write SetLISTA_NOMBRESValue;
property LISTA_NOMBRESIsNull: Boolean read GetLISTA_NOMBRESIsNull write SetLISTA_NOMBRESIsNull;
+ property FECHA_ULT_PRESENTACION_CLIENTE: DateTime read GetFECHA_ULT_PRESENTACION_CLIENTEValue write SetFECHA_ULT_PRESENTACION_CLIENTEValue;
+ property FECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean read GetFECHA_ULT_PRESENTACION_CLIENTEIsNull write SetFECHA_ULT_PRESENTACION_CLIENTEIsNull;
end;
{ TContratosClienteDataTableRules }
@@ -1137,6 +1145,10 @@ type
procedure SetLISTA_NOMBRESValue(const aValue: String); virtual;
function GetLISTA_NOMBRESIsNull: Boolean; virtual;
procedure SetLISTA_NOMBRESIsNull(const aValue: Boolean); virtual;
+ function GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime; virtual;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime); virtual;
+ function GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean; virtual;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean); virtual;
{ Properties }
property ID: Integer read GetIDValue write SetIDValue;
@@ -1237,6 +1249,8 @@ type
property REFERENCIA_CLIENTEIsNull: Boolean read GetREFERENCIA_CLIENTEIsNull write SetREFERENCIA_CLIENTEIsNull;
property LISTA_NOMBRES: String read GetLISTA_NOMBRESValue write SetLISTA_NOMBRESValue;
property LISTA_NOMBRESIsNull: Boolean read GetLISTA_NOMBRESIsNull write SetLISTA_NOMBRESIsNull;
+ property FECHA_ULT_PRESENTACION_CLIENTE: DateTime read GetFECHA_ULT_PRESENTACION_CLIENTEValue write SetFECHA_ULT_PRESENTACION_CLIENTEValue;
+ property FECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean read GetFECHA_ULT_PRESENTACION_CLIENTEIsNull write SetFECHA_ULT_PRESENTACION_CLIENTEIsNull;
public
constructor Create(aDataTable: TDADataTable); override;
@@ -1249,7 +1263,7 @@ type
}
{ ITiposCapitulos }
ITiposCapitulos = interface(IDAStronglyTypedDataTable)
- ['{40EC6583-F105-4DC0-9181-38C309355EDF}']
+ ['{9303AF23-576A-4218-A01D-460C960EE4B3}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -1344,7 +1358,7 @@ type
{ IContratosCliente_Detalles }
IContratosCliente_Detalles = interface(IDAStronglyTypedDataTable)
- ['{9660A725-EBFD-413A-B413-5FC6C4BA26EF}']
+ ['{7DA1AFC7-EB2B-4195-8CC5-0AB9E9B72906}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -1595,7 +1609,7 @@ type
{ IContratoClienteFacturasProv }
IContratoClienteFacturasProv = interface(IDAStronglyTypedDataTable)
- ['{4BA8132B-EFEA-44CF-86F8-5BE79AD5A663}']
+ ['{92725D42-6696-45DF-9DB5-D9606DF194DD}']
{ Property getters and setters }
function GetID_CONTRATOValue: Integer;
procedure SetID_CONTRATOValue(const aValue: Integer);
@@ -3283,6 +3297,27 @@ begin
DataTable.Fields[idx_ContratosClienteLISTA_NOMBRES].AsVariant := Null;
end;
+function TContratosClienteDataTableRules.GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime;
+begin
+ result := DataTable.Fields[idx_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE].AsDateTime;
+end;
+
+procedure TContratosClienteDataTableRules.SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime);
+begin
+ DataTable.Fields[idx_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE].AsDateTime := aValue;
+end;
+
+function TContratosClienteDataTableRules.GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: boolean;
+begin
+ result := DataTable.Fields[idx_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE].IsNull;
+end;
+
+procedure TContratosClienteDataTableRules.SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean);
+begin
+ if aValue then
+ DataTable.Fields[idx_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE].AsVariant := Null;
+end;
+
{ TTiposCapitulosDataTableRules }
constructor TTiposCapitulosDataTableRules.Create(aDataTable: TDADataTable);
diff --git a/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas b/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas
index fe035b61..c6c38d6c 100644
--- a/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas
+++ b/Source/Modulos/Contratos de cliente/Model/schContratosClienteServer_Intf.pas
@@ -9,19 +9,19 @@ 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_ValoresDelta = '{F5BA3630-406E-40FE-97E7-4BC91132C5C8}';
- RID_PropiedadesDelta = '{A595FE24-F858-4D75-9446-36289739B617}';
- RID_ListaAnosContratosDelta = '{E1E216DE-7155-4F81-867C-3884DAD7D803}';
- RID_ContratosClienteBeneficiosDelta = '{A5795708-FD64-43F9-8BFB-9790F4704A05}';
- RID_ContratosClienteDelta = '{DB9934DA-3136-4D8C-8207-684254C4E5ED}';
- RID_TiposCapitulosDelta = '{BC8F6452-CA5B-4003-8BC5-6DC010737C59}';
- RID_ContratosCliente_DetallesDelta = '{5E3953D6-994F-4C13-BD75-D73DB9D7B437}';
- RID_ContratoClienteFacturasProvDelta = '{E4D089BC-21D9-4983-900F-8F82272F74AF}';
+ RID_ValoresDelta = '{D65A1140-B47F-4E5C-9F78-5E23024E699F}';
+ RID_PropiedadesDelta = '{6F61B397-916F-47F9-8B1F-143BBE4D8761}';
+ RID_ListaAnosContratosDelta = '{E49B48FF-2E1A-4370-9CA7-31E903528445}';
+ RID_ContratosClienteBeneficiosDelta = '{9F4F1DC8-CE07-49F0-93A6-E6780C53CC11}';
+ RID_ContratosClienteDelta = '{CEB5EB7A-F6D6-45BF-82B3-F538011FC1F6}';
+ RID_TiposCapitulosDelta = '{7D7EDE09-5AD4-40F0-A2D9-DFB899D5EE0E}';
+ RID_ContratosCliente_DetallesDelta = '{8CE89C32-E498-4B5A-9083-8C056ABE340F}';
+ RID_ContratoClienteFacturasProvDelta = '{5C24C33D-2EA7-495D-B98B-546E7EDA1C19}';
type
{ IValoresDelta }
IValoresDelta = interface(IValores)
- ['{F5BA3630-406E-40FE-97E7-4BC91132C5C8}']
+ ['{D65A1140-B47F-4E5C-9F78-5E23024E699F}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_PROPIEDADValue : Integer;
@@ -79,7 +79,7 @@ type
{ IPropiedadesDelta }
IPropiedadesDelta = interface(IPropiedades)
- ['{A595FE24-F858-4D75-9446-36289739B617}']
+ ['{6F61B397-916F-47F9-8B1F-143BBE4D8761}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldDESCRIPCIONValue : String;
@@ -137,7 +137,7 @@ type
{ IListaAnosContratosDelta }
IListaAnosContratosDelta = interface(IListaAnosContratos)
- ['{E1E216DE-7155-4F81-867C-3884DAD7D803}']
+ ['{E49B48FF-2E1A-4370-9CA7-31E903528445}']
{ Property getters and setters }
function GetOldANOValue : String;
@@ -171,7 +171,7 @@ type
{ IContratosClienteBeneficiosDelta }
IContratosClienteBeneficiosDelta = interface(IContratosClienteBeneficios)
- ['{A5795708-FD64-43F9-8BFB-9790F4704A05}']
+ ['{9F4F1DC8-CE07-49F0-93A6-E6780C53CC11}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldREFERENCIAValue : String;
@@ -385,7 +385,7 @@ type
{ IContratosClienteDelta }
IContratosClienteDelta = interface(IContratosCliente)
- ['{DB9934DA-3136-4D8C-8207-684254C4E5ED}']
+ ['{CEB5EB7A-F6D6-45BF-82B3-F538011FC1F6}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_EMPRESAValue : Integer;
@@ -436,6 +436,7 @@ type
function GetOldCALIDADESValue : IROStrings;
function GetOldREFERENCIA_CLIENTEValue : String;
function GetOldLISTA_NOMBRESValue : String;
+ function GetOldFECHA_ULT_PRESENTACION_CLIENTEValue : DateTime;
{ Properties }
property OldID : Integer read GetOldIDValue;
@@ -487,6 +488,7 @@ type
property OldCALIDADES : IROStrings read GetOldCALIDADESValue;
property OldREFERENCIA_CLIENTE : String read GetOldREFERENCIA_CLIENTEValue;
property OldLISTA_NOMBRES : String read GetOldLISTA_NOMBRESValue;
+ property OldFECHA_ULT_PRESENTACION_CLIENTE : DateTime read GetOldFECHA_ULT_PRESENTACION_CLIENTEValue;
end;
{ TContratosClienteBusinessProcessorRules }
@@ -794,6 +796,12 @@ type
function GetOldLISTA_NOMBRESIsNull: Boolean; virtual;
procedure SetLISTA_NOMBRESValue(const aValue: String); virtual;
procedure SetLISTA_NOMBRESIsNull(const aValue: Boolean); virtual;
+ function GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime; virtual;
+ function GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean; virtual;
+ function GetOldFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime; virtual;
+ function GetOldFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean; virtual;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime); virtual;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean); virtual;
{ Properties }
property ID : Integer read GetIDValue write SetIDValue;
@@ -992,6 +1000,10 @@ type
property LISTA_NOMBRESIsNull : Boolean read GetLISTA_NOMBRESIsNull write SetLISTA_NOMBRESIsNull;
property OldLISTA_NOMBRES : String read GetOldLISTA_NOMBRESValue;
property OldLISTA_NOMBRESIsNull : Boolean read GetOldLISTA_NOMBRESIsNull;
+ property FECHA_ULT_PRESENTACION_CLIENTE : DateTime read GetFECHA_ULT_PRESENTACION_CLIENTEValue write SetFECHA_ULT_PRESENTACION_CLIENTEValue;
+ property FECHA_ULT_PRESENTACION_CLIENTEIsNull : Boolean read GetFECHA_ULT_PRESENTACION_CLIENTEIsNull write SetFECHA_ULT_PRESENTACION_CLIENTEIsNull;
+ property OldFECHA_ULT_PRESENTACION_CLIENTE : DateTime read GetOldFECHA_ULT_PRESENTACION_CLIENTEValue;
+ property OldFECHA_ULT_PRESENTACION_CLIENTEIsNull : Boolean read GetOldFECHA_ULT_PRESENTACION_CLIENTEIsNull;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
@@ -1001,7 +1013,7 @@ type
{ ITiposCapitulosDelta }
ITiposCapitulosDelta = interface(ITiposCapitulos)
- ['{BC8F6452-CA5B-4003-8BC5-6DC010737C59}']
+ ['{7D7EDE09-5AD4-40F0-A2D9-DFB899D5EE0E}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldPOSICIONValue : Integer;
@@ -1095,7 +1107,7 @@ type
{ IContratosCliente_DetallesDelta }
IContratosCliente_DetallesDelta = interface(IContratosCliente_Detalles)
- ['{5E3953D6-994F-4C13-BD75-D73DB9D7B437}']
+ ['{8CE89C32-E498-4B5A-9083-8C056ABE340F}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_CONTRATOValue : Integer;
@@ -1345,7 +1357,7 @@ type
{ IContratoClienteFacturasProvDelta }
IContratoClienteFacturasProvDelta = interface(IContratoClienteFacturasProv)
- ['{E4D089BC-21D9-4983-900F-8F82272F74AF}']
+ ['{5C24C33D-2EA7-495D-B98B-546E7EDA1C19}']
{ Property getters and setters }
function GetOldID_CONTRATOValue : Integer;
function GetOldREFERENCIAValue : String;
@@ -3759,6 +3771,37 @@ begin
BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosClienteLISTA_NOMBRES] := Null;
end;
+function TContratosClienteBusinessProcessorRules.GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime;
+begin
+ result := BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE];
+end;
+
+function TContratosClienteBusinessProcessorRules.GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean;
+begin
+ result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE]);
+end;
+
+function TContratosClienteBusinessProcessorRules.GetOldFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime;
+begin
+ result := BusinessProcessor.CurrentChange.OldValueByName[fld_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE];
+end;
+
+function TContratosClienteBusinessProcessorRules.GetOldFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean;
+begin
+ result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE]);
+end;
+
+procedure TContratosClienteBusinessProcessorRules.SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime);
+begin
+ BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE] := aValue;
+end;
+
+procedure TContratosClienteBusinessProcessorRules.SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean);
+begin
+ if aValue then
+ BusinessProcessor.CurrentChange.NewValueByName[fld_ContratosClienteFECHA_ULT_PRESENTACION_CLIENTE] := Null;
+end;
+
{ TTiposCapitulosBusinessProcessorRules }
constructor TTiposCapitulosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
diff --git a/Source/Modulos/Contratos de cliente/Model/uBizContratosCliente.pas b/Source/Modulos/Contratos de cliente/Model/uBizContratosCliente.pas
index 498949e5..e36ea710 100644
--- a/Source/Modulos/Contratos de cliente/Model/uBizContratosCliente.pas
+++ b/Source/Modulos/Contratos de cliente/Model/uBizContratosCliente.pas
@@ -265,6 +265,7 @@ begin
ID_TIPO_IVA := AppFactuGES.EmpresaActiva.ID_TIPO_IVA;
FECHA_CONTRATO := DateOf(Date);
+ FECHA_ULT_PRESENTACION_CLIENTE := DateOf(Date);
INCIDENCIAS_ACTIVAS := 0;
RE := 0;
@@ -358,13 +359,15 @@ begin
ID_TIPO_IVA := FCliente.ID_TIPO_IVA;
RECARGO_EQUIVALENCIA := FCliente.RECARGO_EQUIVALENCIA;
- if FCliente.ID_TIENDA > 0 then
+
+//OJO en empresa cristina no existen tiendas solo es la tienda cristina por lo que no se cambia asignación si estamos en esa empresa, falla si de cogen un cliente de acana los contadores
+ if (AppFactuGES.EmpresaActiva.ID <> CTE_EMPRESA_CRISTINA)
+ and (FCliente.ID_TIENDA > 0) then
begin
ID_TIENDA := FCliente.ID_TIENDA;
TIENDA := FCliente.TIENDA;
end;
-
// En acana la ficha de cliente no tiene descuento aplicado por defecto
// DESCUENTO := FCliente.DESCUENTO;
diff --git a/Source/Modulos/Contratos de cliente/Model/uBizContratosClienteServer.pas b/Source/Modulos/Contratos de cliente/Model/uBizContratosClienteServer.pas
index 0b12be6c..faf8b4df 100644
--- a/Source/Modulos/Contratos de cliente/Model/uBizContratosClienteServer.pas
+++ b/Source/Modulos/Contratos de cliente/Model/uBizContratosClienteServer.pas
@@ -14,7 +14,7 @@ type
private
FReferenciaAutomatica : Boolean;
function DarReferencia : String;
- function IncrementarReferencia : Boolean;
+ function IncrementarReferencia : Boolean;
protected
procedure BeforeProcessDelta(Sender: TDABusinessProcessor;
const aDelta: IDADelta); override;
@@ -84,7 +84,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
function TBizContratosClienteServer.IncrementarReferencia: Boolean;
@@ -99,7 +100,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
initialization
diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm
index bf2f537f..5645802c 100644
--- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm
+++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm
@@ -205,8 +205,9 @@ object RptContratosCliente: TRptContratosCliente
'IENTE.IMPORTE_TOTAL,'#10' V_CONTRATOS_CLIENTE.PERSONA_CONTACTO,'#10' ' +
' V_CONTRATOS_CLIENTE.VENDEDOR,'#10' V_CONTRATOS_CLIENTE.TIPO_CO' +
'NTRATO,'#10' V_CONTRATOS_CLIENTE.CONDICIONES,'#10' V_CONTRATOS_CLI' +
- 'ENTE.ID_TIENDA'#10'FROM'#10' V_CONTRATOS_CLIENTE'#10'WHERE'#10' V_CONTRATO' +
- 'S_CLIENTE.ID = :ID'#10
+ 'ENTE.ID_TIENDA,'#10' V_CONTRATOS_CLIENTE.FECHA_ULT_PRESENTACION_C' +
+ 'LIENTE'#10'FROM'#10' V_CONTRATOS_CLIENTE'#10'WHERE'#10' V_CONTRATOS_CLIENT' +
+ 'E.ID = :ID'#10
StatementType = stSQL
ColumnMappings = <
item
@@ -340,6 +341,10 @@ object RptContratosCliente: TRptContratosCliente
item
DatasetField = 'ID_TIENDA'
TableField = 'ID_TIENDA'
+ end
+ item
+ DatasetField = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ TableField = 'FECHA_ULT_PRESENTACION_CLIENTE'
end>
end>
Name = 'Informe_Cabecera'
@@ -488,6 +493,10 @@ object RptContratosCliente: TRptContratosCliente
item
Name = 'ID_TIENDA'
DataType = datInteger
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
end>
ReadOnly = True
end
@@ -1230,6 +1239,10 @@ object RptContratosCliente: TRptContratosCliente
item
Name = 'ID_TIENDA'
DataType = datInteger
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
end>
Params = <
item
@@ -1523,6 +1536,7 @@ object RptContratosCliente: TRptContratosCliente
UseFileCache = True
ShowProgress = False
OverwritePrompt = False
+ EmbeddedFonts = True
PrintOptimized = True
Outline = False
Background = False
@@ -1530,7 +1544,7 @@ object RptContratosCliente: TRptContratosCliente
Author = 'FactuGES'
Subject = 'FactuGES'
Creator = 'FactuGES'
- ProtectionFlags = [ePrint, eModify, eCopy, eAnnot]
+ ProtectionFlags = [ePrint, eAnnot]
HideToolbar = False
HideMenubar = False
HideWindowUI = False
diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas
index 32e29a93..2ccf054c 100644
--- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas
+++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas
@@ -76,6 +76,7 @@ type
private
FConnection: IDAConnection;
FIdEmpresa: Integer;
+ FIdTienda: Integer;
FFechaInicio: Variant;
FFechaFin: Variant;
FListaIDClientes: TIntegerArray;
@@ -93,7 +94,7 @@ type
procedure RecuperarNombresClientes;
public
function GenerarContrato(const ListaID : TIntegerArray): Binary;
- function GenerarContratoEnPDF(const ListaID : TIntegerArray): Binary;
+ function GenerarContratoEnPDF(const ListaID : TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
function GenerarInformeListadoContratos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
end;
@@ -141,18 +142,39 @@ begin
end;
end;
-function TRptContratosCliente.GenerarContratoEnPDF(const ListaID: TIntegerArray): Binary;
+function TRptContratosCliente.GenerarContratoEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
var
i: Integer;
+ AStream : Binary;
+ ARutaFichero, ANombreFichero, LlamadaBat : String;
begin
Result := Binary.Create;
try
- //Vamos generando todos y cada uno de los Contratos recibidos
- for i := 0 to ListaID.Count - 1 do
- _GenerarContrato(ListaID.Items[i]);
+ //Inicializamos parametros
- frxPDFExport1.Stream := Result;
- frxReport.Export(frxPDFExport1)
+ //Vamos generando todos y cada uno de los contratos recibidos
+ for i := 0 to ListaID.Count - 1 do
+ begin
+ _GenerarContrato(ListaID.Items[i]);
+ ANombreFichero := frxReport.ReportOptions.Name + '_' + FormatDateTime('yyyymmdd_hhnnss_', now) + Usuario;
+ if Firmado then
+ ANombreFichero := ANombreFichero + 'firmado.pdf'
+ else
+ ANombreFichero := ANombreFichero + '.pdf';
+
+ ANombreFichero := DarRutaPDFS + EscapeIllegalChars(ANombreFichero);
+ frxPDFExport1.Stream := Result;
+ frxReport.Export(frxPDFExport1);
+ Result.SaveToFile(ANombreFichero);
+
+ if Firmado then
+ begin
+ ARutaFichero := DarRutaFichero(DarRutaInformes, 'firma_contrato.bat ', IntToStr(FIdEmpresa), IntToStr(FIdTienda));
+ LlamadaBat := ARutaFichero + '"' + ANombreFichero + '"';
+ if ExecAndWait(LlamadaBat) then
+ Result.LoadFromFile(ANombreFichero);
+ end;
+ end;
finally
end;
end;
@@ -531,9 +553,10 @@ begin
tbl_Cabecera.Active := True;
tbl_Capitulos.Active := True;
tbl_Detalles.Active := True;
-
tbl_DetallesArticulos.Active := True;
+ FIdEmpresa := tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger;
+ FIdTienda := tbl_Cabecera.FieldByName('ID_TIENDA').AsInteger;
AInforme := DarRutaFichero(DarRutaInformes, rptInforme, tbl_Cabecera.FieldByName('ID_EMPRESA').AsString, tbl_Cabecera.FieldByName('ID_TIENDA').AsString);
if VarIsNull(AInforme) then
raise Exception.Create (('Error Servidor: _GenerarContrato, no encuentra informe ' + rptInforme));
diff --git a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm
index a4f90937..c6365958 100644
--- a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm
+++ b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.dfm
@@ -487,6 +487,10 @@ object srvContratosCliente: TsrvContratosCliente
item
DatasetField = 'LISTA_NOMBRES'
TableField = 'LISTA_NOMBRES'
+ end
+ item
+ DatasetField = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ TableField = 'FECHA_ULT_PRESENTACION_CLIENTE'
end>
end>
Name = 'ContratosCliente'
@@ -761,6 +765,10 @@ object srvContratosCliente: TsrvContratosCliente
DataType = datString
Size = 255
DictionaryEntry = 'ContratosCliente_LISTA_NOMBRES'
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
end>
end
item
@@ -1308,6 +1316,11 @@ object srvContratosCliente: TsrvContratosCliente
Name = 'ID_EMPRESA'
DataType = datInteger
Value = ''
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
+ Value = ''
end>
Statements = <
item
@@ -1324,17 +1337,18 @@ object srvContratosCliente: TsrvContratosCliente
'_IVA,'#10' IMPORTE_TOTAL, ID_FORMA_PAGO, ID_TIENDA, ID_VENDEDOR,' +
' PERSONA_CONTACTO,'#10' RE, IMPORTE_RE, RECARGO_EQUIVALENCIA, TE' +
'LEFONO, MOVIL, TIPO_CONTRATO, CONDICIONES,'#10' CALIDADES, REFER' +
- 'ENCIA_CLIENTE, ID_EMPRESA)'#10' VALUES'#10' (:ID, :ID_CLIENTE, :NIF_' +
- 'CIF, :NOMBRE, :ID_DIRECCION, :CALLE, :POBLACION, :PROVINCIA,'#10' ' +
- ' :CODIGO_POSTAL, :REFERENCIA, :FECHA_CONTRATO, :SITUACION, :FOR' +
- 'MA_PAGO,'#10' :PLAZO_ENTREGA, :OBSERVACIONES, :INCIDENCIAS, :INC' +
- 'IDENCIAS_ACTIVAS, CURRENT_TIMESTAMP,'#10' :USUARIO, :IMPORTE_NET' +
- 'O, :IMPORTE_PORTE, :DESCUENTO, :IMPORTE_DESCUENTO,'#10' :BASE_IM' +
- 'PONIBLE, :ID_TIPO_IVA, :IVA, :IMPORTE_IVA, :IMPORTE_TOTAL, :ID_F' +
- 'ORMA_PAGO,'#10' :ID_TIENDA, :ID_VENDEDOR, :PERSONA_CONTACTO, :RE' +
- ', :IMPORTE_RE, :RECARGO_EQUIVALENCIA,'#10' :TELEFONO, :MOVIL, :T' +
- 'IPO_CONTRATO, :CONDICIONES, :CALIDADES, :REFERENCIA_CLIENTE, :ID' +
- '_EMPRESA)'#10#10
+ 'ENCIA_CLIENTE, ID_EMPRESA, FECHA_ULT_PRESENTACION_CLIENTE)'#10' VAL' +
+ 'UES'#10' (:ID, :ID_CLIENTE, :NIF_CIF, :NOMBRE, :ID_DIRECCION, :CA' +
+ 'LLE, :POBLACION, :PROVINCIA,'#10' :CODIGO_POSTAL, :REFERENCIA, :' +
+ 'FECHA_CONTRATO, :SITUACION, :FORMA_PAGO,'#10' :PLAZO_ENTREGA, :O' +
+ 'BSERVACIONES, :INCIDENCIAS, :INCIDENCIAS_ACTIVAS, CURRENT_TIMEST' +
+ 'AMP,'#10' :USUARIO, :IMPORTE_NETO, :IMPORTE_PORTE, :DESCUENTO, :' +
+ 'IMPORTE_DESCUENTO,'#10' :BASE_IMPONIBLE, :ID_TIPO_IVA, :IVA, :IM' +
+ 'PORTE_IVA, :IMPORTE_TOTAL, :ID_FORMA_PAGO,'#10' :ID_TIENDA, :ID_' +
+ 'VENDEDOR, :PERSONA_CONTACTO, :RE, :IMPORTE_RE, :RECARGO_EQUIVALE' +
+ 'NCIA,'#10' :TELEFONO, :MOVIL, :TIPO_CONTRATO, :CONDICIONES, :CAL' +
+ 'IDADES, :REFERENCIA_CLIENTE, :ID_EMPRESA, :FECHA_ULT_PRESENTACIO' +
+ 'N_CLIENTE)'#10#10
StatementType = stSQL
ColumnMappings = <>
end>
@@ -1579,6 +1593,11 @@ object srvContratosCliente: TsrvContratosCliente
DataType = datInteger
Value = ''
end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
+ Value = ''
+ end
item
Name = 'OLD_ID'
Value = ''
@@ -1609,7 +1628,8 @@ object srvContratosCliente: TsrvContratosCliente
'NO = :TELEFONO,'#10' MOVIL = :MOVIL,'#10' TIPO_CONTRATO = :TIPO_CO' +
'NTRATO,'#10' CONDICIONES = :CONDICIONES,'#10' CALIDADES = :CALIDAD' +
'ES,'#10' REFERENCIA_CLIENTE = :REFERENCIA_CLIENTE,'#10' ID_EMPRESA' +
- ' = :ID_EMPRESA'#10' WHERE'#10' (ID = :OLD_ID)'#10#10
+ ' = :ID_EMPRESA,'#10' FECHA_ULT_PRESENTACION_CLIENTE = :FECHA_ULT_' +
+ 'PRESENTACION_CLIENTE'#10' WHERE'#10' (ID = :OLD_ID)'#10#10
StatementType = stSQL
ColumnMappings = <>
end>
diff --git a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.pas b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.pas
index 4381145c..06d7ec97 100644
--- a/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.pas
+++ b/Source/Modulos/Contratos de cliente/Servidor/srvContratosCliente_Impl.pas
@@ -34,7 +34,7 @@ type
protected
{ IsrvContratosCliente methods }
function GenerarInforme(const ListaID: TIntegerArray): Binary;
- function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
end;
implementation
@@ -89,13 +89,13 @@ begin
end;
end;
-function TsrvContratosCliente.GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+function TsrvContratosCliente.GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
var
AReportGenerator : TRptContratosCliente;
begin
AReportGenerator := TRptContratosCliente.Create(nil);
try
- Result := AReportGenerator.GenerarContratoEnPDF(ListaID);
+ Result := AReportGenerator.GenerarContratoEnPDF(ListaID, Usuario, Firmado);
finally
FreeAndNIL(AReportGenerator);
end;
diff --git a/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.dfm
index e03cdb3b..33f5f823 100644
--- a/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.dfm
+++ b/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.dfm
@@ -223,49 +223,49 @@ inherited fEditorContratoCliente: TfEditorContratoCliente
Width = 122
end
inherited cbFormaPago: TcxDBLookupComboBox
- Top = 138
- ExplicitTop = 138
+ Top = 165
+ ExplicitTop = 165
ExplicitWidth = 122
Width = 122
end
inherited bFormasPago: TButton
Left = 305
- Top = 138
+ Top = 165
ExplicitLeft = 305
- ExplicitTop = 138
+ ExplicitTop = 165
end
inherited cbSituacion: TcxDBImageComboBox
- Top = 111
- ExplicitTop = 111
+ Top = 138
+ ExplicitTop = 138
ExplicitWidth = 260
Width = 260
end
inherited memFormaPago: TcxDBMemo
- Top = 287
- ExplicitTop = 287
+ Top = 314
+ ExplicitTop = 314
ExplicitWidth = 396
ExplicitHeight = 100
Height = 100
Width = 396
end
inherited memPlazoEntrega: TcxDBMemo
- Top = 373
- ExplicitTop = 373
+ Top = 387
+ ExplicitTop = 387
ExplicitWidth = 396
ExplicitHeight = 100
Height = 100
Width = 396
end
inherited cbVendedor: TcxDBLookupComboBox
- Top = 165
- ExplicitTop = 165
+ Top = 192
+ ExplicitTop = 192
ExplicitWidth = 27
Width = 27
end
inherited cbTipoContrato: TcxDBComboBox
- Left = 318
+ Left = 331
Top = 84
- ExplicitLeft = 318
+ ExplicitLeft = 331
ExplicitTop = 84
ExplicitWidth = 113
Width = 113
@@ -378,9 +378,9 @@ inherited fEditorContratoCliente: TfEditorContratoCliente
end
end
inherited frViewTienda1: TfrViewTienda
- Top = 216
+ Top = 243
Width = 451
- ExplicitTop = 216
+ ExplicitTop = 243
ExplicitWidth = 451
inherited dxLayoutControl1: TdxLayoutControl
Width = 451
@@ -390,6 +390,12 @@ inherited fEditorContratoCliente: TfEditorContratoCliente
end
end
end
+ inherited edtFechaUltRevision: TcxDBDateEdit
+ Top = 111
+ ExplicitTop = 111
+ ExplicitWidth = 123
+ Width = 123
+ end
end
end
end
@@ -427,51 +433,51 @@ inherited fEditorContratoCliente: TfEditorContratoCliente
ExplicitLeft = 334
ExplicitTop = 0
end
- inherited FontName: TJvFontComboBox
+ inherited FontSize: TEdit [5]
Left = 0
- ExplicitLeft = 0
- end
- inherited FontSize: TEdit
- Left = 145
Width = 110
- ExplicitLeft = 145
+ ExplicitLeft = 0
ExplicitWidth = 110
end
- inherited UpDown1: TUpDown
- Left = 271
- ExplicitLeft = 271
+ inherited UpDown1: TUpDown [6]
+ Left = 110
+ ExplicitLeft = 110
+ end
+ inherited FontName: TJvFontComboBox [7]
+ Left = 127
+ ExplicitLeft = 127
end
inherited ToolButton13: TToolButton
- Left = 288
- ExplicitLeft = 288
+ Left = 272
+ ExplicitLeft = 272
end
inherited ToolButton6: TToolButton
- Left = 296
- ExplicitLeft = 296
+ Left = 280
+ ExplicitLeft = 280
end
inherited ToolButton7: TToolButton
- Left = 330
- ExplicitLeft = 330
+ Left = 314
+ ExplicitLeft = 314
end
inherited ToolButton8: TToolButton
- Left = 364
- ExplicitLeft = 364
+ Left = 348
+ ExplicitLeft = 348
end
inherited ToolButton12: TToolButton
- Left = 398
- ExplicitLeft = 398
+ Left = 382
+ ExplicitLeft = 382
end
inherited ToolButton9: TToolButton
- Left = 406
- ExplicitLeft = 406
+ Left = 390
+ ExplicitLeft = 390
end
inherited ToolButton10: TToolButton
- Left = 440
- ExplicitLeft = 440
+ Left = 424
+ ExplicitLeft = 424
end
inherited ToolButton11: TToolButton
- Left = 474
- ExplicitLeft = 474
+ Left = 458
+ ExplicitLeft = 458
end
end
inherited cxGrid: TcxGrid
diff --git a/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.pas b/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.pas
index 20591ba1..71169cdf 100644
--- a/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.pas
+++ b/Source/Modulos/Contratos de cliente/Views/uEditorContratoCliente.pas
@@ -276,6 +276,12 @@ begin
frViewDetallesContratoCliente1.BeginUpdate;
try
bEsNuevo := FContrato.EsNuevo;
+
+ if not bEsNuevo then
+ if (FContrato.FECHA_ULT_PRESENTACION_CLIENTE < Date) then
+ if ShowConfirmMessage('Cambio fecha actualización', '¿Desea cambiar la fecha de última actualización del contrato por la de hoy?') = IDYES then
+ Controller.FechaUltimaActualizacionToday(FContrato);
+
//GESTION_DOCUMENTOS
if FController.Guardar(FContrato) then
frViewDocumentosContratoCliente1.actActualizarServidor.Execute;
diff --git a/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.dfm
index cf4bc942..c3e27634 100644
--- a/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.dfm
+++ b/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.dfm
@@ -126,7 +126,7 @@ inherited fEditorContratosCliente: TfEditorContratosCliente
Width = 1119
ExplicitWidth = 1119
inherited tbxMain: TTBXToolbar
- ExplicitWidth = 888
+ ExplicitWidth = 1119
object TBXSubmenuItem3: TTBXSubmenuItem [0]
Caption = 'Nuevo'
DisplayMode = nbdmImageAndText
@@ -163,7 +163,11 @@ inherited fEditorContratosCliente: TfEditorContratosCliente
Action = ActDuplicarAPresupuesto
DisplayMode = nbdmImageAndText
end
- object TBXItem47: TTBXItem [14]
+ object TBXItem51: TTBXItem [14]
+ Action = actGenerarPDF
+ DisplayMode = nbdmImageAndText
+ end
+ object TBXItem47: TTBXItem [15]
Action = actEnviarEMail
DisplayMode = nbdmImageAndText
end
@@ -324,6 +328,13 @@ inherited fEditorContratosCliente: TfEditorContratosCliente
OnExecute = ActDuplicarAPresupuestoExecute
OnUpdate = ActDuplicarAPresupuestoUpdate
end
+ object actGenerarPDF: TAction
+ Category = 'Archivo'
+ Caption = 'Generar PDF'
+ ImageIndex = 30
+ OnExecute = actGenerarPDFExecute
+ OnUpdate = actGenerarPDFUpdate
+ end
end
inherited SmallImages: TPngImageList
PngImages = <
@@ -1076,6 +1087,29 @@ inherited fEditorContratosCliente: TfEditorContratosCliente
AE426082}
Name = 'PngImage29'
Background = clWindow
+ end
+ item
+ PngImage.Data = {
+ 89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF
+ 610000000970485973000017120000171201679FD252000001F04944415478DA
+ 633CC0C0F09F0109C83939313CDAB70F5988C181818191C1600644DD850C4664
+ 3946900162D7AEC1053872721838972E85F36F4A4A323818CC60A82CF062689F
+ B00DB7011C1C1C0C9C9C9C0CDFA3A31924B76E65F8F1E307184B7A6E64583825
+ 99E1C69DE70C4B561C64F8F1F3EFC5D7EF7F78030D7A8A6280A0A020D890F7C1
+ C10C826BD7824D17745C09D70C03627C2C0C959D5BBF000DD20019023640FDF9
+ 7314CD201AE48DF7EFDF3368451D62F075D365D0D19265B872ED3198FEF3F90D
+ C3C2F597B7BEDA17EF0337000440CEC70694DE85810DD9BCEB32DC305878800D
+ 00853C08806CFDFEFD3B42674A0A38462E2FDACE90DBF7102CB4A0568361ED49
+ 568663276F31BC3D98883000E66474F04A4B8BC1F6DF3F14B182CEDD0CF3363D
+ 66F87A3C8591B15842F33F0301D0F5EC2A0ABF6DC6368629EBDE3148311F6760
+ 24A479F2A2EDFFB362DC19983E9D67B8BFDC98412AF402C3EC6DCF19E62DDD04
+ 4907C41AF0772D1303AB453CC3FD2D0B197823BE307CFFF18BC13FA19A380372
+ FC2480B61B3228DA3330DC3FC8C0C0E27E95E13B83284344663D7106787FF564
+ 50F4896760F8BC90E1FD3B06860F9719183EDA3F61482A6C25CE00BD279E18E2
+ CCEEF71872ABBA893320C4D30AE8E7DF0CDFBEFF66F8FAFD17C337A0FF41A0A8
+ AE8F380360218E0D000074D3EB115697A8140000000049454E44AE426082}
+ Name = 'PngImage30'
+ Background = clWindow
end>
Bitmap = {}
end
diff --git a/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.pas b/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.pas
index 44c3fe50..836b3898 100644
--- a/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.pas
+++ b/Source/Modulos/Contratos de cliente/Views/uEditorContratosCliente.pas
@@ -56,6 +56,8 @@ type
TBXItem49: TTBXItem;
ActDuplicarAPresupuesto: TAction;
TBXItem50: TTBXItem;
+ actGenerarPDF: TAction;
+ TBXItem51: TTBXItem;
procedure FormShow(Sender: TObject);
procedure actGenerarAlbaranCliExecute(Sender: TObject);
procedure actEliminarUpdate(Sender: TObject);
@@ -85,6 +87,8 @@ type
procedure actVerFacturasProveedorExecute(Sender: TObject);
procedure ActDuplicarAPresupuestoExecute(Sender: TObject);
procedure ActDuplicarAPresupuestoUpdate(Sender: TObject);
+ procedure actGenerarPDFExecute(Sender: TObject);
+ procedure actGenerarPDFUpdate(Sender: TObject);
protected
FContratos: IBizContratoCliente;
@@ -334,6 +338,53 @@ begin
end;
+procedure TfEditorContratosCliente.actGenerarPDFExecute(Sender: TObject);
+var
+ ACadena : String;
+ AContratos: IBizContratoCliente;
+ AllItems: Boolean;
+ AListaCausas: TStringList;
+ AFirmar: Boolean;
+
+begin
+ inherited;
+ AContratos := Nil;
+ AFirmar := False;
+ AllItems := False;
+ AListaCausas := TStringList.Create;
+
+ if MultiSelect and Assigned(ViewGrid) then
+ AllItems := (ViewGrid.NumSeleccionados > 1);
+
+ if AllItems then
+ begin
+ SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Contratos as ISeleccionable).SelectedRecords);
+ AContratos := (Controller as IContratosClienteController).ExtraerSeleccionados(Contratos) as IBizContratoCliente;
+
+ if (Application.MessageBox('¿Desea firmar digitalmente las facturas/abonos de cliente seleccionados?', 'Atención', MB_YESNO) = IDYES) then
+ AFirmar := True;
+ end
+ else
+ begin
+ AContratos := Contratos;
+ ACadena := '¿Desea firmar digitalmente este contrato de cliente?';
+ if (Application.MessageBox(PChar(ACadena), 'Atención', MB_YESNO) = IDYES) then
+ AFirmar := True;
+ end;
+
+ FController.GenerarPDF(AContratos, AllItems, AFirmar);
+end;
+
+procedure TfEditorContratosCliente.actGenerarPDFUpdate(Sender: TObject);
+begin
+ inherited;
+ if HayDatos and Assigned(ViewGrid) then
+ (Sender as TAction).Enabled := ViewGrid.EsSeleccionCeldaDatos
+ and (ViewGrid.NumSeleccionados > 0)
+ else
+ (Sender as TAction).Enabled := False;
+end;
+
procedure TfEditorContratosCliente.actGenerarPedidoProvExecute(Sender: TObject);
var
ACopiarDetalles: Boolean;
@@ -412,14 +463,23 @@ end;
procedure TfEditorContratosCliente.bArmarioClick(Sender: TObject);
begin
inherited;
+
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Contratos, teArmario) then
FController.Ver(Contratos);
-
end;
procedure TfEditorContratosCliente.bBanoClick(Sender: TObject);
begin
inherited;
+
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Contratos, teBano) then
FController.Ver(Contratos);
end;
@@ -427,6 +487,11 @@ end;
procedure TfEditorContratosCliente.bCocinaClick(Sender: TObject);
begin
inherited;
+
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Contratos, teCocina) then
FController.Ver(Contratos);
end;
@@ -434,6 +499,11 @@ end;
procedure TfEditorContratosCliente.bElectrodomesticoClick(Sender: TObject);
begin
inherited;
+
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Contratos, teElectrodomestico) then
FController.Ver(Contratos);
end;
@@ -441,6 +511,11 @@ end;
procedure TfEditorContratosCliente.bObraClick(Sender: TObject);
begin
inherited;
+
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Contratos, teObra) then
FController.Ver(Contratos);
end;
@@ -448,6 +523,11 @@ end;
procedure TfEditorContratosCliente.bVariosClick(Sender: TObject);
begin
inherited;
+
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Contratos, teVarios) then
FController.Ver(Contratos);
end;
diff --git a/Source/Modulos/Contratos de cliente/Views/uViewContratoCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uViewContratoCliente.dfm
index c596ac38..25ea6377 100644
--- a/Source/Modulos/Contratos de cliente/Views/uViewContratoCliente.dfm
+++ b/Source/Modulos/Contratos de cliente/Views/uViewContratoCliente.dfm
@@ -19,7 +19,7 @@ inherited frViewContratoCliente: TfrViewContratoCliente
817
491)
object edtFechaContrato: TcxDBDateEdit
- Left = 104
+ Left = 131
Top = 82
Anchors = [akLeft, akTop, akRight]
DataBinding.DataField = 'FECHA_CONTRATO'
@@ -59,12 +59,12 @@ inherited frViewContratoCliente: TfrViewContratoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 12
+ TabOrder = 13
Height = 139
Width = 404
end
object eReferencia: TcxDBTextEdit
- Left = 104
+ Left = 131
Top = 28
Anchors = [akLeft, akTop, akRight]
DataBinding.DataField = 'REFERENCIA'
@@ -89,8 +89,8 @@ inherited frViewContratoCliente: TfrViewContratoCliente
Width = 122
end
object cbFormaPago: TcxDBLookupComboBox
- Left = 104
- Top = 136
+ Left = 131
+ Top = 163
DataBinding.DataField = 'ID_FORMA_PAGO'
DataBinding.DataSource = DADataSource
Properties.KeyFieldNames = 'ID'
@@ -115,21 +115,21 @@ inherited frViewContratoCliente: TfrViewContratoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 5
+ TabOrder = 6
Width = 122
end
object bFormasPago: TButton
Left = 282
- Top = 136
+ Top = 163
Width = 132
Height = 21
Caption = 'Ver las formas de pago...'
- TabOrder = 6
+ TabOrder = 7
OnClick = bFormasPagoClick
end
object cbSituacion: TcxDBImageComboBox
- Left = 104
- Top = 109
+ Left = 131
+ Top = 136
DataBinding.DataField = 'SITUACION'
DataBinding.DataSource = DADataSource
Properties.Items = <
@@ -154,12 +154,12 @@ inherited frViewContratoCliente: TfrViewContratoCliente
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 4
+ TabOrder = 5
Width = 260
end
object memFormaPago: TcxDBMemo
Left = 22
- Top = 297
+ Top = 324
Anchors = [akLeft, akTop, akRight, akBottom]
DataBinding.DataField = 'FORMA_PAGO'
DataBinding.DataSource = DADataSource
@@ -175,35 +175,35 @@ inherited frViewContratoCliente: TfrViewContratoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 9
- Height = 100
- Width = 396
- end
- object memPlazoEntrega: TcxDBMemo
- Left = 22
- Top = 401
- Anchors = [akLeft, akTop, akRight, akBottom]
- DataBinding.DataField = 'PLAZO_ENTREGA'
- DataBinding.DataSource = DADataSource
- Properties.ScrollBars = ssVertical
- Style.BorderColor = clWindowFrame
- Style.BorderStyle = ebs3D
- Style.HotTrack = False
- Style.LookAndFeel.Kind = lfStandard
- Style.LookAndFeel.NativeStyle = True
- StyleDisabled.LookAndFeel.Kind = lfStandard
- StyleDisabled.LookAndFeel.NativeStyle = True
- StyleFocused.LookAndFeel.Kind = lfStandard
- StyleFocused.LookAndFeel.NativeStyle = True
- StyleHot.LookAndFeel.Kind = lfStandard
- StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 10
Height = 100
Width = 396
end
+ object memPlazoEntrega: TcxDBMemo
+ Left = 22
+ Top = 415
+ Anchors = [akLeft, akTop, akRight, akBottom]
+ DataBinding.DataField = 'PLAZO_ENTREGA'
+ DataBinding.DataSource = DADataSource
+ Properties.ScrollBars = ssVertical
+ Style.BorderColor = clWindowFrame
+ Style.BorderStyle = ebs3D
+ Style.HotTrack = False
+ Style.LookAndFeel.Kind = lfStandard
+ Style.LookAndFeel.NativeStyle = True
+ StyleDisabled.LookAndFeel.Kind = lfStandard
+ StyleDisabled.LookAndFeel.NativeStyle = True
+ StyleFocused.LookAndFeel.Kind = lfStandard
+ StyleFocused.LookAndFeel.NativeStyle = True
+ StyleHot.LookAndFeel.Kind = lfStandard
+ StyleHot.LookAndFeel.NativeStyle = True
+ TabOrder = 11
+ Height = 100
+ Width = 396
+ end
object cbVendedor: TcxDBLookupComboBox
- Left = 104
- Top = 163
+ Left = 131
+ Top = 190
DataBinding.DataField = 'ID_VENDEDOR'
DataBinding.DataSource = DADataSource
Properties.KeyFieldNames = 'ID'
@@ -228,11 +228,11 @@ inherited frViewContratoCliente: TfrViewContratoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 7
+ TabOrder = 8
Width = 27
end
object cbTipoContrato: TcxDBComboBox
- Left = 306
+ Left = 318
Top = 82
DataBinding.DataField = 'TIPO_CONTRATO'
DataBinding.DataSource = DADataSource
@@ -258,7 +258,7 @@ inherited frViewContratoCliente: TfrViewContratoCliente
Width = 113
end
object edtlREF_CLIENTE: TcxDBTextEdit
- Left = 104
+ Left = 131
Top = 55
Anchors = [akLeft, akTop, akRight]
AutoSize = False
@@ -284,7 +284,7 @@ inherited frViewContratoCliente: TfrViewContratoCliente
Top = 28
Width = 366
Height = 270
- TabOrder = 11
+ TabOrder = 12
ReadOnly = False
ExplicitLeft = 444
ExplicitTop = 28
@@ -331,13 +331,36 @@ inherited frViewContratoCliente: TfrViewContratoCliente
end
inline frViewTienda1: TfrViewTienda
Left = 22
- Top = 220
+ Top = 247
Width = 451
Height = 41
- TabOrder = 8
+ TabOrder = 9
ReadOnly = False
ExplicitLeft = 22
- ExplicitTop = 220
+ ExplicitTop = 247
+ end
+ object edtFechaUltRevision: TcxDBDateEdit
+ Left = 131
+ Top = 109
+ Anchors = [akLeft, akTop, akRight]
+ DataBinding.DataField = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataBinding.DataSource = DADataSource
+ Properties.DateButtons = [btnToday]
+ Properties.ImmediatePost = True
+ Style.BorderColor = clWindowFrame
+ Style.BorderStyle = ebs3D
+ Style.Color = clInfoBk
+ Style.HotTrack = False
+ Style.LookAndFeel.NativeStyle = True
+ Style.Shadow = False
+ Style.ButtonStyle = bts3D
+ Style.ButtonTransparency = ebtNone
+ Style.PopupBorderStyle = epbsFrame3D
+ StyleDisabled.LookAndFeel.NativeStyle = True
+ StyleFocused.LookAndFeel.NativeStyle = True
+ StyleHot.LookAndFeel.NativeStyle = True
+ TabOrder = 4
+ Width = 123
end
object dxLayoutControl1Group_Root: TdxLayoutGroup
ShowCaption = False
@@ -386,6 +409,11 @@ inherited frViewContratoCliente: TfrViewContratoCliente
ControlOptions.ShowBorder = False
end
end
+ object dxLayoutControl1Item14: TdxLayoutItem
+ Caption = 'Fecha '#250'ltima revisi'#243'n:'
+ Control = edtFechaUltRevision
+ ControlOptions.ShowBorder = False
+ end
object dxLayoutControl1Item10: TdxLayoutItem
AutoAligns = [aaVertical]
AlignHorz = ahClient
diff --git a/Source/Modulos/Contratos de cliente/Views/uViewContratoCliente.pas b/Source/Modulos/Contratos de cliente/Views/uViewContratoCliente.pas
index 23b2b2cc..1b7c68f1 100644
--- a/Source/Modulos/Contratos de cliente/Views/uViewContratoCliente.pas
+++ b/Source/Modulos/Contratos de cliente/Views/uViewContratoCliente.pas
@@ -70,6 +70,8 @@ type
dxLayoutControl1Item13: TdxLayoutItem;
frViewTienda1: TfrViewTienda;
dxLayoutControl1Group10: TdxLayoutGroup;
+ dxLayoutControl1Item14: TdxLayoutItem;
+ edtFechaUltRevision: TcxDBDateEdit;
procedure CustomViewCreate(Sender: TObject);
procedure CustomViewDestroy(Sender: TObject);
procedure bFormasPagoClick(Sender: TObject);
diff --git a/Source/Modulos/Contratos de cliente/Views/uViewContratosCliente.dfm b/Source/Modulos/Contratos de cliente/Views/uViewContratosCliente.dfm
index 006ecceb..fedc6216 100644
--- a/Source/Modulos/Contratos de cliente/Views/uViewContratosCliente.dfm
+++ b/Source/Modulos/Contratos de cliente/Views/uViewContratosCliente.dfm
@@ -119,6 +119,10 @@ inherited frViewContratosCliente: TfrViewContratosCliente
BestFitMaxWidth = 25
Width = 105
end
+ object cxGridViewFECHA_ULT_PRESENTACION_CLIENTE: TcxGridDBColumn
+ Caption = 'Fecha '#250'lt. actualizaci'#243'n'
+ DataBinding.FieldName = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ end
object cxGridViewNIF_CIF: TcxGridDBColumn
Caption = 'NIF/CIF'
DataBinding.FieldName = 'NIF_CIF'
@@ -210,12 +214,16 @@ inherited frViewContratosCliente: TfrViewContratosCliente
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
+ ExplicitWidth = 250
+ Width = 250
end
inherited edtFechaIniFiltro: TcxDateEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
+ ExplicitWidth = 250
+ Width = 250
end
inherited edtFechaFinFiltro: TcxDateEdit
Left = 515
@@ -224,6 +232,8 @@ inherited frViewContratosCliente: TfrViewContratosCliente
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 515
+ ExplicitWidth = 250
+ Width = 250
end
inherited txtFiltroTodo2: TcxTextEdit
Left = 515
@@ -232,6 +242,8 @@ inherited frViewContratosCliente: TfrViewContratosCliente
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 515
+ ExplicitWidth = 250
+ Width = 250
end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
inherited dxLayoutControl1Group2: TdxLayoutGroup
diff --git a/Source/Modulos/Contratos de cliente/Views/uViewContratosCliente.pas b/Source/Modulos/Contratos de cliente/Views/uViewContratosCliente.pas
index 01cfc6d1..15b6b648 100644
--- a/Source/Modulos/Contratos de cliente/Views/uViewContratosCliente.pas
+++ b/Source/Modulos/Contratos de cliente/Views/uViewContratosCliente.pas
@@ -53,6 +53,7 @@ type
actTienda: TAction;
TBXItem2: TTBXItem;
TBXSeparatorItem1: TTBXSeparatorItem;
+ cxGridViewFECHA_ULT_PRESENTACION_CLIENTE: TcxGridDBColumn;
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel:
TcxGridLevel);
procedure cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView;
diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas
index d3dd2a38..b6cf9592 100644
--- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas
+++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas
@@ -27,7 +27,7 @@ type
function Nuevo (WithInsert: Boolean = True) : IBizFacturaCliente;
function Anadir(AFactura : IBizFacturaCliente) : Boolean; overload;
function AnadirAbono(AFactura : IBizFacturaCliente) : Boolean;
- function AnadirProforma(AFactura : IBizFacturaCliente) : Boolean;
+ function AnadirProforma: IBizFacturaCliente;
function Anadir(AFacturas : IBizFacturaCliente; AListaAlbaranes : IBizAlbaranCliente; Const ATipo: String = CTE_TIPO_FACTURA): Boolean; overload;
function Eliminar(const ID : Integer): Boolean; overload;
@@ -42,6 +42,7 @@ type
procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false);
procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false);
procedure EnviarFacturaPorEMail(AFactura : IBizFacturaCliente);
+ procedure GenerarPDF(AFactura : IBizFacturaCliente; AllItems: Boolean = false; AFirmado: Boolean = False);
procedure RecalcularImportes(AFactura: IBizFacturaCliente);
@@ -93,7 +94,7 @@ type
function Existe(const ID: Integer) : Boolean; virtual;
function Anadir(AFactura : IBizFacturaCliente): Boolean; overload;
function AnadirAbono(AFactura : IBizFacturaCliente) : Boolean;
- function AnadirProforma(AFactura : IBizFacturaCliente) : Boolean;
+ function AnadirProforma: IBizFacturaCliente;
function Anadir(AFacturas : IBizFacturaCliente; AListaAlbaranes : IBizAlbaranCliente; Const ATipo: String = CTE_TIPO_FACTURA): Boolean; overload;
function Buscar(const ID: Integer): IBizFacturaCliente;
function BuscarTodos: IBizFacturaCliente;
@@ -108,6 +109,7 @@ type
procedure Preview(AFactura : IBizFacturaCliente; AllItems: Boolean = false);
procedure Print(AFactura : IBizFacturaCliente; AllItems: Boolean = false);
procedure EnviarFacturaPorEMail(AFactura : IBizFacturaCliente);
+ procedure GenerarPDF(AFactura : IBizFacturaCliente; AllItems: Boolean = false; AFirmado: Boolean = False);
procedure RecalcularImportes(AFactura: IBizFacturaCliente);
function EsModificable(AFactura: IBizFacturaCliente; var AComentario: Variant): Boolean;
@@ -195,9 +197,12 @@ end;
{ TFacturasClienteController }
function TFacturasClienteController.Anadir(AFactura: IBizFacturaCliente) : Boolean;
+var
+ bEnEdicion: Boolean;
begin
if not Assigned(AFactura) then
raise Exception.Create ('Factura no asignada (Anadir)');
+
AFactura.Insert;
Result := True;
end;
@@ -209,12 +214,14 @@ begin
Result := True;
end;
-function TFacturasClienteController.AnadirProforma(
- AFactura: IBizFacturaCliente): Boolean;
+function TFacturasClienteController.AnadirProforma: IBizFacturaCliente;
+var
+ AFactura : IBizFacturaCliente;
+
begin
- Anadir(AFactura);
+ AFactura := Nuevo(True);
AFactura.TIPO := CTE_TIPO_PROFORMA;
- Result := True;
+ Result := AFactura;
end;
function TFacturasClienteController.Anadir(AFacturas: IBizFacturaCliente;
@@ -268,7 +275,10 @@ begin
AAlbaranesController.RecuperarCliente(AListaAlbaranes);
AListaAlbaranes.Cliente.DataTable.Active := True;
AFacturas.Cliente := AListaAlbaranes.Cliente;
- AFacturas.ID_FORMA_PAGO := AListaAlbaranes.ID_FORMA_PAGO;
+ if AListaAlbaranes.datatable.fieldbyname(fld_facturasClienteID_FORMA_PAGO).isnull then
+ AFacturas.ID_FORMA_PAGO := AppFactuGES.EmpresaActiva.ID_FORMA_PAGO
+ else
+ AFacturas.ID_FORMA_PAGO := AListaAlbaranes.ID_FORMA_PAGO;
AFacturas.TIPO := ATipo;
AFacturas.DataTable.FieldByName(fld_FacturasClienteOBSERVACIONES).AsString := AListaAlbaranes.DataTable.FieldByName(fld_FacturasClienteOBSERVACIONES).AsString;
@@ -781,6 +791,11 @@ begin
if (AFactura.IMPORTE_TOTAL > 0) then
raise Exception.Create('Un abono nunca no puede tener un importe positivo, asegurese que las cantidades sean negativas');
+ //En caso de ser una Factura no podra tener un importe total negativo
+ if (AFactura.TIPO = CTE_TIPO_FACTURA) then
+ if (AFactura.IMPORTE_TOTAL < 0) then
+ raise Exception.Create('Una factura nunca no puede tener un importe total negativo, asegurese que la factura esté correcta');
+
{ Esta validación puede saltar cuando se generan facturas automáticamente
por albaranes o pedidos y el cliente no tiene Tipo de IVA puesto, se cambia,
para signar automáticamente por defecto a la factura la primera forma de pago,
@@ -1370,6 +1385,63 @@ begin
end;
end;
+procedure TFacturasClienteController.GenerarPDF(AFactura: IBizFacturaCliente; AllItems, AFirmado: Boolean);
+var
+ AReportController : IFacturasClienteReportController;
+ AFile : String;
+ bEliminado: Boolean;
+ ACausa: Variant;
+
+begin
+ if not Assigned(AFactura) then
+ raise Exception.Create ('Factura no asignado (GenerarPDF)');
+
+ if AFactura.DataTable.Active then
+ AFactura.DataTable.Active := True;
+
+ //En el caso de querer eliminar todos los items del objeto AAlbaran
+ if AllItems then
+ begin
+ with AFactura.DataTable do
+ begin
+ First;
+ while not EOF do
+ begin
+ AFile := EscapeIllegalChars(AFactura.REFERENCIA + ' - ' + AFactura.NOMBRE_CLIENTE);
+ if (not PreguntarFicheroPDFExportar(AFile)) then
+ Next
+ else
+ begin
+ ShowHourglassCursor;
+ try
+ AReportController := TFacturasClienteReportController.Create;
+ AReportController.ExportToPDF(AFactura.ID, AFile, AFirmado);
+ finally
+ AReportController := NIL;
+ HideHourglassCursor;
+ end;
+ Next;
+ end;
+ end;
+ end;
+ end
+ else
+ begin
+ AFile := EscapeIllegalChars(AFactura.REFERENCIA + ' - ' + AFactura.NOMBRE_CLIENTE);
+ if (not PreguntarFicheroPDFExportar(AFile)) then
+ Exit;
+
+ ShowHourglassCursor;
+ try
+ AReportController := TFacturasClienteReportController.Create;
+ AReportController.ExportToPDF(AFactura.ID, AFile, AFirmado);
+ finally
+ AReportController := NIL;
+ HideHourglassCursor;
+ end;
+ end;
+end;
+
procedure TFacturasClienteController.GenerarRecibos(AFactura: IBizFacturaCliente);
var
AFormasPagoController : IFormasPagoController;
diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas
index 85b49b0c..12afb971 100644
--- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas
+++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas
@@ -12,7 +12,7 @@ type
['{A0F41767-4FF6-4BAE-9FC9-894DD721D756}']
procedure Preview(const AListaID : TIntegerList);
procedure Print(const AListaID : TIntegerList);
- function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
+ function ExportToPDF(const AID: Integer; const AFileName : String = ''; const AFirmado: Boolean = False): Boolean;
end;
TFacturasClienteReportController = class(TControllerBase, IFacturasClienteReportController)
@@ -25,7 +25,7 @@ type
procedure Preview(const AListaID : TIntegerList);
procedure Print(const AListaID : TIntegerList);
- function ExportToPDF(const AID: Integer; const AFileName : String = ''): Boolean;
+ function ExportToPDF(const AID: Integer; const AFileName : String = ''; const AFirmado: Boolean = False): Boolean;
end;
@@ -57,8 +57,7 @@ begin
inherited;
end;
-function TFacturasClienteReportController.ExportToPDF(const AID: Integer;
- const AFileName: String): Boolean;
+function TFacturasClienteReportController.ExportToPDF(const AID: Integer; const AFileName: String; const AFirmado: Boolean): Boolean;
var
AStream: Binary;
begin
@@ -68,7 +67,7 @@ begin
ShowHourglassCursor;
try
- AStream := FDataModule.GetRptPDFFactura(AID);
+ AStream := FDataModule.GetRptPDFFactura(AID, AFirmado);
try
AStream.SaveToFile(AFileName);
Result := True;
diff --git a/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.pas
index 1741e1be..a28127af 100644
--- a/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.pas
+++ b/Source/Modulos/Facturas de cliente/Data/uDataModuleFacturasCliente.pas
@@ -34,7 +34,7 @@ type
// Report
function GetReport(const AListaID: TIntegerList): Binary;
- function GetRptPDFFactura(const AID: Integer): Binary;
+ function GetRptPDFFactura(const AID: Integer; const Firmado: Boolean = false): Binary;
end;
implementation
@@ -42,7 +42,7 @@ implementation
{$R *.DFM}
uses
- FactuGES_Intf, uDataModuleConexion, uDataTableUtils, cxControls,
+ FactuGES_Intf, uFactuGES_App, uDataModuleConexion, uDataTableUtils, cxControls,
schFacturasClienteClient_Intf, uBizContactos, Dialogs;
{ TdmPresupuestos }
@@ -65,18 +65,17 @@ begin
end;
end;
-function TDataModuleFacturasCliente.GetRptPDFFactura(const AID: Integer): Binary;
+function TDataModuleFacturasCliente.GetRptPDFFactura(const AID: Integer; const Firmado: Boolean): Binary;
var
AParam : TIntegerArray;
begin
AParam := TIntegerArray.Create;
try
AParam.Add(AID);
- Result := (RORemoteService as IsrvFacturasCliente).GenerarInformeEnPDF(AParam)
+ Result := (RORemoteService as IsrvFacturasCliente).GenerarInformeEnPDF(AParam, AppFactuGES.UsuarioActivo.USERNAME, Firmado)
finally
FreeANDNIL(AParam)
end;
-
end;
function TDataModuleFacturasCliente.NewItem: IBizFacturaCliente;
diff --git a/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj b/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj
index 71b32e39..e012e455 100644
--- a/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj
+++ b/Source/Modulos/Facturas de cliente/FacturasCliente_Group.groupproj
@@ -198,6 +198,15 @@
+
+
+
+
+
+
+
+
+
@@ -252,23 +261,14 @@
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
\ No newline at end of file
diff --git a/Source/Modulos/Facturas de cliente/Model/Data/uIDataModuleFacturasClienteReport.pas b/Source/Modulos/Facturas de cliente/Model/Data/uIDataModuleFacturasClienteReport.pas
index afd4aa57..ba1196e2 100644
--- a/Source/Modulos/Facturas de cliente/Model/Data/uIDataModuleFacturasClienteReport.pas
+++ b/Source/Modulos/Facturas de cliente/Model/Data/uIDataModuleFacturasClienteReport.pas
@@ -9,7 +9,7 @@ type
IDataModuleFacturasClienteReport = interface
['{F498AC70-AA38-4C06-B301-85A4AC0B210B}']
function GetReport(const AListaID: TIntegerList): Binary;
- function GetRptPDFFactura(const AID: Integer): Binary;
+ function GetRptPDFFactura(const AID: Integer; const Firmado: Boolean): Binary;
end;
implementation
diff --git a/Source/Modulos/Facturas de cliente/Model/schFacturasClienteClient_Intf.pas b/Source/Modulos/Facturas de cliente/Model/schFacturasClienteClient_Intf.pas
index df43e4d5..879a82c1 100644
--- a/Source/Modulos/Facturas de cliente/Model/schFacturasClienteClient_Intf.pas
+++ b/Source/Modulos/Facturas de cliente/Model/schFacturasClienteClient_Intf.pas
@@ -9,9 +9,9 @@ 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_ListaAnosFacturas = '{35EC352F-3CB5-431C-941C-773B56FC9C17}';
- RID_FacturasCliente = '{EE5C9C18-5B51-475E-9CFC-A2F163B0F368}';
- RID_FacturasCliente_Detalles = '{CECC09E5-CA18-4B27-A693-F38FD2708E6E}';
+ RID_ListaAnosFacturas = '{AA9E9DF8-6E40-4A04-9F56-47B64CB31051}';
+ RID_FacturasCliente = '{35ABCCE5-A88B-4859-859C-7D64631B8A39}';
+ RID_FacturasCliente_Detalles = '{A1647325-0E90-4395-B301-CA5855F4360C}';
{ Data table names }
nme_ListaAnosFacturas = 'ListaAnosFacturas';
@@ -167,7 +167,7 @@ const
type
{ IListaAnosFacturas }
IListaAnosFacturas = interface(IDAStronglyTypedDataTable)
- ['{35B9CF8B-1998-4510-99B1-1EC13710F8AB}']
+ ['{6F39FFB6-319E-466C-A13F-451029BC363F}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
@@ -202,7 +202,7 @@ type
{ IFacturasCliente }
IFacturasCliente = interface(IDAStronglyTypedDataTable)
- ['{ADFA571C-3DA5-4B91-A0A9-35AFF4CC2018}']
+ ['{7C87FE37-C098-4355-990B-2693BC995665}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -849,7 +849,7 @@ type
{ IFacturasCliente_Detalles }
IFacturasCliente_Detalles = interface(IDAStronglyTypedDataTable)
- ['{1DBA415D-060E-4E81-99F9-6BBC34A48D3E}']
+ ['{8FE5D0B5-031E-4B7C-9CEB-B2ED7A7201D5}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
diff --git a/Source/Modulos/Facturas de cliente/Model/schFacturasClienteServer_Intf.pas b/Source/Modulos/Facturas de cliente/Model/schFacturasClienteServer_Intf.pas
index 051d012a..53460a17 100644
--- a/Source/Modulos/Facturas de cliente/Model/schFacturasClienteServer_Intf.pas
+++ b/Source/Modulos/Facturas de cliente/Model/schFacturasClienteServer_Intf.pas
@@ -9,14 +9,14 @@ const
{ Delta rules ids
Feel free to change them to something more human readable
but make sure they are unique in the context of your application }
- RID_ListaAnosFacturasDelta = '{AF9DCBE5-965F-4954-B3E3-028464D75916}';
- RID_FacturasClienteDelta = '{F7ACAA8D-6710-4ECA-8FBF-0341136DF2CB}';
- RID_FacturasCliente_DetallesDelta = '{D779175D-1E98-4B6B-9059-BEC7DCD94A11}';
+ RID_ListaAnosFacturasDelta = '{625CABDC-50D6-4944-B22B-D3348700AFA2}';
+ RID_FacturasClienteDelta = '{1B6A177E-8B9C-415E-94B1-5CBD0CF0FF05}';
+ RID_FacturasCliente_DetallesDelta = '{A116A70B-8E0A-4216-9D6E-97820C5EB891}';
type
{ IListaAnosFacturasDelta }
IListaAnosFacturasDelta = interface(IListaAnosFacturas)
- ['{AF9DCBE5-965F-4954-B3E3-028464D75916}']
+ ['{625CABDC-50D6-4944-B22B-D3348700AFA2}']
{ Property getters and setters }
function GetOldANOValue : String;
@@ -50,7 +50,7 @@ type
{ IFacturasClienteDelta }
IFacturasClienteDelta = interface(IFacturasCliente)
- ['{F7ACAA8D-6710-4ECA-8FBF-0341136DF2CB}']
+ ['{1B6A177E-8B9C-415E-94B1-5CBD0CF0FF05}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_EMPRESAValue : Integer;
@@ -697,7 +697,7 @@ type
{ IFacturasCliente_DetallesDelta }
IFacturasCliente_DetallesDelta = interface(IFacturasCliente_Detalles)
- ['{D779175D-1E98-4B6B-9059-BEC7DCD94A11}']
+ ['{A116A70B-8E0A-4216-9D6E-97820C5EB891}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_FACTURAValue : Integer;
diff --git a/Source/Modulos/Facturas de cliente/Model/uBizFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Model/uBizFacturasCliente.pas
index 0ba062d9..5b509c3d 100644
--- a/Source/Modulos/Facturas de cliente/Model/uBizFacturasCliente.pas
+++ b/Source/Modulos/Facturas de cliente/Model/uBizFacturasCliente.pas
@@ -341,12 +341,15 @@ begin
ID_TIPO_IVA := FCliente.ID_TIPO_IVA;
RECARGO_EQUIVALENCIA := FCliente.RECARGO_EQUIVALENCIA;
+//OJO en empresa cristina no existe el la tienda de acana por lo que falla si cogen un cliente de acana
+//por eso comentamos esta asignación
+{
if FCliente.ID_TIENDA > 0 then
begin
ID_TIENDA := FCliente.ID_TIENDA;
TIENDA := FCliente.TIENDA;
end;
-
+}
//Si el cliente tiene la contabilidad desactivada la factura que realizamos la desactivamos también.
if (FCliente.IGNORAR_CONTABILIDAD = 1) then
IGNORAR_CONTABILIDAD := 1;
diff --git a/Source/Modulos/Facturas de cliente/Model/uBizFacturasClienteServer.pas b/Source/Modulos/Facturas de cliente/Model/uBizFacturasClienteServer.pas
index f8e8fa9a..4844fe1f 100644
--- a/Source/Modulos/Facturas de cliente/Model/uBizFacturasClienteServer.pas
+++ b/Source/Modulos/Facturas de cliente/Model/uBizFacturasClienteServer.pas
@@ -8,6 +8,12 @@ uses
const
BIZ_SERVER_FACTURAS_CLIENTE = 'Server.FacturasCliente';
+ REF_FACTURAS_CLIENTE = 'REF_FACTURAS_CLIENTE';
+ REF_ABONOS_CLIENTE = 'REF_ABONOS_CLIENTE';
+ REF_FACTURAS_PROFORMA = 'REF_FACTURAS_PROFORMA';
+ CTE_TIPO_ABONO = 'A';
+ CTE_TIPO_FACTURA = 'F';
+ CTE_TIPO_PROFORMA = 'P';
type
TBizFacturasClienteServer = class(TFacturasClienteBusinessProcessorRules)
@@ -30,13 +36,6 @@ uses
Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer,
schFacturasClienteClient_Intf, FactuGES_Intf, uROServer, SysUtils;
-const
- REF_FACTURAS_CLIENTE = 'REF_FACTURAS_CLIENTE';
- REF_ABONOS_CLIENTE = 'REF_ABONOS_CLIENTE';
- REF_FACTURAS_PROFORMA = 'REF_FACTURAS_PROFORMA';
- CTE_TIPO_ABONO = 'A';
- CTE_TIPO_FACTURA = 'F';
- CTE_TIPO_PROFORMA = 'P';
{ TBizFacturasClienteServer }
diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm
index c2e571c9..d9b14641 100644
--- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm
+++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm
@@ -377,7 +377,8 @@ object RptFacturasCliente: TRptFacturasCliente
'L'#10'from V_facturas_cliente'#10'left join contactos on (contactos.ID =' +
' V_facturas_cliente.ID_CLIENTE)'#10'LEFT OUTER JOIN v_contactos_nomb' +
'res ON (v_contactos_nombres.id = v_facturas_cliente.id_cliente)'#10 +
- 'group by 1,2,3,4,5,6,7'#10'order by 1,5,6,7,2,4'#10
+ 'where (V_facturas_cliente.TIPO <> '#39'P'#39')'#10'group by 1,2,3,4,5,6,7'#10'or' +
+ 'der by 1,5,6,7,2,4'#10
StatementType = stSQL
ColumnMappings = <
item
@@ -448,8 +449,7 @@ object RptFacturasCliente: TRptFacturasCliente
end
item
Name = 'NOMBRE'
- DataType = datString
- Size = 255
+ DataType = datMemo
end
item
Name = 'IVA'
@@ -511,7 +511,8 @@ object RptFacturasCliente: TRptFacturasCliente
' NIF_CIF, FECHA_FACTURA, BASE_IMPONIBLE, IVA, IMPORTE_IVA, RE, I' +
'MPORTE_RE, IMPORTE_TOTAL'#10'from v_facturas_cliente'#10'LEFT OUTER JOIN' +
' v_contactos_nombres ON (v_contactos_nombres.id = v_facturas_cli' +
- 'ente.id_cliente)'#10'where {where}'#10'order by ANO, MES, REFERENCIA'#10#10
+ 'ente.id_cliente)'#10'where (V_facturas_cliente.TIPO <> '#39'P'#39')'#10'and {whe' +
+ 're}'#10#10'order by ANO, MES, REFERENCIA'#10#10
StatementType = stSQL
ColumnMappings = <
item
@@ -795,32 +796,33 @@ object RptFacturasCliente: TRptFacturasCliente
TargetTable = 'FACTURAS_CLIENTE'
SQL =
'SELECT'#10' V_FACTURAS_CLIENTE.ID, V_FACTURAS_CLIENTE.REFERENCIA,' +
- ' V_FACTURAS_CLIENTE.FECHA_FACTURA,'#10' V_FACTURAS_CLIENTE.TIENDA' +
- ', V_FACTURAS_CLIENTE.ID_TIENDA,'#10' V_FACTURAS_CLIENTE.IMPORTE_N' +
- 'ETO,'#10' V_FACTURAS_CLIENTE.BASE_IMPONIBLE, V_FACTURAS_CLIENTE.D' +
- 'ESCUENTO, V_FACTURAS_CLIENTE.IMPORTE_DESCUENTO,'#10' V_FACTURAS_C' +
- 'LIENTE.IVA, V_FACTURAS_CLIENTE.IMPORTE_IVA,'#10' V_FACTURAS_CLIEN' +
- 'TE.RE, V_FACTURAS_CLIENTE.IMPORTE_RE,'#10' V_FACTURAS_CLIENTE.IMP' +
- 'ORTE_TOTAL,'#10' V_FACTURAS_CLIENTE.OBSERVACIONES, FORMAS_PAGO.DE' +
- 'SCRIPCION AS FORMA_PAGO, V_FACTURAS_CLIENTE.ID_CLIENTE,'#10' V_FA' +
- 'CTURAS_CLIENTE.NIF_CIF,'#10' V_FACTURAS_CLIENTE.NOMBRE as NOMBRE,' +
- #10' V_FACTURAS_CLIENTE.CALLE,'#10' V_FACTURAS_CLIENTE.PROVINCIA,' +
- ' V_FACTURAS_CLIENTE.CODIGO_POSTAL, V_FACTURAS_CLIENTE.POBLACION,' +
- #10' CONTACTOS_DATOS_BANCO.TITULAR,'#10' CONTACTOS_DATOS_BANCO.EN' +
- 'TIDAD,'#10' CONTACTOS_DATOS_BANCO.SUCURSAL,'#10' CONTACTOS_DATOS_B' +
- 'ANCO.DC,'#10' CONTACTOS_DATOS_BANCO.CUENTA,'#10' ID_EMPRESA, EMPRE' +
- 'SAS.NIF_CIF as NIF_CIF_EMPRESA, EMPRESAS.RAZON_SOCIAL,'#10' EMPRE' +
- 'SAS.CALLE as CALLE_EMPRESA, EMPRESAS.POBLACION as POBLACION_EMPR' +
- 'ESA,'#10' EMPRESAS.PROVINCIA as PROVINCIA_EMPRESA, EMPRESAS.CODIG' +
- 'O_POSTAL as CODIGO_POSTAL_EMPRESA,'#10' EMPRESAS.TELEFONO_1, EMPR' +
- 'ESAS.FAX, EMPRESAS.MOVIL_1, EMPRESAS.EMAIL_1,'#10' EMPRESAS.PAGIN' +
- 'A_WEB, EMPRESAS.REGISTRO_MERCANTIL, EMPRESAS.LOGOTIPO'#10'FROM V_FAC' +
- 'TURAS_CLIENTE'#10'LEFT JOIN EMPRESAS ON EMPRESAS.ID = ID_EMPRESA'#10'LEF' +
- 'T JOIN FORMAS_PAGO ON (FORMAS_PAGO.ID = V_FACTURAS_CLIENTE.ID_FO' +
- 'RMA_PAGO)'#10'LEFT JOIN CONTACTOS_DATOS_BANCO ON (CONTACTOS_DATOS_BA' +
- 'NCO.ID_CONTACTO = V_FACTURAS_CLIENTE.ID_CLIENTE)'#10'LEFT OUTER JOIN' +
- ' v_contactos_nombres ON (v_contactos_nombres.id = V_FACTURAS_CLI' +
- 'ENTE.id_cliente)'#10'WHERE V_FACTURAS_CLIENTE.ID = :ID'#10
+ ' V_FACTURAS_CLIENTE.FECHA_FACTURA,'#10' V_FACTURAS_CLIENTE.TIPO,'#10 +
+ ' V_FACTURAS_CLIENTE.TIENDA, V_FACTURAS_CLIENTE.ID_TIENDA,'#10' ' +
+ ' V_FACTURAS_CLIENTE.IMPORTE_NETO,'#10' V_FACTURAS_CLIENTE.BASE_IM' +
+ 'PONIBLE, V_FACTURAS_CLIENTE.DESCUENTO, V_FACTURAS_CLIENTE.IMPORT' +
+ 'E_DESCUENTO,'#10' V_FACTURAS_CLIENTE.IVA, V_FACTURAS_CLIENTE.IMPO' +
+ 'RTE_IVA,'#10' V_FACTURAS_CLIENTE.RE, V_FACTURAS_CLIENTE.IMPORTE_R' +
+ 'E,'#10' V_FACTURAS_CLIENTE.IMPORTE_TOTAL,'#10' V_FACTURAS_CLIENTE.' +
+ 'OBSERVACIONES, FORMAS_PAGO.DESCRIPCION AS FORMA_PAGO, V_FACTURAS' +
+ '_CLIENTE.ID_CLIENTE,'#10' V_FACTURAS_CLIENTE.NIF_CIF,'#10' V_FACTU' +
+ 'RAS_CLIENTE.NOMBRE as NOMBRE,'#10' V_FACTURAS_CLIENTE.CALLE,'#10' ' +
+ 'V_FACTURAS_CLIENTE.PROVINCIA, V_FACTURAS_CLIENTE.CODIGO_POSTAL, ' +
+ 'V_FACTURAS_CLIENTE.POBLACION,'#10' CONTACTOS_DATOS_BANCO.TITULAR,' +
+ #10' CONTACTOS_DATOS_BANCO.ENTIDAD,'#10' CONTACTOS_DATOS_BANCO.SU' +
+ 'CURSAL,'#10' CONTACTOS_DATOS_BANCO.DC,'#10' CONTACTOS_DATOS_BANCO.' +
+ 'CUENTA,'#10' ID_EMPRESA, EMPRESAS.NIF_CIF as NIF_CIF_EMPRESA, EMP' +
+ 'RESAS.RAZON_SOCIAL,'#10' EMPRESAS.CALLE as CALLE_EMPRESA, EMPRESA' +
+ 'S.POBLACION as POBLACION_EMPRESA,'#10' EMPRESAS.PROVINCIA as PROV' +
+ 'INCIA_EMPRESA, EMPRESAS.CODIGO_POSTAL as CODIGO_POSTAL_EMPRESA,'#10 +
+ ' EMPRESAS.TELEFONO_1, EMPRESAS.FAX, EMPRESAS.MOVIL_1, EMPRESA' +
+ 'S.EMAIL_1,'#10' EMPRESAS.PAGINA_WEB, EMPRESAS.REGISTRO_MERCANTIL,' +
+ ' EMPRESAS.LOGOTIPO'#10'FROM V_FACTURAS_CLIENTE'#10'LEFT JOIN EMPRESAS ON' +
+ ' EMPRESAS.ID = ID_EMPRESA'#10'LEFT JOIN FORMAS_PAGO ON (FORMAS_PAGO.' +
+ 'ID = V_FACTURAS_CLIENTE.ID_FORMA_PAGO)'#10'LEFT JOIN CONTACTOS_DATOS' +
+ '_BANCO ON (CONTACTOS_DATOS_BANCO.ID_CONTACTO = V_FACTURAS_CLIENT' +
+ 'E.ID_CLIENTE)'#10'LEFT OUTER JOIN v_contactos_nombres ON (v_contacto' +
+ 's_nombres.id = V_FACTURAS_CLIENTE.id_cliente)'#10'WHERE V_FACTURAS_C' +
+ 'LIENTE.ID = :ID'#10
StatementType = stSQL
ColumnMappings = <
item
@@ -1010,6 +1012,10 @@ object RptFacturasCliente: TRptFacturasCliente
item
DatasetField = 'ID_TIENDA'
TableField = 'ID_TIENDA'
+ end
+ item
+ DatasetField = 'TIPO'
+ TableField = 'TIPO'
end>
end>
Name = 'InformeFacturasCliente'
@@ -1031,6 +1037,11 @@ object RptFacturasCliente: TRptFacturasCliente
DataType = datDateTime
DictionaryEntry = 'FacturasCliente_FECHA_FACTURA'
end
+ item
+ Name = 'TIPO'
+ DataType = datString
+ Size = 1
+ end
item
Name = 'TIENDA'
DataType = datString
@@ -1815,6 +1826,7 @@ object RptFacturasCliente: TRptFacturasCliente
UseFileCache = True
ShowProgress = False
OverwritePrompt = False
+ EmbeddedFonts = True
PrintOptimized = True
Outline = False
Background = False
@@ -1822,7 +1834,7 @@ object RptFacturasCliente: TRptFacturasCliente
Author = 'FactuGES'
Subject = 'FactuGES'
Creator = 'FactuGES'
- ProtectionFlags = [ePrint, eModify, eCopy, eAnnot]
+ ProtectionFlags = [ePrint, eAnnot]
HideToolbar = False
HideMenubar = False
HideWindowUI = False
diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas
index c749af99..fad6a780 100644
--- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas
+++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas
@@ -46,6 +46,7 @@ type
private
FConnection: IDAConnection;
FIdEmpresa: Integer;
+ FIdTienda: Integer;
FFechaInicio: Variant;
FFechaFin: Variant;
FFechaVenInicio: Variant;
@@ -55,7 +56,7 @@ type
FImporteMinimo: Currency;
FDesglosado : Boolean;
- //Genera cada uno de los albaranes a imprimir
+ //Genera cada uno de las facturas a imprimir
procedure _GenerarFactura(const ID: integer); overload;
procedure PrepararTablaInforme(ATabla: TDAMemDataTable);
@@ -66,7 +67,7 @@ type
public
function GenerarFactura(const ListaID : TIntegerArray): Binary; overload;
- function GenerarFacturaEnPDF(const ListaID : TIntegerArray): Binary;
+ function GenerarFacturaEnPDF(const ListaID : TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
function GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
@@ -78,12 +79,12 @@ implementation
{$R *.dfm}
uses
- uSistemaFunc, StrUtils, uROServer, DataAbstract4_Intf,
+ uSistemaFunc, StrUtils, uROServer, DataAbstract4_Intf, uBizFacturasClienteServer,
uDataModuleServer, schFacturasClienteClient_Intf, schRecibosClienteClient_Intf;
const
rptFacturaCliente = 'InfFacturaCliente.fr3';
-
+ rptFacturaProformaCliente = 'InfFacturaCliente_proforma.fr3';
rptInformeIVA = 'InformeIVAClientes.fr3';
rptInformeIVADesglosado = 'InformeIVAClientesDesglosado.fr3';
rptInformeListadoFacturasCliente = 'InformeListadoFacturasCliente.fr3';
@@ -127,19 +128,39 @@ begin
end;
end;
-function TRptFacturasCliente.GenerarFacturaEnPDF(
- const ListaID: TIntegerArray): Binary;
+function TRptFacturasCliente.GenerarFacturaEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
var
i: Integer;
+ AStream : Binary;
+ ARutaFichero, ANombreFichero, LlamadaBat : String;
begin
Result := Binary.Create;
try
+ //Inicializamos parametros
+
//Vamos generando todos y cada uno de los presupuestos recibidos
for i := 0 to ListaID.Count - 1 do
- _GenerarFactura(ListaID.Items[i]);
+ begin
+ _GenerarFactura(ListaID.Items[i]);
+ ANombreFichero := frxReport.ReportOptions.Name + '_' + FormatDateTime('yyyymmdd_hhnnss_', now) + Usuario;
+ if Firmado then
+ ANombreFichero := ANombreFichero + 'firmado.pdf'
+ else
+ ANombreFichero := ANombreFichero + '.pdf';
- frxPDFExport1.Stream := Result;
- frxReport.Export(frxPDFExport1)
+ ANombreFichero := DarRutaPDFS + EscapeIllegalChars(ANombreFichero);
+ frxPDFExport1.Stream := Result;
+ frxReport.Export(frxPDFExport1);
+ Result.SaveToFile(ANombreFichero);
+
+ if Firmado then
+ begin
+ ARutaFichero := DarRutaFichero(DarRutaInformes, 'firma_factura.bat ', IntToStr(FIdEmpresa), IntToStr(FIdTienda));
+ LlamadaBat := ARutaFichero + '"' + ANombreFichero + '"';
+ if ExecAndWait(LlamadaBat) then
+ Result.LoadFromFile(ANombreFichero);
+ end;
+ end;
finally
end;
end;
@@ -710,7 +731,13 @@ begin
tbl_Detalles.Active := True;
tbl_Vencimientos.Active := True;
- AInforme := DarRutaFichero(DarRutaInformes, rptFacturaCliente, tbl_Cabecera.FieldByName('ID_EMPRESA').AsString, tbl_Cabecera.FieldByName('ID_TIENDA').AsString);
+ FIdEmpresa := tbl_Cabecera.FieldByName('ID_EMPRESA').AsInteger;
+ FIdTienda := tbl_Cabecera.FieldByName('ID_TIENDA').AsInteger;
+ if (tbl_Cabecera.FieldByName('TIPO').AsString = CTE_TIPO_PROFORMA) then
+ AInforme := DarRutaFichero(DarRutaInformes, rptFacturaProformaCliente, tbl_Cabecera.FieldByName('ID_EMPRESA').AsString, tbl_Cabecera.FieldByName('ID_TIENDA').AsString)
+ else
+ AInforme := DarRutaFichero(DarRutaInformes, rptFacturaCliente, tbl_Cabecera.FieldByName('ID_EMPRESA').AsString, tbl_Cabecera.FieldByName('ID_TIENDA').AsString);
+
if VarIsNull(AInforme) then
raise Exception.Create (('Error Servidor: _GenerarFactura, no encuentra informe ' + rptFacturaCliente));
diff --git a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm
index 7b16580a..a0d4484b 100644
--- a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm
+++ b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.dfm
@@ -952,6 +952,12 @@ object srvFacturasCliente: TsrvFacturasCliente
Size = 255
Value = ''
end
+ item
+ Name = 'TIPO'
+ DataType = datString
+ Size = 1
+ Value = ''
+ end
item
Name = 'FECHA_FACTURA'
DataType = datDateTime
@@ -1118,24 +1124,25 @@ object srvFacturasCliente: TsrvFacturasCliente
TargetTable = 'FACTURAS_CLIENTE'
SQL =
'INSERT INTO FACTURAS_CLIENTE ('#10' ID,'#10' ID_EMPRESA,'#10' REFER' +
- 'ENCIA,'#10' FECHA_FACTURA,'#10' FECHA_VENCIMIENTO,'#10' BASE_IMPONI' +
- 'BLE,'#10' DESCUENTO,'#10' IMPORTE_DESCUENTO,'#10' IVA,'#10' IMPORTE_' +
- 'IVA,'#10' RE,'#10' IMPORTE_RE,'#10' IMPORTE_TOTAL,'#10' OBSERVACIONE' +
- 'S,'#10' ID_CLIENTE,'#10' NIF_CIF,'#10' NOMBRE,'#10' CALLE,'#10' POBLA' +
- 'CION,'#10' PROVINCIA,'#10' CODIGO_POSTAL,'#10' FECHA_ALTA,'#10' USUA' +
- 'RIO,'#10' ID_FORMA_PAGO,'#10' RECARGO_EQUIVALENCIA,'#10' ID_TIPO_IV' +
- 'A,'#10' IMPORTE_NETO,'#10' IMPORTE_PORTE,'#10' IGNORAR_CONTABILIDAD' +
- ','#10' ID_TIENDA,'#10' ID_CONTRATO,'#10' SIN_COMISION,'#10' TIPO_FAC' +
- 'TURA,'#10' SITUACION)'#10' VALUES ('#10' :ID,'#10' :ID_EMPRESA,'#10' :R' +
- 'EFERENCIA,'#10' :FECHA_FACTURA,'#10' :FECHA_VENCIMIENTO,'#10' :BASE' +
- '_IMPONIBLE,'#10' :DESCUENTO,'#10' :IMPORTE_DESCUENTO,'#10' :IVA,'#10' ' +
- ' :IMPORTE_IVA,'#10' :RE,'#10' :IMPORTE_RE,'#10' :IMPORTE_TOTAL,'#10' ' +
- ' :OBSERVACIONES,'#10' :ID_CLIENTE,'#10' :NIF_CIF,'#10' :NOMBRE,'#10' ' +
- ' :CALLE,'#10' :POBLACION,'#10' :PROVINCIA,'#10' :CODIGO_POSTAL,'#10' ' +
- ' CURRENT_TIMESTAMP,'#10' :USUARIO,'#10' :ID_FORMA_PAGO,'#10' :RECA' +
- 'RGO_EQUIVALENCIA,'#10' :ID_TIPO_IVA,'#10' :IMPORTE_NETO,'#10' :IMPO' +
- 'RTE_PORTE,'#10' :IGNORAR_CONTABILIDAD,'#10' :ID_TIENDA,'#10' :ID_CO' +
- 'NTRATO,'#10' :SIN_COMISION,'#10' :TIPO_FACTURA,'#10' :SITUACION);'#10
+ 'ENCIA,'#10' TIPO,'#10' FECHA_FACTURA,'#10' FECHA_VENCIMIENTO,'#10' B' +
+ 'ASE_IMPONIBLE,'#10' DESCUENTO,'#10' IMPORTE_DESCUENTO,'#10' IVA,'#10' ' +
+ ' IMPORTE_IVA,'#10' RE,'#10' IMPORTE_RE,'#10' IMPORTE_TOTAL,'#10' OB' +
+ 'SERVACIONES,'#10' ID_CLIENTE,'#10' NIF_CIF,'#10' NOMBRE,'#10' CALLE,' +
+ #10' POBLACION,'#10' PROVINCIA,'#10' CODIGO_POSTAL,'#10' FECHA_ALTA' +
+ ','#10' USUARIO,'#10' ID_FORMA_PAGO,'#10' RECARGO_EQUIVALENCIA,'#10' ' +
+ 'ID_TIPO_IVA,'#10' IMPORTE_NETO,'#10' IMPORTE_PORTE,'#10' IGNORAR_CO' +
+ 'NTABILIDAD,'#10' ID_TIENDA,'#10' ID_CONTRATO,'#10' SIN_COMISION,'#10' ' +
+ ' TIPO_FACTURA,'#10' SITUACION)'#10' VALUES ('#10' :ID,'#10' :ID_EMPRE' +
+ 'SA,'#10' :REFERENCIA,'#10' :TIPO,'#10' :FECHA_FACTURA,'#10' :FECHA_V' +
+ 'ENCIMIENTO,'#10' :BASE_IMPONIBLE,'#10' :DESCUENTO,'#10' :IMPORTE_DE' +
+ 'SCUENTO,'#10' :IVA,'#10' :IMPORTE_IVA,'#10' :RE,'#10' :IMPORTE_RE,'#10' ' +
+ ' :IMPORTE_TOTAL,'#10' :OBSERVACIONES,'#10' :ID_CLIENTE,'#10' :NIF' +
+ '_CIF,'#10' :NOMBRE,'#10' :CALLE,'#10' :POBLACION,'#10' :PROVINCIA,'#10' ' +
+ ' :CODIGO_POSTAL,'#10' CURRENT_TIMESTAMP,'#10' :USUARIO,'#10' :ID_' +
+ 'FORMA_PAGO,'#10' :RECARGO_EQUIVALENCIA,'#10' :ID_TIPO_IVA,'#10' :IM' +
+ 'PORTE_NETO,'#10' :IMPORTE_PORTE,'#10' :IGNORAR_CONTABILIDAD,'#10' :' +
+ 'ID_TIENDA,'#10' :ID_CONTRATO,'#10' :SIN_COMISION,'#10' :TIPO_FACTUR' +
+ 'A,'#10' :SITUACION);'#10
StatementType = stSQL
ColumnMappings = <>
end>
diff --git a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas
index 52856065..d75624a9 100644
--- a/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas
+++ b/Source/Modulos/Facturas de cliente/Servidor/srvFacturasCliente_Impl.pas
@@ -36,7 +36,7 @@ type
protected
{ IsrvFacturasCliente methods }
function GenerateReport(const FacturaID: TIntegerArray): Binary;
- function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
end;
implementation
@@ -78,14 +78,13 @@ begin
ConnectionName := dmServer.ConnectionName;
end;
-function TsrvFacturasCliente.GenerarInformeEnPDF(
- const ListaID: TIntegerArray): Binary;
+function TsrvFacturasCliente.GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
var
AReportGenerator : TRptFacturasCliente;
begin
AReportGenerator := TRptFacturasCliente.Create(nil);
try
- Result := AReportGenerator.GenerarFacturaEnPDF(ListaID);
+ Result := AReportGenerator.GenerarFacturaEnPDF(ListaID, Usuario, Firmado);
finally
FreeAndNIL(AReportGenerator);
end;
diff --git a/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dproj b/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dproj
index a769db74..673f7547 100644
--- a/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dproj
+++ b/Source/Modulos/Facturas de cliente/Views/FacturasCliente_view.dproj
@@ -49,45 +49,45 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TForm
diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm
index 8a8de336..44abfc99 100644
--- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm
+++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturaCliente.dfm
@@ -184,14 +184,15 @@ inherited fEditorFacturaCliente: TfEditorFacturaCliente
Width = 310
end
inherited frViewObservaciones1: TfrViewObservaciones
- Width = 521
+ Width = 785
Height = 228
- ExplicitWidth = 521
+ ExplicitWidth = 785
ExplicitHeight = 228
inherited memObservaciones: TcxDBMemo
DataBinding.DataSource = frViewFacturaCliente1.DADataSource
+ ExplicitWidth = 785
Height = 228
- Width = 521
+ Width = 785
end
end
inherited cbRecargoEquivalencia: TcxDBCheckBox
diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.dfm
index b7c31001..8a7b2e94 100644
--- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.dfm
+++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.dfm
@@ -59,7 +59,11 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
inherited TBXItem2: TTBXItem
Visible = False
end
- object TBXItem41: TTBXItem [13]
+ object TBXItem44: TTBXItem [13]
+ Action = actGenerarPDF
+ DisplayMode = nbdmImageAndText
+ end
+ object TBXItem41: TTBXItem [14]
Action = actEnviarMail
DisplayMode = nbdmImageAndText
end
@@ -227,14 +231,14 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
Width = 263
end
inherited txtFiltroTodo2: TcxTextEdit
- Left = 459
+ Left = 473
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
- ExplicitLeft = 459
- ExplicitWidth = 250
- Width = 250
+ ExplicitLeft = 473
+ ExplicitWidth = 223
+ Width = 223
end
end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
@@ -333,6 +337,13 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
OnExecute = actConvertirEnFacturaExecute
OnUpdate = actConvertirEnFacturaUpdate
end
+ object actGenerarPDF: TAction
+ Category = 'Archivo'
+ Caption = 'Generar PDF'
+ ImageIndex = 28
+ OnExecute = actGenerarPDFExecute
+ OnUpdate = actGenerarPDFUpdate
+ end
end
inherited SmallImages: TPngImageList [5]
PngImages = <
@@ -1118,6 +1129,29 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
00000049454E44AE426082}
Name = 'PngImage27'
Background = clWindow
+ end
+ item
+ PngImage.Data = {
+ 89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF
+ 610000000970485973000017120000171201679FD252000001F04944415478DA
+ 633CC0C0F09F0109C83939313CDAB70F5988C181818191C1600644DD850C4664
+ 3946900162D7AEC1053872721838972E85F36F4A4A323818CC60A82CF062689F
+ B00DB7011C1C1C0C9C9C9C0CDFA3A31924B76E65F8F1E307184B7A6E64583825
+ 99E1C69DE70C4B561C64F8F1F3EFC5D7EF7F78030D7A8A6280A0A020D890F7C1
+ C10C826BD7824D17745C09D70C03627C2C0C959D5BBF000DD20019023640FDF9
+ 7314CD201AE48DF7EFDF3368451D62F075D365D0D19265B872ED3198FEF3F90D
+ C3C2F597B7BEDA17EF0337000440CEC70694DE85810DD9BCEB32DC305878800D
+ 00853C08806CFDFEFD3B42674A0A38462E2FDACE90DBF7102CB4A0568361ED49
+ 568663276F31BC3D98883000E66474F04A4B8BC1F6DF3F14B182CEDD0CF3363D
+ 66F87A3C8591B15842F33F0301D0F5EC2A0ABF6DC6368629EBDE3148311F6760
+ 24A479F2A2EDFFB362DC19983E9D67B8BFDC98412AF402C3EC6DCF19E62DDD04
+ 4907C41AF0772D1303AB453CC3FD2D0B197823BE307CFFF18BC13FA19A380372
+ FC2480B61B3228DA3330DC3FC8C0C0E27E95E13B83284344663D7106787FF564
+ 50F4896760F8BC90E1FD3B06860F9719183EDA3F61482A6C25CE00BD279E18E2
+ CCEEF71872ABBA893320C4D30AE8E7DF0CDFBEFF66F8FAFD17C337A0FF41A0A8
+ AE8F380360218E0D000074D3EB115697A8140000000049454E44AE426082}
+ Name = 'PngImage28'
+ Background = clWindow
end>
Left = 395
Bitmap = {}
@@ -4766,4 +4800,8 @@ inherited fEditorFacturasCliente: TfEditorFacturasCliente
Left = 136
Top = 144
end
+ object JSDialog1: TJSDialog
+ Left = 104
+ Top = 320
+ end
end
diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas
index 9830c0a5..0a588eb0 100644
--- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas
+++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas
@@ -45,18 +45,23 @@ type
actNuevaProforma: TAction;
JsNuevaProformaDialog: TJSDialog;
actConvertirEnFactura: TAction;
+ JSDialog1: TJSDialog;
+ actGenerarPDF: TAction;
+ TBXItem44: TTBXItem;
procedure FormShow(Sender: TObject);
procedure actEliminarUpdate(Sender: TObject);
procedure actNuevaFacturaExecute(Sender: TObject);
+ procedure actNuevaProformaExecute(Sender: TObject);
procedure actNuevoAbonoExecute(Sender: TObject);
procedure actInformesExecute(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
procedure actEnviarMailUpdate(Sender: TObject);
procedure actEnviarMailExecute(Sender: TObject);
procedure actCambiarSituacionExecute(Sender: TObject);
- procedure actNuevaProformaExecute(Sender: TObject);
procedure actConvertirEnFacturaExecute(Sender: TObject);
procedure actConvertirEnFacturaUpdate(Sender: TObject);
+ procedure actGenerarPDFExecute(Sender: TObject);
+ procedure actGenerarPDFUpdate(Sender: TObject);
private
FFacturas: IBizFacturaCliente;
@@ -195,6 +200,58 @@ begin
(Sender as TAction).Enabled := False;
end;
+procedure TfEditorFacturasCliente.actGenerarPDFExecute(Sender: TObject);
+var
+ ACadena : String;
+ AFacturas: IBizFacturaCliente;
+ AllItems: Boolean;
+ AListaCausas: TStringList;
+ AFirmar: Boolean;
+
+begin
+ inherited;
+ AFacturas := Nil;
+ AFirmar := False;
+ AllItems := False;
+ AListaCausas := TStringList.Create;
+
+ if MultiSelect and Assigned(ViewGrid) then
+ AllItems := (ViewGrid.NumSeleccionados > 1);
+
+ if AllItems then
+ begin
+ SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Facturas as ISeleccionable).SelectedRecords);
+ AFacturas := (Controller as IFacturasClienteController).ExtraerSeleccionados(Facturas) as IBizFacturaCliente;
+
+ if (Application.MessageBox('¿Desea firmar digitalmente las facturas/abonos de cliente seleccionados?', 'Atención', MB_YESNO) = IDYES) then
+ AFirmar := True;
+ end
+ else
+ begin
+ AFacturas := Facturas;
+
+ if Facturas.TIPO = CTE_TIPO_FACTURA then
+ ACadena := '¿Desea firmar digitalmente esta factura de cliente?'
+ else
+ ACadena := '¿Desea firmar digitalmente este abono a cliente?';
+
+ if (Application.MessageBox(PChar(ACadena), 'Atención', MB_YESNO) = IDYES) then
+ AFirmar := True;
+ end;
+
+ FController.GenerarPDF(AFacturas, AllItems, AFirmar);
+end;
+
+procedure TfEditorFacturasCliente.actGenerarPDFUpdate(Sender: TObject);
+begin
+ inherited;
+ if HayDatos and Assigned(ViewGrid) then
+ (Sender as TAction).Enabled := ViewGrid.EsSeleccionCeldaDatos
+ and (ViewGrid.NumSeleccionados > 0)
+ else
+ (Sender as TAction).Enabled := False;
+end;
+
procedure TfEditorFacturasCliente.actInformesExecute(Sender: TObject);
var
Respuesta : Integer;
@@ -250,9 +307,12 @@ begin
GenerarFacturaCli(CTE_TIPO_PROFORMA);
actRefrescar.Execute;
end;
- 100 : begin // Factura nueva vacia
- if FController.AnadirProforma(Facturas) then
- FController.Ver(Facturas);
+ 100 : begin // Factura nueva vacia, No funciona como el abono al hacer post me quita el insert en la tabla general
+ //optamos por generar objeto nuevo y refrescar despues, "menos óptimo"
+// if FController.AnadirProforma(Facturas) then
+// FController.Ver(Facturas);
+ FController.Ver(FController.AnadirProforma);
+ actRefrescar.Execute;
end;
end;
end;
diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm
index 7cbaf6fe..bcb812f5 100644
--- a/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm
+++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturaCliente.dfm
@@ -1,6 +1,6 @@
inherited frViewFacturaCliente: TfrViewFacturaCliente
- Width = 705
- Height = 497
+ Width = 1081
+ Height = 551
Align = alClient
OnCreate = CustomViewCreate
OnDestroy = CustomViewDestroy
@@ -9,8 +9,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
object dxLayoutControl1: TdxLayoutControl
Left = 0
Top = 0
- Width = 705
- Height = 497
+ Width = 1081
+ Height = 551
Align = alClient
ParentBackground = True
TabOrder = 0
@@ -20,8 +20,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
ExplicitWidth = 451
ExplicitHeight = 304
DesignSize = (
- 705
- 497)
+ 1081
+ 551)
object eReferencia: TcxDBTextEdit
Left = 135
Top = 30
@@ -98,7 +98,7 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
Width = 78
end
object bFormasPago: TButton
- Left = 311
+ Left = 410
Top = 135
Width = 132
Height = 23
@@ -126,7 +126,7 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
inherited dxLayoutControl1: TdxLayoutControl
Width = 351
Height = 63
- ExplicitWidth = 351
+ ExplicitWidth = 421
ExplicitHeight = 63
inherited cbTienda: TcxComboBox
ExplicitWidth = 399
@@ -135,7 +135,7 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
end
end
inline frViewClienteFactura1: TfrViewClienteFactura
- Left = 471
+ Left = 570
Top = 30
Width = 398
Height = 265
@@ -147,14 +147,14 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
ParentFont = False
TabOrder = 9
ReadOnly = False
- ExplicitLeft = 471
+ ExplicitLeft = 570
ExplicitTop = 30
ExplicitWidth = 398
ExplicitHeight = 265
inherited dxLayoutControl1: TdxLayoutControl
Width = 398
Height = 265
- ExplicitWidth = 398
+ ExplicitWidth = 101
ExplicitHeight = 265
inherited edtlNombre: TcxDBTextEdit
ExplicitWidth = 276
@@ -177,12 +177,12 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
Width = 276
end
inherited edtCodigoPostal: TcxDBTextEdit
- Left = 192
- ExplicitLeft = 192
+ Left = 397
+ ExplicitLeft = 397
end
inherited Button3: TBitBtn
- Left = 82
- ExplicitLeft = 82
+ Left = 287
+ ExplicitLeft = 287
end
inherited cxDBTextEdit1: TcxDBTextEdit
ExplicitWidth = 283
@@ -231,7 +231,8 @@ inherited frViewFacturaCliente: TfrViewFacturaCliente
inherited memObservaciones: TcxDBMemo
DataBinding.DataField = 'OBSERVACIONES'
DataBinding.DataSource = DADataSource
- ExplicitHeight = 228
+ ExplicitWidth = 550
+ ExplicitHeight = 20
Height = 228
end
end
diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturasCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uViewFacturasCliente.dfm
index 5001bcdc..9785cb9e 100644
--- a/Source/Modulos/Facturas de cliente/Views/uViewFacturasCliente.dfm
+++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturasCliente.dfm
@@ -184,6 +184,9 @@ inherited frViewFacturasCliente: TfrViewFacturasCliente
object cxGridPagadas: TcxGridLevel
Caption = 'Pagadas'
end
+ object cxGridProforma: TcxGridLevel
+ Caption = 'Proformas'
+ end
end
inherited frViewFiltroBase1: TfrViewFiltroBase
Width = 802
@@ -261,6 +264,11 @@ inherited frViewFacturasCliente: TfrViewFacturasCliente
object TBXItem2: TTBXItem
Action = actProvincia
end
+ object TBXSeparatorItem3: TTBXSeparatorItem
+ end
+ object TBXItem4: TTBXItem
+ Action = actTienda
+ end
end
end
end
diff --git a/Source/Modulos/Facturas de cliente/Views/uViewFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Views/uViewFacturasCliente.pas
index 6583358d..808a53eb 100644
--- a/Source/Modulos/Facturas de cliente/Views/uViewFacturasCliente.pas
+++ b/Source/Modulos/Facturas de cliente/Views/uViewFacturasCliente.pas
@@ -68,6 +68,9 @@ type
cxStyleProforma: TcxStyle;
actTienda: TAction;
actFormaPago: TAction;
+ TBXSeparatorItem3: TTBXSeparatorItem;
+ TBXItem4: TTBXItem;
+ cxGridProforma: TcxGridLevel;
procedure cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
out AStyle: TcxStyle);
@@ -193,9 +196,20 @@ begin
FFiltro := AddFilterGrid(fboAnd);
case cxGrid.ActiveLevel.Index of
- 1 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, CTE_PENDIENTE, CTE_PENDIENTE);
- 2 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, CTE_PARCIAMENTE_PAGADA, CTE_PARCIAMENTE_PAGADA);
- 3 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, CTE_PAGADA, CTE_PAGADA);
+ 0 : FFiltro.AddItem(cxGridViewTIPO, foNotEqual, CTE_TIPO_PROFORMA, CTE_TIPO_PROFORMA);
+ 1 : Begin
+ FFiltro.AddItem(cxGridViewSITUACION, foEqual, CTE_PENDIENTE, CTE_PENDIENTE);
+ FFiltro.AddItem(cxGridViewTIPO, foNotEqual, CTE_TIPO_PROFORMA, CTE_TIPO_PROFORMA);
+ End;
+ 2 : Begin
+ FFiltro.AddItem(cxGridViewSITUACION, foEqual, CTE_PARCIAMENTE_PAGADA, CTE_PARCIAMENTE_PAGADA);
+ FFiltro.AddItem(cxGridViewTIPO, foNotEqual, CTE_TIPO_PROFORMA, CTE_TIPO_PROFORMA);
+ End;
+ 3 : Begin
+ FFiltro.AddItem(cxGridViewSITUACION, foEqual, CTE_PAGADA, CTE_PAGADA);
+ FFiltro.AddItem(cxGridViewTIPO, foNotEqual, CTE_TIPO_PROFORMA, CTE_TIPO_PROFORMA);
+ End;
+ 4 : FFiltro.AddItem(cxGridViewTIPO, foEqual, CTE_TIPO_PROFORMA, CTE_TIPO_PROFORMA);
end;
end;
@@ -216,6 +230,9 @@ end;
procedure TfrViewFacturasCliente.ConfigView;
begin
inherited;
+ //Para que nos filtre la pestaña todas y quite las facturas proforma
+ AnadirOtrosFiltros;
+
//Solo para aliso
if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_ALISO) then
begin
diff --git a/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedorServer.pas b/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedorServer.pas
index c4fef884..04820595 100644
--- a/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedorServer.pas
+++ b/Source/Modulos/Facturas de proveedor/Model/uBizFacturasProveedorServer.pas
@@ -94,7 +94,7 @@ var
AClientID : TGUID;
ATipo : String;
begin
-//No se hace distinción en la referencia entre facturas y abonos
+//No se hace distinción en la referencia entre facturas y abonos (factura rectificativa)
// if TIPO = CTE_TIPO_FACTURA then
ATipo := REF_FACTURAS_PROVEEDOR;
// else
diff --git a/Source/Modulos/Facturas de proveedor/Views/uViewFacturasProveedor.dfm b/Source/Modulos/Facturas de proveedor/Views/uViewFacturasProveedor.dfm
index 03deefa3..b6b5b7bc 100644
--- a/Source/Modulos/Facturas de proveedor/Views/uViewFacturasProveedor.dfm
+++ b/Source/Modulos/Facturas de proveedor/Views/uViewFacturasProveedor.dfm
@@ -277,6 +277,11 @@ inherited frViewFacturasProveedor: TfrViewFacturasProveedor
object TBXItem4: TTBXItem
Action = actFormaPago
end
+ object TBXSeparatorItem4: TTBXSeparatorItem
+ end
+ object TBXItem5: TTBXItem
+ Action = actTienda
+ end
end
end
end
@@ -304,6 +309,11 @@ inherited frViewFacturasProveedor: TfrViewFacturasProveedor
OnExecute = actFormaPagoExecute
OnUpdate = actFormaPagoUpdate
end
+ object actTienda: TAction
+ Caption = 'Tienda'
+ OnExecute = actTiendaExecute
+ OnUpdate = actTiendaUpdate
+ end
end
inherited GridPNGImageList: TPngImageList
PngImages = <
diff --git a/Source/Modulos/Facturas de proveedor/Views/uViewFacturasProveedor.pas b/Source/Modulos/Facturas de proveedor/Views/uViewFacturasProveedor.pas
index 69ef45e1..969375d5 100644
--- a/Source/Modulos/Facturas de proveedor/Views/uViewFacturasProveedor.pas
+++ b/Source/Modulos/Facturas de proveedor/Views/uViewFacturasProveedor.pas
@@ -64,6 +64,9 @@ type
actFormaPago: TAction;
TBXSeparatorItem3: TTBXSeparatorItem;
TBXItem4: TTBXItem;
+ actTienda: TAction;
+ TBXSeparatorItem4: TTBXSeparatorItem;
+ TBXItem5: TTBXItem;
procedure cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
out AStyle: TcxStyle);
@@ -74,6 +77,8 @@ type
procedure actProvinciaUpdate(Sender: TObject);
procedure actFormaPagoExecute(Sender: TObject);
procedure actFormaPagoUpdate(Sender: TObject);
+ procedure actTiendaExecute(Sender: TObject);
+ procedure actTiendaUpdate(Sender: TObject);
private
//Filtros relativos a la vista
@@ -159,6 +164,26 @@ begin
(Sender as TAction).Checked := not (cxGridViewPROVINCIA.GroupIndex < 0);
end;
+procedure TfrViewFacturasProveedor.actTiendaExecute(Sender: TObject);
+begin
+ if (cxGridViewTIENDA.GroupIndex < 0) then
+ begin
+ cxGridViewTIENDA.GroupIndex := cxGridView.GroupedColumnCount;
+ cxGridViewTIENDA.Visible := False;
+ end
+ else
+ begin
+ cxGridViewTIENDA.GroupIndex := -1;
+ cxGridViewTIENDA.Visible := True;
+ end;
+end;
+
+procedure TfrViewFacturasProveedor.actTiendaUpdate(Sender: TObject);
+begin
+ inherited;
+ (Sender as TAction).Checked := not (cxGridViewTIENDA.GroupIndex < 0);
+end;
+
procedure TfrViewFacturasProveedor.AnadirFiltroFechas;
var
Columna: TcxGridDBColumn;
diff --git a/Source/Modulos/Pedidos a proveedor/Controller/uPedidosProveedorController.pas b/Source/Modulos/Pedidos a proveedor/Controller/uPedidosProveedorController.pas
index 96f35041..b77091e8 100644
--- a/Source/Modulos/Pedidos a proveedor/Controller/uPedidosProveedorController.pas
+++ b/Source/Modulos/Pedidos a proveedor/Controller/uPedidosProveedorController.pas
@@ -61,6 +61,7 @@ type
function ElegirPedidos(APedido: IBizPedidoProveedor; AMensaje: String; AMultiSelect: Boolean): IBizPedidoProveedor;
procedure RecuperarProveedor(APedido: IBizPedidoProveedor);
Procedure AsignarContrato(APedido: IBizPedidoProveedor; const ID_CONTRATO: Integer; AReferencia, ANombreCliente: String);
+ procedure AsignarTienda(APedido: IBIzPedidoProveedor; const ID_TIENDA: Integer);
end;
TPedidosProveedorController = class(TControllerBase, IPedidosProveedorController)
@@ -135,6 +136,7 @@ type
function ExtraerSeleccionados(APedido: IBizPedidoProveedor) : IBizPedidoProveedor;
function ElegirPedidos(APedido: IBizPedidoProveedor; AMensaje: String; AMultiSelect: Boolean): IBizPedidoProveedor;
Procedure AsignarContrato(APedido: IBizPedidoProveedor; const ID_CONTRATO: Integer; AReferencia, ANombreCliente: String);
+ procedure AsignarTienda(APedido: IBIzPedidoProveedor; const ID_TIENDA: Integer);
function DarListaAnosPedidos: TStringList;
procedure FiltrarAno(APedido: IBizPedidoProveedor; ADynWhereDataTable: WideString; const Ano: String);
@@ -189,6 +191,32 @@ begin
FDataModule := TDataModulePedidosProveedor.Create(Nil);
end;
+procedure TPedidosProveedorController.AsignarTienda(
+ APedido: IBIzPedidoProveedor; const ID_TIENDA: Integer);
+var
+ bEnEdicion : Boolean;
+
+begin
+ if not Assigned(APedido) then
+ raise Exception.Create ('APedido no asignado');
+
+ ShowHourglassCursor;
+ try
+ bEnEdicion := (APedido.DataTable.State in dsEditModes);
+ if not bEnEdicion then
+ APedido.Edit;
+
+ APedido.DataTable.Edit;
+ APedido.ID_TIENDA := ID_TIENDA;
+
+ if not bEnEdicion then
+ APedido.Post;
+
+ finally
+ HideHourglassCursor;
+ end;
+end;
+
function TPedidosProveedorController.Buscar(const ID: Integer): IBizPedidoProveedor;
begin
Result := FDataModule.GetItem(ID);
diff --git a/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedor.pas b/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedor.pas
index 7134b418..347674ec 100644
--- a/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedor.pas
+++ b/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedor.pas
@@ -329,14 +329,6 @@ begin
DataTable.Edit;
ID_PROVEEDOR := FProveedor.ID;
-
- if FProveedor.ID_TIENDA > 0 then
- begin
- ID_TIENDA := FProveedor.ID_TIENDA;
- TIENDA := FProveedor.TIENDA;
- end;
-
-
DataTable.Post; //Muy importante ya que es necesario hacer un post de la cabecera antes de añadir detalles
//si se quita el id de la cabecera y los detalles se desincroniza
if bEnEdicion then
diff --git a/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedorServer.pas b/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedorServer.pas
index c4de8df7..3e393290 100644
--- a/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedorServer.pas
+++ b/Source/Modulos/Pedidos a proveedor/Model/uBizPedidosProveedorServer.pas
@@ -80,7 +80,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.DarNuevaReferencia(REF_PEDIDOS_PROVEEDOR, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.DarNuevaReferencia(REF_PEDIDOS_PROVEEDOR, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.DarNuevaReferencia(REF_PEDIDOS_PROVEEDOR, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
function TBizPedidosProveedorServer.IncrementarReferencia: Boolean;
@@ -93,7 +94,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.IncrementarValorReferencia(REF_PEDIDOS_PROVEEDOR, Self.REFERENCIA, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.IncrementarValorReferencia(REF_PEDIDOS_PROVEEDOR, Self.REFERENCIA, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.IncrementarValorReferencia(REF_PEDIDOS_PROVEEDOR, Self.REFERENCIA, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
initialization
diff --git a/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.dproj b/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.dproj
index af5fe38a..309e214a 100644
--- a/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.dproj
+++ b/Source/Modulos/Pedidos a proveedor/Views/PedidosProveedor_view.dproj
@@ -49,28 +49,28 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TfEditorDireccionEntregaPedidoProveedor
diff --git a/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidoProveedor.dfm b/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidoProveedor.dfm
index 03872a4a..2b0cbed9 100644
--- a/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidoProveedor.dfm
+++ b/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidoProveedor.dfm
@@ -107,31 +107,8 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
ExplicitHeight = 463
inherited frViewProveedorPedido: TfrViewDatosYSeleccionProveedor
Left = 551
- Width = 357
ExplicitLeft = 551
- ExplicitWidth = 357
inherited dxLayoutControl1: TdxLayoutControl
- Width = 357
- inherited edtlNombre: TcxDBTextEdit
- ExplicitWidth = 283
- Width = 283
- end
- inherited edtNIFCIF: TcxDBTextEdit
- ExplicitWidth = 283
- Width = 283
- end
- inherited edtCalle: TcxDBTextEdit
- ExplicitWidth = 283
- Width = 283
- end
- inherited edtPoblacion: TcxDBTextEdit
- ExplicitWidth = 176
- Width = 176
- end
- inherited edtProvincia: TcxDBTextEdit
- ExplicitWidth = 283
- Width = 283
- end
inherited edtCodigoPostal: TcxDBTextEdit
Left = 237
ExplicitLeft = 237
@@ -142,30 +119,8 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
end
end
end
- inherited edtFechaPedido: TcxDBDateEdit
- ExplicitWidth = 158
- Width = 158
- end
- inherited edtFechaConfirmacion: TcxDBDateEdit
- ExplicitWidth = 158
- Width = 158
- end
- inherited edtFechaEntrega: TcxDBDateEdit
- ExplicitWidth = 158
- Width = 158
- end
- inherited eReferencia: TcxDBTextEdit
- ExplicitWidth = 158
- Width = 158
- end
inherited frViewDireccionEntregaPedidoProv1: TfrViewDireccionEntregaPedidoProv
- Width = 273
- Height = 166
- ExplicitWidth = 273
- ExplicitHeight = 166
inherited dxLayoutControl1: TdxLayoutControl
- Width = 273
- Height = 166
inherited rdxDestino1: TRadioButton
Width = 253
ExplicitWidth = 253
@@ -203,8 +158,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 323
- ExplicitWidth = 183
- Width = 183
end
inherited eNumBultos: TcxDBSpinEdit
Left = 401
@@ -212,60 +165,24 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
end
end
end
- inherited cbFormaPago: TcxDBLookupComboBox
- ExplicitWidth = 20
- Width = 20
- end
inherited bFormasPago: TButton
Left = 389
ExplicitLeft = 389
end
- inherited edtFechaEnvio: TcxDBDateEdit
- ExplicitWidth = 158
- Width = 158
- end
- inherited eReferenciaContratoCli: TcxTextEdit
- ExplicitWidth = 20
- Width = 20
- end
inherited Button1: TButton
Left = 421
ExplicitLeft = 421
end
inherited frViewTienda1: TfrViewTienda
Left = 551
- Width = 357
Enabled = True
ExplicitLeft = 551
- ExplicitWidth = 357
- inherited dxLayoutControl1: TdxLayoutControl
- Width = 357
- inherited cbTienda: TcxComboBox
- ExplicitWidth = 390
- Width = 390
- end
- end
end
inherited frViewObservaciones1: TfrViewObservaciones
- Width = 422
- ExplicitWidth = 422
inherited memObservaciones: TcxDBMemo
DataBinding.DataSource = frViewPedidoProveedor1.DADataSource
- Width = 422
end
end
- inherited edtlDescripcion: TcxDBTextEdit
- ExplicitWidth = 283
- Width = 283
- end
- inherited edtFechaEnvio2: TcxDBDateEdit
- ExplicitWidth = 257
- Width = 257
- end
- inherited cbVendedor: TcxDBLookupComboBox
- ExplicitWidth = 250
- Width = 250
- end
inherited Button2: TButton
Left = 315
ExplicitLeft = 315
@@ -523,8 +440,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Style.IsFontAssigned = True
ExplicitLeft = 164
ExplicitTop = 38
- ExplicitWidth = 93
- Width = 93
end
inherited ImporteIVA: TcxDBCurrencyEdit
Left = 636
@@ -532,8 +447,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Style.IsFontAssigned = True
ExplicitLeft = 636
ExplicitTop = 88
- ExplicitWidth = 137
- Width = 137
end
inherited ImporteTotal: TcxDBCurrencyEdit
Left = 566
@@ -541,8 +454,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Style.IsFontAssigned = True
ExplicitLeft = 566
ExplicitTop = 142
- ExplicitWidth = 137
- Width = 137
end
inherited edtDescuento: TcxDBSpinEdit
Left = 93
@@ -564,8 +475,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Style.IsFontAssigned = True
ExplicitLeft = 565
ExplicitTop = 11
- ExplicitWidth = 92
- Width = 92
end
inherited edtRE: TcxDBSpinEdit
Left = 565
@@ -584,8 +493,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Style.IsFontAssigned = True
ExplicitLeft = 636
ExplicitTop = 115
- ExplicitWidth = 56
- Width = 56
end
inherited eImporteNeto: TcxDBCurrencyEdit
Left = 93
@@ -593,8 +500,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Style.IsFontAssigned = True
ExplicitLeft = 93
ExplicitTop = 11
- ExplicitWidth = 147
- Width = 147
end
inherited ePorte: TcxDBCurrencyEdit
Left = 93
@@ -603,8 +508,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
Style.IsFontAssigned = True
ExplicitLeft = 93
ExplicitTop = 65
- ExplicitWidth = 147
- Width = 147
end
inherited eIVA: TcxDBLookupComboBox
Left = 93
@@ -613,8 +516,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
DataBinding.DataSource = nil
ExplicitLeft = 93
ExplicitTop = 92
- ExplicitWidth = 81
- Width = 81
end
inherited bTiposIVA: TButton
Left = 305
@@ -628,8 +529,6 @@ inherited fEditorPedidoProveedor: TfEditorPedidoProveedor
DataBinding.DataField = ''
ExplicitLeft = 93
ExplicitTop = 119
- ExplicitWidth = 219
- Width = 219
end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
inherited dxLayoutControl1Group1: TdxLayoutGroup
diff --git a/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidoProveedor.pas b/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidoProveedor.pas
index 80b2b0cf..6e2bff6f 100644
--- a/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidoProveedor.pas
+++ b/Source/Modulos/Pedidos a proveedor/Views/uEditorPedidoProveedor.pas
@@ -219,8 +219,12 @@ end;
procedure TfEditorPedidoProveedor.OnProveedorChanged(Sender: TObject);
begin
FPedido.Proveedor := ViewPedido.ViewProveedorPedido.Proveedor;
+
+ if (ShowConfirmMessage('Atención tienda asignada', '¿Desea actualizar la tienda a la pertenece el pedido en base a la tienda a la que pertenece el proveedor seleccionado?') = IDYES) then
+ FController.AsignarTienda(FPedido, FPedido.Proveedor.ID_TIENDA);
+
frViewPedidoProveedor1.frViewTienda1.ElegirTienda(FPedido.ID_TIENDA);
-
+
// Si el pedido tiene detalles hay que mirar si los descuentos y otros campos
// para los artículos hay que cambiarlos.
// if (FPedido.Detalles.RecordCount > 0) then
diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas
index e5691c6f..42e29075 100644
--- a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas
+++ b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas
@@ -113,6 +113,7 @@ type
function DarListaAnosPresupuestos: TStringList;
procedure FiltrarAno(APresupuesto: IBizPresupuestoCliente; ADynWhereDataTable: WideString; const Ano: String);
+ procedure FechaUltimaActualizacionToday (APresupuesto: IBizPresupuestoCliente);
end;
TPresupuestosClienteController = class(TControllerBase, IPresupuestosClienteController)
@@ -189,6 +190,7 @@ type
function DarListaAnosPresupuestos: TStringList;
procedure FiltrarAno(APresupuesto: IBizPresupuestoCliente; ADynWhereDataTable: WideString; const Ano: String);
+ procedure FechaUltimaActualizacionToday (APresupuesto: IBizPresupuestoCliente);
end;
implementation
@@ -782,9 +784,7 @@ begin
if not Assigned(APresupuesto) then
raise Exception.Create ('Presupuesto no asignado (EsModificable)');
- //Result := (APresupuesto.SITUACION = SITUACION_PRESUPUESTO_PENDIENTE);
-
- Result := True;
+ Result := (APresupuesto.SITUACION <> SITUACION_PRESUPUESTO_PLANTILLA);
end;
procedure TPresupuestosClienteController.RecalcularImportes(
@@ -870,6 +870,32 @@ begin
Result := ASeleccionados;
end;
+procedure TPresupuestosClienteController.FechaUltimaActualizacionToday(APresupuesto: IBizPresupuestoCliente);
+var
+ bEnEdicion : Boolean;
+begin
+ if not Assigned(APresupuesto) then
+ raise Exception.Create ('Contrato no asignado (CopiarDireccion)');
+
+ if APresupuesto.DataTable.Active then
+ APresupuesto.DataTable.Active := True;
+
+ bEnEdicion := (APresupuesto.DataTable.State in dsEditModes);
+ if not bEnEdicion then
+ APresupuesto.Edit;
+
+ ShowHourglassCursor;
+ APresupuesto.Edit;
+ try
+ APresupuesto.FECHA_ULT_PRESENTACION_CLIENTE := DateOf(Date);
+
+ if not bEnEdicion then
+ APresupuesto.Post;
+ finally
+ HideHourglassCursor;
+ end;
+end;
+
procedure TPresupuestosClienteController.FiltrarAno(APresupuesto: IBizPresupuestoCliente; ADynWhereDataTable: WideString;const Ano: String);
var
Condicion: TDAWhereExpression;
diff --git a/Source/Modulos/Presupuestos de cliente/Data/uDataModulePresupuestosCliente.dfm b/Source/Modulos/Presupuestos de cliente/Data/uDataModulePresupuestosCliente.dfm
index 1ef011d9..2a5e0192 100644
--- a/Source/Modulos/Presupuestos de cliente/Data/uDataModulePresupuestosCliente.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Data/uDataModulePresupuestosCliente.dfm
@@ -308,6 +308,10 @@ inherited DataModulePresupuestosCliente: TDataModulePresupuestosCliente
Size = 255
DisplayLabel = 'Otros nombres'
DictionaryEntry = 'PresupuestosCliente_LISTA_NOMBRES'
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
end>
Params = <>
StreamingOptions = [soDisableEventsWhileStreaming]
diff --git a/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteClient_Intf.pas b/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteClient_Intf.pas
index 3aac314d..d5a1c757 100644
--- a/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteClient_Intf.pas
+++ b/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteClient_Intf.pas
@@ -9,12 +9,12 @@ 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_Valores = '{B97FDFCF-3DC5-4FBD-A7CA-D8410AE6D1A2}';
- RID_Propiedades = '{EC5DE5CF-02CE-44C1-B361-0AAFF7B78ADC}';
- RID_ListaAnosPresupuestos = '{92B72FB6-5806-4F60-A078-A8BF296A4802}';
- RID_PresupuestosCliente = '{5F381B4C-4432-4E10-B498-A9D9093769AC}';
- RID_CapitulosPresupuesto = '{ABB90CA8-CFFC-4FA2-94D3-FE61B70DE842}';
- RID_PresupuestosCliente_Detalles = '{215F3858-E25C-4697-B36E-6E4862292811}';
+ RID_Valores = '{1C137EA2-79F9-4B4C-905B-31E2F3118006}';
+ RID_Propiedades = '{A64DFA30-E2C1-4317-B535-D2FEC9DD5FDC}';
+ RID_ListaAnosPresupuestos = '{AFF490F1-4DC0-4717-B4A1-1C66A8BE0B61}';
+ RID_PresupuestosCliente = '{CC490968-9BAD-41E4-81CB-A6EEBFE5F382}';
+ RID_CapitulosPresupuesto = '{2F44DC36-32F6-45B9-85D6-3D793A9F4AE2}';
+ RID_PresupuestosCliente_Detalles = '{C95D5B67-4EC8-4B81-A498-2104C61C977C}';
{ Data table names }
nme_Valores = 'Valores';
@@ -101,6 +101,7 @@ const
fld_PresupuestosClienteCALIDADES = 'CALIDADES';
fld_PresupuestosClienteREFERENCIA_CLIENTE = 'REFERENCIA_CLIENTE';
fld_PresupuestosClienteLISTA_NOMBRES = 'LISTA_NOMBRES';
+ fld_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE = 'FECHA_ULT_PRESENTACION_CLIENTE';
{ PresupuestosCliente field indexes }
idx_PresupuestosClienteID = 0;
@@ -147,6 +148,7 @@ const
idx_PresupuestosClienteCALIDADES = 41;
idx_PresupuestosClienteREFERENCIA_CLIENTE = 42;
idx_PresupuestosClienteLISTA_NOMBRES = 43;
+ idx_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE = 44;
{ CapitulosPresupuesto fields }
fld_CapitulosPresupuestoID = 'ID';
@@ -219,7 +221,7 @@ const
type
{ IValores }
IValores = interface(IDAStronglyTypedDataTable)
- ['{1F250F6D-3212-402A-9D52-3FFEF4F656F4}']
+ ['{D66A0BC2-1BB9-4699-8E7A-786E0205A42D}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -326,7 +328,7 @@ type
{ IPropiedades }
IPropiedades = interface(IDAStronglyTypedDataTable)
- ['{0986E005-7249-4D17-80E3-4D7E14429CCB}']
+ ['{5CA94698-11F6-4DAB-82E2-7BC712E7E4D8}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -373,7 +375,7 @@ type
{ IListaAnosPresupuestos }
IListaAnosPresupuestos = interface(IDAStronglyTypedDataTable)
- ['{F1CE9770-4F7E-47B9-9E11-CF91133C609D}']
+ ['{B695311B-59BC-4222-B586-5CE4E46426D5}']
{ Property getters and setters }
function GetANOValue: String;
procedure SetANOValue(const aValue: String);
@@ -408,7 +410,7 @@ type
{ IPresupuestosCliente }
IPresupuestosCliente = interface(IDAStronglyTypedDataTable)
- ['{632DB14E-4E7E-4FBA-BAB3-0E0A4F4358F1}']
+ ['{B2C60249-0034-42C6-ACB9-E6AF356420DD}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -581,6 +583,10 @@ type
procedure SetLISTA_NOMBRESValue(const aValue: String);
function GetLISTA_NOMBRESIsNull: Boolean;
procedure SetLISTA_NOMBRESIsNull(const aValue: Boolean);
+ function GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime);
+ function GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean);
{ Properties }
@@ -672,6 +678,8 @@ type
property REFERENCIA_CLIENTEIsNull: Boolean read GetREFERENCIA_CLIENTEIsNull write SetREFERENCIA_CLIENTEIsNull;
property LISTA_NOMBRES: String read GetLISTA_NOMBRESValue write SetLISTA_NOMBRESValue;
property LISTA_NOMBRESIsNull: Boolean read GetLISTA_NOMBRESIsNull write SetLISTA_NOMBRESIsNull;
+ property FECHA_ULT_PRESENTACION_CLIENTE: DateTime read GetFECHA_ULT_PRESENTACION_CLIENTEValue write SetFECHA_ULT_PRESENTACION_CLIENTEValue;
+ property FECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean read GetFECHA_ULT_PRESENTACION_CLIENTEIsNull write SetFECHA_ULT_PRESENTACION_CLIENTEIsNull;
end;
{ TPresupuestosClienteDataTableRules }
@@ -860,6 +868,10 @@ type
procedure SetLISTA_NOMBRESValue(const aValue: String); virtual;
function GetLISTA_NOMBRESIsNull: Boolean; virtual;
procedure SetLISTA_NOMBRESIsNull(const aValue: Boolean); virtual;
+ function GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime; virtual;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime); virtual;
+ function GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean; virtual;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean); virtual;
{ Properties }
property ID: Integer read GetIDValue write SetIDValue;
@@ -950,6 +962,8 @@ type
property REFERENCIA_CLIENTEIsNull: Boolean read GetREFERENCIA_CLIENTEIsNull write SetREFERENCIA_CLIENTEIsNull;
property LISTA_NOMBRES: String read GetLISTA_NOMBRESValue write SetLISTA_NOMBRESValue;
property LISTA_NOMBRESIsNull: Boolean read GetLISTA_NOMBRESIsNull write SetLISTA_NOMBRESIsNull;
+ property FECHA_ULT_PRESENTACION_CLIENTE: DateTime read GetFECHA_ULT_PRESENTACION_CLIENTEValue write SetFECHA_ULT_PRESENTACION_CLIENTEValue;
+ property FECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean read GetFECHA_ULT_PRESENTACION_CLIENTEIsNull write SetFECHA_ULT_PRESENTACION_CLIENTEIsNull;
public
constructor Create(aDataTable: TDADataTable); override;
@@ -959,7 +973,7 @@ type
{ ICapitulosPresupuesto }
ICapitulosPresupuesto = interface(IDAStronglyTypedDataTable)
- ['{AE4D0841-3455-4F06-BCC4-F5CB620D6E6F}']
+ ['{8DDBB981-6B18-428A-9F4E-FF4BE6283AD4}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -1114,7 +1128,7 @@ type
{ IPresupuestosCliente_Detalles }
IPresupuestosCliente_Detalles = interface(IDAStronglyTypedDataTable)
- ['{2DD0D791-E9A1-4501-8382-B10F87D19770}']
+ ['{D156932E-C94A-4BD6-A3CF-B3EF3166E76E}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -2575,6 +2589,27 @@ begin
DataTable.Fields[idx_PresupuestosClienteLISTA_NOMBRES].AsVariant := Null;
end;
+function TPresupuestosClienteDataTableRules.GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime;
+begin
+ result := DataTable.Fields[idx_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE].AsDateTime;
+end;
+
+procedure TPresupuestosClienteDataTableRules.SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime);
+begin
+ DataTable.Fields[idx_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE].AsDateTime := aValue;
+end;
+
+function TPresupuestosClienteDataTableRules.GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: boolean;
+begin
+ result := DataTable.Fields[idx_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE].IsNull;
+end;
+
+procedure TPresupuestosClienteDataTableRules.SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean);
+begin
+ if aValue then
+ DataTable.Fields[idx_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE].AsVariant := Null;
+end;
+
{ TCapitulosPresupuestoDataTableRules }
constructor TCapitulosPresupuestoDataTableRules.Create(aDataTable: TDADataTable);
diff --git a/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteServer_Intf.pas b/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteServer_Intf.pas
index bed82f90..23921c51 100644
--- a/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteServer_Intf.pas
+++ b/Source/Modulos/Presupuestos de cliente/Model/schPresupuestosClienteServer_Intf.pas
@@ -9,17 +9,17 @@ 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_ValoresDelta = '{8A602FA2-F0F7-48FF-9D5C-450DD49824A0}';
- RID_PropiedadesDelta = '{ED1FE07A-4D3A-42CA-B260-9C0F63280666}';
- RID_ListaAnosPresupuestosDelta = '{1C36675B-4471-4B14-BE62-E6B8B99DBBC9}';
- RID_PresupuestosClienteDelta = '{FB71F4AF-2DC1-41AF-BB17-E817422E50C9}';
- RID_CapitulosPresupuestoDelta = '{FE29C9E0-026F-4C67-8D59-3D9ECA83E94E}';
- RID_PresupuestosCliente_DetallesDelta = '{E0A8A450-F599-49A7-80FA-05390499C535}';
+ RID_ValoresDelta = '{F1287920-FCBE-4504-9B47-E59123D3BDA3}';
+ RID_PropiedadesDelta = '{EC69B037-7162-4B60-B280-DC0BE4C2C763}';
+ RID_ListaAnosPresupuestosDelta = '{1F8FFF3A-9750-4D9F-944E-3B5A4696FD1C}';
+ RID_PresupuestosClienteDelta = '{F7B626AE-70AA-4FEB-8E94-9B5D049DBF5B}';
+ RID_CapitulosPresupuestoDelta = '{CDA86224-B80C-4EE6-BA08-1FBE48C27FE6}';
+ RID_PresupuestosCliente_DetallesDelta = '{F7A55A7B-967E-410C-AA6D-C1D14E2D57DD}';
type
{ IValoresDelta }
IValoresDelta = interface(IValores)
- ['{8A602FA2-F0F7-48FF-9D5C-450DD49824A0}']
+ ['{F1287920-FCBE-4504-9B47-E59123D3BDA3}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_EMPRESAValue : Integer;
@@ -125,7 +125,7 @@ type
{ IPropiedadesDelta }
IPropiedadesDelta = interface(IPropiedades)
- ['{ED1FE07A-4D3A-42CA-B260-9C0F63280666}']
+ ['{EC69B037-7162-4B60-B280-DC0BE4C2C763}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldDESCRIPCIONValue : String;
@@ -171,7 +171,7 @@ type
{ IListaAnosPresupuestosDelta }
IListaAnosPresupuestosDelta = interface(IListaAnosPresupuestos)
- ['{1C36675B-4471-4B14-BE62-E6B8B99DBBC9}']
+ ['{1F8FFF3A-9750-4D9F-944E-3B5A4696FD1C}']
{ Property getters and setters }
function GetOldANOValue : String;
@@ -205,7 +205,7 @@ type
{ IPresupuestosClienteDelta }
IPresupuestosClienteDelta = interface(IPresupuestosCliente)
- ['{FB71F4AF-2DC1-41AF-BB17-E817422E50C9}']
+ ['{F7B626AE-70AA-4FEB-8E94-9B5D049DBF5B}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_EMPRESAValue : Integer;
@@ -251,6 +251,7 @@ type
function GetOldCALIDADESValue : IROStrings;
function GetOldREFERENCIA_CLIENTEValue : String;
function GetOldLISTA_NOMBRESValue : String;
+ function GetOldFECHA_ULT_PRESENTACION_CLIENTEValue : DateTime;
{ Properties }
property OldID : Integer read GetOldIDValue;
@@ -297,6 +298,7 @@ type
property OldCALIDADES : IROStrings read GetOldCALIDADESValue;
property OldREFERENCIA_CLIENTE : String read GetOldREFERENCIA_CLIENTEValue;
property OldLISTA_NOMBRES : String read GetOldLISTA_NOMBRESValue;
+ property OldFECHA_ULT_PRESENTACION_CLIENTE : DateTime read GetOldFECHA_ULT_PRESENTACION_CLIENTEValue;
end;
{ TPresupuestosClienteBusinessProcessorRules }
@@ -573,6 +575,12 @@ type
function GetOldLISTA_NOMBRESIsNull: Boolean; virtual;
procedure SetLISTA_NOMBRESValue(const aValue: String); virtual;
procedure SetLISTA_NOMBRESIsNull(const aValue: Boolean); virtual;
+ function GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime; virtual;
+ function GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean; virtual;
+ function GetOldFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime; virtual;
+ function GetOldFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean; virtual;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime); virtual;
+ procedure SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean); virtual;
{ Properties }
property ID : Integer read GetIDValue write SetIDValue;
@@ -751,6 +759,10 @@ type
property LISTA_NOMBRESIsNull : Boolean read GetLISTA_NOMBRESIsNull write SetLISTA_NOMBRESIsNull;
property OldLISTA_NOMBRES : String read GetOldLISTA_NOMBRESValue;
property OldLISTA_NOMBRESIsNull : Boolean read GetOldLISTA_NOMBRESIsNull;
+ property FECHA_ULT_PRESENTACION_CLIENTE : DateTime read GetFECHA_ULT_PRESENTACION_CLIENTEValue write SetFECHA_ULT_PRESENTACION_CLIENTEValue;
+ property FECHA_ULT_PRESENTACION_CLIENTEIsNull : Boolean read GetFECHA_ULT_PRESENTACION_CLIENTEIsNull write SetFECHA_ULT_PRESENTACION_CLIENTEIsNull;
+ property OldFECHA_ULT_PRESENTACION_CLIENTE : DateTime read GetOldFECHA_ULT_PRESENTACION_CLIENTEValue;
+ property OldFECHA_ULT_PRESENTACION_CLIENTEIsNull : Boolean read GetOldFECHA_ULT_PRESENTACION_CLIENTEIsNull;
public
constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
@@ -760,7 +772,7 @@ type
{ ICapitulosPresupuestoDelta }
ICapitulosPresupuestoDelta = interface(ICapitulosPresupuesto)
- ['{FE29C9E0-026F-4C67-8D59-3D9ECA83E94E}']
+ ['{CDA86224-B80C-4EE6-BA08-1FBE48C27FE6}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldPOSICIONValue : Integer;
@@ -914,7 +926,7 @@ type
{ IPresupuestosCliente_DetallesDelta }
IPresupuestosCliente_DetallesDelta = interface(IPresupuestosCliente_Detalles)
- ['{E0A8A450-F599-49A7-80FA-05390499C535}']
+ ['{F7A55A7B-967E-410C-AA6D-C1D14E2D57DD}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_PRESUPUESTOValue : Integer;
@@ -2920,6 +2932,37 @@ begin
BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosClienteLISTA_NOMBRES] := Null;
end;
+function TPresupuestosClienteBusinessProcessorRules.GetFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime;
+begin
+ result := BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE];
+end;
+
+function TPresupuestosClienteBusinessProcessorRules.GetFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean;
+begin
+ result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE]);
+end;
+
+function TPresupuestosClienteBusinessProcessorRules.GetOldFECHA_ULT_PRESENTACION_CLIENTEValue: DateTime;
+begin
+ result := BusinessProcessor.CurrentChange.OldValueByName[fld_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE];
+end;
+
+function TPresupuestosClienteBusinessProcessorRules.GetOldFECHA_ULT_PRESENTACION_CLIENTEIsNull: Boolean;
+begin
+ result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE]);
+end;
+
+procedure TPresupuestosClienteBusinessProcessorRules.SetFECHA_ULT_PRESENTACION_CLIENTEValue(const aValue: DateTime);
+begin
+ BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE] := aValue;
+end;
+
+procedure TPresupuestosClienteBusinessProcessorRules.SetFECHA_ULT_PRESENTACION_CLIENTEIsNull(const aValue: Boolean);
+begin
+ if aValue then
+ BusinessProcessor.CurrentChange.NewValueByName[fld_PresupuestosClienteFECHA_ULT_PRESENTACION_CLIENTE] := Null;
+end;
+
{ TCapitulosPresupuestoBusinessProcessorRules }
constructor TCapitulosPresupuestoBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
diff --git a/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosCliente.pas b/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosCliente.pas
index b6225617..75896f4d 100644
--- a/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosCliente.pas
+++ b/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosCliente.pas
@@ -13,6 +13,7 @@ const
SITUACION_PRESUPUESTO_PENDIENTE = 'PENDIENTE';
SITUACION_PRESUPUESTO_ACEPTADO = 'ACEPTADO';
SITUACION_PRESUPUESTO_ANULADO = 'ANULADO';
+ SITUACION_PRESUPUESTO_PLANTILLA = 'PLANTILLA';
type
@@ -267,6 +268,7 @@ begin
FECHA_PRESUPUESTO := DateOf(Date);
FECHA_VIGENCIA := IncMonth(Date, AppFactuGES.EmpresaActiva.VALIDEZ_PRESUPUESTOS);
+ FECHA_ULT_PRESENTACION_CLIENTE := DateOf(Date);
NO_VALORADO := 0;
INCIDENCIAS_ACTIVAS := 0;
@@ -340,12 +342,15 @@ begin
if FCliente.ID_FORMA_PAGO > 0 then
ID_FORMA_PAGO := FCliente.ID_FORMA_PAGO;
- if FCliente.ID_TIENDA > 0 then
+//OJO en empresa cristina no existen tiendas solo es la tienda cristina por lo que no se cambia asignación si estamos en esa empresa, falla si de cogen un cliente de acana los contadores
+ if (AppFactuGES.EmpresaActiva.ID <> CTE_EMPRESA_CRISTINA)
+ and (FCliente.ID_TIENDA > 0) then
begin
ID_TIENDA := FCliente.ID_TIENDA;
TIENDA := FCliente.TIENDA;
end;
-// En acana la ficha de cliente no tiene descuento aplicado por defecto
+
+// En acana la ficha de cliente no tiene descuento aplicado por defecto
// DESCUENTO := FCliente.DESCUENTO;
DataTable.Post; //Muy importante ya que es necesario hacer un post de la cabecera antes de añadir detalles
diff --git a/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosClienteServer.pas b/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosClienteServer.pas
index cbf9ca77..f3b3bbd7 100644
--- a/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosClienteServer.pas
+++ b/Source/Modulos/Presupuestos de cliente/Model/uBizPresupuestosClienteServer.pas
@@ -84,7 +84,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, -1); //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.DarNuevaReferencia(ACodigoReferencia, ID_EMPRESA, ID_TIENDA); //Referencia diferente según tienda
end;
function TBizPresupuestosClienteServer.IncrementarReferencia: Boolean;
@@ -99,7 +100,8 @@ begin
GetClassFactory('srvReferencias').CreateInstance(AClientID, Intf);
AReferenciasService := Intf as IsrvReferencias;
- Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, -1) //Referencia común a todas las tiendas de la empresa
+// Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, -1) //Referencia común a todas las tiendas de la empresa
+ Result := AReferenciasService.IncrementarValorReferencia(ACodigoReferencia, Self.REFERENCIA, ID_EMPRESA, ID_TIENDA) //Referencia diferente según tienda
end;
initialization
diff --git a/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj b/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
index ddf8b33e..ae5c362a 100644
--- a/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
+++ b/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
@@ -17,6 +17,7 @@
+
@@ -261,14 +262,23 @@
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
\ No newline at end of file
diff --git a/Source/Modulos/Presupuestos de cliente/Reports/uRptPresupuestosCliente_Server.dfm b/Source/Modulos/Presupuestos de cliente/Reports/uRptPresupuestosCliente_Server.dfm
index 4470f539..d07e0976 100644
--- a/Source/Modulos/Presupuestos de cliente/Reports/uRptPresupuestosCliente_Server.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Reports/uRptPresupuestosCliente_Server.dfm
@@ -229,7 +229,8 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
'TACTOS_DIRECCIONES.MOVIL, CONTACTOS.MOVIL_1) AS MOVIL,'#10' V_PRE' +
'SUPUESTOS_CLIENTE.PERSONA_CONTACTO,'#10' V_PRESUPUESTOS_CLIENTE.V' +
'ENDEDOR, V_PRESUPUESTOS_CLIENTE.NO_VALORADO,'#10' V_PRESUPUESTOS_' +
- 'CLIENTE.ID_TIENDA'#10'FROM'#10' V_PRESUPUESTOS_CLIENTE'#10' INNER JOIN' +
+ 'CLIENTE.ID_TIENDA,'#10' V_PRESUPUESTOS_CLIENTE.FECHA_ULT_PRESENTA' +
+ 'CION_CLIENTE'#10' '#10'FROM'#10' V_PRESUPUESTOS_CLIENTE'#10' INNER JOIN' +
' CONTACTOS ON (CONTACTOS.ID = V_PRESUPUESTOS_CLIENTE.ID_CLIENTE)' +
#10' LEFT OUTER JOIN CONTACTOS_DIRECCIONES ON (CONTACTOS_DIRECCI' +
'ONES.ID = V_PRESUPUESTOS_CLIENTE.ID_DIRECCION)'#10'WHERE'#10' V_PRESU' +
@@ -371,6 +372,10 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
item
DatasetField = 'ID_TIENDA'
TableField = 'ID_TIENDA'
+ end
+ item
+ DatasetField = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ TableField = 'FECHA_ULT_PRESENTACION_CLIENTE'
end>
end>
Name = 'Informe_Cabecera'
@@ -524,6 +529,10 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
item
Name = 'ID_TIENDA'
DataType = datInteger
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
end>
ReadOnly = True
end
@@ -917,7 +926,7 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
PrintOptions.Printer = 'Por defecto'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 39065.872423495400000000
- ReportOptions.LastChange = 44396.827522094910000000
+ ReportOptions.LastChange = 45462.732395833340000000
ScriptLanguage = 'PascalScript'
ShowProgress = False
StoreInDFM = False
@@ -1094,6 +1103,10 @@ object RptPresupuestosCliente: TRptPresupuestosCliente
item
Name = 'ID_TIENDA'
DataType = datInteger
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
end>
Params = <
item
diff --git a/Source/Modulos/Presupuestos de cliente/Servidor/srvPresupuestosCliente_Impl.dfm b/Source/Modulos/Presupuestos de cliente/Servidor/srvPresupuestosCliente_Impl.dfm
index 3f9698a5..e30a94be 100644
--- a/Source/Modulos/Presupuestos de cliente/Servidor/srvPresupuestosCliente_Impl.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Servidor/srvPresupuestosCliente_Impl.dfm
@@ -342,6 +342,10 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
item
DatasetField = 'LISTA_NOMBRES'
TableField = 'LISTA_NOMBRES'
+ end
+ item
+ DatasetField = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ TableField = 'FECHA_ULT_PRESENTACION_CLIENTE'
end>
end>
Name = 'PresupuestosCliente'
@@ -583,6 +587,10 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
DataType = datString
Size = 255
DictionaryEntry = 'PresupuestosCliente_LISTA_NOMBRES'
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
end>
end
item
@@ -1101,6 +1109,11 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
Name = 'ID_EMPRESA'
DataType = datInteger
Value = ''
+ end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
+ Value = ''
end>
Statements = <
item
@@ -1117,16 +1130,17 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
'_IVA,'#10' RE, IMPORTE_RE, RECARGO_EQUIVALENCIA, IMPORTE_TOTAL, ' +
'ID_FORMA_PAGO, ID_TIENDA, ID_VENDEDOR,'#10' ID_CONTRATO, NO_VALO' +
'RADO, TIPO_PRESUPUESTO, CALIDADES, REFERENCIA_CLIENTE,'#10' ID_E' +
- 'MPRESA)'#10' VALUES'#10' (:ID,'#10' :FECHA_PRESUPUESTO, :FECHA_VIGEN' +
- 'CIA, :FECHA_DECISION, :REFERENCIA,'#10' :SITUACION, :ID_CLIENTE,' +
- ' :ID_DIRECCION, :PERSONA_CONTACTO,'#10' :FORMA_PAGO, :PLAZO_ENTR' +
- 'EGA, :OBSERVACIONES, :INCIDENCIAS,'#10' :INCIDENCIAS_ACTIVAS, CU' +
- 'RRENT_TIMESTAMP, :USUARIO, :IMPORTE_NETO, :IMPORTE_PORTE,'#10' :' +
- 'DESCUENTO, :IMPORTE_DESCUENTO, :BASE_IMPONIBLE, :ID_TIPO_IVA, :I' +
- 'VA, :IMPORTE_IVA,'#10' :RE, :IMPORTE_RE, :RECARGO_EQUIVALENCIA, ' +
- ':IMPORTE_TOTAL, :ID_FORMA_PAGO, :ID_TIENDA, :ID_VENDEDOR,'#10' :' +
- 'ID_CONTRATO, :NO_VALORADO, :TIPO_PRESUPUESTO, :CALIDADES, :REFER' +
- 'ENCIA_CLIENTE,'#10' :ID_EMPRESA)'#10' '#10#10#10#10#10
+ 'MPRESA, FECHA_ULT_PRESENTACION_CLIENTE)'#10' VALUES'#10' (:ID,'#10' ' +
+ ':FECHA_PRESUPUESTO, :FECHA_VIGENCIA, :FECHA_DECISION, :REFERENCI' +
+ 'A,'#10' :SITUACION, :ID_CLIENTE, :ID_DIRECCION, :PERSONA_CONTACT' +
+ 'O,'#10' :FORMA_PAGO, :PLAZO_ENTREGA, :OBSERVACIONES, :INCIDENCIA' +
+ 'S,'#10' :INCIDENCIAS_ACTIVAS, CURRENT_TIMESTAMP, :USUARIO, :IMPO' +
+ 'RTE_NETO, :IMPORTE_PORTE,'#10' :DESCUENTO, :IMPORTE_DESCUENTO, :' +
+ 'BASE_IMPONIBLE, :ID_TIPO_IVA, :IVA, :IMPORTE_IVA,'#10' :RE, :IMP' +
+ 'ORTE_RE, :RECARGO_EQUIVALENCIA, :IMPORTE_TOTAL, :ID_FORMA_PAGO, ' +
+ ':ID_TIENDA, :ID_VENDEDOR,'#10' :ID_CONTRATO, :NO_VALORADO, :TIPO' +
+ '_PRESUPUESTO, :CALIDADES, :REFERENCIA_CLIENTE,'#10' :ID_EMPRESA,' +
+ ' :FECHA_ULT_PRESENTACION_CLIENTE)'#10' '#10#10#10#10#10
StatementType = stSQL
ColumnMappings = <>
end>
@@ -1340,6 +1354,11 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
DataType = datInteger
Value = ''
end
+ item
+ Name = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataType = datDateTime
+ Value = ''
+ end
item
Name = 'OLD_ID'
Value = ''
@@ -1370,7 +1389,8 @@ object srvPresupuestosCliente: TsrvPresupuestosCliente
'ID_CONTRATO = :ID_CONTRATO,'#10' NO_VALORADO = :NO_VALORADO,'#10' ' +
'TIPO_PRESUPUESTO = :TIPO_PRESUPUESTO,'#10' CALIDADES = :CALIDADES' +
','#10' REFERENCIA_CLIENTE = :REFERENCIA_CLIENTE,'#10' ID_EMPRESA =' +
- ' :ID_EMPRESA'#10' WHERE'#10' (ID = :OLD_ID)'#10#10
+ ' :ID_EMPRESA,'#10' FECHA_ULT_PRESENTACION_CLIENTE = :FECHA_ULT_PR' +
+ 'ESENTACION_CLIENTE'#10' WHERE'#10' (ID = :OLD_ID)'#10#10
StatementType = stSQL
ColumnMappings = <>
end>
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm
index 66c2cd5d..2939e4b2 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm
@@ -202,121 +202,48 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Height = 414
ExplicitWidth = 834
ExplicitHeight = 414
- inherited edtFechaPresupuesto: TcxDBDateEdit
- ExplicitWidth = 187
- Width = 187
- end
inherited memObservaciones: TcxDBMemo
- Left = 396
- ExplicitLeft = 396
- ExplicitWidth = 793
- Width = 793
- end
- inherited eReferencia: TcxDBTextEdit
- ExplicitWidth = 122
- Width = 122
- end
- inherited cbFormaPago: TcxDBLookupComboBox
- ExplicitWidth = 122
- Width = 122
+ Left = 403
+ ExplicitLeft = 403
end
inherited bFormasPago: TButton
- Left = 234
- ExplicitLeft = 234
+ Left = 241
+ ExplicitLeft = 241
end
inherited edtFechaDecision: TcxDBDateEdit
- Left = 276
- ExplicitLeft = 276
- ExplicitWidth = 260
- Width = 260
- end
- inherited edtFechaVigencia: TcxDBDateEdit
- ExplicitWidth = 260
- Width = 260
- end
- inherited cbSituacion: TcxDBImageComboBox
- ExplicitWidth = 260
- Width = 260
+ Left = 287
+ ExplicitLeft = 287
end
inherited frViewDatosYSeleccionClientePresupuesto1: TfrViewDatosYSeleccionClientePresupuesto
- Left = 396
- Width = 320
- ExplicitLeft = 396
- ExplicitWidth = 320
+ Left = 403
+ ExplicitLeft = 403
inherited dxLayoutControl1: TdxLayoutControl
- Width = 320
- inherited edtlNombre: TcxDBTextEdit
- ExplicitWidth = 224
- Width = 224
- end
+ ExplicitWidth = 320
inherited edtNIFCIF: TcxDBTextEdit
- Left = 286
- ExplicitLeft = 286
+ Left = 279
+ ExplicitLeft = 279
end
inherited Button3: TBitBtn
- Left = 197
- ExplicitLeft = 197
- end
- inherited edtPersonaContacto: TcxDBTextEdit
- ExplicitWidth = 283
- Width = 283
- end
- inherited edtDireccion: TcxMemo
- ExplicitWidth = 121
- Width = 121
+ Left = 190
+ ExplicitLeft = 190
end
inherited Button4: TButton
- Left = 366
- ExplicitLeft = 366
+ Left = 359
+ ExplicitLeft = 359
end
inherited Button5: TButton
- Left = 366
- ExplicitLeft = 366
- end
- inherited edtTelefonos: TcxTextEdit
- ExplicitWidth = 363
- Width = 363
+ Left = 359
+ ExplicitLeft = 359
end
end
end
- inherited memFormaPago: TcxDBMemo
- ExplicitWidth = 475
- ExplicitHeight = 44
- Height = 44
- Width = 475
- end
inherited memPlazoEntrega: TcxDBMemo
- Top = 380
- ExplicitTop = 380
- ExplicitWidth = 396
- ExplicitHeight = 100
- Height = 100
- Width = 396
- end
- inherited cbVendedor: TcxDBLookupComboBox
- ExplicitWidth = 27
- Width = 27
+ Top = 407
+ ExplicitTop = 407
end
inherited cbTipoPresupuesto: TcxDBComboBox
- Left = 270
- ExplicitLeft = 270
- ExplicitWidth = 186
- Width = 186
- end
- inherited edtRef_cliente: TcxDBTextEdit
- ExplicitWidth = 204
- Width = 204
- end
- inherited frViewTienda1: TfrViewTienda
- Width = 451
- ExplicitWidth = 451
- inherited dxLayoutControl1: TdxLayoutControl
- Width = 451
- inherited cbTienda: TcxComboBox
- ExplicitWidth = 390
- Width = 390
- end
- end
+ Left = 282
+ ExplicitLeft = 282
end
end
end
@@ -344,11 +271,33 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
ExplicitHeight = 414
inherited ToolBar1: TToolBar
Width = 834
+ Height = 24
ExplicitWidth = 834
- inherited FontName: TJvFontComboBox
- ExplicitLeft = 368
+ inherited ToolButton14: TToolButton [1]
+ Left = 109
+ Top = 0
+ Enabled = True
+ ExplicitLeft = 109
ExplicitTop = 0
end
+ inherited ToolButton2: TToolButton [2]
+ Left = 143
+ end
+ inherited FontName: TJvFontComboBox [3]
+ Left = 257
+ Top = 0
+ ExplicitLeft = 257
+ ExplicitTop = 0
+ end
+ inherited ToolButton3: TToolButton [4]
+ Left = 402
+ ExplicitLeft = 402
+ end
+ inherited ToolButton4: TToolButton [5]
+ Left = 457
+ Wrap = False
+ ExplicitLeft = 457
+ end
inherited FontSize: TEdit
Left = 513
Top = 0
@@ -416,14 +365,12 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Top = 50
Width = 834
Height = 364
- ExplicitTop = 50
ExplicitWidth = 834
ExplicitHeight = 364
end
inherited TBXDock1: TTBXDock
Top = 24
Width = 834
- ExplicitTop = 24
ExplicitWidth = 834
inherited TBXToolbar1: TTBXToolbar
ExplicitWidth = 665
@@ -594,18 +541,16 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
LookAndFeel = dxLayoutOfficeLookAndFeel1
ExplicitWidth = 848
inherited Bevel3: TBevel
- Left = 352
+ Left = 310
Top = 57
- Height = 122
- ExplicitLeft = 352
+ ExplicitLeft = 310
ExplicitTop = 57
- ExplicitHeight = 122
end
inherited Bevel4: TBevel
- Left = 464
+ Left = 422
Top = 88
Width = 342
- ExplicitLeft = 464
+ ExplicitLeft = 422
ExplicitTop = 88
ExplicitWidth = 342
end
@@ -613,26 +558,20 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Top = 84
Style.IsFontAssigned = True
ExplicitTop = 84
- ExplicitWidth = 93
- Width = 93
end
inherited ImporteIVA: TcxDBCurrencyEdit
- Left = 535
+ Left = 493
Top = 108
Style.IsFontAssigned = True
- ExplicitLeft = 535
+ ExplicitLeft = 493
ExplicitTop = 108
- ExplicitWidth = 137
- Width = 137
end
inherited ImporteTotal: TcxDBCurrencyEdit
- Left = 465
+ Left = 423
Top = 162
Style.IsFontAssigned = True
- ExplicitLeft = 465
+ ExplicitLeft = 423
ExplicitTop = 162
- ExplicitWidth = 137
- Width = 137
end
inherited edtDescuento: TcxDBSpinEdit
Top = 84
@@ -640,69 +579,57 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
ExplicitTop = 84
end
inherited edtIVA: TcxDBSpinEdit
- Left = 464
+ Left = 422
Top = 108
Style.IsFontAssigned = True
- ExplicitLeft = 464
+ ExplicitLeft = 422
ExplicitTop = 108
end
inherited ImporteBase: TcxDBCurrencyEdit
- Left = 464
+ Left = 422
Top = 57
Style.IsFontAssigned = True
- ExplicitLeft = 464
+ ExplicitLeft = 422
ExplicitTop = 57
- ExplicitWidth = 92
- Width = 92
end
inherited edtRE: TcxDBSpinEdit
- Left = 464
+ Left = 422
Top = 135
Style.IsFontAssigned = True
- ExplicitLeft = 464
+ ExplicitLeft = 422
ExplicitTop = 135
end
inherited ImporteRE: TcxDBCurrencyEdit
- Left = 535
+ Left = 493
Top = 135
Style.IsFontAssigned = True
- ExplicitLeft = 535
+ ExplicitLeft = 493
ExplicitTop = 135
- ExplicitWidth = 56
- Width = 56
end
inherited eImporteNeto: TcxDBCurrencyEdit
Top = 57
Style.IsFontAssigned = True
ExplicitTop = 57
- ExplicitWidth = 147
- Width = 147
end
inherited ePorte: TcxDBCurrencyEdit
Top = 111
Style.IsFontAssigned = True
ExplicitTop = 111
- ExplicitWidth = 147
- Width = 147
end
inherited eIVA: TcxDBLookupComboBox
Top = 138
ExplicitTop = 138
- ExplicitWidth = 81
- Width = 81
end
inherited bTiposIVA: TButton
- Left = 204
+ Left = 162
Top = 138
OnClick = frViewTotales1bTiposIVAClick
- ExplicitLeft = 204
+ ExplicitLeft = 162
ExplicitTop = 138
end
inherited cbRecargoEquivalencia: TcxDBCheckBox
Top = 165
ExplicitTop = 165
- ExplicitWidth = 219
- Width = 219
end
inherited cbValorado: TcxDBCheckBox
Left = 11
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas
index 07d7c107..5ac7b244 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas
+++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas
@@ -281,6 +281,12 @@ begin
frViewDetallesPresupuestoCliente1.BeginUpdate;
try
bEsNuevo := FPresupuesto.EsNuevo;
+
+ if not bEsNuevo then
+ if (FPresupuesto.FECHA_ULT_PRESENTACION_CLIENTE < Date) then
+ if ShowConfirmMessage('Cambio fecha actualización', '¿Desea cambiar la fecha de última actualización del presupuesto por la de hoy?') = IDYES then
+ Controller.FechaUltimaActualizacionToday(FPresupuesto);
+
//GESTION_DOCUMENTOS
if FController.Guardar(FPresupuesto) then
frViewDocumentosPresupuestoCliente1.actActualizarServidor.Execute;
@@ -430,7 +436,6 @@ begin
FViewPresupuesto.Presupuesto := FPresupuesto;
frViewDetallesPresupuestoCliente1.Detalles := FPresupuesto.Detalles;
frViewDetallesPresupuestoCliente1.Presupuesto := FPresupuesto; //Para poder sacar los descuento del articulos segun el cliente seleccionado
-
finally
ViewPresupuesto.ViewClientePresupuesto.OnClienteChanged := OnClienteChanged;
end;
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm
index 78d826c6..ab1af750 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.dfm
@@ -2,7 +2,7 @@ inherited fEditorPresupuestosCliente: TfEditorPresupuestosCliente
Caption = 'Lista de presupuestos de cliente'
ClientWidth = 805
ExplicitWidth = 813
- ExplicitHeight = 478
+ ExplicitHeight = 240
PixelsPerInch = 96
TextHeight = 13
inherited JvNavPanelHeader: TJvNavPanelHeader
@@ -125,7 +125,7 @@ inherited fEditorPresupuestosCliente: TfEditorPresupuestosCliente
Width = 805
ExplicitWidth = 805
inherited tbxMain: TTBXToolbar
- ExplicitWidth = 751
+ ExplicitWidth = 805
object TBXSubmenuItem3: TTBXSubmenuItem [0]
Caption = 'Nuevo'
DisplayMode = nbdmImageAndText
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.pas
index fe326de9..09f35daf 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.pas
+++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestosCliente.pas
@@ -285,6 +285,10 @@ end;
procedure TfEditorPresupuestosCliente.bArmarioClick(Sender: TObject);
begin
inherited;
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Presupuestos, teArmario) then
FController.Ver(Presupuestos);
end;
@@ -292,6 +296,10 @@ end;
procedure TfEditorPresupuestosCliente.bBanoClick(Sender: TObject);
begin
inherited;
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Presupuestos, teBano) then
FController.Ver(Presupuestos);
end;
@@ -299,6 +307,10 @@ end;
procedure TfEditorPresupuestosCliente.bCocinaClick(Sender: TObject);
begin
inherited;
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Presupuestos, teCocina) then
FController.Ver(Presupuestos);
end;
@@ -306,6 +318,10 @@ end;
procedure TfEditorPresupuestosCliente.bElectrodomesticoClick(Sender: TObject);
begin
inherited;
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Presupuestos, teElectrodomestico) then
FController.Ver(Presupuestos);
end;
@@ -313,6 +329,10 @@ end;
procedure TfEditorPresupuestosCliente.bObraClick(Sender: TObject);
begin
inherited;
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Presupuestos, teObra) then
FController.Ver(Presupuestos);
end;
@@ -320,6 +340,10 @@ end;
procedure TfEditorPresupuestosCliente.bVariosClick(Sender: TObject);
begin
inherited;
+ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+ if (ShowConfirmMessage('Atención CIF - CRISTINA', 'No hagas el presupuesto en esta empresa si no va a ser facturado con el CIF de Cristina Puerta Estudio, ¿Desea continuar con el presupuesto?') = IDNO) then
+ exit;
+
if FController.Anadir(Presupuestos, teVarios) then
FController.Ver(Presupuestos);
end;
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestoCliente.dfm
index 461f731d..bbbd74ea 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestoCliente.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestoCliente.dfm
@@ -19,7 +19,7 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
895
555)
object edtFechaPresupuesto: TcxDBDateEdit
- Left = 103
+ Left = 131
Top = 82
Anchors = [akLeft, akTop, akRight]
DataBinding.DataField = 'FECHA_PRESUPUESTO'
@@ -42,7 +42,7 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
Width = 187
end
object memObservaciones: TcxDBMemo
- Left = 432
+ Left = 440
Top = 288
Anchors = [akLeft, akTop, akRight, akBottom]
DataBinding.DataField = 'OBSERVACIONES'
@@ -59,12 +59,12 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 14
+ TabOrder = 15
Height = 245
Width = 793
end
object eReferencia: TcxDBTextEdit
- Left = 103
+ Left = 131
Top = 28
Anchors = [akLeft, akTop, akRight]
DataBinding.DataField = 'REFERENCIA'
@@ -89,8 +89,8 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
Width = 122
end
object cbFormaPago: TcxDBLookupComboBox
- Left = 103
- Top = 163
+ Left = 131
+ Top = 190
DataBinding.DataField = 'ID_FORMA_PAGO'
DataBinding.DataSource = DADataSource
Properties.KeyFieldNames = 'ID'
@@ -115,21 +115,21 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 7
+ TabOrder = 8
Width = 122
end
object bFormasPago: TButton
- Left = 270
- Top = 163
+ Left = 278
+ Top = 190
Width = 132
Height = 21
Caption = 'Ver las formas de pago...'
- TabOrder = 8
+ TabOrder = 9
OnClick = bFormasPagoClick
end
object edtFechaDecision: TcxDBDateEdit
- Left = 295
- Top = 109
+ Left = 306
+ Top = 136
Anchors = [akLeft, akTop, akRight]
DataBinding.DataField = 'FECHA_DECISION'
DataBinding.DataSource = DADataSource
@@ -146,12 +146,12 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 5
+ TabOrder = 6
Width = 260
end
object edtFechaVigencia: TcxDBDateEdit
- Left = 103
- Top = 109
+ Left = 131
+ Top = 136
Anchors = [akLeft, akTop, akRight]
DataBinding.DataField = 'FECHA_VIGENCIA'
DataBinding.DataSource = DADataSource
@@ -172,12 +172,12 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 4
+ TabOrder = 5
Width = 260
end
object cbSituacion: TcxDBImageComboBox
- Left = 103
- Top = 136
+ Left = 131
+ Top = 163
DataBinding.DataField = 'SITUACION'
DataBinding.DataSource = DADataSource
Properties.ImmediatePost = True
@@ -194,6 +194,10 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
item
Description = 'ANULADO'
Value = 'ANULADO'
+ end
+ item
+ Description = 'PLANTILLA'
+ Value = 'PLANTILLA'
end>
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
@@ -203,11 +207,11 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 6
+ TabOrder = 7
Width = 260
end
inline frViewDatosYSeleccionClientePresupuesto1: TfrViewDatosYSeleccionClientePresupuesto
- Left = 432
+ Left = 440
Top = 28
Width = 320
Height = 224
@@ -217,9 +221,9 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
- TabOrder = 13
+ TabOrder = 14
ReadOnly = False
- ExplicitLeft = 432
+ ExplicitLeft = 440
ExplicitTop = 28
ExplicitWidth = 320
ExplicitHeight = 224
@@ -233,12 +237,12 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
Width = 224
end
inherited edtNIFCIF: TcxDBTextEdit
- Left = 328
- ExplicitLeft = 328
+ Left = 320
+ ExplicitLeft = 320
end
inherited Button3: TBitBtn
- Left = 239
- ExplicitLeft = 239
+ Left = 231
+ ExplicitLeft = 231
end
inherited edtPersonaContacto: TcxDBTextEdit
ExplicitWidth = 283
@@ -249,12 +253,12 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
Width = 121
end
inherited Button4: TButton
- Left = 408
- ExplicitLeft = 408
+ Left = 400
+ ExplicitLeft = 400
end
inherited Button5: TButton
- Left = 408
- ExplicitLeft = 408
+ Left = 400
+ ExplicitLeft = 400
end
inherited edtTelefonos: TcxTextEdit
ExplicitWidth = 363
@@ -264,7 +268,7 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
end
object memFormaPago: TcxDBMemo
Left = 22
- Top = 324
+ Top = 351
Anchors = [akLeft, akTop, akRight, akBottom]
DataBinding.DataField = 'FORMA_PAGO'
DataBinding.DataSource = DADataSource
@@ -280,13 +284,13 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 11
+ TabOrder = 12
Height = 44
Width = 475
end
object memPlazoEntrega: TcxDBMemo
Left = 22
- Top = 415
+ Top = 432
Anchors = [akLeft, akTop, akRight, akBottom]
DataBinding.DataField = 'PLAZO_ENTREGA'
DataBinding.DataSource = DADataSource
@@ -302,13 +306,13 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 12
+ TabOrder = 13
Height = 100
Width = 396
end
object cbVendedor: TcxDBLookupComboBox
- Left = 103
- Top = 190
+ Left = 131
+ Top = 217
DataBinding.DataField = 'ID_VENDEDOR'
DataBinding.DataSource = DADataSource
Properties.KeyFieldNames = 'ID'
@@ -333,11 +337,11 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
- TabOrder = 9
+ TabOrder = 10
Width = 27
end
object cbTipoPresupuesto: TcxDBComboBox
- Left = 289
+ Left = 302
Top = 82
DataBinding.DataField = 'TIPO_PRESUPUESTO'
DataBinding.DataSource = DADataSource
@@ -357,7 +361,7 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
Width = 186
end
object edtRef_cliente: TcxDBTextEdit
- Left = 103
+ Left = 131
Top = 55
Anchors = [akLeft, akTop, akRight]
AutoSize = False
@@ -380,13 +384,36 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
end
inline frViewTienda1: TfrViewTienda
Left = 22
- Top = 247
+ Top = 274
Width = 451
Height = 41
- TabOrder = 10
+ TabOrder = 11
ReadOnly = False
ExplicitLeft = 22
- ExplicitTop = 247
+ ExplicitTop = 274
+ end
+ object edtFechaUltRevision: TcxDBDateEdit
+ Left = 131
+ Top = 109
+ Anchors = [akLeft, akTop, akRight]
+ DataBinding.DataField = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ DataBinding.DataSource = DADataSource
+ Properties.DateButtons = [btnToday]
+ Properties.ImmediatePost = True
+ Style.BorderColor = clWindowFrame
+ Style.BorderStyle = ebs3D
+ Style.Color = clInfoBk
+ Style.HotTrack = False
+ Style.LookAndFeel.NativeStyle = True
+ Style.Shadow = False
+ Style.ButtonStyle = bts3D
+ Style.ButtonTransparency = ebtNone
+ Style.PopupBorderStyle = epbsFrame3D
+ StyleDisabled.LookAndFeel.NativeStyle = True
+ StyleFocused.LookAndFeel.NativeStyle = True
+ StyleHot.LookAndFeel.NativeStyle = True
+ TabOrder = 4
+ Width = 111
end
object dxLayoutControl1Group_Root: TdxLayoutGroup
ShowCaption = False
@@ -422,20 +449,30 @@ inherited frViewPresupuestoCliente: TfrViewPresupuestoCliente
object dxLayoutControl1Group12: TdxLayoutGroup
ShowCaption = False
Hidden = True
- LayoutDirection = ldHorizontal
ShowBorder = False
- object dxLayoutControl1Item2: TdxLayoutItem
- AutoAligns = [aaVertical]
- AlignHorz = ahClient
- Caption = 'Fecha presup.:'
- Control = edtFechaPresupuesto
- ControlOptions.ShowBorder = False
+ object dxLayoutControl1Group14: TdxLayoutGroup
+ ShowCaption = False
+ Hidden = True
+ LayoutDirection = ldHorizontal
+ ShowBorder = False
+ object dxLayoutControl1Item2: TdxLayoutItem
+ AutoAligns = [aaVertical]
+ AlignHorz = ahClient
+ Caption = 'Fecha presup.:'
+ Control = edtFechaPresupuesto
+ ControlOptions.ShowBorder = False
+ end
+ object dxLayoutControl1Item12: TdxLayoutItem
+ AutoAligns = [aaVertical]
+ AlignHorz = ahClient
+ Caption = 'Tipo presup.:'
+ Control = cbTipoPresupuesto
+ ControlOptions.ShowBorder = False
+ end
end
- object dxLayoutControl1Item12: TdxLayoutItem
- AutoAligns = [aaVertical]
- AlignHorz = ahClient
- Caption = 'Tipo presup.:'
- Control = cbTipoPresupuesto
+ object dxLayoutControl1Item16: TdxLayoutItem
+ Caption = 'Fecha '#250'ltima revisi'#243'n:'
+ Control = edtFechaUltRevision
ControlOptions.ShowBorder = False
end
end
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestoCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestoCliente.pas
index a35f3210..a50f55e6 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestoCliente.pas
+++ b/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestoCliente.pas
@@ -75,6 +75,9 @@ type
dxLayoutControl1Item14: TdxLayoutItem;
frViewTienda1: TfrViewTienda;
dxLayoutControl1Group13: TdxLayoutGroup;
+ dxLayoutControl1Item16: TdxLayoutItem;
+ edtFechaUltRevision: TcxDBDateEdit;
+ dxLayoutControl1Group14: TdxLayoutGroup;
procedure CustomViewCreate(Sender: TObject);
procedure CustomViewDestroy(Sender: TObject);
procedure bFormasPagoClick(Sender: TObject);
@@ -134,7 +137,7 @@ begin
cbTipoPresupuesto.Properties.Items.Add(CTE_VARIOS);
//FILTRO DE EMPRESAS
- if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
+{ if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_CRISTINA) then
begin
frViewTienda1.Visible := False;
frViewTienda1.dxLayoutControl1.Visible := False;
@@ -146,6 +149,7 @@ begin
frViewTienda1.dxLayoutControl1.Visible := True;
dxLayoutControl1Group13.Visible := True;
end;
+ }
end;
procedure TfrViewPresupuestoCliente.CustomViewDestroy(Sender: TObject);
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestosCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestosCliente.dfm
index cf9ddfdb..950f78b6 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestosCliente.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestosCliente.dfm
@@ -178,6 +178,10 @@ inherited frViewPresupuestosCliente: TfrViewPresupuestosCliente
Caption = 'Tienda'
DataBinding.FieldName = 'TIENDA'
end
+ object cxGridViewFECHA_ULT_PRESENTACION_CLIENTE: TcxGridDBColumn
+ Caption = 'Fecha '#250'lt. actualizaci'#243'n'
+ DataBinding.FieldName = 'FECHA_ULT_PRESENTACION_CLIENTE'
+ end
end
inherited cxGridLevel: TcxGridLevel
Caption = 'Todos'
@@ -191,6 +195,9 @@ inherited frViewPresupuestosCliente: TfrViewPresupuestosCliente
object cxGridLevelServidor: TcxGridLevel
Caption = 'Anulados'
end
+ object cxGridPlantillas: TcxGridLevel
+ Caption = 'Plantillas'
+ end
end
inherited frViewFiltroBase1: TfrViewFiltroBase
Width = 903
@@ -584,5 +591,9 @@ inherited frViewPresupuestosCliente: TfrViewPresupuestosCliente
AssignedValues = [svTextColor]
TextColor = clGrayText
end
+ object cxStylePLANTILLA: TcxStyle
+ AssignedValues = [svTextColor]
+ TextColor = 33023
+ end
end
end
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestosCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestosCliente.pas
index 43ba100b..72b50148 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestosCliente.pas
+++ b/Source/Modulos/Presupuestos de cliente/Views/uViewPresupuestosCliente.pas
@@ -55,6 +55,9 @@ type
actTienda: TAction;
TBXItem4: TTBXItem;
TBXSeparatorItem3: TTBXSeparatorItem;
+ cxGridViewFECHA_ULT_PRESENTACION_CLIENTE: TcxGridDBColumn;
+ cxGridPlantillas: TcxGridLevel;
+ cxStylePLANTILLA: TcxStyle;
procedure cxGridActiveTabChanged(Sender: TcxCustomGrid; ALevel:
TcxGridLevel);
procedure cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView;
@@ -223,9 +226,11 @@ begin
FFiltro := AddFilterGrid(fboAnd);
case cxGrid.ActiveLevel.Index of
+ 0 : FFiltro.AddItem(cxGridViewSITUACION, foNotEqual, SITUACION_PRESUPUESTO_PLANTILLA, SITUACION_PRESUPUESTO_PLANTILLA);
1 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_PENDIENTE, SITUACION_PRESUPUESTO_PENDIENTE);
2 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_ACEPTADO, SITUACION_PRESUPUESTO_ACEPTADO);
3 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_ANULADO, SITUACION_PRESUPUESTO_ANULADO);
+ 4 : FFiltro.AddItem(cxGridViewSITUACION, foEqual, SITUACION_PRESUPUESTO_PLANTILLA, SITUACION_PRESUPUESTO_PLANTILLA);
end;
end;
@@ -248,6 +253,9 @@ end;
procedure TfrViewPresupuestosCliente.ConfigView;
begin
inherited;
+ //Para que nos filtre la pestaña todas y quite las facturas proforma
+ AnadirOtrosFiltros;
+
//FILTRO DE EMPRESAS
if (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_ALISO) then
begin
@@ -350,6 +358,8 @@ begin
AStyle.TextColor := cxStyleACEPTADO.TextColor
else if ASituacion = SITUACION_PRESUPUESTO_ANULADO then
AStyle.TextColor := cxStyleRECHAZADO.TextColor
+ else if ASituacion = SITUACION_PRESUPUESTO_PLANTILLA then
+ AStyle.TextColor := cxStylePLANTILLA.TextColor
end;
end;
diff --git a/Source/Modulos/Recibos de cliente/Reports/uRptRecibosCliente_Server.dfm b/Source/Modulos/Recibos de cliente/Reports/uRptRecibosCliente_Server.dfm
index c0e363a5..878896ce 100644
--- a/Source/Modulos/Recibos de cliente/Reports/uRptRecibosCliente_Server.dfm
+++ b/Source/Modulos/Recibos de cliente/Reports/uRptRecibosCliente_Server.dfm
@@ -270,10 +270,10 @@ object RptRecibosCliente: TRptRecibosCliente
'nto) = 11 then '#39'NOVIEMBRE - '#39' || extract (year from fecha_vencim' +
'iento)'#10'when extract (month from fecha_vencimiento) = 12 then '#39'DI' +
'CIEMBRE - '#39' || extract (year from fecha_vencimiento)'#10'end as TITU' +
- 'LO,'#10'REFERENCIA, ID_CLIENTE, NOMBRE_CLIENTE, SITUACION, NIF_CIF ' +
- 'as NIF_CIF_CLIENTE, fecha_vencimiento, FECHA_EMISION,'#10'IMPORTE_TO' +
- 'TAL'#10#10'from V_recibos_cliente'#10'where {where}'#10'order by ANO, MES, NOM' +
- 'BRE_CLIENTE'#10
+ 'LO,'#10'REFERENCIA, TIENDA, ID_CLIENTE, NOMBRE_CLIENTE, SITUACION, N' +
+ 'IF_CIF as NIF_CIF_CLIENTE, fecha_vencimiento, FECHA_EMISION,'#10'IMP' +
+ 'ORTE_TOTAL'#10#10'from V_recibos_cliente'#10'where {where}'#10'order by ANO, M' +
+ 'ES, NOMBRE_CLIENTE'#10
StatementType = stSQL
ColumnMappings = <
item
@@ -323,6 +323,10 @@ object RptRecibosCliente: TRptRecibosCliente
item
DatasetField = 'ANO'
TableField = 'ANO'
+ end
+ item
+ DatasetField = 'TIENDA'
+ TableField = 'TIENDA'
end>
end>
Name = 'InformeListadoRecibos'
@@ -349,6 +353,11 @@ object RptRecibosCliente: TRptRecibosCliente
DataType = datString
Size = 255
end
+ item
+ Name = 'TIENDA'
+ DataType = datString
+ Size = 255
+ end
item
Name = 'ID_CLIENTE'
DataType = datInteger
@@ -998,6 +1007,10 @@ object RptRecibosCliente: TRptRecibosCliente
Name = 'ID_EMPRESA'
DataType = datInteger
end
+ item
+ Name = 'ANO'
+ DataType = datSmallInt
+ end
item
Name = 'MES'
DataType = datSmallInt
@@ -1012,6 +1025,11 @@ object RptRecibosCliente: TRptRecibosCliente
DataType = datString
Size = 255
end
+ item
+ Name = 'TIENDA'
+ DataType = datString
+ Size = 255
+ end
item
Name = 'ID_CLIENTE'
DataType = datInteger
diff --git a/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.dfm b/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.dfm
index 2d5c5c83..d11ff72d 100644
--- a/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.dfm
+++ b/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.dfm
@@ -58,9 +58,7 @@ inherited frViewRecibosCliente: TfrViewRecibosCliente
object cxGridViewTIENDA: TcxGridDBColumn
Caption = 'Tienda'
DataBinding.FieldName = 'TIENDA'
- Visible = False
BestFitMaxWidth = 60
- VisibleForCustomization = False
end
object cxGridViewID_RECIBO_COMPENSADO: TcxGridDBColumn
Caption = 'Compensado'
@@ -227,19 +225,41 @@ inherited frViewRecibosCliente: TfrViewRecibosCliente
Width = 686
ExplicitWidth = 686
inherited txtFiltroTodo: TcxTextEdit
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 434
Width = 434
end
inherited edtFechaIniFiltro: TcxDateEdit
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 183
Width = 183
end
inherited edtFechaFinFiltro: TcxDateEdit
Left = 367
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 367
ExplicitWidth = 234
Width = 234
end
+ inherited txtFiltroTodo2: TcxTextEdit
+ Left = 464
+ Style.LookAndFeel.SkinName = ''
+ StyleDisabled.LookAndFeel.SkinName = ''
+ StyleFocused.LookAndFeel.SkinName = ''
+ StyleHot.LookAndFeel.SkinName = ''
+ ExplicitLeft = 464
+ ExplicitWidth = 250
+ Width = 250
+ end
end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel
Width = 686
@@ -267,6 +287,11 @@ inherited frViewRecibosCliente: TfrViewRecibosCliente
object TBXItem2: TTBXItem
Action = actCliente
end
+ object TBXSeparatorItem2: TTBXSeparatorItem
+ end
+ object TBXItem3: TTBXItem
+ Action = actTienda
+ end
end
end
end
@@ -289,6 +314,11 @@ inherited frViewRecibosCliente: TfrViewRecibosCliente
OnExecute = actClienteExecute
OnUpdate = actClienteUpdate
end
+ object actTienda: TAction
+ Caption = 'Tienda'
+ OnExecute = actTiendaExecute
+ OnUpdate = actTiendaUpdate
+ end
end
inherited cxStyleRepositoryInforme: TcxStyleRepository
Top = 184
diff --git a/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.pas b/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.pas
index 87a5064a..e933fb61 100644
--- a/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.pas
+++ b/Source/Modulos/Recibos de cliente/Views/uViewRecibosCliente.pas
@@ -59,6 +59,9 @@ type
cxGridViewCODIGO_POSTAL: TcxGridDBColumn;
cxGridViewCUENTA_CONTABLE: TcxGridDBColumn;
cxGridViewLISTA_NOMBRES: TcxGridDBColumn;
+ actTienda: TAction;
+ TBXSeparatorItem2: TTBXSeparatorItem;
+ TBXItem3: TTBXItem;
procedure cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
out AStyle: TcxStyle);
@@ -70,6 +73,8 @@ type
procedure cxGridViewID_RECIBO_COMPENSADOCustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
+ procedure actTiendaExecute(Sender: TObject);
+ procedure actTiendaUpdate(Sender: TObject);
private
//Filtros relativos a la vista
@@ -117,6 +122,26 @@ begin
(Sender as TAction).Checked := not (cxGridViewNOMBRE_CLIENTE.GroupIndex < 0);
end;
+procedure TfrViewRecibosCliente.actTiendaExecute(Sender: TObject);
+begin
+ if (cxGridViewTIENDA.GroupIndex < 0) then
+ begin
+ cxGridViewTIENDA.GroupIndex := cxGridView.GroupedColumnCount;
+ cxGridViewTIENDA.Visible := False;
+ end
+ else
+ begin
+ cxGridViewTIENDA.GroupIndex := -1;
+ cxGridViewTIENDA.Visible := True;
+ end;
+end;
+
+procedure TfrViewRecibosCliente.actTiendaUpdate(Sender: TObject);
+begin
+ inherited;
+ (Sender as TAction).Checked := not (cxGridViewTIENDA.GroupIndex < 0);
+end;
+
procedure TfrViewRecibosCliente.AnadirFiltroFechas;
var
Columna: TcxGridDBColumn;
diff --git a/Source/Modulos/Recibos de proveedor/Reports/uRptRecibosProveedor_Server.dfm b/Source/Modulos/Recibos de proveedor/Reports/uRptRecibosProveedor_Server.dfm
index 68ab3c16..b0bede60 100644
--- a/Source/Modulos/Recibos de proveedor/Reports/uRptRecibosProveedor_Server.dfm
+++ b/Source/Modulos/Recibos de proveedor/Reports/uRptRecibosProveedor_Server.dfm
@@ -65,11 +65,11 @@ object RptRecibosProveedor: TRptRecibosProveedor
'nto) = 11 then '#39'NOVIEMBRE - '#39' || extract (year from fecha_vencim' +
'iento)'#10'when extract (month from fecha_vencimiento) = 12 then '#39'DI' +
'CIEMBRE - '#39' || extract (year from fecha_vencimiento)'#10'end as TITU' +
- 'LO,'#10'REFERENCIA, REFERENCIA_FACTURA_PROV, ID_PROVEEDOR, NOMBRE_P' +
- 'ROVEEDOR, SITUACION, ID_FORMA_PAGO_FACTURA, FORMA_PAGO_FACTURA, ' +
- 'NIF_CIF as NIF_CIF_PROVEEDOR, fecha_vencimiento, FECHA_EMISION,'#10 +
- 'IMPORTE_TOTAL'#10#10'from V_recibos_proveedor'#10'where {where}'#10'order by A' +
- 'NO, MES, NOMBRE_PROVEEDOR'#10
+ 'LO,'#10'REFERENCIA, TIENDA, REFERENCIA_FACTURA_PROV, ID_PROVEEDOR, N' +
+ 'OMBRE_PROVEEDOR, SITUACION, ID_FORMA_PAGO_FACTURA, FORMA_PAGO_FA' +
+ 'CTURA, NIF_CIF as NIF_CIF_PROVEEDOR, fecha_vencimiento, FECHA_EM' +
+ 'ISION,'#10'IMPORTE_TOTAL'#10#10'from V_recibos_proveedor'#10'where {where}'#10'ord' +
+ 'er by ANO, MES, NOMBRE_PROVEEDOR'#10
StatementType = stSQL
ColumnMappings = <
item
@@ -135,6 +135,10 @@ object RptRecibosProveedor: TRptRecibosProveedor
item
DatasetField = 'ID_FORMA_PAGO_FACTURA'
TableField = 'ID_FORMA_PAGO_FACTURA'
+ end
+ item
+ DatasetField = 'TIENDA'
+ TableField = 'TIENDA'
end>
end>
Name = 'InformeListadoRecibos'
@@ -161,6 +165,11 @@ object RptRecibosProveedor: TRptRecibosProveedor
DataType = datString
Size = 255
end
+ item
+ Name = 'TIENDA'
+ DataType = datString
+ Size = 255
+ end
item
Name = 'REFERENCIA_FACTURA_PROV'
DataType = datString
@@ -231,7 +240,7 @@ object RptRecibosProveedor: TRptRecibosProveedor
PrintOptions.Printer = 'Por defecto'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 37800.807714351900000000
- ReportOptions.LastChange = 45055.383770833330000000
+ ReportOptions.LastChange = 45226.449743009260000000
ScriptLanguage = 'PascalScript'
ShowProgress = False
StoreInDFM = False
@@ -264,6 +273,11 @@ object RptRecibosProveedor: TRptRecibosProveedor
DataType = datString
Size = 255
end
+ item
+ Name = 'TIENDA'
+ DataType = datString
+ Size = 255
+ end
item
Name = 'REFERENCIA_FACTURA_PROV'
DataType = datString
diff --git a/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.dfm b/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.dfm
index 20788f77..2c15f817 100644
--- a/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.dfm
+++ b/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.dfm
@@ -43,6 +43,10 @@ inherited frViewRecibosProveedor: TfrViewRecibosProveedor
end>
OptionsCustomize.ColumnHidingOnGrouping = False
OptionsView.GroupFooters = gfAlwaysVisible
+ object cxGridViewTIENDA: TcxGridDBColumn
+ Caption = 'Tienda'
+ DataBinding.FieldName = 'TIENDA'
+ end
object cxGridViewREFERENCIA: TcxGridDBColumn
Caption = 'Referencia'
DataBinding.FieldName = 'REFERENCIA'
@@ -246,6 +250,11 @@ inherited frViewRecibosProveedor: TfrViewRecibosProveedor
object TBXItem3: TTBXItem
Action = actFormasPago
end
+ object TBXSeparatorItem3: TTBXSeparatorItem
+ end
+ object TBXItem4: TTBXItem
+ Action = actTienda
+ end
end
end
end
@@ -266,6 +275,11 @@ inherited frViewRecibosProveedor: TfrViewRecibosProveedor
OnExecute = actFormasPagoExecute
OnUpdate = actFormasPagoUpdate
end
+ object actTienda: TAction
+ Caption = 'Tienda'
+ OnExecute = actTiendaExecute
+ OnUpdate = actTiendaUpdate
+ end
end
inherited GridPNGImageList: TPngImageList
PngImages = <
diff --git a/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.pas b/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.pas
index 80e047b4..0c620a8c 100644
--- a/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.pas
+++ b/Source/Modulos/Recibos de proveedor/Views/uViewRecibosProveedor.pas
@@ -56,6 +56,10 @@ type
actFormasPago: TAction;
TBXSeparatorItem2: TTBXSeparatorItem;
TBXItem3: TTBXItem;
+ actTienda: TAction;
+ TBXSeparatorItem3: TTBXSeparatorItem;
+ TBXItem4: TTBXItem;
+ cxGridViewTIENDA: TcxGridDBColumn;
procedure cxGridViewStylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
out AStyle: TcxStyle);
@@ -69,6 +73,8 @@ type
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure actFormasPagoExecute(Sender: TObject);
procedure actFormasPagoUpdate(Sender: TObject);
+ procedure actTiendaExecute(Sender: TObject);
+ procedure actTiendaUpdate(Sender: TObject);
private
//Filtros relativos a la vista
@@ -138,6 +144,27 @@ begin
(Sender as TAction).Checked := not (cxGridViewNOMBRE_PROVEEDOR.GroupIndex < 0);
end;
+procedure TfrViewRecibosProveedor.actTiendaExecute(Sender: TObject);
+begin
+ inherited;
+ if (cxGridViewTIENDA.GroupIndex < 0) then
+ begin
+ cxGridViewTIENDA.GroupIndex := cxGridView.GroupedColumnCount;
+ cxGridViewTIENDA.Visible := False;
+ end
+ else
+ begin
+ cxGridViewTIENDA.GroupIndex := -1;
+ cxGridViewTIENDA.Visible := True;
+ end;
+end;
+
+procedure TfrViewRecibosProveedor.actTiendaUpdate(Sender: TObject);
+begin
+ inherited;
+ (Sender as TAction).Checked := not (cxGridViewTIENDA.GroupIndex < 0);
+end;
+
procedure TfrViewRecibosProveedor.AnadirFiltroFechas;
var
Columna: TcxGridDBColumn;
diff --git a/Source/Servicios/FactuGES.RODL b/Source/Servicios/FactuGES.RODL
index 5f236331..c4e11e21 100644
--- a/Source/Servicios/FactuGES.RODL
+++ b/Source/Servicios/FactuGES.RODL
@@ -310,6 +310,10 @@
+
+
+
+
@@ -945,6 +949,10 @@
+
+
+
+
diff --git a/Source/Servicios/FactuGES_Intf.pas b/Source/Servicios/FactuGES_Intf.pas
index a7a30e2b..394175f7 100644
--- a/Source/Servicios/FactuGES_Intf.pas
+++ b/Source/Servicios/FactuGES_Intf.pas
@@ -517,7 +517,7 @@ type
IsrvFacturasCliente = interface(IDataAbstractService)
['{56B4FFF0-AB1B-46B2-BA16-ABD5360F6311}']
function GenerateReport(const FacturaID: TIntegerArray): Binary;
- function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
end;
{ CosrvFacturasCliente }
@@ -531,7 +531,7 @@ type
function __GetInterfaceName:string; override;
function GenerateReport(const FacturaID: TIntegerArray): Binary;
- function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
end;
{ IsrvFacturasProveedor }
@@ -866,7 +866,7 @@ type
IsrvContratosCliente = interface(IDataAbstractService)
['{ADBF1627-F507-4A0F-818E-38BAE28579B6}']
function GenerarInforme(const ListaID: TIntegerArray): Binary;
- function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
end;
{ CosrvContratosCliente }
@@ -880,7 +880,7 @@ type
function __GetInterfaceName:string; override;
function GenerarInforme(const ListaID: TIntegerArray): Binary;
- function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
end;
implementation
@@ -1840,12 +1840,14 @@ begin
end
end;
-function TsrvFacturasCliente_Proxy.GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+function TsrvFacturasCliente_Proxy.GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
begin
try
result := nil;
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarInformeEnPDF');
__Message.Write('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
+ __Message.Write('Usuario', TypeInfo(AnsiString), Usuario, []);
+ __Message.Write('Firmado', TypeInfo(Boolean), Firmado, []);
__Message.Finalize;
__TransportChannel.Dispatch(__Message);
@@ -2825,12 +2827,14 @@ begin
end
end;
-function TsrvContratosCliente_Proxy.GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary;
+function TsrvContratosCliente_Proxy.GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary;
begin
try
result := nil;
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'GenerarInformeEnPDF');
__Message.Write('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
+ __Message.Write('Usuario', TypeInfo(AnsiString), Usuario, []);
+ __Message.Write('Firmado', TypeInfo(Boolean), Firmado, []);
__Message.Finalize;
__TransportChannel.Dispatch(__Message);
diff --git a/Source/Servicios/FactuGES_Invk.pas b/Source/Servicios/FactuGES_Invk.pas
index 69d8a39c..c3326b17 100644
--- a/Source/Servicios/FactuGES_Invk.pas
+++ b/Source/Servicios/FactuGES_Invk.pas
@@ -965,9 +965,11 @@ begin
end;
procedure TsrvFacturasCliente_Invoker.Invoke_GenerarInformeEnPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
-{ function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; }
+{ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary; }
var
ListaID: FactuGES_Intf.TIntegerArray;
+ Usuario: AnsiString;
+ Firmado: Boolean;
lResult: Binary;
__lObjectDisposer: TROObjectDisposer;
begin
@@ -975,8 +977,10 @@ begin
lResult := nil;
try
__Message.Read('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
+ __Message.Read('Usuario', TypeInfo(AnsiString), Usuario, []);
+ __Message.Read('Firmado', TypeInfo(Boolean), Firmado, []);
- lResult := (__Instance as IsrvFacturasCliente).GenerarInformeEnPDF(ListaID);
+ lResult := (__Instance as IsrvFacturasCliente).GenerarInformeEnPDF(ListaID, Usuario, Firmado);
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvFacturasCliente', 'GenerarInformeEnPDFResponse');
__Message.Write('Result', TypeInfo(Binary), lResult, []);
@@ -2364,9 +2368,11 @@ begin
end;
procedure TsrvContratosCliente_Invoker.Invoke_GenerarInformeEnPDF(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
-{ function GenerarInformeEnPDF(const ListaID: TIntegerArray): Binary; }
+{ function GenerarInformeEnPDF(const ListaID: TIntegerArray; const Usuario: AnsiString; const Firmado: Boolean): Binary; }
var
ListaID: FactuGES_Intf.TIntegerArray;
+ Usuario: AnsiString;
+ Firmado: Boolean;
lResult: Binary;
__lObjectDisposer: TROObjectDisposer;
begin
@@ -2374,8 +2380,10 @@ begin
lResult := nil;
try
__Message.Read('ListaID', TypeInfo(FactuGES_Intf.TIntegerArray), ListaID, []);
+ __Message.Read('Usuario', TypeInfo(AnsiString), Usuario, []);
+ __Message.Read('Firmado', TypeInfo(Boolean), Firmado, []);
- lResult := (__Instance as IsrvContratosCliente).GenerarInformeEnPDF(ListaID);
+ lResult := (__Instance as IsrvContratosCliente).GenerarInformeEnPDF(ListaID, Usuario, Firmado);
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvContratosCliente', 'GenerarInformeEnPDFResponse');
__Message.Write('Result', TypeInfo(Binary), lResult, []);
diff --git a/Source/Servicios/RODLFile.res b/Source/Servicios/RODLFile.res
index fd8d5708..a5a471ba 100644
Binary files a/Source/Servicios/RODLFile.res and b/Source/Servicios/RODLFile.res differ
diff --git a/Source/Servidor/FactuGES_Server.dpr b/Source/Servidor/FactuGES_Server.dpr
index 4834721d..26c30918 100644
--- a/Source/Servidor/FactuGES_Server.dpr
+++ b/Source/Servidor/FactuGES_Server.dpr
@@ -116,8 +116,6 @@ uses
schRecibosClienteServer_Intf in '..\Modulos\Recibos de cliente\Model\schRecibosClienteServer_Intf.pas',
schRecibosProveedorClient_Intf in '..\Modulos\Recibos de proveedor\Model\schRecibosProveedorClient_Intf.pas',
schRecibosProveedorServer_Intf in '..\Modulos\Recibos de proveedor\Model\schRecibosProveedorServer_Intf.pas',
- schFacturasClienteClient_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteClient_Intf.pas',
- schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas',
schEmpresasClient_Intf in '..\ApplicationBase\Empresas\Model\schEmpresasClient_Intf.pas',
schEmpresasServer_Intf in '..\ApplicationBase\Empresas\Model\schEmpresasServer_Intf.pas',
schArticulosClient_Intf in '..\Modulos\Articulos\Model\schArticulosClient_Intf.pas',
@@ -130,15 +128,17 @@ uses
schAlbaranesProveedorServer_Intf in '..\Modulos\Albaranes de proveedor\Model\schAlbaranesProveedorServer_Intf.pas',
schPedidosProveedorClient_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorClient_Intf.pas',
schPedidosProveedorServer_Intf in '..\Modulos\Pedidos a proveedor\Model\schPedidosProveedorServer_Intf.pas',
- schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas',
- schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas',
schBase_Intf in '..\Base\schBase_Intf.pas',
schAlbaranesClienteClient_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteClient_Intf.pas',
schAlbaranesClienteServer_Intf in '..\Modulos\Albaranes de cliente\Model\schAlbaranesClienteServer_Intf.pas',
+ schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas',
+ schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas',
+ schPresupuestosClienteClient_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteClient_Intf.pas',
+ schPresupuestosClienteServer_Intf in '..\Modulos\Presupuestos de cliente\Model\schPresupuestosClienteServer_Intf.pas',
schContratosClienteClient_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteClient_Intf.pas',
schContratosClienteServer_Intf in '..\Modulos\Contratos de cliente\Model\schContratosClienteServer_Intf.pas',
- schFacturasProveedorClient_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorClient_Intf.pas',
- schFacturasProveedorServer_Intf in '..\Modulos\Facturas de proveedor\Model\schFacturasProveedorServer_Intf.pas';
+ schFacturasClienteClient_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteClient_Intf.pas',
+ schFacturasClienteServer_Intf in '..\Modulos\Facturas de cliente\Model\schFacturasClienteServer_Intf.pas';
{$R *.res}
{$R ..\Servicios\RODLFile.res}
diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj
index 8ee87cd6..e75e1b01 100644
--- a/Source/Servidor/FactuGES_Server.dproj
+++ b/Source/Servidor/FactuGES_Server.dproj
@@ -28,8 +28,7 @@
Delphi.Personality
-FalseTrueFalseTrueFalse3670FalseFalseFalseFalseFalse30821252Rodax Software S.L.3.6.7.0FactuGES (Servidor)3.6.7.0miércoles, 18 de octubre de 2023 17:30
-
+FalseTrueFalseTrueFalse4000FalseFalseFalseFalseFalse30821252Rodax Software S.L.4.0.0.0FactuGES (Servidor)4.0.0.0jueves, 01 de agosto de 2024 15:42
File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found
FactuGES_Server.dpr
diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc
index e0aa9c74..502b1b69 100644
--- a/Source/Servidor/FactuGES_Server.rc
+++ b/Source/Servidor/FactuGES_Server.rc
@@ -1,7 +1,7 @@
MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Servidor.ico"
1 VERSIONINFO
-FILEVERSION 3,6,7,0
-PRODUCTVERSION 3,6,7,0
+FILEVERSION 4,0,0,0
+PRODUCTVERSION 4,0,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", "3.6.7.0\0"
+ VALUE "FileVersion", "4.0.0.0\0"
VALUE "ProductName", "FactuGES (Servidor)\0"
- VALUE "ProductVersion", "3.6.7.0\0"
- VALUE "CompileDate", "jueves, 19 de octubre de 2023 15:39\0"
+ VALUE "ProductVersion", "4.0.0.0\0"
+ VALUE "CompileDate", "domingo, 04 de agosto de 2024 18:59\0"
END
END
BLOCK "VarFileInfo"
diff --git a/Source/Servidor/FactuGES_Server.res b/Source/Servidor/FactuGES_Server.res
index d6d25530..16bd23b1 100644
Binary files a/Source/Servidor/FactuGES_Server.res and b/Source/Servidor/FactuGES_Server.res differ
diff --git a/Source/Servidor/uDataModuleServer.pas b/Source/Servidor/uDataModuleServer.pas
index cb33b180..c294e89d 100644
--- a/Source/Servidor/uDataModuleServer.pas
+++ b/Source/Servidor/uDataModuleServer.pas
@@ -62,6 +62,7 @@ type
function DarRutaInformes : String;
+function DarRutaPDFS : String;
function Encrypt (const Source : string) : String;
function Decrypt (const Source : string) : String;
function GetNextAutoinc(AConnection : IDAConnection; const GeneratorName: string): integer;
@@ -82,6 +83,11 @@ begin
Result := ExtractFilePath(Application.ExeName) + 'Informes' + PathDelim;
end;
+function DarRutaPDFS : String;
+begin
+ Result := ExtractFilePath(Application.ExeName) + 'PDFS' + PathDelim;
+end;
+
function GetNextAutoinc(AConnection : IDAConnection; const GeneratorName: string): integer;
var
ds: IDADataset;