diff --git a/include/XMLDocument/invoiceubl21.class.php b/include/XMLDocument/invoiceubl21.class.php index 2c62a938d..5ec481a30 100644 --- a/include/XMLDocument/invoiceubl21.class.php +++ b/include/XMLDocument/invoiceubl21.class.php @@ -449,7 +449,7 @@ class InvoiceUBL21 extends XMLInvoice { // ITEM $item=$this->createElement("cac:Item"); - $item->appendChild($this->createElement("cbc:Description",$row['name'])); + $item->appendChild($this->createElement("cbc:Description",$row['description'])); $item->appendChild($this->createElement("cbc:Name", $row['qcode'])); $classifiedTaxCat=$this->createElement("cac:ClassifiedTaxCategory"); @@ -562,6 +562,10 @@ class InvoiceUBL21 extends XMLInvoice { } $root->appendChild($this->createElement('cbc:DueDate',$this->data['due_date'])); $root->appendChild($this->createElement('cbc:InvoiceTypeCode',380)); + /** + * add note if any + */ + $root->appendChild($this->createElement('cbc:DocumentCurrencyCode',$this->data['currency'])); $root->appendChild($this->createElement('cbc:BuyerReference',$this->data['info']['order'])); /** diff --git a/include/XMLDocument/xmlinvoice.class.php b/include/XMLDocument/xmlinvoice.class.php index 41de86bf9..086e26a8f 100644 --- a/include/XMLDocument/xmlinvoice.class.php +++ b/include/XMLDocument/xmlinvoice.class.php @@ -186,6 +186,7 @@ abstract class XMLInvoice extends \DOMDocument // document description $result['description']=$operation->det->jr_comment; + // note if any // goods and services $result['operation']=array(); @@ -196,7 +197,8 @@ abstract class XMLInvoice extends \DOMDocument $card=new \Fiche($this->cn,$operation->det->array[$i]['qs_fiche']); $result['operation'][$i]['qcode']=$card->get_attribute(ATTR_DEF_QUICKCODE); $result['operation'][$i]['name']=$card->get_attribute(ATTR_DEF_NAME); - $result['operation'][$i]['description']=$card->get_attribute(9); + $result['operation'][$i]['description']=($operation->det->array[$i]['j_text']=="")?$card->get_attribute(9):$operation->det->array[$i]['j_text']; + // get the type of unity, if not found then it will be EA $x= $card->get_attribute(ATTR_DEF_QUANTITY_TYPE,0); $result['operation'][$i]['code_quantity']=($x===false||$x=="")?"EA":$x;