We sell item in units, however for ease of customers we have to show the number of carton for each item.
For this, I created a custom field “Units in Ctn” in Items doctype. Now while making sales invoices, as soon as the user select a product I want fetch the “Units in Ctn” from Items table as readonly field.
Also after user enter the Qty, I want to show Total ctns in another readonly field
Please guide on how this can be achieved.
Once this is done then I can update my Sales Invoice print format to show Ctns as well as Units.
In Sales Invoice Item, create a custom field called “Units in Ctn” and “Total Ctns” both as Read Only
In the options of The new custom field Units in Ctn specify item_code.units_in_ctn. This will fetch units in ctn from item form whenever you select an item code
In custom script of sales invoice form, write the code to set total Ctns on change of qty
This is an interesting feature and we ate struggling to put a count on units in a carton. If you could look at adding it as a base feature that would be great. At least please add this on your list of potential features.
@anand
Its not fetching the data. I have added a new custom field “units_in_ctn” in “Sales invoice item” and written following code “item_code.units_in_ctn” in options. But nothing happens. An other idea?