fix: revert last commit
(cherry picked from commit 154e9813c4)
# Conflicts:
# erpnext/patches.txt
This commit is contained in:
@@ -262,10 +262,13 @@ erpnext.patches.v14_0.clear_reconciliation_values_from_singles
|
|||||||
execute:frappe.rename_doc("Report", "TDS Payable Monthly", "Tax Withholding Details", force=True)
|
execute:frappe.rename_doc("Report", "TDS Payable Monthly", "Tax Withholding Details", force=True)
|
||||||
erpnext.patches.v14_0.update_proprietorship_to_individual
|
erpnext.patches.v14_0.update_proprietorship_to_individual
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
erpnext.patches.v15_0.rename_subcontracting_fields
|
erpnext.patches.v15_0.rename_subcontracting_fields
|
||||||
=======
|
=======
|
||||||
erpnext.stock.doctype.purchase_receipt_item.patches.rename_field_from_rate_difference_to_amount_difference
|
erpnext.stock.doctype.purchase_receipt_item.patches.rename_field_from_rate_difference_to_amount_difference
|
||||||
>>>>>>> 17d415b105 (fix: set landed cost based on purchase invoice rate)
|
>>>>>>> 17d415b105 (fix: set landed cost based on purchase invoice rate)
|
||||||
|
=======
|
||||||
|
>>>>>>> 154e9813c4 (fix: revert last commit)
|
||||||
|
|
||||||
[post_model_sync]
|
[post_model_sync]
|
||||||
erpnext.patches.v15_0.create_asset_depreciation_schedules_from_assets
|
erpnext.patches.v15_0.create_asset_depreciation_schedules_from_assets
|
||||||
@@ -398,6 +401,7 @@ erpnext.patches.v15_0.sync_auto_reconcile_config
|
|||||||
execute:frappe.db.set_single_value("Accounts Settings", "exchange_gain_loss_posting_date", "Payment")
|
execute:frappe.db.set_single_value("Accounts Settings", "exchange_gain_loss_posting_date", "Payment")
|
||||||
erpnext.patches.v14_0.disable_add_row_in_gross_profit
|
erpnext.patches.v14_0.disable_add_row_in_gross_profit
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
erpnext.patches.v15_0.set_difference_amount_in_asset_value_adjustment
|
erpnext.patches.v15_0.set_difference_amount_in_asset_value_adjustment
|
||||||
erpnext.patches.v14_0.update_posting_datetime
|
erpnext.patches.v14_0.update_posting_datetime
|
||||||
erpnext.stock.doctype.stock_ledger_entry.patches.ensure_sle_indexes
|
erpnext.stock.doctype.stock_ledger_entry.patches.ensure_sle_indexes
|
||||||
@@ -406,3 +410,7 @@ erpnext.patches.v15_0.update_query_report
|
|||||||
=======
|
=======
|
||||||
erpnext.stock.doctype.purchase_receipt_item.patches.recalculate_amount_difference_field
|
erpnext.stock.doctype.purchase_receipt_item.patches.recalculate_amount_difference_field
|
||||||
>>>>>>> 17d415b105 (fix: set landed cost based on purchase invoice rate)
|
>>>>>>> 17d415b105 (fix: set landed cost based on purchase invoice rate)
|
||||||
|
=======
|
||||||
|
erpnext.stock.doctype.purchase_receipt_item.patches.rename_field_from_rate_difference_to_amount_difference
|
||||||
|
erpnext.stock.doctype.purchase_receipt_item.patches.recalculate_amount_difference_field
|
||||||
|
>>>>>>> 154e9813c4 (fix: revert last commit)
|
||||||
|
|||||||
@@ -27,30 +27,35 @@ def execute():
|
|||||||
)
|
)
|
||||||
if fiscal_year_dates := get_fiscal_year(frappe.utils.datetime.date.today(), raise_on_missing=False):
|
if fiscal_year_dates := get_fiscal_year(frappe.utils.datetime.date.today(), raise_on_missing=False):
|
||||||
query.where(parent.posting_date.between(fiscal_year_dates[1], fiscal_year_dates[2]))
|
query.where(parent.posting_date.between(fiscal_year_dates[1], fiscal_year_dates[2]))
|
||||||
result = query.run(as_dict=True)
|
|
||||||
|
|
||||||
item_wise_billed_qty = get_billed_qty_against_purchase_receipt([item.name for item in result])
|
if result := query.run(as_dict=True):
|
||||||
|
item_wise_billed_qty = get_billed_qty_against_purchase_receipt([item.name for item in result])
|
||||||
|
|
||||||
for item in result:
|
for item in result:
|
||||||
adjusted_amt = 0.0
|
adjusted_amt = 0.0
|
||||||
|
|
||||||
if item.billed_amt is not None and item.amount is not None and item_wise_billed_qty.get(item.name):
|
if (
|
||||||
adjusted_amt = (
|
item.billed_amt is not None
|
||||||
flt(item.billed_amt / item_wise_billed_qty.get(item.name)) - flt(item.rate)
|
and item.amount is not None
|
||||||
) * item.qty
|
and item_wise_billed_qty.get(item.name)
|
||||||
adjusted_amt = flt(
|
):
|
||||||
adjusted_amt * flt(item.conversion_rate), frappe.get_precision("Purchase Receipt Item", "amount")
|
adjusted_amt = (
|
||||||
)
|
flt(item.billed_amt / item_wise_billed_qty.get(item.name)) - flt(item.rate)
|
||||||
|
) * item.qty
|
||||||
if adjusted_amt != item.amount_difference_with_purchase_invoice:
|
adjusted_amt = flt(
|
||||||
frappe.db.set_value(
|
adjusted_amt * flt(item.conversion_rate),
|
||||||
"Purchase Receipt Item",
|
frappe.get_precision("Purchase Receipt Item", "amount"),
|
||||||
item.name,
|
|
||||||
"amount_difference_with_purchase_invoice",
|
|
||||||
adjusted_amt,
|
|
||||||
update_modified=False,
|
|
||||||
)
|
)
|
||||||
adjust_incoming_rate_for_pr(frappe.get_doc("Purchase Receipt", item.parent))
|
|
||||||
|
if adjusted_amt != item.amount_difference_with_purchase_invoice:
|
||||||
|
frappe.db.set_value(
|
||||||
|
"Purchase Receipt Item",
|
||||||
|
item.name,
|
||||||
|
"amount_difference_with_purchase_invoice",
|
||||||
|
adjusted_amt,
|
||||||
|
update_modified=False,
|
||||||
|
)
|
||||||
|
adjust_incoming_rate_for_pr(frappe.get_doc("Purchase Receipt", item.parent))
|
||||||
|
|
||||||
|
|
||||||
def get_billed_qty_against_purchase_receipt(pr_names):
|
def get_billed_qty_against_purchase_receipt(pr_names):
|
||||||
|
|||||||
@@ -13,6 +13,5 @@ def execute():
|
|||||||
"Purchase Receipt Item",
|
"Purchase Receipt Item",
|
||||||
"rate_difference_with_purchase_invoice",
|
"rate_difference_with_purchase_invoice",
|
||||||
"amount_difference_with_purchase_invoice",
|
"amount_difference_with_purchase_invoice",
|
||||||
validate=False,
|
|
||||||
)
|
)
|
||||||
frappe.clear_cache(doctype="Purchase Receipt Item")
|
frappe.clear_cache(doctype="Purchase Receipt Item")
|
||||||
|
|||||||
Reference in New Issue
Block a user