bigota Posted June 6, 2010 Share Posted June 6, 2010 Hello. In the account history can I put to my customer the Delivery Note (PDF) instead invoice.I want that my customers can download the delivery note, not the invoice, Is ist possible??Thanks, and sorry for my english. Link to comment Share on other sites More sharing options...
Sultan Posted June 6, 2010 Share Posted June 6, 2010 Hello. In the account history can I put to my customer the Delivery Note (PDF) instead invoice.I want that my customers can download the delivery note, not the invoice, Is ist possible??Thanks, and sorry for my english. That would be a nice idea....I think you should create a template for the delivery notice and then play with the history.php file.in case the order Status ID is NOT 5 (the default delivery status ID number) then the customer should see and download the invoice & if the order status ID is 5 then he should be able to download the delivery notice.I think this is how it should be done... but unfortunately I am not a developer to do that :red: Hope we get some kind developers to do it.Thanks for the idea Link to comment Share on other sites More sharing options...
bigota Posted June 6, 2010 Author Share Posted June 6, 2010 Its a good idea but i dont know how to do this someone can help me?thanks Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 I think copying the pdf-invoice.php and modifying it should work. Create a new file in the root called pdf-delivery.php containing the following: <?php include(dirname(__FILE__).'/config/config.inc.php'); include(dirname(__FILE__).'/init.php'); $cookie = new Cookie('ps'); if (!$cookie->isLogged()) Tools::redirect('authentication.php?back=pdf-delivery.php'); if (!intval(Configuration::get('PS_INVOICE'))) die(Tools::displayError('invoices are disabled on this shop')); if (isset($_GET['id_order']) AND Validate::isUnsignedId($_GET['id_order'])) $order = new Order(intval($_GET['id_order'])); if (!isset($order) OR !Validate::isLoadedObject($order)) die(Tools::displayError('delivery slip not found')); elseif ($order->id_customer != $cookie->id_customer) die(Tools::displayError('delivery slip not found')); elseif (!OrderState::deliveryAvailable($order->getCurrentState()) AND !$order->delivery_number) die(Tools::displayError('No delivery slip available')); else { $parameter = NULL; PDF::invoice($order, 'D', false, $parameter, false, true); } ?> then edit classes/OrderState.php and add this function: static public function deliveryAvailable($id_order_state) { $result = Db::getInstance()->getRow(' SELECT `delivery` AS ok FROM `'._DB_PREFIX_.'order_state` WHERE `id_order_state` = '.intval($id_order_state)); return $result['ok']; } then change lines 41-43 of history.tpl in your theme's directory from: {if ($order.invoice AND $order.invoice_number) AND $invoiceAllowed} {l s='PDF'} to: {if $order.delivery_number} {l s='PDF'} Link to comment Share on other sites More sharing options...
bigota Posted June 7, 2010 Author Share Posted June 7, 2010 Thanks, but it did not solved the problem.I did what you said step bu step and now dont appear the page www.yourdomain.com/history.php It appear a white page, only the blocks around the page, but no information about orders.Any solution please????? Link to comment Share on other sites More sharing options...
rocky Posted June 8, 2010 Share Posted June 8, 2010 You are right. I made a typo in my last code block and found a "can't pass NULL by reference" error. I've updated my code above. Please try again. Link to comment Share on other sites More sharing options...
bigota Posted June 9, 2010 Author Share Posted June 9, 2010 With the new code you gave me it work, it show the delivery note, but there is a problem, the delivery note number is DE000001 always.Dont change the number of delivery note, the details (id order and products) are well, but the deliveris note number does not change, any solution to fix this bug????? Thanks. Link to comment Share on other sites More sharing options...
rocky Posted June 10, 2010 Share Posted June 10, 2010 Try changing the PDF::invoice line in pdf-delivery.php to: PDF::invoice($order, 'D', false, $parameter, false, $order->delivery_number); Let me know whether that works. Link to comment Share on other sites More sharing options...
bigota Posted June 10, 2010 Author Share Posted June 10, 2010 I tried to put what you said, and there was an error: "FPDF error: Some data has already been output, can't send PDF file·Any idea??? Thanks a lot. Link to comment Share on other sites More sharing options...
bigota Posted June 10, 2010 Author Share Posted June 10, 2010 Sorry, I was wrong copying some lines. I did your idea and it was all OK. Thank you very much, you are the best. Thanksssssssss Link to comment Share on other sites More sharing options...
Stefand Posted November 21, 2011 Share Posted November 21, 2011 How can I change the order status for the delivery slip? So when status is set tot status with id 1 the delivery slip is also available. Now the standard is that the delivery slip can only be generate when the status is set to Delivered. Please help me. Link to comment Share on other sites More sharing options...
Jazzman Posted June 4, 2013 Share Posted June 4, 2013 Now the standard is that the delivery slip can only be generate when the status is set to Delivered. I have the same problem. This worked correctly in the previous version. This is a major bug. can someone fix it? Link to comment Share on other sites More sharing options...
Recommended Posts