How can I add the customer's PO Number as entered in the Sales Order to the invoice item lines. At the moment I have the DN showing, and it looks like I can show the SO, but I need the customer PO from the SO.
Create a Custom Field for “Customer’s PO NO" inside Sales Invoice with same field name as in Sales Order. Then when you create sales invoice from sales order, PO No will get copied automatically.
How can I add the customer's PO Number as entered in the Sales Order to the invoice item lines. At the moment I have the DN showing, and it looks like I can show the SO, but I need the customer PO from the SO.
It doesn't work so I'm assuming I did something wrong... here is my screenshot of the field I created.
How will this work when we are always creating the Invoice from Delivery Note? Both SO and DN have the same field so I don't see it being a problem. We follow the "Sales Order -> Delivery Note -> Sales Invoice" process.
It doesn't work so I'm assuming I did something wrong... here is my screenshot of the field I created.
How will this work when we are always creating the Invoice from Delivery Note? Both SO and DN have the same field so I don't see it being a problem. We follow the "Sales Order -> Delivery Note -> Sales Invoice" process.
It doesn't work so I'm assuming I did something wrong... here is my screenshot of the field I created.
How will this work when we are always creating the Invoice from Delivery Note? Both SO and DN have the same field so I don't see it being a problem. We follow the "Sales Order -> Delivery Note -> Sales Invoice" process.
It doesn't work so I'm assuming I did something wrong... here is my screenshot of the field I created.
How will this work when we are always creating the Invoice from Delivery Note? Both SO and DN have the same field so I don't see it being a problem. We follow the "Sales Order -> Delivery Note -> Sales Invoice" process.
It doesn't work so I'm assuming I did something wrong... here is my screenshot of the field I created.
How will this work when we are always creating the Invoice from Delivery Note? Both SO and DN have the same field so I don't see it being a problem. We follow the "Sales Order -> Delivery Note -> Sales Invoice" process.
I don't thik the po_no field is in item table of sales order. Please ensure that the fieldname is same for all the documents. it is fieldname, not the field label.
It doesn't work so I'm assuming I did something wrong... here is my screenshot of the field I created.
How will this work when we are always creating the Invoice from Delivery Note? Both SO and DN have the same field so I don't see it being a problem. We follow the "Sales Order -> Delivery Note -> Sales Invoice" process.
There are 2 options for defining the PO # on the sales invoice.
You can use a po_no field in SO, DN and SI and then when an order comes you mention the po_no in SO which would be taken into a DN and SI. Now the problem with this approach is that if you want to make the Invoice for multiple SO with multiple po_no then in this case that would not be possible. For this you would need to go to next option.
The next option is to add po_no field in the SO Item, DN Item and SI Item table, here you can define a custom script in the Sales Order wherein po_no in SO would be same as in SO item.
We are using the Option 1 in our organisation and make only 1 SI for one po_no, though I know that the second option is much more robost but it would increase the column in sales invoice which is not desirable.
I will implement a custom script in delivery notes to make the DN Item po_no = the DN po_no if I need to use multiple DNs in a Sales Invoice in the future, and therefore need to put it on each item line in the Sales Invoice.
I had the same problem,
I have made a custom script that extracts the SO and PO-number for each Sales Invoice Item and places them is a two custom fields instead. This way the table doesn’t becomes so large and I still can use multiple SO to one Invoice.
I’m sure you can edit the script so it will fit your needs.
Br
Jens Bohlin
// DOCTYPE: Sales Invoice
// Client Script
// Author: Jens Bohlin
// Date 2014-05-13
// Script to set the two custom fields:
// Sales Order (agg_so) and
// Customer's Purchase Order Number (agg_po)
// Note: Sales Order name may not contain ",". (Normally not a problem)
cur_frm.cscript.custom_onload = function(doc) {
var so_ref = "";
var po_ref = "";
$.each(doc.entries, function(i, d) {
if (d.sales_order) {
if (so_ref.indexOf(d.sales_order) == -1) {
if (so_ref) {
so_ref += ', ';
}
so_ref += d.sales_order;
cur_frm.set_value("agg_so", so_ref);
frappe.call({
method: "frappe.client.get_value",
args: {
doctype: "Sales Order",
filters: {
name: d.sales_order
},
fieldname: ["po_no"]
},
callback: function(r) {
console.log(r);
if (po_ref) {
po_ref += ', ';
}
po_ref += r.message.po_no;
cur_frm.set_value("agg_po", po_ref);
}
});
}
}
});
}
// Update also when page is refreshed....
cur_frm.cscript.custom_refresh = cur_frm.cscript.custom_onload;
i am new to erpnext and i was looking the solution for copyng custom field to another doctype, I saw this two options that you wrote. Could you please help me about problem that i have with print format in Sales Invoice.
I Wan’t to create Sales Invoice from multiple delivery notes. I create custom field in delivery note and another in Sales invoice. When i create invoice, erpnext copy only value from last inserted delivery note.
I need to print delivery note custom field to sales invoice print, but he displays only one value. How could i fetch all values from delivery notes.