mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-23 20:16:40 +00:00
calculate_service_costs paired the service_items and items child tables by list index, which breaks if the tables are not index-aligned (e.g. populate_items_table skips a service item with zero available qty), assigning the wrong service cost or raising IndexError. Match by purchase_order_item instead, and guard against division by zero qty. Adds a regression test asserting service costs follow purchase_order_item regardless of table ordering.