diff --git a/include/XMLDocument/InvoiceUBL21.php b/include/XMLDocument/InvoiceUBL21.php index 7183bbfb3..52f3a9bdc 100644 --- a/include/XMLDocument/InvoiceUBL21.php +++ b/include/XMLDocument/InvoiceUBL21.php @@ -296,16 +296,16 @@ class InvoiceUBL21 extends XMLInvoice { */ function build_paymentInfo() { + $company = $this->load_noalyss_parameter(); $payment=$this->createElement("cac:PaymentMeans"); $payment->appendChild($this->createElement('cbc:PaymentMeansCode',30)); ///@note cbc:PaymentID est la communication lors du paiement - $payment->appendChild($this->createElement('cbc:PaymentID',$this->data["id"])); + $payment->appendChild($this->createElement('cbc:PaymentID',$this->data["info"]['communication'])); $f=$this->createElement ('cac:PayeeFinancialAccount'); ///@todo customer = IBAN doit être dans les paramètres (voir upgrade.sql) - $f->appendChild($this->createElement("cbc:ID", "ERROR:IBAN")); + $f->appendChild($this->createElement("cbc:ID",$company['COMPANY_BANK_IBAN'])); $g=$this->createElement("cac:FinancialInstitutionBranch"); - ///@todo customer = BIC doit être dans les paramètres (voir upgrade.sql) - $g->appendChild($this->createElement("cbc:ID", "ERROR:BIC")); + $g->appendChild($this->createElement("cbc:ID", $company['COMPANY_BANK_BIC'])); $f->appendChild($g); $payment->appendChild($f); @@ -596,7 +596,7 @@ class InvoiceUBL21 extends XMLInvoice { $root->appendChild($this->createElement('cbc:DueDate',$this->data['due_date'])); $root->appendChild($this->createElement('cbc:InvoiceTypeCode',380)); $root->appendChild($this->createElement('cbc:DocumentCurrencyCode',$this->data['currency'])); - $root->appendChild($this->createElement('cbc:BuyerReference',"NOALYSS")); + $root->appendChild($this->createElement('cbc:BuyerReference',$this->data['info']['order'])); /** * insert PDF in the XML */ diff --git a/include/XMLDocument/XMLInvoice.php b/include/XMLDocument/XMLInvoice.php index a1ce9e0ae..ba5a2d392 100644 --- a/include/XMLDocument/XMLInvoice.php +++ b/include/XMLDocument/XMLInvoice.php @@ -59,7 +59,7 @@ namespace Noalyss\XMLDocument; [currency] => 0 [info] => Array [order] = order reference - [comment] = comment added to the invoice + [communication] = communication added to the invoice [operation] => Array ( [0] => Array @@ -218,17 +218,20 @@ abstract class XMLInvoice extends \DOMDocument ,[$jr_id]); $nb_row = count($a_row); $result['info']=[]; + $result['info']['order']='NA'; + $result['info']['communication']=''; for($i=0;$i<$nb_row;$i++) { switch ($a_row[$i]['id_type']) { case 'BON_COMMANDE': $result['info']['order']=$a_row[$i]['ji_value']; break; case 'OTHER': - $result['info']['comment']=$a_row[$i]['ji_value']; + $result['info']['communication']=$a_row[$i]['ji_value']; break; } } + $result['info']['communication']=($result['info']['communication']=="")?$result['id']:""; return $result; } diff --git a/include/class/acc_ledger_sale.class.php b/include/class/acc_ledger_sale.class.php index 2b929d641..fd7c35420 100644 --- a/include/class/acc_ledger_sale.class.php +++ b/include/class/acc_ledger_sale.class.php @@ -1286,7 +1286,8 @@ EOF; return $r; } - /*!\brief the function extra info allows to + /*! + * \brief the function extra info allows to * - add a attachment * - generate an invoice * - insert extra info @@ -1294,7 +1295,7 @@ EOF; */ public function extra_info() { - $r = '