feat: Inter warehouse stock transfer on valuation rate with taxation (#20083)
* fix: Validation for target warehouse * feat: Get items on valuation rate in delivery note on Internal transfers * fix: Create Inter company purchase receipt from delivery note * feat: Inter company stock transfer on valuation rate with taxation * fix: Add from warehouse in purchase invoice * fix: Use get_value instead of get_cached_value * fix: Get incoming rate instead of valuation rate * fix: GL entry for from warehouse in purchase receipt * fix: GL Entries fixes in purchase invoice * fix: Address and tax fetching fixes * fix: Add test case for stock transfer via purchase receipt * fix: Code cleanup, added validations and test cases * fix: Validation for supplier warehouse * fix: Test Cases * fix: Change validation condition * fix: Address fixes while creating Purchase Receipt from delivery note * fix: Set taxes while creating Purchase Receipt from Delivery Note * fix: Update set_missing_value function Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
@@ -72,7 +72,7 @@ class StockController(AccountsController):
|
||||
if sle_list:
|
||||
for sle in sle_list:
|
||||
if warehouse_account.get(sle.warehouse):
|
||||
# from warehouse account
|
||||
# from warehouse account/ target warehouse account
|
||||
|
||||
self.check_expense_account(item_row)
|
||||
|
||||
@@ -96,7 +96,7 @@ class StockController(AccountsController):
|
||||
"is_opening": item_row.get("is_opening") or self.get("is_opening") or "No",
|
||||
}, warehouse_account[sle.warehouse]["account_currency"], item=item_row))
|
||||
|
||||
# to target warehouse / expense account
|
||||
# expense account
|
||||
gl_list.append(self.get_gl_dict({
|
||||
"account": item_row.expense_account,
|
||||
"against": warehouse_account[sle.warehouse]["account"],
|
||||
@@ -288,7 +288,7 @@ class StockController(AccountsController):
|
||||
|
||||
return serialized_items
|
||||
|
||||
def get_incoming_rate_for_sales_return(self, item_code, against_document):
|
||||
def get_incoming_rate_for_return(self, item_code, against_document):
|
||||
incoming_rate = 0.0
|
||||
if against_document and item_code:
|
||||
incoming_rate = frappe.db.sql("""select abs(stock_value_difference / actual_qty)
|
||||
@@ -306,6 +306,16 @@ class StockController(AccountsController):
|
||||
warehouses = list(set([d.warehouse for d in
|
||||
self.get("items") if getattr(d, "warehouse", None)]))
|
||||
|
||||
target_warehouses = list(set([d.target_warehouse for d in
|
||||
self.get("items") if getattr(d, "target_warehouse", None)]))
|
||||
|
||||
warehouses.extend(target_warehouses)
|
||||
|
||||
from_warehouse = list(set([d.from_warehouse for d in
|
||||
self.get("items") if getattr(d, "from_warehouse", None)]))
|
||||
|
||||
warehouses.extend(from_warehouse)
|
||||
|
||||
for w in warehouses:
|
||||
validate_warehouse_company(w, self.company)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user