fix: labels name
This commit is contained in:
parent
8e86553717
commit
a8445da02a
@ -1486,7 +1486,7 @@ class PurchaseInvoice(BuyingController):
|
||||
updated_pr += update_billed_amount_based_on_po(po_details, update_modified)
|
||||
|
||||
adjust_incoming_rate = frappe.db.get_single_value(
|
||||
"Buying Settings", "adjust_incoming_rate_based_on_purchase_invoice_rate"
|
||||
"Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate"
|
||||
)
|
||||
|
||||
for pr in set(updated_pr):
|
||||
|
@ -1527,7 +1527,7 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
|
||||
frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 0)
|
||||
|
||||
frappe.db.set_single_value(
|
||||
"Buying Settings", "adjust_incoming_rate_based_on_purchase_invoice_rate", 1
|
||||
"Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", 1
|
||||
)
|
||||
|
||||
# Increase the cost of the item
|
||||
@ -1581,7 +1581,7 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
|
||||
self.assertEqual(stock_value_difference, 50)
|
||||
|
||||
frappe.db.set_single_value(
|
||||
"Buying Settings", "adjust_incoming_rate_based_on_purchase_invoice_rate", 0
|
||||
"Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", 0
|
||||
)
|
||||
|
||||
# Don't adjust incoming rate
|
||||
|
@ -18,7 +18,7 @@
|
||||
"pr_required",
|
||||
"column_break_12",
|
||||
"maintain_same_rate",
|
||||
"adjust_incoming_rate_based_on_purchase_invoice_rate",
|
||||
"set_landed_cost_based_on_purchase_invoice_rate",
|
||||
"allow_multiple_items",
|
||||
"bill_for_rejected_quantity_in_purchase_invoice",
|
||||
"disable_last_purchase_rate",
|
||||
@ -153,9 +153,9 @@
|
||||
"default": "0",
|
||||
"depends_on": "eval: !doc.maintain_same_rate",
|
||||
"description": "Users can enable the checkbox If they want to adjust the incoming rate (set using purchase receipt) based on the purchase invoice rate.",
|
||||
"fieldname": "adjust_incoming_rate_based_on_purchase_invoice_rate",
|
||||
"fieldname": "set_landed_cost_based_on_purchase_invoice_rate",
|
||||
"fieldtype": "Check",
|
||||
"label": "Adjust Incoming Rate Based on Purchase Invoice Rate"
|
||||
"label": "Set Landed Cost Based on Purchase Invoice Rate"
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-cog",
|
||||
@ -163,7 +163,7 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2023-02-20 14:25:58.544143",
|
||||
"modified": "2023-02-28 15:41:32.686805",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Buying Settings",
|
||||
|
@ -27,4 +27,4 @@ class BuyingSettings(Document):
|
||||
|
||||
def check_maintain_same_rate(self):
|
||||
if self.maintain_same_rate:
|
||||
self.adjust_incoming_rate_based_on_purchase_invoice_rate = 0
|
||||
self.set_landed_cost_based_on_purchase_invoice_rate = 0
|
||||
|
@ -268,7 +268,7 @@ class BuyingController(SubcontractingController):
|
||||
item.base_net_amount
|
||||
+ item.item_tax_amount
|
||||
+ flt(item.landed_cost_voucher_amount)
|
||||
+ flt(item.get("adjust_incoming_rate"))
|
||||
+ flt(item.get("rate_difference_with_purchase_invoice"))
|
||||
) / qty_in_stock_uom
|
||||
else:
|
||||
item.valuation_rate = 0.0
|
||||
|
@ -451,14 +451,14 @@ class PurchaseReceipt(BuyingController):
|
||||
item=d,
|
||||
)
|
||||
|
||||
if d.adjust_incoming_rate and stock_rbnb:
|
||||
if d.rate_difference_with_purchase_invoice and stock_rbnb:
|
||||
account_currency = get_account_currency(stock_rbnb)
|
||||
self.add_gl_entry(
|
||||
gl_entries=gl_entries,
|
||||
account=stock_rbnb,
|
||||
cost_center=d.cost_center,
|
||||
debit=0.0,
|
||||
credit=flt(d.adjust_incoming_rate),
|
||||
credit=flt(d.rate_difference_with_purchase_invoice),
|
||||
remarks=_("Adjustment based on Purchase Invoice rate"),
|
||||
against_account=warehouse_account_name,
|
||||
account_currency=account_currency,
|
||||
@ -486,7 +486,7 @@ class PurchaseReceipt(BuyingController):
|
||||
+ flt(d.landed_cost_voucher_amount)
|
||||
+ flt(d.rm_supp_cost)
|
||||
+ flt(d.item_tax_amount)
|
||||
+ flt(d.adjust_incoming_rate)
|
||||
+ flt(d.rate_difference_with_purchase_invoice)
|
||||
)
|
||||
|
||||
divisional_loss = flt(
|
||||
@ -919,7 +919,7 @@ def update_billing_percentage(pr_doc, update_modified=True, adjust_incoming_rate
|
||||
if item.billed_amt and item.amount:
|
||||
adjusted_amt = flt(item.billed_amt) - flt(item.amount)
|
||||
|
||||
item.db_set("adjust_incoming_rate", adjusted_amt, update_modified=False)
|
||||
item.db_set("rate_difference_with_purchase_invoice", adjusted_amt, update_modified=False)
|
||||
|
||||
percent_billed = round(100 * (total_billed_amount / (total_amount or 1)), 6)
|
||||
pr_doc.db_set("per_billed", percent_billed)
|
||||
|
@ -69,7 +69,7 @@
|
||||
"item_tax_amount",
|
||||
"rm_supp_cost",
|
||||
"landed_cost_voucher_amount",
|
||||
"adjust_incoming_rate",
|
||||
"rate_difference_with_purchase_invoice",
|
||||
"billed_amt",
|
||||
"warehouse_and_reference",
|
||||
"warehouse",
|
||||
@ -1010,9 +1010,9 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "adjust_incoming_rate",
|
||||
"fieldname": "rate_difference_with_purchase_invoice",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Adjust Incoming Rate (Purchase Invoice)",
|
||||
"label": "Rate Difference with Purchase Invoice",
|
||||
"no_copy": 1,
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
@ -1021,7 +1021,7 @@
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2023-02-28 12:05:59.732266",
|
||||
"modified": "2023-02-28 15:43:04.470104",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Purchase Receipt Item",
|
||||
|
Loading…
x
Reference in New Issue
Block a user