diff --git a/Build/Build.fbl6 b/Build/Build.fbl6
index db36662..2b8e79a 100644
Binary files a/Build/Build.fbl6 and b/Build/Build.fbl6 differ
diff --git a/Output/Debug/Servidor/Informes/1/firma.bat b/Output/Debug/Servidor/Informes/1/firma.bat
new file mode 100644
index 0000000..0678a8c
--- /dev/null
+++ b/Output/Debug/Servidor/Informes/1/firma.bat
@@ -0,0 +1,48 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\1\log.txt
+
+set ARCHIVO=%1
+set city=FUENLABRADA
+set province=MADRID
+set postalcode=28946
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true"
+
+
+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:\DATOS2\FINANZAS\CERTIFICADOS\abeto.pfx" -password %PASSABETO% -filter subject.contains:850331 -config %CONFIG%
+
diff --git a/Output/Debug/Servidor/Informes/10/firma.bat b/Output/Debug/Servidor/Informes/10/firma.bat
new file mode 100644
index 0000000..34bd7fd
--- /dev/null
+++ b/Output/Debug/Servidor/Informes/10/firma.bat
@@ -0,0 +1,45 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\2\log.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28002
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\2\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true\nownerPassword=uecko24"
+
+REM echo %CONFIG% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\DATOS2\FINANZAS\CERTIFICADOS\graden.pfx" -password %PASSGRADEN% -filter subject.contains:806465 -config %CONFIG%
+
diff --git a/Output/Debug/Servidor/Informes/15/firma.bat b/Output/Debug/Servidor/Informes/15/firma.bat
new file mode 100644
index 0000000..34bd7fd
--- /dev/null
+++ b/Output/Debug/Servidor/Informes/15/firma.bat
@@ -0,0 +1,45 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\2\log.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28002
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\2\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true\nownerPassword=uecko24"
+
+REM echo %CONFIG% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\DATOS2\FINANZAS\CERTIFICADOS\graden.pfx" -password %PASSGRADEN% -filter subject.contains:806465 -config %CONFIG%
+
diff --git a/Output/Debug/Servidor/Informes/2/firma.bat b/Output/Debug/Servidor/Informes/2/firma.bat
new file mode 100644
index 0000000..34bd7fd
--- /dev/null
+++ b/Output/Debug/Servidor/Informes/2/firma.bat
@@ -0,0 +1,45 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\2\log.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28002
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\2\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true\nownerPassword=uecko24"
+
+REM echo %CONFIG% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\DATOS2\FINANZAS\CERTIFICADOS\graden.pfx" -password %PASSGRADEN% -filter subject.contains:806465 -config %CONFIG%
+
diff --git a/Output/Debug/Servidor/Informes/20/firma.bat b/Output/Debug/Servidor/Informes/20/firma.bat
new file mode 100644
index 0000000..34bd7fd
--- /dev/null
+++ b/Output/Debug/Servidor/Informes/20/firma.bat
@@ -0,0 +1,45 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\2\log.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28002
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\2\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true\nownerPassword=uecko24"
+
+REM echo %CONFIG% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\DATOS2\FINANZAS\CERTIFICADOS\graden.pfx" -password %PASSGRADEN% -filter subject.contains:806465 -config %CONFIG%
+
diff --git a/Output/Debug/Servidor/Informes/3/firma.bat b/Output/Debug/Servidor/Informes/3/firma.bat
new file mode 100644
index 0000000..34bd7fd
--- /dev/null
+++ b/Output/Debug/Servidor/Informes/3/firma.bat
@@ -0,0 +1,45 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\2\log.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28002
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\2\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true\nownerPassword=uecko24"
+
+REM echo %CONFIG% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\DATOS2\FINANZAS\CERTIFICADOS\graden.pfx" -password %PASSGRADEN% -filter subject.contains:806465 -config %CONFIG%
+
diff --git a/Output/Debug/Servidor/Informes/30/firma.bat b/Output/Debug/Servidor/Informes/30/firma.bat
new file mode 100644
index 0000000..34bd7fd
--- /dev/null
+++ b/Output/Debug/Servidor/Informes/30/firma.bat
@@ -0,0 +1,45 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\2\log.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28002
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\2\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true\nownerPassword=uecko24"
+
+REM echo %CONFIG% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\DATOS2\FINANZAS\CERTIFICADOS\graden.pfx" -password %PASSGRADEN% -filter subject.contains:806465 -config %CONFIG%
+
diff --git a/Output/Debug/Servidor/Informes/6/firma.bat b/Output/Debug/Servidor/Informes/6/firma.bat
new file mode 100644
index 0000000..34bd7fd
--- /dev/null
+++ b/Output/Debug/Servidor/Informes/6/firma.bat
@@ -0,0 +1,45 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\2\log.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28002
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\2\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true\nownerPassword=uecko24"
+
+REM echo %CONFIG% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\DATOS2\FINANZAS\CERTIFICADOS\graden.pfx" -password %PASSGRADEN% -filter subject.contains:806465 -config %CONFIG%
+
diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj
index 1263d53..a75ef83 100644
--- a/Source/Base/Base.dproj
+++ b/Source/Base/Base.dproj
@@ -44,6 +44,13 @@
Package
FalseTrueFalseLibreria base de FactuGESFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0
+
+
+
+
+
+
+
VCL for the Web Design Package for CodeGear RAD Studio
CodeGear WebSnap Components
CodeGear SOAP Components
@@ -58,55 +65,55 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TForm
diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj
index 313d674..46b942c 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\TrueFalse4890FalseFalseFalseFalseFalse30821252Rodax Software S.L.4.8.9.0FactuGESFactuGES4.8.9.0
+FalseTrueFalseC:\Archivos de programa\Borland\Delphi7\Bin\TrueFalse5000FalseFalseFalseFalseFalse30821252Rodax Software S.L.5.0.0.0FactuGESFactuGES5.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.res b/Source/Cliente/FactuGES.res
index d77b74e..d696021 100644
Binary files a/Source/Cliente/FactuGES.res and b/Source/Cliente/FactuGES.res differ
diff --git a/Source/Informes/1/InformeComprasArticulos.fr3 b/Source/Informes/1/InformeComprasArticulos.fr3
new file mode 100644
index 0000000..b135ff8
--- /dev/null
+++ b/Source/Informes/1/InformeComprasArticulos.fr3
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/1/InformeComprasArticulosProveedor.fr3 b/Source/Informes/1/InformeComprasArticulosProveedor.fr3
new file mode 100644
index 0000000..47a9aec
--- /dev/null
+++ b/Source/Informes/1/InformeComprasArticulosProveedor.fr3
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/1/InformeVentasArticulos.fr3 b/Source/Informes/1/InformeVentasArticulos.fr3
new file mode 100644
index 0000000..1b54b50
--- /dev/null
+++ b/Source/Informes/1/InformeVentasArticulos.fr3
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/1/InformeVentasArticulosComercial.fr3 b/Source/Informes/1/InformeVentasArticulosComercial.fr3
new file mode 100644
index 0000000..0d6f474
--- /dev/null
+++ b/Source/Informes/1/InformeVentasArticulosComercial.fr3
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/1/fr/InfAlbaranCliente.fr3 b/Source/Informes/1/fr/InfAlbaranCliente.fr3
new file mode 100644
index 0000000..aba1ed8
--- /dev/null
+++ b/Source/Informes/1/fr/InfAlbaranCliente.fr3
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/1/fr/InfContratoCliente.fr3 b/Source/Informes/1/fr/InfContratoCliente.fr3
new file mode 100644
index 0000000..5485d4e
--- /dev/null
+++ b/Source/Informes/1/fr/InfContratoCliente.fr3
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/1/fr/InfFacturaCliente.fr3 b/Source/Informes/1/fr/InfFacturaCliente.fr3
new file mode 100644
index 0000000..9b9ae75
--- /dev/null
+++ b/Source/Informes/1/fr/InfFacturaCliente.fr3
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/1/fr/InfPresupuestoCliente.fr3 b/Source/Informes/1/fr/InfPresupuestoCliente.fr3
new file mode 100644
index 0000000..4bff5cc
--- /dev/null
+++ b/Source/Informes/1/fr/InfPresupuestoCliente.fr3
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/10/firma.bat b/Source/Informes/10/firma.bat
new file mode 100644
index 0000000..34bd7fd
--- /dev/null
+++ b/Source/Informes/10/firma.bat
@@ -0,0 +1,45 @@
+@ECHO off
+title firmadocumento
+cls
+
+set LOGFILE=D:\RODAX\FACTUGES\Servidor\Informes\2\log.txt
+
+set ARCHIVO=%1
+set city=MADRID
+set province=MADRID
+set postalcode=28002
+set PositionOnPageLowerLeftX=420
+set PositionOnPageLowerLeftY=140
+set PositionOnPageUpperRightX=570
+set PositionOnPageUpperRigthY=210
+set signaturePage=-1
+set signatureRubricImage="D:\RODAX\FACTUGES\Servidor\Informes\2\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\nsignatureRubricImage=%signatureRubricImage%\nincludeOnlySignningCertificate=true\nownerPassword=uecko24"
+
+REM echo %CONFIG% > %LOGFILE%
+
+call :FIRMA >> %LOGFILE%
+exit /b
+
+:FIRMA
+"C:\Program Files (x86)\AutoFirma\AutoFirma\AutoFirmaCommandLine.exe" sign -i %ARCHIVO% -o %ARCHIVO% -store pkcs12:"D:\DATOS2\FINANZAS\CERTIFICADOS\graden.pfx" -password %PASSGRADEN% -filter subject.contains:806465 -config %CONFIG%
+
diff --git a/Source/Informes/30/InfPresupuestoCliente.fr3 b/Source/Informes/30/InfPresupuestoCliente.fr3
index b72ba52..b2852e1 100644
--- a/Source/Informes/30/InfPresupuestoCliente.fr3
+++ b/Source/Informes/30/InfPresupuestoCliente.fr3
@@ -1,5 +1,5 @@
-
+
@@ -10,7 +10,7 @@
-
+
diff --git a/Source/Informes/6/fr/InfContratoCliente.fr3 b/Source/Informes/6/fr/InfContratoCliente.fr3
new file mode 100644
index 0000000..3ae3311
--- /dev/null
+++ b/Source/Informes/6/fr/InfContratoCliente.fr3
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/6/fr/InfFacturaCliente.fr3 b/Source/Informes/6/fr/InfFacturaCliente.fr3
new file mode 100644
index 0000000..510037e
--- /dev/null
+++ b/Source/Informes/6/fr/InfFacturaCliente.fr3
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Informes/6/fr/InfPresupuestoCliente.fr3 b/Source/Informes/6/fr/InfPresupuestoCliente.fr3
new file mode 100644
index 0000000..c96a0b2
--- /dev/null
+++ b/Source/Informes/6/fr/InfPresupuestoCliente.fr3
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm
index d55e5cc..9f12693 100644
--- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm
+++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.dfm
@@ -66,13 +66,13 @@ object RptContratosCliente: TRptContratosCliente
') ARTICULO,'#10'avg(coalesce(FCD.importe_unidad,0)) importe_medio_un' +
'idad, sum(coalesce(FCD.cantidad,0)) CANTIDAD, avg(coalesce(FCD.i' +
'mporte_unidad,0))*sum(coalesce(FCD.cantidad,0)) importe_medio_to' +
- 'tal,'#10'sum(coalesce(FCD.importe_unidad,0)) importe_real_total'#10'from' +
- ' contratos_cliente_detalles FCD'#10'inner join contratos_cliente FC ' +
- 'on (FC.ID = FCD.ID_CONTRATO)'#10'left join contactos AGENTES on (AGE' +
- 'NTES.ID = FC.ID_AGENTE)'#10'inner join articulos A on (A.ID = FCD.ID' +
- '_ARTICULO)'#10'where {where}'#10'and FC.ID_EMPRESA = :ID_EMPRESA'#10'and FC.' +
- 'FECHA_CONTRATO between :FECHAINI and :FECHAFIN'#10'and FCD.id_articu' +
- 'lo > 1'#10'and A.COMISIONABLE = 1'#10#10'GROUP BY 1,2,3,4'#10'order by 6 DESC'#10
+ 'tal,'#10'sum(coalesce(FCD.importe_total,0)) importe_real_total'#10'from ' +
+ 'contratos_cliente_detalles FCD'#10'inner join contratos_cliente FC o' +
+ 'n (FC.ID = FCD.ID_CONTRATO)'#10'left join contactos AGENTES on (AGEN' +
+ 'TES.ID = FC.ID_AGENTE)'#10'inner join articulos A on (A.ID = FCD.ID_' +
+ 'ARTICULO)'#10'where {where}'#10'and FC.ID_EMPRESA = :ID_EMPRESA'#10'and FC.F' +
+ 'ECHA_CONTRATO between :FECHAINI and :FECHAFIN'#10'and FCD.id_articul' +
+ 'o > 1'#10'and A.COMISIONABLE = 1'#10#10'GROUP BY 1,2,3,4'#10'order by 6 DESC'#10
StatementType = stSQL
ColumnMappings = <
item
@@ -1574,7 +1574,7 @@ object RptContratosCliente: TRptContratosCliente
PrintOptions.Printer = 'Por defecto'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 37800.807714351900000000
- ReportOptions.LastChange = 45831.740295370370000000
+ ReportOptions.LastChange = 45876.725298599540000000
ScriptLanguage = 'PascalScript'
ShowProgress = False
StoreInDFM = False
diff --git a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas
index a727d79..45ae6b4 100644
--- a/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas
+++ b/Source/Modulos/Contratos de cliente/Reports/uRptContratosCliente_Server.pas
@@ -451,7 +451,7 @@ begin
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
end;
end;
- end;
+ end;
end;
procedure TRptContratosCliente.PrepararTablaResumenInforme(ATabla: IDADataset);
diff --git a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm
index 9f47b9a..9d661b7 100644
--- a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm
+++ b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.dfm
@@ -2,7 +2,7 @@ object RptFacturasProveedor: TRptFacturasProveedor
OldCreateOrder = True
OnCreate = DataModuleCreate
OnDestroy = DataModuleDestroy
- Height = 405
+ Height = 669
Width = 837
object frxRichObject1: TfrxRichObject
Left = 48
@@ -239,6 +239,113 @@ object RptFacturasProveedor: TRptFacturasProveedor
DataType = datCurrency
end>
end
+ item
+ Params = <
+ item
+ Name = 'ID_EMPRESA'
+ Value = ''
+ end
+ item
+ Name = 'FECHAINI'
+ Value = ''
+ end
+ item
+ Name = 'FECHAFIN'
+ Value = ''
+ end>
+ Statements = <
+ item
+ ConnectionType = 'Interbase'
+ Default = True
+ Name = 'IBX'
+ SQL =
+ 'select FCD.ID_ARTICULO, A.REFERENCIA, FCD.CONCEPTO,'#10'COALESCE(A.F' +
+ 'AMILIA,'#39#39') || '#39' '#39' || COALESCE(A.referencia_prov,'#39#39') || '#39' '#39' || CO' +
+ 'ALESCE(A.DESCRIPCION,'#39#39') ARTICULO,'#10'avg(coalesce(FCD.importe_unid' +
+ 'ad,0)) importe_medio_unidad, sum(coalesce(FCD.cantidad,0)) CANTI' +
+ 'DAD, avg(coalesce(FCD.importe_unidad,0))*sum(coalesce(FCD.cantid' +
+ 'ad,0)) importe_medio_total,'#10'sum(coalesce(FCD.importe_total,0)) i' +
+ 'mporte_real_total'#10'from facturas_proveedor_detalles FCD'#10'inner joi' +
+ 'n facturas_proveedor FP on (FP.ID = FCD.ID_FACTURA)'#10'inner join a' +
+ 'rticulos A on (A.ID = FCD.ID_ARTICULO)'#10'where {where}'#10'and FP.ID_E' +
+ 'MPRESA = :ID_EMPRESA'#10'and FP.FECHA_FACTURA between :FECHAINI and ' +
+ ':FECHAFIN'#10'and FCD.id_articulo > 1'#10#10'GROUP BY 1,2,3,4'#10'order by 6 D' +
+ 'ESC'#10
+ StatementType = stSQL
+ ColumnMappings = <
+ item
+ DatasetField = 'ID_ARTICULO'
+ TableField = 'ID_ARTICULO'
+ end
+ item
+ DatasetField = 'REFERENCIA'
+ TableField = 'REFERENCIA'
+ end
+ item
+ DatasetField = 'CONCEPTO'
+ TableField = 'CONCEPTO'
+ end
+ item
+ DatasetField = 'ARTICULO'
+ TableField = 'ARTICULO'
+ end
+ item
+ DatasetField = 'IMPORTE_MEDIO_UNIDAD'
+ TableField = 'IMPORTE_MEDIO_UNIDAD'
+ end
+ item
+ DatasetField = 'CANTIDAD'
+ TableField = 'CANTIDAD'
+ end
+ item
+ DatasetField = 'IMPORTE_MEDIO_TOTAL'
+ TableField = 'IMPORTE_MEDIO_TOTAL'
+ end
+ item
+ DatasetField = 'IMPORTE_REAL_TOTAL'
+ TableField = 'IMPORTE_REAL_TOTAL'
+ end>
+ end>
+ Name = 'InfomeComprasArticulos'
+ Fields = <
+ item
+ Name = 'ID_ARTICULO'
+ DataType = datInteger
+ end
+ item
+ Name = 'REFERENCIA'
+ DataType = datString
+ Size = 255
+ end
+ item
+ Name = 'CONCEPTO'
+ DataType = datString
+ Size = 2000
+ end
+ item
+ Name = 'ARTICULO'
+ DataType = datString
+ Size = 767
+ end
+ item
+ Name = 'IMPORTE_MEDIO_UNIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'CANTIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'IMPORTE_MEDIO_TOTAL'
+ DataType = datDecimal
+ DecimalPrecision = 18
+ DecimalScale = 6
+ end
+ item
+ Name = 'IMPORTE_REAL_TOTAL'
+ DataType = datCurrency
+ end>
+ end
item
Params = <>
Statements = <
@@ -519,6 +626,217 @@ object RptFacturasProveedor: TRptFacturasProveedor
Name = 'IMPORTE_TOTAL'
DataType = datCurrency
end>
+ end
+ item
+ Params = <
+ item
+ Name = 'ID_EMPRESA'
+ Value = ''
+ end
+ item
+ Name = 'FECHAINI'
+ Value = ''
+ end
+ item
+ Name = 'FECHAFIN'
+ Value = ''
+ end>
+ Statements = <
+ item
+ ConnectionType = 'Interbase'
+ Default = True
+ SQL =
+ 'select FP.ID_EMPRESA, FP.ID_PROVEEDOR, FP.NOMBRE,'#10'avg(coalesce(F' +
+ 'CD.importe_unidad,0)) importe_medio_unidad, sum(coalesce(FCD.can' +
+ 'tidad,0)) CANTIDAD, avg(coalesce(FCD.importe_unidad,0))*sum(coal' +
+ 'esce(FCD.cantidad,0)) importe_medio_total,'#10'sum(coalesce(FCD.impo' +
+ 'rte_unidad,0)) importe_real_total'#10'from facturas_proveedor_detall' +
+ 'es FCD'#10'inner join facturas_proveedor FP on (FP.ID = FCD.ID_FACTU' +
+ 'RA)'#10'where {where}'#10'and FP.ID_EMPRESA = :ID_EMPRESA'#10'and FP.FECHA_F' +
+ 'ACTURA between :FECHAINI and :FECHAFIN'#10'and FCD.id_articulo > 1'#10#10 +
+ 'GROUP BY 1,2,3'#10'order by 7 DESC'#10
+ StatementType = stSQL
+ ColumnMappings = <
+ item
+ DatasetField = 'IMPORTE_MEDIO_UNIDAD'
+ TableField = 'IMPORTE_MEDIO_UNIDAD'
+ end
+ item
+ DatasetField = 'CANTIDAD'
+ TableField = 'CANTIDAD'
+ end
+ item
+ DatasetField = 'IMPORTE_MEDIO_TOTAL'
+ TableField = 'IMPORTE_MEDIO_TOTAL'
+ end
+ item
+ DatasetField = 'IMPORTE_REAL_TOTAL'
+ TableField = 'IMPORTE_REAL_TOTAL'
+ end
+ item
+ DatasetField = 'ID_PROVEEDOR'
+ TableField = 'ID_PROVEEDOR'
+ end
+ item
+ DatasetField = 'NOMBRE'
+ TableField = 'NOMBRE'
+ end
+ item
+ DatasetField = 'ID_EMPRESA'
+ TableField = 'ID_EMPRESA'
+ end>
+ end>
+ Name = 'InfomeComprasArticulosResumen'
+ Fields = <
+ item
+ Name = 'ID_EMPRESA'
+ DataType = datInteger
+ end
+ item
+ Name = 'ID_PROVEEDOR'
+ DataType = datInteger
+ end
+ item
+ Name = 'NOMBRE'
+ DataType = datString
+ Size = 255
+ end
+ item
+ Name = 'IMPORTE_MEDIO_UNIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'CANTIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'IMPORTE_MEDIO_TOTAL'
+ DataType = datDecimal
+ DecimalPrecision = 18
+ DecimalScale = 6
+ end
+ item
+ Name = 'IMPORTE_REAL_TOTAL'
+ DataType = datCurrency
+ end>
+ end
+ item
+ Params = <
+ item
+ Name = 'ID_EMPRESA'
+ Value = ''
+ end
+ item
+ Name = 'FECHAINI'
+ Value = ''
+ end
+ item
+ Name = 'FECHAFIN'
+ Value = ''
+ end
+ item
+ Name = 'ID_PROVEEDOR'
+ Value = ''
+ end>
+ Statements = <
+ item
+ ConnectionType = 'Interbase'
+ Default = True
+ SQL =
+ 'select FP.ID_PROVEEDOR, FCD.ID_ARTICULO, A.REFERENCIA, FCD.CONCE' +
+ 'PTO,'#10'COALESCE(A.FAMILIA,'#39#39') || '#39' '#39' || COALESCE(A.referencia_prov' +
+ ','#39#39') || '#39' '#39' || COALESCE(A.DESCRIPCION,'#39#39') ARTICULO,'#10'avg(coalesce' +
+ '(FCD.importe_unidad,0)) importe_medio_unidad, sum(coalesce(FCD.c' +
+ 'antidad,0)) CANTIDAD, avg(coalesce(FCD.importe_unidad,0))*sum(co' +
+ 'alesce(FCD.cantidad,0)) importe_medio_total,'#10'sum(coalesce(FCD.im' +
+ 'porte_total,0)) importe_real_total'#10'from facturas_proveedor_detal' +
+ 'les FCD'#10'inner join facturas_proveedor FP on (FP.ID = FCD.ID_FACT' +
+ 'URA)'#10'inner join articulos A on (A.ID = FCD.ID_ARTICULO)'#10'where {w' +
+ 'here}'#10'and FP.ID_EMPRESA = :ID_EMPRESA'#10'and FP.FECHA_FACTURA betwe' +
+ 'en :FECHAINI and :FECHAFIN'#10'and FP.ID_PROVEEDOR = :ID_PROVEEDOR'#10'a' +
+ 'nd FCD.id_articulo > 1'#10#10'GROUP BY 1,2,3,4,5'#10'order by 7 DESC'#10
+ StatementType = stSQL
+ ColumnMappings = <
+ item
+ DatasetField = 'ID_ARTICULO'
+ TableField = 'ID_ARTICULO'
+ end
+ item
+ DatasetField = 'REFERENCIA'
+ TableField = 'REFERENCIA'
+ end
+ item
+ DatasetField = 'CONCEPTO'
+ TableField = 'CONCEPTO'
+ end
+ item
+ DatasetField = 'ARTICULO'
+ TableField = 'ARTICULO'
+ end
+ item
+ DatasetField = 'IMPORTE_MEDIO_UNIDAD'
+ TableField = 'IMPORTE_MEDIO_UNIDAD'
+ end
+ item
+ DatasetField = 'CANTIDAD'
+ TableField = 'CANTIDAD'
+ end
+ item
+ DatasetField = 'IMPORTE_MEDIO_TOTAL'
+ TableField = 'IMPORTE_MEDIO_TOTAL'
+ end
+ item
+ DatasetField = 'IMPORTE_REAL_TOTAL'
+ TableField = 'IMPORTE_REAL_TOTAL'
+ end
+ item
+ DatasetField = 'ID_PROVEEDOR'
+ TableField = 'ID_PROVEEDOR'
+ end>
+ end>
+ Name = 'InfomeComprasArticulosProveedor'
+ Fields = <
+ item
+ Name = 'ID_PROVEEDOR'
+ DataType = datInteger
+ end
+ item
+ Name = 'ID_ARTICULO'
+ DataType = datInteger
+ end
+ item
+ Name = 'REFERENCIA'
+ DataType = datString
+ Size = 255
+ end
+ item
+ Name = 'CONCEPTO'
+ DataType = datString
+ Size = 2000
+ end
+ item
+ Name = 'ARTICULO'
+ DataType = datString
+ Size = 767
+ end
+ item
+ Name = 'IMPORTE_MEDIO_UNIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'CANTIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'IMPORTE_MEDIO_TOTAL'
+ DataType = datDecimal
+ DecimalPrecision = 18
+ DecimalScale = 6
+ end
+ item
+ Name = 'IMPORTE_REAL_TOTAL'
+ DataType = datCurrency
+ end>
end>
JoinDataTables = <>
UnionDataTables = <>
@@ -733,7 +1051,7 @@ object RptFacturasProveedor: TRptFacturasProveedor
PrintOptions.Printer = 'Por defecto'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 37800.807714351900000000
- ReportOptions.LastChange = 43661.771358321760000000
+ ReportOptions.LastChange = 45881.547278703710000000
ScriptLanguage = 'PascalScript'
ShowProgress = False
StoreInDFM = False
@@ -985,4 +1303,194 @@ object RptFacturasProveedor: TRptFacturasProveedor
Left = 280
Top = 24
end
+ object frxDBInformeComprasArticulos: TfrxDBDataset
+ UserName = 'frxDBInformeComprasArticulos'
+ CloseDataSource = True
+ DataSource = DADSInformeComprasArticulos
+ BCDToCurrency = False
+ Left = 472
+ Top = 376
+ end
+ object DADSInformeComprasArticulos: TDADataSource
+ DataSet = tbl_informeComprasArticulos.Dataset
+ DataTable = tbl_informeComprasArticulos
+ Left = 472
+ Top = 432
+ end
+ object tbl_informeComprasArticulos: TDAMemDataTable
+ RemoteUpdatesOptions = []
+ Fields = <
+ item
+ Name = 'ID_ARTICULO'
+ DataType = datInteger
+ end
+ item
+ Name = 'REFERENCIA'
+ DataType = datString
+ Size = 255
+ end
+ item
+ Name = 'CONCEPTO'
+ DataType = datString
+ Size = 2000
+ end
+ item
+ Name = 'ARTICULO'
+ DataType = datString
+ Size = 767
+ end
+ item
+ Name = 'IMPORTE_MEDIO_UNIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'CANTIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'IMPORTE_MEDIO_TOTAL'
+ DataType = datDecimal
+ DecimalPrecision = 18
+ DecimalScale = 6
+ end
+ item
+ Name = 'IMPORTE_REAL_TOTAL'
+ DataType = datCurrency
+ end>
+ Params = <
+ item
+ Name = 'ID_EMPRESA'
+ Value = ''
+ end
+ item
+ Name = 'FECHAINI'
+ Value = ''
+ end
+ item
+ Name = 'FECHAFIN'
+ Value = ''
+ end>
+ MasterMappingMode = mmDataRequest
+ LogChanges = False
+ StreamingOptions = [soDisableEventsWhileStreaming]
+ RemoteFetchEnabled = False
+ LocalSchema = schReport
+ LocalDataStreamer = Bin2DataStreamer
+ LogicalName = 'InfomeComprasArticulos'
+ IndexDefs = <>
+ Left = 472
+ Top = 488
+ end
+ object frxDBInformeComprasArticulosResumen: TfrxDBDataset
+ UserName = 'frxDBInformeComprasArticulosResumen'
+ CloseDataSource = True
+ DataSource = DADSInformeComprasArticulosResumen
+ BCDToCurrency = False
+ Left = 656
+ Top = 376
+ end
+ object DADSInformeComprasArticulosResumen: TDADataSource
+ DataSet = tbl_InformeComprasArticulosResumen.Dataset
+ DataTable = tbl_InformeComprasArticulosResumen
+ Left = 656
+ Top = 432
+ end
+ object tbl_InformeComprasArticulosResumen: TDAMemDataTable
+ RemoteUpdatesOptions = []
+ Fields = <>
+ Params = <>
+ MasterMappingMode = mmDataRequest
+ LogChanges = False
+ StreamingOptions = [soDisableEventsWhileStreaming]
+ RemoteFetchEnabled = False
+ IndexDefs = <>
+ Left = 656
+ Top = 488
+ end
+ object frxDBInformeComprasArticulosProveedor: TfrxDBDataset
+ UserName = 'frxDBInformeComprasArticulosProveedor'
+ CloseDataSource = True
+ DataSource = DADSInformeComprasArticulosProveedor
+ BCDToCurrency = False
+ Left = 272
+ Top = 416
+ end
+ object DADSInformeComprasArticulosProveedor: TDADataSource
+ DataSet = tbl_informeComprasArticulosProveedor.Dataset
+ DataTable = tbl_informeComprasArticulosProveedor
+ Left = 272
+ Top = 472
+ end
+ object tbl_informeComprasArticulosProveedor: TDAMemDataTable
+ RemoteUpdatesOptions = []
+ Fields = <
+ item
+ Name = 'ID_PROVEEDOR'
+ DataType = datInteger
+ end
+ item
+ Name = 'ID_ARTICULO'
+ DataType = datInteger
+ end
+ item
+ Name = 'REFERENCIA'
+ DataType = datString
+ Size = 255
+ end
+ item
+ Name = 'CONCEPTO'
+ DataType = datString
+ Size = 2000
+ end
+ item
+ Name = 'ARTICULO'
+ DataType = datString
+ Size = 767
+ end
+ item
+ Name = 'IMPORTE_MEDIO_UNIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'CANTIDAD'
+ DataType = datCurrency
+ end
+ item
+ Name = 'IMPORTE_MEDIO_TOTAL'
+ DataType = datDecimal
+ DecimalPrecision = 18
+ DecimalScale = 6
+ end
+ item
+ Name = 'IMPORTE_REAL_TOTAL'
+ DataType = datCurrency
+ end>
+ Params = <
+ item
+ Name = 'ID_EMPRESA'
+ Value = ''
+ end
+ item
+ Name = 'FECHAINI'
+ Value = ''
+ end
+ item
+ Name = 'FECHAFIN'
+ Value = ''
+ end
+ item
+ Name = 'ID_PROVEEDOR'
+ Value = ''
+ end>
+ MasterMappingMode = mmDataRequest
+ LogChanges = False
+ StreamingOptions = [soDisableEventsWhileStreaming]
+ RemoteFetchEnabled = False
+ LocalSchema = schReport
+ LocalDataStreamer = Bin2DataStreamer
+ LogicalName = 'InfomeComprasArticulosProveedor'
+ IndexDefs = <>
+ Left = 272
+ Top = 528
+ end
end
diff --git a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas
index 95e0a38..59ae3c4 100644
--- a/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas
+++ b/Source/Modulos/Facturas de proveedor/Reports/uRptFacturasProveedor_Server.pas
@@ -33,6 +33,15 @@ type
tbl_InformeListadoRecibos: TDAMemDataTable;
DADSInformeListadoRecibos: TDADataSource;
frxDBInformeListadoRecibos: TfrxDBDataset;
+ frxDBInformeComprasArticulos: TfrxDBDataset;
+ DADSInformeComprasArticulos: TDADataSource;
+ tbl_informeComprasArticulos: TDAMemDataTable;
+ frxDBInformeComprasArticulosResumen: TfrxDBDataset;
+ DADSInformeComprasArticulosResumen: TDADataSource;
+ tbl_InformeComprasArticulosResumen: TDAMemDataTable;
+ frxDBInformeComprasArticulosProveedor: TfrxDBDataset;
+ DADSInformeComprasArticulosProveedor: TDADataSource;
+ tbl_informeComprasArticulosProveedor: TDAMemDataTable;
schReport: TDASchema;
DataDictionary: TDADataDictionary;
procedure DataModuleCreate(Sender: TObject);
@@ -47,20 +56,26 @@ type
FFechaVenFin: Variant;
FListaIDProveedores: TIntegerArray;
FListaNombresProveedores: TStringList;
+ FListaIDArticulos: TIntegerArray;
+ FListaNombresArticulos: TStringList;
FImporteMinimo: Currency;
FDesglosado : Boolean;
procedure PrepararTablaInforme(ATabla: TDAMemDataTable);
procedure PrepararTablaResumenInforme(ATabla: IDADataset);
+ procedure PrepararTablaInformeComprasArticulo(ATabla: TDAMemDataTable);
+ procedure PrepararTablaResumenComprasArticulos(ATabla: IDADataset);
function _GenerarInforme(const TipoInforme: String): Binary;
procedure IniciarParametrosInforme;
procedure RecuperarNombresProveedores;
+ procedure RecuperarNombresArticulos;
public
function GenerarInformeIVA(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturas(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasRecibos(const IdEmpresa: Integer; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const FechaInicio, FechaFin: Variant): Binary;
+ function GenerarInformeComprasArticulos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDArticulos: TIntegerArray; const ListaIDProveedores: TIntegerArray): Binary;
end;
implementation
@@ -83,7 +98,8 @@ const
ds_InformeListadoFacturasTipoResumen = 'ListadoFacturasProveedorTipoResumen';
rptInformeListadoFacturasRecibosProveedor = 'InformeListadoFacturasRecibosProveedor.fr3';
rptInformeListadoFacturasRecibosProveedorDesglosado = 'InformeListadoFacturasRecibosProveedorDesglosado.fr3';
-
+ rptInformeComprasArticulos = 'InformeComprasArticulos.fr3';
+ rptInformeComprasArticulosProveedor = 'InformeComprasArticulosProveedor.fr3';
{ TRptFacturasProveedor }
@@ -95,11 +111,66 @@ begin
frxReport.EngineOptions.NewSilentMode := simReThrow;
FListaNombresProveedores := TStringList.Create;
+ FListaNombresArticulos := TStringList.Create;
end;
procedure TRptFacturasProveedor.DataModuleDestroy(Sender: TObject);
begin
FreeANDNIL(FListaNombresProveedores);
+ FreeANDNIL(FListaNombresArticulos);
+end;
+
+function TRptFacturasProveedor.GenerarInformeComprasArticulos(const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant; const ListaIDArticulos: TIntegerArray; const ListaIDProveedores: TIntegerArray): Binary;
+var
+ ATipoInforme: String;
+ AStream: TMemoryStream;
+ dsMaster: IDADataset;
+
+begin
+ FConnection.BeginTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
+
+ AStream := TMemoryStream.Create;
+ try
+ //Inicializamos parametros
+ FIdEmpresa := IdEmpresa;
+ FFechaInicio := FechaInicio;
+ FFechaFin := FechaFin;
+
+ if Assigned(FListaIDArticulos) then
+ FListaIDArticulos.Free;
+ FListaIDArticulos := ListaIDArticulos;
+
+ if Assigned(FListaIDProveedores) then
+ FListaIDProveedores.Free;
+ FListaIDProveedores := ListaIDProveedores;
+
+
+ if Assigned(FListaIDProveedores) and (FListaIDProveedores.Count > 0) then
+ begin
+ if tbl_InformeComprasArticulosProveedor.Active then
+ tbl_InformeComprasArticulosProveedor.Active := False;
+ PrepararTablaInformeComprasArticulo(tbl_InformeComprasArticulosProveedor);
+ ATipoInforme := rptInformeComprasArticulosProveedor;
+ tbl_InformeComprasArticulosProveedor.Active := True;
+ end
+ else
+ begin
+ if tbl_InformeComprasArticulos.Active then
+ tbl_InformeComprasArticulos.Active := False;
+ PrepararTablaInformeComprasArticulo(tbl_InformeComprasArticulos);
+ ATipoInforme := rptInformeComprasArticulos;
+ tbl_InformeComprasArticulos.Active := True;
+ end;
+
+
+
+ Result := _GenerarInforme(ATipoInforme);
+
+ finally
+ AStream.Free;
+ dsMaster := Nil;
+ FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO"
+ end;
end;
function TRptFacturasProveedor.GenerarInformeIVA(const IdEmpresa: Integer;
@@ -452,6 +523,17 @@ begin
ACadena := ACadena + ' (desglosados)'
end;
+ if Assigned(FListaIDArticulos) and (FListaIDArticulos.Count > 0) then
+ begin
+ RecuperarNombresArticulos;
+ ACadena := FListaNombresArticulos.Text;
+ end
+ else begin
+ ACadena := 'Todos los articulos';
+ if FDesglosado then
+ ACadena := ACadena + ' (desglosados)'
+ end;
+
ATextos.Add(ACadena);
ACadena := '';
@@ -544,6 +626,121 @@ begin
end;
end;
+procedure TRptFacturasProveedor.PrepararTablaInformeComprasArticulo(ATabla: TDAMemDataTable);
+var
+ Condicion: TDAWhereExpression;
+ i: Integer;
+
+begin
+ // Filtrar el informe por empresa
+ if not VarIsNull(FIdEmpresa) then
+ begin
+ ATabla.ParamByName('ID_EMPRESA').AsVariant := FIdEmpresa;
+ end;
+
+ // Filtrar el informe por fechas
+ if not VarIsNull(FFechaInicio)
+ and not VarIsNull(FFechaFin) then
+ begin
+ ATabla.ParamByName('FECHAINI').AsVariant := FFechaInicio;
+ ATabla.ParamByName('FECHAFIN').AsVariant := FFechaFin;
+ end;
+
+ // Filtrar el informe por articulo
+ if Assigned(FListaIDArticulos) then
+ begin
+ with ATabla.DynamicWhere do
+ begin
+ for i := 0 to FListaIDArticulos.Count - 1 do
+ begin
+
+ // (ID_ARTICULO = ID)
+ Condicion := NewBinaryExpression(NewField('', fld_facturasProveedor_DetallesID_ARTICULO), NewConstant(FListaIDArticulos.Items[i], datInteger), dboEqual);
+ if IsEmpty then
+ Expression := Condicion
+ else
+ Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
+ end;
+ end;
+ end;
+
+ // Filtrar el informe por Proveedores
+ if Assigned(FListaIDProveedores) then
+ begin
+ if FListaIDProveedores.Count > 0 then
+ ATabla.ParamByName('ID_PROVEEDOR').AsVariant := FListaIDProveedores.Items[i];
+
+{ with ATabla.DynamicWhere do
+ begin
+ for i := 0 to FListaIDProveedores.Count - 1 do
+ begin
+
+ // (ID_PROVEEDOR = ID)
+ Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorID_PROVEEDOR), NewConstant(FListaIDProveedores.Items[i], datInteger), dboEqual);
+ if IsEmpty then
+ Expression := Condicion
+ else
+ Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
+ end;
+ end;
+}
+ end;
+
+end;
+
+procedure TRptFacturasProveedor.PrepararTablaResumenComprasArticulos(ATabla: IDADataset);
+var
+ i: Integer;
+ AWhereStr : String;
+ Condicion: TDAWhereExpression;
+
+begin
+ // Filtrar el informe por empresa
+ with ATabla.DynamicWhere do
+ begin
+ // (ID_EMPRESA >= ID)
+ Condicion := NewBinaryExpression(NewField('', ('FC.'+ fld_FacturasProveedorID_EMPRESA)), NewConstant(FIdEmpresa, datInteger), dboEqual);
+ if IsEmpty then
+ Expression := Condicion
+ else
+ Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
+ end;
+
+ // Filtrar el informe por fechas
+ if not VarIsNull(FFechaInicio)
+ and not VarIsNull(FFechaFin) then
+ begin
+ with ATabla.DynamicWhere do
+ begin
+ // (FECHA_INICIO between FECHA_FIN)
+ Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedorFECHA_FACTURA), NewConstant(FFechaInicio, datDateTime), dboGreaterOrEqual);
+ Condicion := NewBinaryExpression(NewBinaryExpression(NewField('', fld_FacturasProveedorFECHA_FACTURA), NewConstant(FFechaFin, datDateTime), dboLessOrEqual), Condicion, dboAnd);
+ if IsEmpty then
+ Expression := Condicion
+ else
+ Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
+ end;
+ end;
+
+ // Filtrar el informe por articulo
+ if Assigned(FListaIDArticulos) then
+ begin
+ with ATabla.DynamicWhere do
+ begin
+ for i := 0 to FListaIDArticulos.Count - 1 do
+ begin
+
+ // (ID_ARTICULO = ID)
+ Condicion := NewBinaryExpression(NewField('', fld_FacturasProveedor_DetallesID_ARTICULO), NewConstant(FListaIDArticulos.Items[i], datInteger), dboEqual);
+ if IsEmpty then
+ Expression := Condicion
+ else
+ Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
+ end;
+ end;
+ end;
+end;
+
procedure TRptFacturasProveedor.PrepararTablaResumenInforme(ATabla: IDADataset);
var
i: Integer;
@@ -593,6 +790,98 @@ begin
ATabla.Where.AddText(AWhereStr);
end;
+procedure TRptFacturasProveedor.RecuperarNombresArticulos;
+var
+ AArticulosService : IsrvArticulos;
+ Intf : IInterface;
+ AClientID : TGUID;
+
+ ATableNameArray: StringArray;
+ ATableRequestInfoArray: TableRequestInfoArray;
+ ATableRequestInfo: TableRequestInfoV5;
+ AStream: TMemoryStream;
+ ADataTable: TDAMemDataTable;
+ i: Integer;
+ AWhereBuilder : TDAWhereBuilder;
+ ACondicion : TDAWhereExpression;
+ ACadena: String;
+begin
+ CreateGUID(AClientID);
+
+ GetClassFactory('srvArticulos').CreateInstance(AClientID, Intf);
+
+ if Assigned(Intf) then
+ begin
+ AArticulosService := Intf as IsrvArticulos;
+
+ ATableNameArray := StringArray.Create;
+ ATableRequestInfoArray := TableRequestInfoArray.Create;
+ AWhereBuilder := TDAWhereBuilder.Create;
+ try
+ ATableNameArray.Add('Articulos');
+ ATableRequestInfo := TableRequestInfoV5.Create;
+
+ with ATableRequestInfo do
+ begin
+ IncludeSchema := True;
+ MaxRecords := -1;
+ UserFilter := '';
+
+ AWhereBuilder.Clear;
+ with AWhereBuilder do
+ for i := 0 to FListaIDArticulos.Count - 1 do
+ begin
+ ACondicion := NewBinaryExpression(
+ NewBinaryExpression(NewField('', 'ID'), NewConstant(FListaIDArticulos[i], datInteger), dboEqual),
+ NewBinaryExpression(NewField('', 'ID_EMPRESA'), NewConstant(FIdEmpresa, datInteger), dboEqual),
+ dboAnd);
+
+ if not AWhereBuilder.IsEmpty then
+ Expression := NewBinaryExpression(Expression, ACondicion, dboOr)
+ else
+ Expression := ACondicion;
+ end;
+
+ WhereClause := AWhereBuilder.ExpressionToXmlNode(AWhereBuilder.Expression);
+ end;
+
+ try
+ ATableRequestInfoArray.Add(ATableRequestInfo);
+ AStream := AArticulosService.GetData(ATableNameArray, ATableRequestInfoArray);
+ if Assigned(AStream) then
+ begin
+ ADataTable := TDAMemDataTable.Create(nil);
+ try
+ ADataTable.Name := 'Articulos';
+ ADataTable.LocalDataStreamer := Bin2DataStreamer;
+ ADataTable.RemoteFetchEnabled := False;
+ Bin2DataStreamer.ReadDataset(AStream, ADataTable, True);
+
+ ADataTable.Open;
+ FListaNombresArticulos.Clear;
+ for i := 0 to ADataTable.RecordCount - 1 do
+ begin
+ ACadena := ADataTable.FieldByName('FAMILIA').AsString + ADataTable.FieldByName('REFERENCIA_PROV').AsString + ADataTable.FieldByName('DESCRIPCION').AsString;
+ FListaNombresArticulos.Add(ACadena);
+ ADataTable.Next;
+ end;
+
+ finally
+ FreeANDNil(ADataTable);
+ end;
+ end;
+ except
+ on e: Exception do
+ dmServer.EscribirLog(e.Message);
+ end;
+ finally
+ FreeANDNIL(ATableRequestInfoArray);
+ FreeANDNIL(ATableNameArray);
+ FreeANDNIL(AWhereBuilder);
+ end;
+ end;
+end;
+
procedure TRptFacturasProveedor.RecuperarNombresProveedores;
var
AContactosService : IsrvContactos;
diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk
index bb72a46..b2c3b20 100644
--- a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk
+++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dpk
@@ -54,6 +54,7 @@ contains
uIViewFiltroAno in 'View\uIViewFiltroAno.pas',
uIEditorInformeVentasArticulosReport in 'View\uIEditorInformeVentasArticulosReport.pas',
uIViewFiltroArticulos in 'View\uIViewFiltroArticulos.pas',
- uIViewFiltroComerciales in 'View\uIViewFiltroComerciales.pas';
+ uIViewFiltroComerciales in 'View\uIViewFiltroComerciales.pas',
+ uIEditorInformeComprasArticulosReport in 'View\uIEditorInformeComprasArticulosReport.pas';
end.
diff --git a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj
index 659e14f..e360695 100644
--- a/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj
+++ b/Source/Modulos/Gestor de informes/Controller/GestorInformes_controller.dproj
@@ -38,11 +38,12 @@
MainSource
-
-
-
+
+
+
+
diff --git a/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas
index e35b371..5dbfa1e 100644
--- a/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas
+++ b/Source/Modulos/Gestor de informes/Controller/uGestorInformesController.pas
@@ -38,6 +38,7 @@ type
procedure VerInformeIVAProveedores;
procedure VerInformeListadoFacturasProv;
procedure VerInformeListadoFacturasProvPendientes;
+ procedure VerInformeComprasArticulo;
//MODULO RECIBOS DE PROVEEDOR
procedure VerInformeListadoRecibosProvPendientes;
@@ -91,11 +92,12 @@ type
procedure VerInformeListadoRecibosCliente;
//MODULO FACTURAS DE PROVEEDOR
- function DarListaAnosFacturasProv: TStringList;
+ function DarListaAnosFacturasProv: TStringList;
procedure VerInformeIVAProveedores;
procedure VerInformeListadoFacturasProv;
procedure VerInformeListadoFacturasProvPendientes;
procedure VerInformeListadoFacturasRecibosProv(const ID_PROVEEDOR: Integer);
+ procedure VerInformeComprasArticulo;
//MODULO RECIBOS DE PROVEEDOR
procedure VerInformeListadoRecibosProvPendientes;
@@ -122,7 +124,7 @@ uses
uIEditorInformeRecibosProvPendientesReport,
uIEditorInformePedidosReport, uIEditorInformeFacturasRecibosClienteReport,
uIEditorInformeFacturasRecibosProveedorReport, uIEditorInformeVentasArticulosReport,
- uIEditorInformeInventarioValoradoCompras2AnosReport,
+ uIEditorInformeComprasArticulosReport, uIEditorInformeInventarioValoradoCompras2AnosReport,
uIEditorInformeModelo347Report;
@@ -304,6 +306,28 @@ begin
Result := FDataModule;
end;
+procedure TGestorInformesController.VerInformeComprasArticulo;
+var
+ AStream: Binary;
+ AEditor : IEditorInformeComprasArticulosReport;
+begin
+ AEditor := NIL;
+
+ CreateEditor('EditorInformeComprasArticulosReport', IEditorInformeComprasArticulosReport, AEditor);
+ if Assigned(AEditor) then
+ try
+ AEditor.Controller := Self;
+ AEditor.Title := 'Listado de compras de articulos';
+ AStream := FDataModule.GenerarInformeComprasArticulos(AppFactuGES.EmpresaActiva.ID, AEditor.FechaInicio, AEditor.FechaFin, AEditor.ListaIDArticulos, AEditor.ListaIDProveedores);
+ AEditor.LoadFromStream(AStream);
+ AEditor.Preview;
+ finally
+ AEditor.Release;
+ AEditor := Nil;
+ FreeAndNil(AStream);
+ end;
+end;
+
procedure TGestorInformesController.VerInformeInventarioValoradoCompras2Anos;
var
AStream: Binary;
diff --git a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas
index 874d521..c13e060 100644
--- a/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas
+++ b/Source/Modulos/Gestor de informes/Data/uDataModuleGestorInformes.pas
@@ -41,11 +41,12 @@ type
function GenerarInformeListadoRecibosCliente(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
//MODULO FACTURAS DE PROVEEDOR
- function DarListaAnosFacturasProv: TStringList;
+ function DarListaAnosFacturasProv: TStringList;
function GenerarInformeIVAProveedores(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasProv(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasRecibosProv(const IdEmpresa: Integer; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const FechaInicio: Variant; const FechaFin: Variant): Binary;
+ function GenerarInformeComprasArticulos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDArticulos: TIntegerArray; const ListaIDProveedores: TIntegerArray): Binary;
//MODULO RECIBOS DE CLIENTE
function GenerarInformeListadoRecibosProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
@@ -105,6 +106,14 @@ begin
end;
end;
+function TDataModuleGestorInformes.GenerarInformeComprasArticulos(const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant; const ListaIDArticulos: TIntegerArray; const ListaIDProveedores: TIntegerArray): Binary;
+begin
+ try
+ Result := (RORemoteService as IsrvGestorInformes).GenerarInformeComprasArticulos(IdEmpresa, FechaInicio, FechaFin, ListaIdArticulos, ListaIdProveedores);
+ finally
+ end;
+end;
+
function TDataModuleGestorInformes.GenerarInformeIVAClientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDClientes: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
begin
try
@@ -146,10 +155,8 @@ begin
end;
end;
-function TDataModuleGestorInformes.GenerarInformeListadoFacturasProv(
- const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant;
- const FechaVenInicio: Variant; const FechaVenFin: Variant;
- const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean;
+function TDataModuleGestorInformes.GenerarInformeListadoFacturasProv(const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant;
+ const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean;
const ImporteMinimo: Currency): Binary;
begin
try
diff --git a/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas
index f70fc4f..3719d02 100644
--- a/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas
+++ b/Source/Modulos/Gestor de informes/Model/Data/uIDataModuleGestorInformes.pas
@@ -35,6 +35,7 @@ type
function GenerarInformeListadoFacturasProv(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasRecibosProv(const IdEmpresa: Integer; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const FechaInicio: Variant; const FechaFin: Variant): Binary;
+ function GenerarInformeComprasArticulos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDArticulos: TIntegerArray; const ListaIDProveedores: TIntegerArray): Binary;
//MODULO RECIBOS DE CLIENTE
function GenerarInformeListadoRecibosProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
diff --git a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm
index 5f995e1..81eeca3 100644
--- a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm
+++ b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.dfm
@@ -121,6 +121,10 @@ object PluginGestorInformes: TPluginGestorInformes
Caption = 'Informe de ventas de articulo'
OnExecute = actInformeVentasArticuloExecute
end
+ object actInformeComprasArticulo: TAction
+ Caption = 'Informe de compras de articulo'
+ OnExecute = actInformeComprasArticuloExecute
+ end
end
object MainMenu: TMainMenu
Images = LargeImages
@@ -203,6 +207,10 @@ object PluginGestorInformes: TPluginGestorInformes
Tag = 170
Action = actInformeVentasArticulo
end
+ object Informedecomprasdearticulo1: TMenuItem
+ Tag = 180
+ Action = actInformeComprasArticulo
+ end
end
end
object SmallImages: TPngImageList
diff --git a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas
index c1f9f8a..9a964ac 100644
--- a/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas
+++ b/Source/Modulos/Gestor de informes/Plugin/uPluginGestorInformes.pas
@@ -51,6 +51,8 @@ type
InformeModelo3472: TMenuItem;
actInformeVentasArticulo: TAction;
InformedeVentasdearticulo1: TMenuItem;
+ actInformeComprasArticulo: TAction;
+ Informedecomprasdearticulo1: TMenuItem;
procedure actInformeFacturasClienteExecute(Sender: TObject);
procedure actInformeFacturasClientePendientesExecute(Sender: TObject);
procedure actInformeFacturasClienteIVAExecute(Sender: TObject);
@@ -65,6 +67,7 @@ type
procedure actInformeListadoFacturasRecibosCliExecute(Sender: TObject);
procedure actInformeModelo347Execute(Sender: TObject);
procedure actInformeVentasArticuloExecute(Sender: TObject);
+ procedure actInformeComprasArticuloExecute(Sender: TObject);
private
FController : IGestorInformesController;
public
@@ -88,6 +91,11 @@ end;
exports
GetModule name GET_MODULE_FUNC;
+procedure TPluginGestorInformes.actInformeComprasArticuloExecute(Sender: TObject);
+begin
+ FController.VerInformeComprasArticulo;
+end;
+
procedure TPluginGestorInformes.actInformeFacturasClienteExecute(
Sender: TObject);
begin
diff --git a/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas
index b1de8e5..f319754 100644
--- a/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas
+++ b/Source/Modulos/Gestor de informes/Servidor/srvGestorInformes_Impl.pas
@@ -71,6 +71,7 @@ type
function GenerarInformeListadoFacturasProvPendientes(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
function GenerarInformeListadoFacturasRecibosProv(const IdEmpresa: Integer; const ListadoIDProveedores: TIntegerArray; const Desglosado: Boolean; const FechaInicio: Variant;
const FechaFin: Variant): Binary;
+ function GenerarInformeComprasArticulos(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const ListaIDArticulos: TIntegerArray; const ListaIDProveedores: TIntegerArray): Binary;
//MODULO RECIBOS PROVEEDOR
function GenerarInformeListadoRecibosProveedor(const IdEmpresa: Integer; const FechaInicio: Variant; const FechaFin: Variant; const FechaVenInicio: Variant; const FechaVenFin: Variant; const ListaIDProveedores: TIntegerArray; const Desglosado: Boolean; const ImporteMinimo: Currency): Binary;
@@ -175,6 +176,18 @@ begin
}
end;
+function TsrvGestorInformes.GenerarInformeComprasArticulos(const IdEmpresa: Integer; const FechaInicio, FechaFin: Variant; const ListaIDArticulos: TIntegerArray; const ListaIDProveedores: TIntegerArray): Binary;
+var
+ AReportGenerator : TRptFacturasProveedor;
+begin
+ AReportGenerator := TRptFacturasProveedor.Create(nil);
+ try
+ Result := AReportGenerator.GenerarInformeComprasArticulos(IdEmpresa, FechaInicio, FechaFin, ListaIDArticulos, ListaIDProveedores);
+ finally
+ FreeAndNIL(AReportGenerator);
+ end;
+end;
+
function TsrvGestorInformes.GenerarInformeInventarioValoradoCompras2Anos: Binary;
var
AReportGenerator : TRptInventario;
diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk
index 129e359..3ce80f0 100644
--- a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk
+++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dpk
@@ -94,6 +94,7 @@ contains
uViewFiltroAno in 'uViewFiltroAno.pas' {frViewFiltroAno: TFrame},
uViewFiltroArticulos in 'uViewFiltroArticulos.pas' {frViewFiltroArticulos: TFrame},
uEditorInformeVentasArticulosReport in 'uEditorInformeVentasArticulosReport.pas' {fEditorInformeVentasArticulosReport: TForm},
- uViewFiltroComerciales in 'uViewFiltroComerciales.pas' {frViewFiltroComerciales: TFrame};
+ uViewFiltroComerciales in 'uViewFiltroComerciales.pas' {frViewFiltroComerciales: TFrame},
+ uEditorInformeComprasArticulosReport in 'uEditorInformeComprasArticulosReport.pas' {fEditorInformeComprasArticulosReport: TForm};
end.
diff --git a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj
index c566331..d6ab2ae 100644
--- a/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj
+++ b/Source/Modulos/Gestor de informes/Views/GestorInformes_view.dproj
@@ -38,53 +38,51 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TForm
+
+
+ TForm
+
t
@@ -159,7 +157,7 @@
TFrame
-
+
TFrame
@@ -178,6 +176,12 @@
TFrame
+
+
+
+
+
+