Merge branch 'develop' into fix-clear-depr-schedule
This commit is contained in:
commit
2e01b40465
@ -78,6 +78,7 @@ frappe.treeview_settings["Account"] = {
|
|||||||
const format = (value, currency) => format_currency(Math.abs(value), currency);
|
const format = (value, currency) => format_currency(Math.abs(value), currency);
|
||||||
|
|
||||||
if (account.balance!==undefined) {
|
if (account.balance!==undefined) {
|
||||||
|
node.parent && node.parent.find('.balance-area').remove();
|
||||||
$('<span class="balance-area pull-right">'
|
$('<span class="balance-area pull-right">'
|
||||||
+ (account.balance_in_account_currency ?
|
+ (account.balance_in_account_currency ?
|
||||||
(format(account.balance_in_account_currency, account.account_currency) + " / ") : "")
|
(format(account.balance_in_account_currency, account.account_currency) + " / ") : "")
|
||||||
@ -175,7 +176,7 @@ frappe.treeview_settings["Account"] = {
|
|||||||
&& node.expandable && !node.hide_add;
|
&& node.expandable && !node.hide_add;
|
||||||
},
|
},
|
||||||
click: function() {
|
click: function() {
|
||||||
var me = frappe.treeview_settings['Account'].treeview;
|
var me = frappe.views.trees['Account'];
|
||||||
me.new_node();
|
me.new_node();
|
||||||
},
|
},
|
||||||
btnClass: "hidden-xs"
|
btnClass: "hidden-xs"
|
||||||
|
@ -19,6 +19,9 @@ class AccountsSettings(Document):
|
|||||||
frappe.db.set_default("add_taxes_from_item_tax_template",
|
frappe.db.set_default("add_taxes_from_item_tax_template",
|
||||||
self.get("add_taxes_from_item_tax_template", 0))
|
self.get("add_taxes_from_item_tax_template", 0))
|
||||||
|
|
||||||
|
frappe.db.set_default("enable_common_party_accounting",
|
||||||
|
self.get("enable_common_party_accounting", 0))
|
||||||
|
|
||||||
self.validate_stale_days()
|
self.validate_stale_days()
|
||||||
self.enable_payment_schedule_in_print()
|
self.enable_payment_schedule_in_print()
|
||||||
self.toggle_discount_accounting_fields()
|
self.toggle_discount_accounting_fields()
|
||||||
|
@ -25,3 +25,17 @@ class PartyLink(Document):
|
|||||||
if existing_party_link:
|
if existing_party_link:
|
||||||
frappe.throw(_('{} {} is already linked with another {}')
|
frappe.throw(_('{} {} is already linked with another {}')
|
||||||
.format(self.primary_role, self.primary_party, existing_party_link[0]))
|
.format(self.primary_role, self.primary_party, existing_party_link[0]))
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def create_party_link(primary_role, primary_party, secondary_party):
|
||||||
|
party_link = frappe.new_doc('Party Link')
|
||||||
|
party_link.primary_role = primary_role
|
||||||
|
party_link.primary_party = primary_party
|
||||||
|
party_link.secondary_role = 'Customer' if primary_role == 'Supplier' else 'Supplier'
|
||||||
|
party_link.secondary_party = secondary_party
|
||||||
|
|
||||||
|
party_link.save(ignore_permissions=True)
|
||||||
|
|
||||||
|
return party_link
|
||||||
|
|
||||||
|
@ -88,9 +88,10 @@ class PeriodClosingVoucher(AccountsController):
|
|||||||
|
|
||||||
for acc in pl_accounts:
|
for acc in pl_accounts:
|
||||||
if flt(acc.bal_in_company_currency):
|
if flt(acc.bal_in_company_currency):
|
||||||
|
cost_center = acc.cost_center if self.cost_center_wise_pnl else company_cost_center
|
||||||
gl_entry = self.get_gl_dict({
|
gl_entry = self.get_gl_dict({
|
||||||
"account": self.closing_account_head,
|
"account": self.closing_account_head,
|
||||||
"cost_center": acc.cost_center or company_cost_center,
|
"cost_center": cost_center,
|
||||||
"finance_book": acc.finance_book,
|
"finance_book": acc.finance_book,
|
||||||
"account_currency": acc.account_currency,
|
"account_currency": acc.account_currency,
|
||||||
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) > 0 else 0,
|
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) > 0 else 0,
|
||||||
|
@ -66,8 +66,8 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
|||||||
company = create_company()
|
company = create_company()
|
||||||
surplus_account = create_account()
|
surplus_account = create_account()
|
||||||
|
|
||||||
cost_center1 = create_cost_center("Test Cost Center 1")
|
cost_center1 = create_cost_center("Main")
|
||||||
cost_center2 = create_cost_center("Test Cost Center 2")
|
cost_center2 = create_cost_center("Western Branch")
|
||||||
|
|
||||||
create_sales_invoice(
|
create_sales_invoice(
|
||||||
company=company,
|
company=company,
|
||||||
@ -86,7 +86,10 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
|||||||
debit_to="Debtors - TPC"
|
debit_to="Debtors - TPC"
|
||||||
)
|
)
|
||||||
|
|
||||||
pcv = self.make_period_closing_voucher()
|
pcv = self.make_period_closing_voucher(submit=False)
|
||||||
|
pcv.cost_center_wise_pnl = 1
|
||||||
|
pcv.save()
|
||||||
|
pcv.submit()
|
||||||
surplus_account = pcv.closing_account_head
|
surplus_account = pcv.closing_account_head
|
||||||
|
|
||||||
expected_gle = (
|
expected_gle = (
|
||||||
@ -149,7 +152,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertEqual(pcv_gle, expected_gle)
|
self.assertEqual(pcv_gle, expected_gle)
|
||||||
|
|
||||||
def make_period_closing_voucher(self):
|
def make_period_closing_voucher(self, submit=True):
|
||||||
surplus_account = create_account()
|
surplus_account = create_account()
|
||||||
cost_center = create_cost_center("Test Cost Center 1")
|
cost_center = create_cost_center("Test Cost Center 1")
|
||||||
pcv = frappe.get_doc({
|
pcv = frappe.get_doc({
|
||||||
@ -163,7 +166,8 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
|||||||
"remarks": "test"
|
"remarks": "test"
|
||||||
})
|
})
|
||||||
pcv.insert()
|
pcv.insert()
|
||||||
pcv.submit()
|
if submit:
|
||||||
|
pcv.submit()
|
||||||
|
|
||||||
return pcv
|
return pcv
|
||||||
|
|
||||||
|
@ -833,29 +833,12 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
|
|
||||||
pi.shipping_rule = shipping_rule.name
|
pi.shipping_rule = shipping_rule.name
|
||||||
pi.insert()
|
pi.insert()
|
||||||
|
|
||||||
shipping_amount = 0.0
|
|
||||||
for condition in shipping_rule.get("conditions"):
|
|
||||||
if not condition.to_value or (flt(condition.from_value) <= pi.net_total <= flt(condition.to_value)):
|
|
||||||
shipping_amount = condition.shipping_amount
|
|
||||||
|
|
||||||
shipping_charge = {
|
|
||||||
"doctype": "Purchase Taxes and Charges",
|
|
||||||
"category": "Valuation and Total",
|
|
||||||
"charge_type": "Actual",
|
|
||||||
"account_head": shipping_rule.account,
|
|
||||||
"cost_center": shipping_rule.cost_center,
|
|
||||||
"tax_amount": shipping_amount,
|
|
||||||
"description": shipping_rule.name,
|
|
||||||
"add_deduct_tax": "Add"
|
|
||||||
}
|
|
||||||
pi.append("taxes", shipping_charge)
|
|
||||||
pi.save()
|
pi.save()
|
||||||
|
|
||||||
self.assertEqual(pi.net_total, 1250)
|
self.assertEqual(pi.net_total, 1250)
|
||||||
|
|
||||||
self.assertEqual(pi.total_taxes_and_charges, 462.3)
|
self.assertEqual(pi.total_taxes_and_charges, 354.1)
|
||||||
self.assertEqual(pi.grand_total, 1712.3)
|
self.assertEqual(pi.grand_total, 1604.1)
|
||||||
|
|
||||||
def test_make_pi_without_terms(self):
|
def test_make_pi_without_terms(self):
|
||||||
pi = make_purchase_invoice(do_not_save=1)
|
pi = make_purchase_invoice(do_not_save=1)
|
||||||
|
@ -1603,28 +1603,12 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
|
|
||||||
si.shipping_rule = shipping_rule.name
|
si.shipping_rule = shipping_rule.name
|
||||||
si.insert()
|
si.insert()
|
||||||
|
|
||||||
shipping_amount = 0.0
|
|
||||||
for condition in shipping_rule.get("conditions"):
|
|
||||||
if not condition.to_value or (flt(condition.from_value) <= si.net_total <= flt(condition.to_value)):
|
|
||||||
shipping_amount = condition.shipping_amount
|
|
||||||
|
|
||||||
shipping_charge = {
|
|
||||||
"doctype": "Sales Taxes and Charges",
|
|
||||||
"category": "Valuation and Total",
|
|
||||||
"charge_type": "Actual",
|
|
||||||
"account_head": shipping_rule.account,
|
|
||||||
"cost_center": shipping_rule.cost_center,
|
|
||||||
"tax_amount": shipping_amount,
|
|
||||||
"description": shipping_rule.name
|
|
||||||
}
|
|
||||||
si.append("taxes", shipping_charge)
|
|
||||||
si.save()
|
si.save()
|
||||||
|
|
||||||
self.assertEqual(si.net_total, 1250)
|
self.assertEqual(si.net_total, 1250)
|
||||||
|
|
||||||
self.assertEqual(si.total_taxes_and_charges, 577.05)
|
self.assertEqual(si.total_taxes_and_charges, 468.85)
|
||||||
self.assertEqual(si.grand_total, 1827.05)
|
self.assertEqual(si.grand_total, 1718.85)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2316,6 +2300,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
|
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
|
||||||
make_customer,
|
make_customer,
|
||||||
)
|
)
|
||||||
|
from erpnext.accounts.doctype.party_link.party_link import create_party_link
|
||||||
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
|
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
|
||||||
|
|
||||||
# create a customer
|
# create a customer
|
||||||
@ -2324,13 +2309,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
supplier = create_supplier(supplier_name="_Test Common Supplier").name
|
supplier = create_supplier(supplier_name="_Test Common Supplier").name
|
||||||
|
|
||||||
# create a party link between customer & supplier
|
# create a party link between customer & supplier
|
||||||
# set primary role as supplier
|
party_link = create_party_link("Supplier", supplier, customer)
|
||||||
party_link = frappe.new_doc("Party Link")
|
|
||||||
party_link.primary_role = "Supplier"
|
|
||||||
party_link.primary_party = supplier
|
|
||||||
party_link.secondary_role = "Customer"
|
|
||||||
party_link.secondary_party = customer
|
|
||||||
party_link.save()
|
|
||||||
|
|
||||||
# enable common party accounting
|
# enable common party accounting
|
||||||
frappe.db.set_value('Accounts Settings', None, 'enable_common_party_accounting', 1)
|
frappe.db.set_value('Accounts Settings', None, 'enable_common_party_accounting', 1)
|
||||||
|
@ -44,7 +44,7 @@ frappe.query_reports["Gross Profit"] = {
|
|||||||
"formatter": function(value, row, column, data, default_formatter) {
|
"formatter": function(value, row, column, data, default_formatter) {
|
||||||
value = default_formatter(value, row, column, data);
|
value = default_formatter(value, row, column, data);
|
||||||
|
|
||||||
if (data && data.indent == 0.0) {
|
if (data && (data.indent == 0.0 || row[1].content == "Total")) {
|
||||||
value = $(`<span>${value}</span>`);
|
value = $(`<span>${value}</span>`);
|
||||||
var $value = $(value).css("font-weight", "bold");
|
var $value = $(value).css("font-weight", "bold");
|
||||||
value = $value.wrap("<p></p>").parent().html();
|
value = $value.wrap("<p></p>").parent().html();
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"filters": [],
|
"filters": [],
|
||||||
"idx": 3,
|
"idx": 3,
|
||||||
"is_standard": "Yes",
|
"is_standard": "Yes",
|
||||||
"modified": "2021-08-19 18:57:07.468202",
|
"modified": "2021-11-13 19:14:23.730198",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Gross Profit",
|
"name": "Gross Profit",
|
||||||
|
@ -19,7 +19,7 @@ def execute(filters=None):
|
|||||||
data = []
|
data = []
|
||||||
|
|
||||||
group_wise_columns = frappe._dict({
|
group_wise_columns = frappe._dict({
|
||||||
"invoice": ["parent", "customer", "customer_group", "posting_date","item_code", "item_name","item_group", "brand", "description", \
|
"invoice": ["invoice_or_item", "customer", "customer_group", "posting_date","item_code", "item_name","item_group", "brand", "description",
|
||||||
"warehouse", "qty", "base_rate", "buying_rate", "base_amount",
|
"warehouse", "qty", "base_rate", "buying_rate", "base_amount",
|
||||||
"buying_amount", "gross_profit", "gross_profit_percent", "project"],
|
"buying_amount", "gross_profit", "gross_profit_percent", "project"],
|
||||||
"item_code": ["item_code", "item_name", "brand", "description", "qty", "base_rate",
|
"item_code": ["item_code", "item_name", "brand", "description", "qty", "base_rate",
|
||||||
@ -77,13 +77,15 @@ def get_data_when_not_grouped_by_invoice(gross_profit_data, filters, group_wise_
|
|||||||
|
|
||||||
row.append(filters.currency)
|
row.append(filters.currency)
|
||||||
if idx == len(gross_profit_data.grouped_data)-1:
|
if idx == len(gross_profit_data.grouped_data)-1:
|
||||||
row[0] = frappe.bold("Total")
|
row[0] = "Total"
|
||||||
|
|
||||||
data.append(row)
|
data.append(row)
|
||||||
|
|
||||||
def get_columns(group_wise_columns, filters):
|
def get_columns(group_wise_columns, filters):
|
||||||
columns = []
|
columns = []
|
||||||
column_map = frappe._dict({
|
column_map = frappe._dict({
|
||||||
"parent": _("Sales Invoice") + ":Link/Sales Invoice:120",
|
"parent": _("Sales Invoice") + ":Link/Sales Invoice:120",
|
||||||
|
"invoice_or_item": _("Sales Invoice") + ":Link/Sales Invoice:120",
|
||||||
"posting_date": _("Posting Date") + ":Date:100",
|
"posting_date": _("Posting Date") + ":Date:100",
|
||||||
"posting_time": _("Posting Time") + ":Data:100",
|
"posting_time": _("Posting Time") + ":Data:100",
|
||||||
"item_code": _("Item Code") + ":Link/Item:100",
|
"item_code": _("Item Code") + ":Link/Item:100",
|
||||||
@ -122,7 +124,7 @@ def get_columns(group_wise_columns, filters):
|
|||||||
|
|
||||||
def get_column_names():
|
def get_column_names():
|
||||||
return frappe._dict({
|
return frappe._dict({
|
||||||
'parent': 'sales_invoice',
|
'invoice_or_item': 'sales_invoice',
|
||||||
'customer': 'customer',
|
'customer': 'customer',
|
||||||
'customer_group': 'customer_group',
|
'customer_group': 'customer_group',
|
||||||
'posting_date': 'posting_date',
|
'posting_date': 'posting_date',
|
||||||
@ -245,19 +247,28 @@ class GrossProfitGenerator(object):
|
|||||||
self.add_to_totals(new_row)
|
self.add_to_totals(new_row)
|
||||||
else:
|
else:
|
||||||
for i, row in enumerate(self.grouped[key]):
|
for i, row in enumerate(self.grouped[key]):
|
||||||
if row.parent in self.returned_invoices \
|
if row.indent == 1.0:
|
||||||
and row.item_code in self.returned_invoices[row.parent]:
|
if row.parent in self.returned_invoices \
|
||||||
returned_item_rows = self.returned_invoices[row.parent][row.item_code]
|
and row.item_code in self.returned_invoices[row.parent]:
|
||||||
for returned_item_row in returned_item_rows:
|
returned_item_rows = self.returned_invoices[row.parent][row.item_code]
|
||||||
row.qty += flt(returned_item_row.qty)
|
for returned_item_row in returned_item_rows:
|
||||||
row.base_amount += flt(returned_item_row.base_amount, self.currency_precision)
|
row.qty += flt(returned_item_row.qty)
|
||||||
row.buying_amount = flt(flt(row.qty) * flt(row.buying_rate), self.currency_precision)
|
row.base_amount += flt(returned_item_row.base_amount, self.currency_precision)
|
||||||
if (flt(row.qty) or row.base_amount) and self.is_not_invoice_row(row):
|
row.buying_amount = flt(flt(row.qty) * flt(row.buying_rate), self.currency_precision)
|
||||||
row = self.set_average_rate(row)
|
if (flt(row.qty) or row.base_amount):
|
||||||
self.grouped_data.append(row)
|
row = self.set_average_rate(row)
|
||||||
self.add_to_totals(row)
|
self.grouped_data.append(row)
|
||||||
|
self.add_to_totals(row)
|
||||||
|
|
||||||
self.set_average_gross_profit(self.totals)
|
self.set_average_gross_profit(self.totals)
|
||||||
self.grouped_data.append(self.totals)
|
|
||||||
|
if self.filters.get("group_by") == "Invoice":
|
||||||
|
self.totals.indent = 0.0
|
||||||
|
self.totals.parent_invoice = ""
|
||||||
|
self.totals.parent = "Total"
|
||||||
|
self.si_list.append(self.totals)
|
||||||
|
else:
|
||||||
|
self.grouped_data.append(self.totals)
|
||||||
|
|
||||||
def is_not_invoice_row(self, row):
|
def is_not_invoice_row(self, row):
|
||||||
return (self.filters.get("group_by") == "Invoice" and row.indent != 0.0) or self.filters.get("group_by") != "Invoice"
|
return (self.filters.get("group_by") == "Invoice" and row.indent != 0.0) or self.filters.get("group_by") != "Invoice"
|
||||||
@ -446,7 +457,7 @@ class GrossProfitGenerator(object):
|
|||||||
if not row.indent:
|
if not row.indent:
|
||||||
row.indent = 1.0
|
row.indent = 1.0
|
||||||
row.parent_invoice = row.parent
|
row.parent_invoice = row.parent
|
||||||
row.parent = row.item_code
|
row.invoice_or_item = row.item_code
|
||||||
|
|
||||||
if frappe.db.exists('Product Bundle', row.item_code):
|
if frappe.db.exists('Product Bundle', row.item_code):
|
||||||
self.add_bundle_items(row, index)
|
self.add_bundle_items(row, index)
|
||||||
@ -455,7 +466,8 @@ class GrossProfitGenerator(object):
|
|||||||
return frappe._dict({
|
return frappe._dict({
|
||||||
'parent_invoice': "",
|
'parent_invoice': "",
|
||||||
'indent': 0.0,
|
'indent': 0.0,
|
||||||
'parent': row.parent,
|
'invoice_or_item': row.parent,
|
||||||
|
'parent': None,
|
||||||
'posting_date': row.posting_date,
|
'posting_date': row.posting_date,
|
||||||
'posting_time': row.posting_time,
|
'posting_time': row.posting_time,
|
||||||
'project': row.project,
|
'project': row.project,
|
||||||
@ -499,7 +511,8 @@ class GrossProfitGenerator(object):
|
|||||||
return frappe._dict({
|
return frappe._dict({
|
||||||
'parent_invoice': product_bundle.item_code,
|
'parent_invoice': product_bundle.item_code,
|
||||||
'indent': product_bundle.indent + 1,
|
'indent': product_bundle.indent + 1,
|
||||||
'parent': item.item_code,
|
'parent': None,
|
||||||
|
'invoice_or_item': item.item_code,
|
||||||
'posting_date': product_bundle.posting_date,
|
'posting_date': product_bundle.posting_date,
|
||||||
'posting_time': product_bundle.posting_time,
|
'posting_time': product_bundle.posting_time,
|
||||||
'project': product_bundle.project,
|
'project': product_bundle.project,
|
||||||
|
@ -14,6 +14,14 @@ frappe.ui.form.on('Asset Value Adjustment', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
frm.set_query('asset', function() {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
calculate_depreciation: 1,
|
||||||
|
docstatus: 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onload: function(frm) {
|
onload: function(frm) {
|
||||||
|
@ -10,7 +10,11 @@ from frappe.utils import cint, date_diff, flt, formatdate, getdate
|
|||||||
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
||||||
get_checks_for_pl_and_bs_accounts,
|
get_checks_for_pl_and_bs_accounts,
|
||||||
)
|
)
|
||||||
|
from erpnext.assets.doctype.asset.asset import get_depreciation_amount
|
||||||
from erpnext.assets.doctype.asset.depreciation import get_depreciation_accounts
|
from erpnext.assets.doctype.asset.depreciation import get_depreciation_accounts
|
||||||
|
from erpnext.regional.india.utils import (
|
||||||
|
get_depreciation_amount as get_depreciation_amount_for_india,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AssetValueAdjustment(Document):
|
class AssetValueAdjustment(Document):
|
||||||
@ -90,6 +94,7 @@ class AssetValueAdjustment(Document):
|
|||||||
|
|
||||||
def reschedule_depreciations(self, asset_value):
|
def reschedule_depreciations(self, asset_value):
|
||||||
asset = frappe.get_doc('Asset', self.asset)
|
asset = frappe.get_doc('Asset', self.asset)
|
||||||
|
country = frappe.get_value('Company', self.company, 'country')
|
||||||
|
|
||||||
for d in asset.finance_books:
|
for d in asset.finance_books:
|
||||||
d.value_after_depreciation = asset_value
|
d.value_after_depreciation = asset_value
|
||||||
@ -111,8 +116,10 @@ class AssetValueAdjustment(Document):
|
|||||||
depreciation_amount = days * rate_per_day
|
depreciation_amount = days * rate_per_day
|
||||||
from_date = data.schedule_date
|
from_date = data.schedule_date
|
||||||
else:
|
else:
|
||||||
depreciation_amount = asset.get_depreciation_amount(value_after_depreciation,
|
if country == "India":
|
||||||
no_of_depreciations, d)
|
depreciation_amount = get_depreciation_amount_for_india(asset, value_after_depreciation, d)
|
||||||
|
else:
|
||||||
|
depreciation_amount = get_depreciation_amount(asset, value_after_depreciation, d)
|
||||||
|
|
||||||
if depreciation_amount:
|
if depreciation_amount:
|
||||||
value_after_depreciation -= flt(depreciation_amount)
|
value_after_depreciation -= flt(depreciation_amount)
|
||||||
|
@ -83,6 +83,12 @@ frappe.ui.form.on("Supplier", {
|
|||||||
frm.trigger("get_supplier_group_details");
|
frm.trigger("get_supplier_group_details");
|
||||||
}, __('Actions'));
|
}, __('Actions'));
|
||||||
|
|
||||||
|
if (cint(frappe.defaults.get_default("enable_common_party_accounting"))) {
|
||||||
|
frm.add_custom_button(__('Link with Customer'), function () {
|
||||||
|
frm.trigger('show_party_link_dialog');
|
||||||
|
}, __('Actions'));
|
||||||
|
}
|
||||||
|
|
||||||
// indicators
|
// indicators
|
||||||
erpnext.utils.set_party_dashboard_indicators(frm);
|
erpnext.utils.set_party_dashboard_indicators(frm);
|
||||||
}
|
}
|
||||||
@ -128,5 +134,42 @@ frappe.ui.form.on("Supplier", {
|
|||||||
else {
|
else {
|
||||||
frm.toggle_reqd("represents_company", false);
|
frm.toggle_reqd("represents_company", false);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
show_party_link_dialog: function(frm) {
|
||||||
|
const dialog = new frappe.ui.Dialog({
|
||||||
|
title: __('Select a Customer'),
|
||||||
|
fields: [{
|
||||||
|
fieldtype: 'Link', label: __('Customer'),
|
||||||
|
options: 'Customer', fieldname: 'customer', reqd: 1
|
||||||
|
}],
|
||||||
|
primary_action: function({ customer }) {
|
||||||
|
frappe.call({
|
||||||
|
method: 'erpnext.accounts.doctype.party_link.party_link.create_party_link',
|
||||||
|
args: {
|
||||||
|
primary_role: 'Supplier',
|
||||||
|
primary_party: frm.doc.name,
|
||||||
|
secondary_party: customer
|
||||||
|
},
|
||||||
|
freeze: true,
|
||||||
|
callback: function() {
|
||||||
|
dialog.hide();
|
||||||
|
frappe.msgprint({
|
||||||
|
message: __('Successfully linked to Customer'),
|
||||||
|
alert: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
dialog.hide();
|
||||||
|
frappe.msgprint({
|
||||||
|
message: __('Linking to Customer Failed. Please try again.'),
|
||||||
|
title: __('Linking Failed'),
|
||||||
|
indicator: 'red'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
primary_action_label: __('Create Link')
|
||||||
|
});
|
||||||
|
dialog.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -676,5 +676,6 @@ def create_repost_item_valuation_entry(args):
|
|||||||
repost_entry.company = args.company
|
repost_entry.company = args.company
|
||||||
repost_entry.allow_zero_rate = args.allow_zero_rate
|
repost_entry.allow_zero_rate = args.allow_zero_rate
|
||||||
repost_entry.flags.ignore_links = True
|
repost_entry.flags.ignore_links = True
|
||||||
|
repost_entry.flags.ignore_permissions = True
|
||||||
repost_entry.save()
|
repost_entry.save()
|
||||||
repost_entry.submit()
|
repost_entry.submit()
|
||||||
|
@ -50,6 +50,7 @@ class calculate_taxes_and_totals(object):
|
|||||||
self.initialize_taxes()
|
self.initialize_taxes()
|
||||||
self.determine_exclusive_rate()
|
self.determine_exclusive_rate()
|
||||||
self.calculate_net_total()
|
self.calculate_net_total()
|
||||||
|
self.calculate_shipping_charges()
|
||||||
self.calculate_taxes()
|
self.calculate_taxes()
|
||||||
self.manipulate_grand_total_for_inclusive_tax()
|
self.manipulate_grand_total_for_inclusive_tax()
|
||||||
self.calculate_totals()
|
self.calculate_totals()
|
||||||
@ -258,6 +259,11 @@ class calculate_taxes_and_totals(object):
|
|||||||
|
|
||||||
self.doc.round_floats_in(self.doc, ["total", "base_total", "net_total", "base_net_total"])
|
self.doc.round_floats_in(self.doc, ["total", "base_total", "net_total", "base_net_total"])
|
||||||
|
|
||||||
|
def calculate_shipping_charges(self):
|
||||||
|
if hasattr(self.doc, "shipping_rule") and self.doc.shipping_rule:
|
||||||
|
shipping_rule = frappe.get_doc("Shipping Rule", self.doc.shipping_rule)
|
||||||
|
shipping_rule.apply(self.doc)
|
||||||
|
|
||||||
def calculate_taxes(self):
|
def calculate_taxes(self):
|
||||||
if not self.doc.get('is_consolidated'):
|
if not self.doc.get('is_consolidated'):
|
||||||
self.doc.rounding_adjustment = 0
|
self.doc.rounding_adjustment = 0
|
||||||
|
@ -306,7 +306,8 @@ doc_events = {
|
|||||||
'validate': ["erpnext.erpnext_integrations.taxjar_integration.set_sales_tax"]
|
'validate': ["erpnext.erpnext_integrations.taxjar_integration.set_sales_tax"]
|
||||||
},
|
},
|
||||||
"Company": {
|
"Company": {
|
||||||
"on_trash": "erpnext.regional.india.utils.delete_gst_settings_for_company"
|
"on_trash": ["erpnext.regional.india.utils.delete_gst_settings_for_company",
|
||||||
|
"erpnext.regional.saudi_arabia.utils.delete_vat_settings_for_company"]
|
||||||
},
|
},
|
||||||
"Integration Request": {
|
"Integration Request": {
|
||||||
"validate": "erpnext.accounts.doctype.payment_request.payment_request.validate_payment"
|
"validate": "erpnext.accounts.doctype.payment_request.payment_request.validate_payment"
|
||||||
|
@ -389,7 +389,9 @@ frappe.ui.form.on("Expense Claim Detail", {
|
|||||||
sanctioned_amount: function(frm, cdt, cdn) {
|
sanctioned_amount: function(frm, cdt, cdn) {
|
||||||
cur_frm.cscript.calculate_total(frm.doc, cdt, cdn);
|
cur_frm.cscript.calculate_total(frm.doc, cdt, cdn);
|
||||||
frm.trigger("get_taxes");
|
frm.trigger("get_taxes");
|
||||||
|
frm.trigger("calculate_grand_total");
|
||||||
},
|
},
|
||||||
|
|
||||||
cost_center: function(frm, cdt, cdn) {
|
cost_center: function(frm, cdt, cdn) {
|
||||||
erpnext.utils.copy_value_in_all_rows(frm.doc, cdt, cdn, "expenses", "cost_center");
|
erpnext.utils.copy_value_in_all_rows(frm.doc, cdt, cdn, "expenses", "cost_center");
|
||||||
}
|
}
|
||||||
|
@ -379,11 +379,12 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-05-04 05:35:12.040199",
|
"modified": "2021-11-22 16:26:57.787838",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Expense Claim",
|
"name": "Expense Claim",
|
||||||
"name_case": "Title Case",
|
"name_case": "Title Case",
|
||||||
|
"naming_rule": "By \"Naming Series\" field",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"actions": [],
|
||||||
"creation": "2017-10-09 16:53:26.410762",
|
"creation": "2017-10-09 16:53:26.410762",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Document",
|
"document_type": "Document",
|
||||||
@ -50,7 +51,7 @@
|
|||||||
"fieldname": "unclaimed_amount",
|
"fieldname": "unclaimed_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Unclaimed amount",
|
"label": "Unclaimed Amount",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"oldfieldname": "advance_amount",
|
"oldfieldname": "advance_amount",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
@ -65,7 +66,7 @@
|
|||||||
"fieldname": "allocated_amount",
|
"fieldname": "allocated_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Allocated amount",
|
"label": "Allocated Amount",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"oldfieldname": "allocated_amount",
|
"oldfieldname": "allocated_amount",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
@ -87,7 +88,7 @@
|
|||||||
],
|
],
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2019-12-17 13:53:22.111766",
|
"modified": "2021-11-22 16:33:58.515819",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Expense Claim Advance",
|
"name": "Expense Claim Advance",
|
||||||
|
@ -28,7 +28,7 @@ frappe.ui.form.on('Job Card', {
|
|||||||
frappe.flags.resume_job = 0;
|
frappe.flags.resume_job = 0;
|
||||||
let has_items = frm.doc.items && frm.doc.items.length;
|
let has_items = frm.doc.items && frm.doc.items.length;
|
||||||
|
|
||||||
if (frm.doc.__onload.work_order_stopped) {
|
if (frm.doc.__onload.work_order_closed) {
|
||||||
frm.disable_save();
|
frm.disable_save();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class JobCard(Document):
|
|||||||
def onload(self):
|
def onload(self):
|
||||||
excess_transfer = frappe.db.get_single_value("Manufacturing Settings", "job_card_excess_transfer")
|
excess_transfer = frappe.db.get_single_value("Manufacturing Settings", "job_card_excess_transfer")
|
||||||
self.set_onload("job_card_excess_transfer", excess_transfer)
|
self.set_onload("job_card_excess_transfer", excess_transfer)
|
||||||
self.set_onload("work_order_stopped", self.is_work_order_stopped())
|
self.set_onload("work_order_closed", self.is_work_order_closed())
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_time_logs()
|
self.validate_time_logs()
|
||||||
@ -549,10 +549,10 @@ class JobCard(Document):
|
|||||||
.format(message, bold(row.operation), bold(self.operation)), OperationSequenceError)
|
.format(message, bold(row.operation), bold(self.operation)), OperationSequenceError)
|
||||||
|
|
||||||
def validate_work_order(self):
|
def validate_work_order(self):
|
||||||
if self.is_work_order_stopped():
|
if self.is_work_order_closed():
|
||||||
frappe.throw(_("You can't make any changes to Job Card since Work Order is stopped."))
|
frappe.throw(_("You can't make any changes to Job Card since Work Order is closed."))
|
||||||
|
|
||||||
def is_work_order_stopped(self):
|
def is_work_order_closed(self):
|
||||||
if self.work_order:
|
if self.work_order:
|
||||||
status = frappe.get_value('Work Order', self.work_order)
|
status = frappe.get_value('Work Order', self.work_order)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ frappe.query_reports["Work Order Summary"] = {
|
|||||||
label: __("Status"),
|
label: __("Status"),
|
||||||
fieldname: "status",
|
fieldname: "status",
|
||||||
fieldtype: "Select",
|
fieldtype: "Select",
|
||||||
options: ["", "Not Started", "In Process", "Completed", "Stopped"]
|
options: ["", "Not Started", "In Process", "Completed", "Stopped", "Closed"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: __("Sales Orders"),
|
label: __("Sales Orders"),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
@ -58,21 +59,16 @@ def get_chart_data(data, filters):
|
|||||||
return get_chart_based_on_qty(data, filters)
|
return get_chart_based_on_qty(data, filters)
|
||||||
|
|
||||||
def get_chart_based_on_status(data):
|
def get_chart_based_on_status(data):
|
||||||
labels = ["Completed", "In Process", "Stopped", "Not Started"]
|
labels = frappe.get_meta("Work Order").get_options("status").split("\n")
|
||||||
|
if "" in labels:
|
||||||
|
labels.remove("")
|
||||||
|
|
||||||
status_wise_data = {
|
status_wise_data = defaultdict(int)
|
||||||
"Not Started": 0,
|
|
||||||
"In Process": 0,
|
|
||||||
"Stopped": 0,
|
|
||||||
"Completed": 0,
|
|
||||||
"Draft": 0
|
|
||||||
}
|
|
||||||
|
|
||||||
for d in data:
|
for d in data:
|
||||||
status_wise_data[d.status] += 1
|
status_wise_data[d.status] += 1
|
||||||
|
|
||||||
values = [status_wise_data["Completed"], status_wise_data["In Process"],
|
values = [status_wise_data[label] for label in labels]
|
||||||
status_wise_data["Stopped"], status_wise_data["Not Started"]]
|
|
||||||
|
|
||||||
chart = {
|
chart = {
|
||||||
"data": {
|
"data": {
|
||||||
|
@ -81,6 +81,7 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
this.initialize_taxes();
|
this.initialize_taxes();
|
||||||
this.determine_exclusive_rate();
|
this.determine_exclusive_rate();
|
||||||
this.calculate_net_total();
|
this.calculate_net_total();
|
||||||
|
this.calculate_shipping_charges();
|
||||||
this.calculate_taxes();
|
this.calculate_taxes();
|
||||||
this.manipulate_grand_total_for_inclusive_tax();
|
this.manipulate_grand_total_for_inclusive_tax();
|
||||||
this.calculate_totals();
|
this.calculate_totals();
|
||||||
@ -266,8 +267,13 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
|
|||||||
me.frm.doc.net_total += item.net_amount;
|
me.frm.doc.net_total += item.net_amount;
|
||||||
me.frm.doc.base_net_total += item.base_net_amount;
|
me.frm.doc.base_net_total += item.base_net_amount;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
calculate_shipping_charges() {
|
||||||
frappe.model.round_floats_in(this.frm.doc, ["total", "base_total", "net_total", "base_net_total"]);
|
frappe.model.round_floats_in(this.frm.doc, ["total", "base_total", "net_total", "base_net_total"]);
|
||||||
|
if (frappe.meta.get_docfield(this.frm.doc.doctype, "shipping_rule", this.frm.doc.name)) {
|
||||||
|
this.shipping_rule();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
add_taxes_from_item_tax_template(item_tax_map) {
|
add_taxes_from_item_tax_template(item_tax_map) {
|
||||||
|
@ -1085,16 +1085,8 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
doc: this.frm.doc,
|
doc: this.frm.doc,
|
||||||
method: "apply_shipping_rule",
|
method: "apply_shipping_rule",
|
||||||
callback: function(r) {
|
|
||||||
if(!r.exc) {
|
|
||||||
me.calculate_taxes_and_totals();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).fail(() => this.frm.set_value('shipping_rule', ''));
|
}).fail(() => this.frm.set_value('shipping_rule', ''));
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
me.calculate_taxes_and_totals();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_margin_amount_based_on_currency(exchange_rate) {
|
set_margin_amount_based_on_currency(exchange_rate) {
|
||||||
|
@ -103,6 +103,45 @@ class TestGSTR3BReport(unittest.TestCase):
|
|||||||
gst_settings.round_off_gst_values = 1
|
gst_settings.round_off_gst_values = 1
|
||||||
gst_settings.save()
|
gst_settings.save()
|
||||||
|
|
||||||
|
def test_gst_category_auto_update(self):
|
||||||
|
if not frappe.db.exists("Customer", "_Test GST Customer With GSTIN"):
|
||||||
|
customer = frappe.get_doc({
|
||||||
|
"customer_group": "_Test Customer Group",
|
||||||
|
"customer_name": "_Test GST Customer With GSTIN",
|
||||||
|
"customer_type": "Individual",
|
||||||
|
"doctype": "Customer",
|
||||||
|
"territory": "_Test Territory"
|
||||||
|
}).insert()
|
||||||
|
|
||||||
|
self.assertEqual(customer.gst_category, 'Unregistered')
|
||||||
|
|
||||||
|
if not frappe.db.exists('Address', '_Test GST Category-1-Billing'):
|
||||||
|
address = frappe.get_doc({
|
||||||
|
"address_line1": "_Test Address Line 1",
|
||||||
|
"address_title": "_Test GST Category-1",
|
||||||
|
"address_type": "Billing",
|
||||||
|
"city": "_Test City",
|
||||||
|
"state": "Test State",
|
||||||
|
"country": "India",
|
||||||
|
"doctype": "Address",
|
||||||
|
"is_primary_address": 1,
|
||||||
|
"phone": "+91 0000000000",
|
||||||
|
"gstin": "29AZWPS7135H1ZG",
|
||||||
|
"gst_state": "Karnataka",
|
||||||
|
"gst_state_number": "29"
|
||||||
|
}).insert()
|
||||||
|
|
||||||
|
address.append("links", {
|
||||||
|
"link_doctype": "Customer",
|
||||||
|
"link_name": "_Test GST Customer With GSTIN"
|
||||||
|
})
|
||||||
|
|
||||||
|
address.save()
|
||||||
|
|
||||||
|
customer.load_from_db()
|
||||||
|
self.assertEqual(customer.gst_category, 'Registered Regular')
|
||||||
|
|
||||||
|
|
||||||
def make_sales_invoice():
|
def make_sales_invoice():
|
||||||
si = create_sales_invoice(company="_Test Company GST",
|
si = create_sales_invoice(company="_Test Company GST",
|
||||||
customer = '_Test GST Customer',
|
customer = '_Test GST Customer',
|
||||||
|
@ -791,7 +791,7 @@ def set_tax_withholding_category(company):
|
|||||||
accounts = [dict(company=company, account=tds_account)]
|
accounts = [dict(company=company, account=tds_account)]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fiscal_year_details = get_fiscal_year(today(), verbose=0, company=company)
|
fiscal_year_details = get_fiscal_year(today(), verbose=0)
|
||||||
except FiscalYearError:
|
except FiscalYearError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -74,11 +74,11 @@ def validate_tax_category(doc, method):
|
|||||||
frappe.throw(_("Intra State tax category for GST State {0} already exists").format(doc.gst_state))
|
frappe.throw(_("Intra State tax category for GST State {0} already exists").format(doc.gst_state))
|
||||||
|
|
||||||
def update_gst_category(doc, method):
|
def update_gst_category(doc, method):
|
||||||
if hasattr(doc, 'gst_category'):
|
for link in doc.links:
|
||||||
for link in doc.links:
|
if link.link_doctype in ['Customer', 'Supplier']:
|
||||||
if link.link_doctype in ['Customer', 'Supplier']:
|
meta = frappe.get_meta(link.link_doctype)
|
||||||
if doc.get('gstin'):
|
if doc.get('gstin') and meta.has_field('gst_category'):
|
||||||
frappe.db.set_value(link.link_doctype, {'name': link.link_name, 'gst_category': 'Unregistered'}, 'gst_category', 'Registered Regular')
|
frappe.db.set_value(link.link_doctype, {'name': link.link_name, 'gst_category': 'Unregistered'}, 'gst_category', 'Registered Regular')
|
||||||
|
|
||||||
def set_gst_state_and_state_number(doc):
|
def set_gst_state_and_state_number(doc):
|
||||||
if not doc.gst_state:
|
if not doc.gst_state:
|
||||||
|
File diff suppressed because one or more lines are too long
@ -28,14 +28,22 @@ def create_qr_code(doc, method):
|
|||||||
|
|
||||||
for field in meta.get_image_fields():
|
for field in meta.get_image_fields():
|
||||||
if field.fieldname == 'qr_code':
|
if field.fieldname == 'qr_code':
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
# Creating public url to print format
|
# Creating public url to print format
|
||||||
default_print_format = frappe.db.get_value('Property Setter', dict(property='default_print_format', doc_type=doc.doctype), "value")
|
default_print_format = frappe.db.get_value('Property Setter', dict(property='default_print_format', doc_type=doc.doctype), "value")
|
||||||
|
|
||||||
# System Language
|
# System Language
|
||||||
language = frappe.get_system_settings('language')
|
language = frappe.get_system_settings('language')
|
||||||
|
|
||||||
|
params = urlencode({
|
||||||
|
'format': default_print_format or 'Standard',
|
||||||
|
'_lang': language,
|
||||||
|
'key': doc.get_signature()
|
||||||
|
})
|
||||||
|
|
||||||
# creating qr code for the url
|
# creating qr code for the url
|
||||||
url = f"{ frappe.utils.get_url() }/{ doc.doctype }/{ doc.name }?format={ default_print_format or 'Standard' }&_lang={ language }&key={ doc.get_signature() }"
|
url = f"{ frappe.utils.get_url() }/{ doc.doctype }/{ doc.name }?{ params }"
|
||||||
qr_image = io.BytesIO()
|
qr_image = io.BytesIO()
|
||||||
url = qr_create(url, error='L')
|
url = qr_create(url, error='L')
|
||||||
url.png(qr_image, scale=2, quiet_zone=1)
|
url.png(qr_image, scale=2, quiet_zone=1)
|
||||||
@ -74,4 +82,11 @@ def delete_qr_code_file(doc, method):
|
|||||||
'file_url': doc.get('qr_code')
|
'file_url': doc.get('qr_code')
|
||||||
})
|
})
|
||||||
if len(file_doc):
|
if len(file_doc):
|
||||||
frappe.delete_doc('File', file_doc[0].name)
|
frappe.delete_doc('File', file_doc[0].name)
|
||||||
|
|
||||||
|
def delete_vat_settings_for_company(doc, method):
|
||||||
|
if doc.country != 'Saudi Arabia':
|
||||||
|
return
|
||||||
|
|
||||||
|
settings_doc = frappe.get_doc('KSA VAT Setting', {'company': doc.name})
|
||||||
|
settings_doc.delete()
|
@ -134,6 +134,12 @@ frappe.ui.form.on("Customer", {
|
|||||||
frm.trigger("get_customer_group_details");
|
frm.trigger("get_customer_group_details");
|
||||||
}, __('Actions'));
|
}, __('Actions'));
|
||||||
|
|
||||||
|
if (cint(frappe.defaults.get_default("enable_common_party_accounting"))) {
|
||||||
|
frm.add_custom_button(__('Link with Supplier'), function () {
|
||||||
|
frm.trigger('show_party_link_dialog');
|
||||||
|
}, __('Actions'));
|
||||||
|
}
|
||||||
|
|
||||||
// indicator
|
// indicator
|
||||||
erpnext.utils.set_party_dashboard_indicators(frm);
|
erpnext.utils.set_party_dashboard_indicators(frm);
|
||||||
|
|
||||||
@ -158,5 +164,42 @@ frappe.ui.form.on("Customer", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
show_party_link_dialog: function(frm) {
|
||||||
|
const dialog = new frappe.ui.Dialog({
|
||||||
|
title: __('Select a Supplier'),
|
||||||
|
fields: [{
|
||||||
|
fieldtype: 'Link', label: __('Supplier'),
|
||||||
|
options: 'Supplier', fieldname: 'supplier', reqd: 1
|
||||||
|
}],
|
||||||
|
primary_action: function({ supplier }) {
|
||||||
|
frappe.call({
|
||||||
|
method: 'erpnext.accounts.doctype.party_link.party_link.create_party_link',
|
||||||
|
args: {
|
||||||
|
primary_role: 'Customer',
|
||||||
|
primary_party: frm.doc.name,
|
||||||
|
secondary_party: supplier
|
||||||
|
},
|
||||||
|
freeze: true,
|
||||||
|
callback: function() {
|
||||||
|
dialog.hide();
|
||||||
|
frappe.msgprint({
|
||||||
|
message: __('Successfully linked to Supplier'),
|
||||||
|
alert: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
dialog.hide();
|
||||||
|
frappe.msgprint({
|
||||||
|
message: __('Linking to Supplier Failed. Please try again.'),
|
||||||
|
title: __('Linking Failed'),
|
||||||
|
indicator: 'red'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
primary_action_label: __('Create Link')
|
||||||
|
});
|
||||||
|
dialog.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -49,11 +49,11 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
this.$component.append(
|
this.$component.append(
|
||||||
`<div class="cart-container">
|
`<div class="cart-container">
|
||||||
<div class="abs-cart-container">
|
<div class="abs-cart-container">
|
||||||
<div class="cart-label">Item Cart</div>
|
<div class="cart-label">${__('Item Cart')}</div>
|
||||||
<div class="cart-header">
|
<div class="cart-header">
|
||||||
<div class="name-header">Item</div>
|
<div class="name-header">${__('Item')}</div>
|
||||||
<div class="qty-header">Qty</div>
|
<div class="qty-header">${__('Quantity')}</div>
|
||||||
<div class="rate-amount-header">Amount</div>
|
<div class="rate-amount-header">${__('Amount')}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cart-items-section"></div>
|
<div class="cart-items-section"></div>
|
||||||
<div class="cart-totals-section"></div>
|
<div class="cart-totals-section"></div>
|
||||||
@ -78,7 +78,7 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
make_no_items_placeholder() {
|
make_no_items_placeholder() {
|
||||||
this.$cart_header.css('display', 'none');
|
this.$cart_header.css('display', 'none');
|
||||||
this.$cart_items_wrapper.html(
|
this.$cart_items_wrapper.html(
|
||||||
`<div class="no-item-wrapper">No items in cart</div>`
|
`<div class="no-item-wrapper">${__('No items in cart')}</div>`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,19 +98,19 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
|
|
||||||
this.$totals_section.append(
|
this.$totals_section.append(
|
||||||
`<div class="add-discount-wrapper">
|
`<div class="add-discount-wrapper">
|
||||||
${this.get_discount_icon()} Add Discount
|
${this.get_discount_icon()} ${__('Add Discount')}
|
||||||
</div>
|
</div>
|
||||||
<div class="net-total-container">
|
<div class="net-total-container">
|
||||||
<div class="net-total-label">Net Total</div>
|
<div class="net-total-label">${__("Net Total")}</div>
|
||||||
<div class="net-total-value">0.00</div>
|
<div class="net-total-value">0.00</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="taxes-container"></div>
|
<div class="taxes-container"></div>
|
||||||
<div class="grand-total-container">
|
<div class="grand-total-container">
|
||||||
<div>Grand Total</div>
|
<div>${__('Grand Total')}</div>
|
||||||
<div>0.00</div>
|
<div>0.00</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="checkout-btn">Checkout</div>
|
<div class="checkout-btn">${__('Checkout')}</div>
|
||||||
<div class="edit-cart-btn">Edit Cart</div>`
|
<div class="edit-cart-btn">${__('Edit Cart')}</div>`
|
||||||
)
|
)
|
||||||
|
|
||||||
this.$add_discount_elem = this.$component.find(".add-discount-wrapper");
|
this.$add_discount_elem = this.$component.find(".add-discount-wrapper");
|
||||||
@ -126,10 +126,10 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
},
|
},
|
||||||
cols: 5,
|
cols: 5,
|
||||||
keys: [
|
keys: [
|
||||||
[ 1, 2, 3, 'Quantity' ],
|
[ 1, 2, 3, __('Quantity') ],
|
||||||
[ 4, 5, 6, 'Discount' ],
|
[ 4, 5, 6, __('Discount') ],
|
||||||
[ 7, 8, 9, 'Rate' ],
|
[ 7, 8, 9, __('Rate') ],
|
||||||
[ '.', 0, 'Delete', 'Remove' ]
|
[ '.', 0, __('Delete'), __('Remove') ]
|
||||||
],
|
],
|
||||||
css_classes: [
|
css_classes: [
|
||||||
[ '', '', '', 'col-span-2' ],
|
[ '', '', '', 'col-span-2' ],
|
||||||
@ -148,7 +148,7 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
)
|
)
|
||||||
|
|
||||||
this.$numpad_section.append(
|
this.$numpad_section.append(
|
||||||
`<div class="numpad-btn checkout-btn" data-button-value="checkout">Checkout</div>`
|
`<div class="numpad-btn checkout-btn" data-button-value="checkout">${__('Checkout')}</div>`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
'border': '1px dashed var(--gray-500)',
|
'border': '1px dashed var(--gray-500)',
|
||||||
'padding': 'var(--padding-sm) var(--padding-md)'
|
'padding': 'var(--padding-sm) var(--padding-md)'
|
||||||
});
|
});
|
||||||
me.$add_discount_elem.html(`${me.get_discount_icon()} Add Discount`);
|
me.$add_discount_elem.html(`${me.get_discount_icon()} ${__('Add Discount')}`);
|
||||||
me.discount_field = undefined;
|
me.discount_field = undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -411,7 +411,7 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
});
|
});
|
||||||
this.$add_discount_elem.html(
|
this.$add_discount_elem.html(
|
||||||
`<div class="edit-discount-btn">
|
`<div class="edit-discount-btn">
|
||||||
${this.get_discount_icon()} Additional ${String(discount).bold()}% discount applied
|
${this.get_discount_icon()} ${__("Additional")} ${String(discount).bold()}% ${__("discount applied")}
|
||||||
</div>`
|
</div>`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -445,7 +445,7 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
|
|
||||||
function get_customer_description() {
|
function get_customer_description() {
|
||||||
if (!email_id && !mobile_no) {
|
if (!email_id && !mobile_no) {
|
||||||
return `<div class="customer-desc">Click to add email / phone</div>`;
|
return `<div class="customer-desc">${__('Click to add email / phone')}</div>`;
|
||||||
} else if (email_id && !mobile_no) {
|
} else if (email_id && !mobile_no) {
|
||||||
return `<div class="customer-desc">${email_id}</div>`;
|
return `<div class="customer-desc">${email_id}</div>`;
|
||||||
} else if (mobile_no && !email_id) {
|
} else if (mobile_no && !email_id) {
|
||||||
@ -479,22 +479,22 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
render_net_total(value) {
|
render_net_total(value) {
|
||||||
const currency = this.events.get_frm().doc.currency;
|
const currency = this.events.get_frm().doc.currency;
|
||||||
this.$totals_section.find('.net-total-container').html(
|
this.$totals_section.find('.net-total-container').html(
|
||||||
`<div>Net Total</div><div>${format_currency(value, currency)}</div>`
|
`<div>${__('Net Total')}</div><div>${format_currency(value, currency)}</div>`
|
||||||
)
|
)
|
||||||
|
|
||||||
this.$numpad_section.find('.numpad-net-total').html(
|
this.$numpad_section.find('.numpad-net-total').html(
|
||||||
`<div>Net Total: <span>${format_currency(value, currency)}</span></div>`
|
`<div>${__('Net Total')}: <span>${format_currency(value, currency)}</span></div>`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render_grand_total(value) {
|
render_grand_total(value) {
|
||||||
const currency = this.events.get_frm().doc.currency;
|
const currency = this.events.get_frm().doc.currency;
|
||||||
this.$totals_section.find('.grand-total-container').html(
|
this.$totals_section.find('.grand-total-container').html(
|
||||||
`<div>Grand Total</div><div>${format_currency(value, currency)}</div>`
|
`<div>${__('Grand Total')}</div><div>${format_currency(value, currency)}</div>`
|
||||||
)
|
)
|
||||||
|
|
||||||
this.$numpad_section.find('.numpad-grand-total').html(
|
this.$numpad_section.find('.numpad-grand-total').html(
|
||||||
`<div>Grand Total: <span>${format_currency(value, currency)}</span></div>`
|
`<div>${__('Grand Total')}: <span>${format_currency(value, currency)}</span></div>`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ erpnext.PointOfSale.ItemDetails = class {
|
|||||||
init_child_components() {
|
init_child_components() {
|
||||||
this.$component.html(
|
this.$component.html(
|
||||||
`<div class="item-details-header">
|
`<div class="item-details-header">
|
||||||
<div class="label">Item Details</div>
|
<div class="label">${__('Item Details')}</div>
|
||||||
<div class="close-btn">
|
<div class="close-btn">
|
||||||
<svg width="32" height="32" viewBox="0 0 14 14" fill="none">
|
<svg width="32" height="32" viewBox="0 0 14 14" fill="none">
|
||||||
<path d="M4.93764 4.93759L7.00003 6.99998M9.06243 9.06238L7.00003 6.99998M7.00003 6.99998L4.93764 9.06238L9.06243 4.93759" stroke="#8D99A6"/>
|
<path d="M4.93764 4.93759L7.00003 6.99998M9.06243 9.06238L7.00003 6.99998M7.00003 6.99998L4.93764 9.06238L9.06243 4.93759" stroke="#8D99A6"/>
|
||||||
@ -201,8 +201,9 @@ erpnext.PointOfSale.ItemDetails = class {
|
|||||||
`<div class="grid-filler no-select"></div>`
|
`<div class="grid-filler no-select"></div>`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
const label = __('Auto Fetch Serial Numbers');
|
||||||
this.$form_container.append(
|
this.$form_container.append(
|
||||||
`<div class="btn btn-sm btn-secondary auto-fetch-btn">Auto Fetch Serial Numbers</div>`
|
`<div class="btn btn-sm btn-secondary auto-fetch-btn">${label}</div>`
|
||||||
);
|
);
|
||||||
this.$form_container.find('.serial_no-control').find('textarea').css('height', '6rem');
|
this.$form_container.find('.serial_no-control').find('textarea').css('height', '6rem');
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ erpnext.PointOfSale.ItemSelector = class {
|
|||||||
this.wrapper.append(
|
this.wrapper.append(
|
||||||
`<section class="items-selector">
|
`<section class="items-selector">
|
||||||
<div class="filter-section">
|
<div class="filter-section">
|
||||||
<div class="label">All Items</div>
|
<div class="label">${__('All Items')}</div>
|
||||||
<div class="search-field"></div>
|
<div class="search-field"></div>
|
||||||
<div class="item-group-field"></div>
|
<div class="item-group-field"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,7 @@ erpnext.PointOfSale.PastOrderList = class {
|
|||||||
this.wrapper.append(
|
this.wrapper.append(
|
||||||
`<section class="past-order-list">
|
`<section class="past-order-list">
|
||||||
<div class="filter-section">
|
<div class="filter-section">
|
||||||
<div class="label">Recent Orders</div>
|
<div class="label">${__('Recent Orders')}</div>
|
||||||
<div class="search-field"></div>
|
<div class="search-field"></div>
|
||||||
<div class="status-field"></div>
|
<div class="status-field"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,16 +17,16 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
this.wrapper.append(
|
this.wrapper.append(
|
||||||
`<section class="past-order-summary">
|
`<section class="past-order-summary">
|
||||||
<div class="no-summary-placeholder">
|
<div class="no-summary-placeholder">
|
||||||
Select an invoice to load summary data
|
${__('Select an invoice to load summary data')}
|
||||||
</div>
|
</div>
|
||||||
<div class="invoice-summary-wrapper">
|
<div class="invoice-summary-wrapper">
|
||||||
<div class="abs-container">
|
<div class="abs-container">
|
||||||
<div class="upper-section"></div>
|
<div class="upper-section"></div>
|
||||||
<div class="label">Items</div>
|
<div class="label">${__('Items')}</div>
|
||||||
<div class="items-container summary-container"></div>
|
<div class="items-container summary-container"></div>
|
||||||
<div class="label">Totals</div>
|
<div class="label">${__('Totals')}</div>
|
||||||
<div class="totals-container summary-container"></div>
|
<div class="totals-container summary-container"></div>
|
||||||
<div class="label">Payments</div>
|
<div class="label">${__('Payments')}</div>
|
||||||
<div class="payments-container summary-container"></div>
|
<div class="payments-container summary-container"></div>
|
||||||
<div class="summary-btns"></div>
|
<div class="summary-btns"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -82,7 +82,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
return `<div class="left-section">
|
return `<div class="left-section">
|
||||||
<div class="customer-name">${doc.customer}</div>
|
<div class="customer-name">${doc.customer}</div>
|
||||||
<div class="customer-email">${this.customer_email}</div>
|
<div class="customer-email">${this.customer_email}</div>
|
||||||
<div class="cashier">Sold by: ${doc.owner}</div>
|
<div class="cashier">${__('Sold by')}: ${doc.owner}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-section">
|
<div class="right-section">
|
||||||
<div class="paid-amount">${format_currency(doc.paid_amount, doc.currency)}</div>
|
<div class="paid-amount">${format_currency(doc.paid_amount, doc.currency)}</div>
|
||||||
@ -121,7 +121,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
|
|
||||||
get_net_total_html(doc) {
|
get_net_total_html(doc) {
|
||||||
return `<div class="summary-row-wrapper">
|
return `<div class="summary-row-wrapper">
|
||||||
<div>Net Total</div>
|
<div>${__('Net Total')}</div>
|
||||||
<div>${format_currency(doc.net_total, doc.currency)}</div>
|
<div>${format_currency(doc.net_total, doc.currency)}</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
@ -144,14 +144,14 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
|
|
||||||
get_grand_total_html(doc) {
|
get_grand_total_html(doc) {
|
||||||
return `<div class="summary-row-wrapper grand-total">
|
return `<div class="summary-row-wrapper grand-total">
|
||||||
<div>Grand Total</div>
|
<div>${__('Grand Total')}</div>
|
||||||
<div>${format_currency(doc.grand_total, doc.currency)}</div>
|
<div>${format_currency(doc.grand_total, doc.currency)}</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
get_payment_html(doc, payment) {
|
get_payment_html(doc, payment) {
|
||||||
return `<div class="summary-row-wrapper payments">
|
return `<div class="summary-row-wrapper payments">
|
||||||
<div>${payment.mode_of_payment}</div>
|
<div>${__(payment.mode_of_payment)}</div>
|
||||||
<div>${format_currency(payment.amount, doc.currency)}</div>
|
<div>${format_currency(payment.amount, doc.currency)}</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
@ -285,8 +285,9 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
if (m.condition) {
|
if (m.condition) {
|
||||||
m.visible_btns.forEach(b => {
|
m.visible_btns.forEach(b => {
|
||||||
const class_name = b.split(' ')[0].toLowerCase();
|
const class_name = b.split(' ')[0].toLowerCase();
|
||||||
|
const btn = __(b);
|
||||||
this.$summary_btns.append(
|
this.$summary_btns.append(
|
||||||
`<div class="summary-btn btn btn-default ${class_name}-btn">${b}</div>`
|
`<div class="summary-btn btn btn-default ${class_name}-btn">${btn}</div>`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -18,11 +18,11 @@ erpnext.PointOfSale.Payment = class {
|
|||||||
prepare_dom() {
|
prepare_dom() {
|
||||||
this.wrapper.append(
|
this.wrapper.append(
|
||||||
`<section class="payment-container">
|
`<section class="payment-container">
|
||||||
<div class="section-label payment-section">Payment Method</div>
|
<div class="section-label payment-section">${__('Payment Method')}</div>
|
||||||
<div class="payment-modes"></div>
|
<div class="payment-modes"></div>
|
||||||
<div class="fields-numpad-container">
|
<div class="fields-numpad-container">
|
||||||
<div class="fields-section">
|
<div class="fields-section">
|
||||||
<div class="section-label">Additional Information</div>
|
<div class="section-label">${__('Additional Information')}</div>
|
||||||
<div class="invoice-fields"></div>
|
<div class="invoice-fields"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="number-pad"></div>
|
<div class="number-pad"></div>
|
||||||
@ -30,7 +30,7 @@ erpnext.PointOfSale.Payment = class {
|
|||||||
<div class="totals-section">
|
<div class="totals-section">
|
||||||
<div class="totals"></div>
|
<div class="totals"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="submit-order-btn">Complete Order</div>
|
<div class="submit-order-btn">${__("Complete Order")}</div>
|
||||||
</section>`
|
</section>`
|
||||||
);
|
);
|
||||||
this.$component = this.wrapper.find('.payment-container');
|
this.$component = this.wrapper.find('.payment-container');
|
||||||
@ -518,12 +518,12 @@ erpnext.PointOfSale.Payment = class {
|
|||||||
|
|
||||||
this.$totals.html(
|
this.$totals.html(
|
||||||
`<div class="col">
|
`<div class="col">
|
||||||
<div class="total-label">Grand Total</div>
|
<div class="total-label">${__('Grand Total')}</div>
|
||||||
<div class="value">${format_currency(grand_total, currency)}</div>
|
<div class="value">${format_currency(grand_total, currency)}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="seperator-y"></div>
|
<div class="seperator-y"></div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="total-label">Paid Amount</div>
|
<div class="total-label">${__('Paid Amount')}</div>
|
||||||
<div class="value">${format_currency(paid_amount, currency)}</div>
|
<div class="value">${format_currency(paid_amount, currency)}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="seperator-y"></div>
|
<div class="seperator-y"></div>
|
||||||
|
@ -177,10 +177,11 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-07-22 18:59:43.057878",
|
"modified": "2021-11-18 02:18:10.524560",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Repost Item Valuation",
|
"name": "Repost Item Valuation",
|
||||||
|
"naming_rule": "Expression (old style)",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
@ -197,20 +198,6 @@
|
|||||||
"submit": 1,
|
"submit": 1,
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cancel": 1,
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "Stock User",
|
|
||||||
"share": 1,
|
|
||||||
"submit": 1,
|
|
||||||
"write": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cancel": 1,
|
"cancel": 1,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
@ -226,7 +213,6 @@
|
|||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cancel": 1,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
@ -234,7 +220,7 @@
|
|||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "Accounts User",
|
"role": "Accounts Manager",
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"write": 1
|
"write": 1
|
||||||
|
@ -133,7 +133,7 @@ def repost_entries():
|
|||||||
riv_entries = get_repost_item_valuation_entries()
|
riv_entries = get_repost_item_valuation_entries()
|
||||||
|
|
||||||
for row in riv_entries:
|
for row in riv_entries:
|
||||||
doc = frappe.get_cached_doc('Repost Item Valuation', row.name)
|
doc = frappe.get_doc('Repost Item Valuation', row.name)
|
||||||
repost(doc)
|
repost(doc)
|
||||||
|
|
||||||
riv_entries = get_repost_item_valuation_entries()
|
riv_entries = get_repost_item_valuation_entries()
|
||||||
|
@ -111,6 +111,7 @@ def validate_cancellation(args):
|
|||||||
frappe.throw(_("Cannot cancel the transaction. Reposting of item valuation on submission is not completed yet."))
|
frappe.throw(_("Cannot cancel the transaction. Reposting of item valuation on submission is not completed yet."))
|
||||||
if repost_entry.status == 'Queued':
|
if repost_entry.status == 'Queued':
|
||||||
doc = frappe.get_doc("Repost Item Valuation", repost_entry.name)
|
doc = frappe.get_doc("Repost Item Valuation", repost_entry.name)
|
||||||
|
doc.flags.ignore_permissions = True
|
||||||
doc.cancel()
|
doc.cancel()
|
||||||
doc.delete()
|
doc.delete()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user