We are glad to inform you that using this custom function you can meet the scenario where in you have to calculate the total weight of all the items in the invoice taking into account the individual item weights.
1. Create 2 custom fields in the item module :
Settings > Preferences > Items > Field Customization > New Custom Field ( Decimal datatype )
1. Weight Per Item ( API Field Name: cf_weight_per_item, Decimal datatype) - Weight of the Item - To be filled during Item creation.
2. Overall Weight( API Field Name: cf_overall_weight, Decimal datatype ) - Script will calculate and update the line item weight. ( Weight per item * quantity)
2. Create 1 custom field in the invoice module:
Settings > Preferences > Invoices > Field Customization > New Custom Field
1. Total Weight ( API Field Name: cf_total, Decimal datatype) To calculate and update the Total weight in Invoice.