From 39bb30bcd7699885efb55e5f3f8b6f7d08a95c5c Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 27 Nov 2016 13:42:42 +0100 Subject: [PATCH] =?UTF-8?q?PDF=20Operation=20ajout=20d=C3=A9tail=20op?= =?UTF-8?q?=C3=A9ration=20pour=20GrandLivre=20ANC=20,=20export=20des=20pi?= =?UTF-8?q?=C3=A8ces=20avec=20tampon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class/class_document_export.php | 30 +++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/include/class/class_document_export.php b/include/class/class_document_export.php index 89bc9f536..a42979fe6 100644 --- a/include/class/class_document_export.php +++ b/include/class/class_document_export.php @@ -205,11 +205,11 @@ class Document_Export } // output $output = $this->store_convert . '/stamp_' . $file_pdf; - + // Concatenate stamp + file $stmt = PDFTK . " " . escapeshellarg($this->store_convert . '/' . $file_pdf) . ' stamp ' . $this->store_convert . '/stamp.pdf output ' . $output; - + passthru($stmt, $status); echo $stmt; if ($status <> 0) @@ -221,6 +221,32 @@ class Document_Export $cnt_feedback++; continue; } + + // create the pdf with the detail of operation + $detail_operation = new PDF_Operation($cn,$jr_id); + $detail_operation->export_pdf(array("acc","anc")); + + // output 2 + $output2 = $this->store_convert . '/operation_' . $file_pdf; + + // concatenate detail operation with the output + $stmt = PDFTK . " " . $detail_operation->get_pdf_file()." ".$output. + ' output ' . $output2; + + passthru($stmt, $status); + echo $stmt; + if ($status <> 0) + { + + $this->feedback[$cnt_feedback]['file'] = $file_pdf; + $this->feedback[$cnt_feedback]['message'] = _('Echec Ajout detail '); + $this->feedback[$cnt_feedback]['error'] = $status; + $cnt_feedback++; + continue; + } + // overwrite old with new PDF + rename ($output2,$output); + // Move the PDF into another temp directory $this->move_file($output, 'stamp_' . $file_pdf); }