liuksas Posted February 18 Share Posted February 18 (edited) Please help, Maybe someone knows where the error is, why it doesn't show invoice number in xml ? php: // Data Header $xml->writeElement('DocNumber', $order['Invoice_number']); Prestashop 1.7.8 Edited February 23 by liuksas (see edit history) Link to comment Share on other sites More sharing options...
Prestashop Addict Posted February 19 Share Posted February 19 Please give more context, in which class/controller/module... Link to comment Share on other sites More sharing options...
liuksas Posted February 19 Author Share Posted February 19 my module generte xml but not generate invoice number $xml->writeElement('DocNumber', $order['invoice']); ? i try to add Invoice number, Invoice_number etc.. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted February 20 Share Posted February 20 Hi, you have to use OrderInvoice object and both order to do what you want. And it is recommended to not use core object. $order = new Order( $idOrder); $invoice = new OrderInvoice( $idInvoice); Link to comment Share on other sites More sharing options...
liuksas Posted February 20 Author Share Posted February 20 can i try one more time explain my php script: ........ // Data Header $xml->startElement('Data-Header'); $xml->writeElement('UniqId', $orderDate->format('Ymd') . $order['id_order']); $xml->writeElement('DocNumber', $order['reference']); $xml->writeElement('DocDate', $order['date_add']); $xml->writeElement('InvoiceCurrency', 'EUR'); $xml->writeElement('TaxationMethod', '12'); $xml->writeElement('VATCode', '21'); $xml->writeElement('WarehouseCode', 'P'); $xml->writeElement('PaymentTypeCode', '5'); $xml->writeElement('CashReceipNo', $orderDate->format('Ymd') . $order['id_order']); $xml->writeElement('EncodingTableCode', 'LOVIT'); $xml->endElement(); ....... xml fragment: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Document><Document-Header><DocumentType>ORDER</DocumentType></Document-Header><Data-Header><UniqId>20240201359</UniqId><DocNumber>LFFHYBVUC</DocNumber><................ script genrate order reference thats fine but i need order invoice number: TOP000314 not reference.. i need to change: $xml->writeElement('DocNumber', $order['reference']); but i dont how Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now