Try ERPNext Buy Support Partners Foundation

Customer's PO number on Delivery Note Item

I would like to get po_no (customer’s purchase order number) on delivery note item.

i.e.

 # po_no Item    Qty   Price
#1 XXXXX Item_1    2    1.00
#2 XXXXX Item_2    5    5.35
#3 YYYYY Item_3    7    3.15

etc.

Adding po_no to Delivery Note Items didn’t work :frowning:

Any pointers?

Are all the Items having the same po_no in a particular Delivery Note?

No, that would make absolutely no sense, plastering same purchase order number all over the place :slight_smile:
As in my simplified example: two items have po_no XXXXX and one YYYYY

On that note: it would be nice, if column with po_no would show only if delivery note is linked to >1 customer’s purchase order, but I suppose I can create two distinct formats if that’s complicated.

You can solve it but this will require a small change in the Python code which may lead to update conflicts in the future. Hence I would not recommend it.

Can we include items from multiple sales orders into a single delivery note ?

This can be done for items from multiple sales orders.

  1. For the Customer PO field in Delivery Note Item, mention this in Options Fetch From of that field, assuming against_sales_order is the Sales Order Link in that Item row : against_sales_order.po_no You can keep this field read only.

  2. Now create a new Delivery Note and Get Items from multiple Sales Orders for that customer.

  3. Now check if the Customer POs have been mapped to the Delivery Note Items or not.

Why I think this should work

Every item when fetched from a Sales Invoice/Order will contain a backlink to it. Now it the Customer purchase order number is mentioned in the correct field of Order/Invoice and you too have referenced the correct variable as above then it will get mapped automatically.


Making Deliveries from both Sales Invoice and Sales orders

In case you make Delivery Notes from Sales Invoice too, then you can create a similar field but with different Fetch From value i.e. against_sales_invoice.po_no In this way, it becomes flexible for you.


Note

For multiple sales orders you can make a single delivery, but if you are make it from a a Sales Invoice then you cannot do it for multiple invoices unless you do it manually for each item - a practice which will be restricted depending on the number of items. I am not sure about how okay is this practice as far as accounting standards go.

2 Likes

We are making one delivery from multiple sales orders and then usually make one invoice per delivery or one invoice for multiple deliveries if all of them were made on the same date.

I’ll try your suggestion and give you feedback as to the end result. Thank you! :slight_smile:

1 Like

It worked. Thank you :slight_smile:

One note however: I had to enter “against_sales_order.po_no” into “Fetch from” field, instead of “Options” as you suggested. Other than that, it works great. Thanks for the tip!

2 Likes

Oh yes I had forgotten that one detail. I’ll correct it.