diff --git a/Doxyfile b/Doxyfile index 09d5e7ff2..2b01ef747 100644 --- a/Doxyfile +++ b/Doxyfile @@ -218,7 +218,7 @@ JAVADOC_AUTOBRIEF = YES # interpreted by doxygen. # The default value is: NO. -JAVADOC_BANNER = NO +JAVADOC_BANNER = YES # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If diff --git a/include/XMLDocument/XMLInvoice.php b/include/XMLDocument/XMLInvoice.php index b8668b3ae..51126afe5 100644 --- a/include/XMLDocument/XMLInvoice.php +++ b/include/XMLDocument/XMLInvoice.php @@ -213,7 +213,6 @@ abstract class XMLInvoice extends \DOMDocument $result['operation'][$i]['vat_id']=$operation->det->array[$i]['qs_vat_code']; $result['operation'][$i]['vat_reversed']=$operation->det->array[$i]['qs_vat_sided']; } - print_r($result); return $result; } diff --git a/include/class/acc_document.class.php b/include/class/acc_document.class.php index 0d6ee7f41..a523a5f0a 100644 --- a/include/class/acc_document.class.php +++ b/include/class/acc_document.class.php @@ -31,16 +31,16 @@ * @brief Document used in accountancy : invoice , credit note, ... It is * a specialization of Document used in Follow-UP. * property : + * - d_id JRN.JR_ID * - d_name name Receipt number - - d_description Comment of the operation - - d_mimetype mimetype of the document - - d_filename filename - - document_xml oid of the XML invoice (including PDF) + - d_description Comment of the operation + - d_mimetype mimetype of the document JRN.JR_PJ_TYPE + - d_filename filename JRN.JR_PJ_NAME + - document_xml oid of the XML invoice (including PDF) JRN.JR_DOCUMENT_XML + - d_lob = JRN.JR_PJ * */ class Acc_Document extends Document { - - private $document_xml; ///< $document_xml (oid) XML document e-invoice public function get_document_xml() { @@ -130,19 +130,16 @@ class Acc_Document extends Document { $oid, $this->d_id ]); + } /** * @brief create the invoice and saved it as attachment to the * operation, - * @param $internal is the internal code JRN.JR_INTERNAL * @param $p_array is normally the $_POST @verbatim Array ( [ledger_type] => VEN - [ac] => COMPTA/VENMENU/VEN - [sa] => p - [action_gestion] => [gDossier] => x [nb_item] => 1 (number of item used to numerate e_marchX, e_quantX ,...) [p_jrn] => 2 @@ -174,6 +171,7 @@ class Acc_Document extends Document { [e_mp_qcode_16] => Banque 1 [e_mp_qcode_17] => Banque 2 [view_invoice] => Enregistrer + [gen_doc] => int DOCUMENT_MODELE.MD_ID , document template to use ) * @endverbatim * @todo rewrite code : remove extract and +SQL value @@ -181,9 +179,13 @@ class Acc_Document extends Document { */ function create_document($internal, $p_array) { $this->f_id = $p_array['e_client']; + // var md_id (int) DOCUMENT_MODELE.MD_ID $this->md_id = $p_array['gen_doc']; + // var ag_id == 0 fake follow-up $this->ag_id = 0; - $p_array['e_pj'] = $this->db->get_value("select jr_pj_number from jrn where jr_internal=$1", [$internal]); + // var e_pj (string) receipt nb + $p_array['e_pj'] = $this->db->get_value("select jr_pj_number from jrn where jr_id=$1" + , [$this->d_id]); $filename = ""; // generate the document and set d_lob,d_mimetype, $this->generate($p_array, $p_array['e_pj']); @@ -207,7 +209,7 @@ class Acc_Document extends Document { if (empty($this->d_filename)) { return false; } - + $this->db->start(); if ($this->db->lo_export($this->d_lob, $destination_file) == false) { record_log("ACD122. cannot export"); @@ -216,6 +218,7 @@ class Acc_Document extends Document { } $this->db->commit(); - return true; + return $destination_file; } -} + +} \ No newline at end of file diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 105f18369..ef68df361 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -1981,8 +1981,13 @@ class Acc_Ledger extends jrn_def_sql */ function create_document($internal, $p_array) { - $acc_document=new Acc_Document($this->db); - $acc_document->create_document($internal, $p_array); + $id=$this->db->get_value('select jr_id from jrn where jr_internal=$1', + [$internal]); + if ( $id == "") { + return; + } + $acc_document=new Acc_Document($this->db,$id); + $acc_document->create_document($internal,$p_array); return h($acc_document->d_name.' ('.$acc_document->d_filename.')'); }