fix(defaults): apply discount and provisonal defaults from item group and brand if available (#37466)
(cherry picked from commit 1612d7ba3f353e23ad6ae9ba12b995106cddcb9e)
Co-authored-by: David Arnold <dgx.arnold@gmail.com>
fix: incorrect cost center in the purchase invoice (#37591)
(cherry picked from commit 14b009b09355f53b1dfcd05d0f7ba918b0b25210)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
* fix: Multiple issues in purchase invoice submission
* fix: Base grand total calculation
* chore: Calculate base grand total separately only in multi currency docs
* fix: Add gl entry for round off
* fix: never get cutomer price on purchase document
chores: syntax
chore: typo in stock_entry get_uom_details (#33998)
fix: typo in stock_entry get_uom_details
chores: syntax
* feat: add test for get_item_detail price list oriented
* feat: add test for get_item_detail price price oriented
* feat: add test for get_item_detail price price oriented
* chore: clean test code
* refactor: DB independent quoting and truthy/falsy values
* style: reformat to black spec
* fix: ifnull -> coalesce
* fix: coalesce -> Coalesce
* fix: revert pypika comparison
* refactor: convert queries to QB
* fix: incorrect value types for query
`=` query makes no sense with list of values
* fix: remove warehouse docstatus condition
* fix: keep using base rate as rate
Co-authored-by: Ankush Menat <ankush@frappe.io>
- Use `get_default_bom` in sales_order.py (reduce duplicate utility functions)
- Remove redundant if else in `get_work_order_items`
- `get_default_bom`: If no BOM and template exists try to fetch template BOM
- test: `get_work_order_items` via SO and if right BOM is picked
* fix: Auto Insert Item Price If Missing when discount and blank UOM
fixes wrong item price insert when discount is used and adds uom=stock_uom instead of blank as price is converted to stock uom
* unit tests added for item with discount
I have added test for auto_insert_price where discount is used.
* unit test issue fixed
fixed make_sales_order as some of the test that depended on it were failing due to passing of incorrect parameters.
Co-authored-by: Ankush Menat <me@ankush.dev>