diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 12e6e336d..295952b11 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -1979,7 +1979,7 @@ class Acc_Ledger extends jrn_def_sql * @param $internal is the internal code * @param $p_array is normally the $_POST @see Acc_Document::create_document - * @return a string + * @return html string */ function create_document($internal, $p_array) { diff --git a/include/class/document.class.php b/include/class/document.class.php index 6112d61eb..6c9e7bb47 100644 --- a/include/class/document.class.php +++ b/include/class/document.class.php @@ -151,15 +151,15 @@ class Document throw new Exception ("DC121 cannot create $dirname directory",5000); } /** - * md_id == -2 is the standard PDF invoice, you don't parse or compute + * md_id == -2 : INVOICE_STD is the standard PDF invoice, you don't parse or compute * it */ - if ( $this->md_id == -2) + if ( $this->md_id == INVOICE_STD) { $file_to_parse=str_replace( array('/', '*', '<', '>', ';', ',', '\\', '.', ':', '(', ')', ' ', '[', ']') , "-" - , "inv-std-".$p_array['e_pj'].".pdf"); + , "inv-std-".$p_array['e_pj']).".pdf"; $this->d_number=$this->db->get_next_seq("seq_doc_type_stdinv"); $this->d_filename=$file_to_parse; diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index 64df8fe20..cd7b00ac2 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -176,10 +176,8 @@ if ( isset($_POST['record']) ) } else /* Generate an invoice and save it into the database */ - if (isset($_POST['gen_invoice'])) + if (isset($_POST['gen_invoice'])) { - //@var $invoice_template (int) get the invoice number DOCUMENT_MODELE.MD_ID - $invoice_template=$http->post("gen_doc","number"); // generate an invoice $file = $Ledger->create_document($internal, $_POST); $receipt= HtmlInput::show_receipt_document($Ledger->jr_id @@ -228,7 +226,7 @@ if ( isset($_POST['record']) ) $mt=date ('ymd-Hi').'+'.$Ledger->jr_id; $uniq= $_ENV['TMP']. DIRECTORY_SEPARATOR."$mt-e-invoice.xml"; file_put_contents($uniq, $xml); - chmod ($uniq,774); + chmod ($uniq,"0774"); echo \Noalyss\Dbg::echo_file("file save $uniq"); } diff --git a/include/constant.php b/include/constant.php index 5476ae158..4026788e0 100644 --- a/include/constant.php +++ b/include/constant.php @@ -25,7 +25,7 @@ global $version_noalyss; // version -define('NOALYSS_VERSION', 9312 ); +define('NOALYSS_VERSION', 9400 ); // Database schema version define("DBVERSION", 203); @@ -208,6 +208,7 @@ define("OPEN", 1); define("CLOSED", 0); define("NOTCENTRALIZED", 3); define("ALL", 4); +define("INVOICE_STD", -2); // Pour les ShowMenuComptaLeft define("MENU_FACT", 1);