Browse Source

chore: mass trailing whitespace and EOF fixes

develop
Ankush Menat 3 years ago
parent
commit
4551d7d602
No known key found for this signature in database GPG Key ID: 8EA82E09BBD13AAF
  1. 2
      erpnext/.stylelintrc
  2. 2
      erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.js
  3. 2
      erpnext/accounts/deferred_revenue.py
  4. 2
      erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js
  5. 2
      erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py
  6. 2
      erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js
  7. 2
      erpnext/accounts/doctype/accounting_period/accounting_period.py
  8. 2
      erpnext/accounts/doctype/accounts_settings/accounts_settings.js
  9. 4
      erpnext/accounts/doctype/accounts_settings/accounts_settings.py
  10. 2
      erpnext/accounts/doctype/accounts_settings/regional/united_states.js
  11. 2
      erpnext/accounts/doctype/bank/bank.js
  12. 2
      erpnext/accounts/doctype/bank/bank.py
  13. 2
      erpnext/accounts/doctype/bank_account/bank_account_dashboard.py
  14. 2
      erpnext/accounts/doctype/bank_clearance/bank_clearance.js
  15. 2
      erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py
  16. 2
      erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
  17. 1
      erpnext/accounts/doctype/bank_transaction/bank_transaction.py
  18. 2
      erpnext/accounts/doctype/bank_transaction/bank_transaction_list.js
  19. 2
      erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py
  20. 2
      erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py
  21. 2
      erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py
  22. 2
      erpnext/accounts/doctype/cashier_closing/cashier_closing.py
  23. 10
      erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js
  24. 2
      erpnext/accounts/doctype/cost_center/cost_center.py
  25. 2
      erpnext/accounts/doctype/cost_center/cost_center_dashboard.py
  26. 2
      erpnext/accounts/doctype/cost_center/cost_center_tree.js
  27. 3
      erpnext/accounts/doctype/cost_center/test_cost_center.py
  28. 2
      erpnext/accounts/doctype/coupon_code/coupon_code.py
  29. 3
      erpnext/accounts/doctype/coupon_code/test_coupon_code.py
  30. 2
      erpnext/accounts/doctype/discounted_invoice/discounted_invoice.py
  31. 2
      erpnext/accounts/doctype/dunning/dunning_dashboard.py
  32. 2
      erpnext/accounts/doctype/dunning/test_dunning.py
  33. 4
      erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
  34. 4
      erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
  35. 2
      erpnext/accounts/doctype/finance_book/test_finance_book.py
  36. 2
      erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py
  37. 2
      erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js
  38. 2
      erpnext/accounts/doctype/journal_entry/regional/india.js
  39. 2
      erpnext/accounts/doctype/journal_entry/test_journal_entry.py
  40. 2
      erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js
  41. 2
      erpnext/accounts/doctype/mode_of_payment/mode_of_payment.js
  42. 1
      erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py
  43. 2
      erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py
  44. 2
      erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py
  45. 2
      erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js
  46. 1
      erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
  47. 6
      erpnext/accounts/doctype/payment_entry/payment_entry.py
  48. 2
      erpnext/accounts/doctype/payment_entry/payment_entry_list.js
  49. 2
      erpnext/accounts/doctype/payment_entry/tests/test_payment_against_purchase_invoice.js
  50. 2
      erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js
  51. 2
      erpnext/accounts/doctype/payment_entry/tests/test_payment_entry_write_off.js
  52. 10
      erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.py
  53. 2
      erpnext/accounts/doctype/payment_order/payment_order.js
  54. 2
      erpnext/accounts/doctype/payment_order/payment_order_dashboard.py
  55. 2
      erpnext/accounts/doctype/payment_order/test_payment_order.py
  56. 2
      erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
  57. 2
      erpnext/accounts/doctype/payment_request/payment_request.py
  58. 2
      erpnext/accounts/doctype/payment_request/test_payment_request.py
  59. 2
      erpnext/accounts/doctype/payment_term/payment_term.js
  60. 2
      erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js
  61. 2
      erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py
  62. 4
      erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
  63. 2
      erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
  64. 6
      erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js
  65. 6
      erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.js
  66. 2
      erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py
  67. 1
      erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py
  68. 2
      erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.js
  69. 2
      erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.py
  70. 6
      erpnext/accounts/doctype/pos_opening_entry/test_pos_opening_entry.py
  71. 2
      erpnext/accounts/doctype/pos_settings/pos_settings.py
  72. 2
      erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
  73. 1
      erpnext/accounts/doctype/pricing_rule/tests/test_pricing_rule.js
  74. 2
      erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py
  75. 2
      erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py
  76. 2
      erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
  77. 2
      erpnext/accounts/doctype/promotional_scheme/promotional_scheme.js
  78. 2
      erpnext/accounts/doctype/promotional_scheme/promotional_scheme_dashboard.py
  79. 12
      erpnext/accounts/doctype/promotional_scheme/test_promotional_scheme.py
  80. 2
      erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
  81. 2
      erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
  82. 2
      erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
  83. 1
      erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
  84. 2
      erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py
  85. 2
      erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py
  86. 2
      erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py
  87. 1
      erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.js
  88. 8
      erpnext/accounts/doctype/sales_invoice/regional/india_list.js
  89. 2
      erpnext/accounts/doctype/sales_invoice/regional/italy.js
  90. 2
      erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
  91. 1
      erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice.js
  92. 1
      erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js
  93. 1
      erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
  94. 1
      erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment_request.js
  95. 1
      erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_serialize_item.js
  96. 2
      erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py
  97. 2
      erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py
  98. 2
      erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py
  99. 1
      erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.js
  100. 2
      erpnext/accounts/doctype/share_transfer/share_transfer.js

2
erpnext/.stylelintrc

@ -6,4 +6,4 @@
"scss/at-rule-no-unknown": true,
"no-descending-specificity": null
}
}
}

2
erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.js

@ -19,4 +19,4 @@ frappe.dashboards.chart_sources["Account Balance Timeline"] = {
reqd: 1
},
]
};
};

2
erpnext/accounts/deferred_revenue.py

@ -450,5 +450,3 @@ def get_deferred_booking_accounts(doctype, voucher_detail_no, dr_or_cr):
return debit_account
else:
return credit_account

2
erpnext/accounts/doctype/accounting_dimension/accounting_dimension.js

@ -60,4 +60,4 @@ frappe.ui.form.on('Accounting Dimension Detail', {
let row = locals[cdt][cdn];
row.reference_document = frm.doc.document_type;
}
});
});

2
erpnext/accounts/doctype/accounting_dimension/test_accounting_dimension.py

@ -113,5 +113,3 @@ def disable_dimension():
dimension2 = frappe.get_doc("Accounting Dimension", "Location")
dimension2.disabled = 1
dimension2.save()

2
erpnext/accounts/doctype/accounting_dimension_filter/accounting_dimension_filter.js

@ -79,4 +79,4 @@ frappe.ui.form.on('Allowed Dimension', {
row.accounting_dimension = frm.doc.accounting_dimension;
frm.refresh_field("dimensions");
}
});
});

2
erpnext/accounts/doctype/accounting_period/accounting_period.py

@ -56,4 +56,4 @@ class AccountingPeriod(Document):
self.append('closed_documents', {
"document_type": doctype_for_closing.document_type,
"closed": doctype_for_closing.closed
})
})

2
erpnext/accounts/doctype/accounts_settings/accounts_settings.js

@ -48,4 +48,4 @@ frappe.tour['Accounts Settings'] = [
title: "Unlink Advance Payment on Cancellation of Order",
description: __("Similar to the previous option, this unlinks any advance payments made against Purchase/Sales Orders.")
}
];
];

4
erpnext/accounts/doctype/accounts_settings/accounts_settings.py

@ -37,7 +37,7 @@ class AccountsSettings(Document):
def toggle_discount_accounting_fields(self):
enable_discount_accounting = cint(self.enable_discount_accounting)
for doctype in ["Sales Invoice Item", "Purchase Invoice Item"]:
make_property_setter(doctype, "discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
if enable_discount_accounting:
@ -52,4 +52,4 @@ class AccountsSettings(Document):
else:
make_property_setter(doctype, "additional_discount_account", "mandatory_depends_on", "", "Code", validate_fields_for_doctype=False)
make_property_setter("Item", "default_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
make_property_setter("Item", "default_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)

2
erpnext/accounts/doctype/accounts_settings/regional/united_states.js

@ -5,4 +5,4 @@ frappe.ui.form.on('Accounts Settings', {
frm.set_df_property("frozen_accounts_modifier", "label", "Role Allowed to Close Books & Make Changes to Closed Periods");
frm.set_df_property("credit_controller", "label", "Credit Manager");
}
});
});

2
erpnext/accounts/doctype/bank/bank.js

@ -120,4 +120,4 @@ erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
plaid_success(token, response) {
frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
}
};
};

2
erpnext/accounts/doctype/bank/bank.py

@ -13,4 +13,4 @@ class Bank(Document):
load_address_and_contact(self)
def on_trash(self):
delete_contact_and_address('Bank', self.name)
delete_contact_and_address('Bank', self.name)

2
erpnext/accounts/doctype/bank_account/bank_account_dashboard.py

@ -26,4 +26,4 @@ def get_data():
'items': ['Journal Entry']
}
]
}
}

2
erpnext/accounts/doctype/bank_clearance/bank_clearance.js

@ -8,7 +8,7 @@ frappe.ui.form.on("Bank Clearance", {
onload: function(frm) {
let default_bank_account = frappe.defaults.get_user_default("Company")?
let default_bank_account = frappe.defaults.get_user_default("Company")?
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
frm.set_value("account", default_bank_account);

2
erpnext/accounts/doctype/bank_clearance_detail/bank_clearance_detail.py

@ -6,4 +6,4 @@ import frappe
from frappe.model.document import Document
class BankClearanceDetail(Document):
pass
pass

2
erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py

@ -25,6 +25,6 @@ class BankGuarantee(Document):
def get_vouchar_detials(column_list, doctype, docname):
column_list = json.loads(column_list)
for col in column_list:
sanitize_searchfield(col)
sanitize_searchfield(col)
return frappe.db.sql(''' select {columns} from `tab{doctype}` where name=%s'''
.format(columns=", ".join(column_list), doctype=doctype), docname, as_dict=1)[0]

1
erpnext/accounts/doctype/bank_transaction/bank_transaction.py

@ -105,4 +105,3 @@ def unclear_reference_payment(doctype, docname):
frappe.db.set_value(doc.payment_document, doc.payment_entry, "clearance_date", None)
return doc.payment_entry

2
erpnext/accounts/doctype/bank_transaction/bank_transaction_list.js

@ -10,4 +10,4 @@ frappe.listview_settings['Bank Transaction'] = {
return [__("Reconciled"), "green", "unallocated_amount,=,0"];
}
}
};
};

2
erpnext/accounts/doctype/bank_transaction/bank_transaction_upload.py

@ -77,4 +77,4 @@ def get_bank_mapping(bank_account):
mapping = {row.file_field:row.bank_transaction_field for row in bank.bank_transaction_mapping}
return mapping
return mapping

2
erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py

@ -6,4 +6,4 @@ import frappe
from frappe.model.document import Document
class CFormInvoiceDetail(Document):
pass
pass

2
erpnext/accounts/doctype/cash_flow_mapping/cash_flow_mapping.py

@ -18,5 +18,3 @@ class CashFlowMapping(Document):
frappe._('You can only select a maximum of one option from the list of check boxes.'),
title='Error'
)

2
erpnext/accounts/doctype/cashier_closing/cashier_closing.py

@ -33,4 +33,4 @@ class CashierClosing(Document):
def validate_time(self):
if self.from_time >= self.time:
frappe.throw(_("From Time Should Be Less Than To Time"))
frappe.throw(_("From Time Should Be Less Than To Time"))

10
erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js

@ -10,10 +10,10 @@ frappe.ui.form.on('Cheque Print Template', {
function() {
erpnext.cheque_print.view_cheque_print(frm);
}).addClass("btn-primary");
$(frm.fields_dict.cheque_print_preview.wrapper).empty()
var template = '<div style="position: relative; overflow-x: scroll;">\
<div id="cheque_preview" style="width: {{ cheque_width }}cm; \
height: {{ cheque_height }}cm;\
@ -47,9 +47,9 @@ frappe.ui.form.on('Cheque Print Template', {
position: absolute;"> Signatory Name </span>\
</div>\
</div>';
$(frappe.render(template, frm.doc)).appendTo(frm.fields_dict.cheque_print_preview.wrapper)
if (frm.doc.scanned_cheque) {
$(frm.fields_dict.cheque_print_preview.wrapper).find("#cheque_preview").css('background-image', 'url(' + frm.doc.scanned_cheque + ')');
}

2
erpnext/accounts/doctype/cost_center/cost_center.py

@ -129,4 +129,4 @@ def get_name_with_number(new_account, account_number):
def check_if_distributed_cost_center_enabled(cost_center_list):
value_list = frappe.get_list("Cost Center", {"name": ["in", cost_center_list]}, "enable_distributed_cost_center", as_list=1)
return next((True for x in value_list if x[0]), False)
return next((True for x in value_list if x[0]), False)

2
erpnext/accounts/doctype/cost_center/cost_center_dashboard.py

@ -12,4 +12,4 @@ def get_data():
'items': ['Budget Variance Report', 'General Ledger']
}
]
}
}

2
erpnext/accounts/doctype/cost_center/cost_center_tree.js

@ -51,4 +51,4 @@ frappe.treeview_settings["Cost Center"] = {
}
}
}

3
erpnext/accounts/doctype/cost_center/test_cost_center.py

@ -62,6 +62,3 @@ def create_cost_center(**args):
cc.is_group = args.is_group or 0
cc.parent_cost_center = args.parent_cost_center or "_Test Company - _TC"
cc.insert()

2
erpnext/accounts/doctype/coupon_code/coupon_code.py

@ -17,7 +17,7 @@ class CouponCode(Document):
self.coupon_code =''.join(i for i in self.coupon_name if not i.isdigit())[0:8].upper()
elif self.coupon_type == "Gift Card":
self.coupon_code = frappe.generate_hash()[:10].upper()
def validate(self):
if self.coupon_type == "Gift Card":
self.maximum_use = 1

3
erpnext/accounts/doctype/coupon_code/test_coupon_code.py

@ -124,6 +124,3 @@ class TestCouponCode(unittest.TestCase):
so.submit()
self.assertEqual(frappe.db.get_value("Coupon Code", "SAVE30", "used"), 1)

2
erpnext/accounts/doctype/discounted_invoice/discounted_invoice.py

@ -7,4 +7,4 @@ from __future__ import unicode_literals
from frappe.model.document import Document
class DiscountedInvoice(Document):
pass
pass

2
erpnext/accounts/doctype/dunning/dunning_dashboard.py

@ -14,4 +14,4 @@ def get_data():
'items': ['Payment Entry', 'Journal Entry']
}
]
}
}

2
erpnext/accounts/doctype/dunning/test_dunning.py

@ -143,4 +143,4 @@ def create_dunning_type_with_zero_interest_rate():
'closing_text': 'We kindly request that you pay the outstanding amount immediately, and late fees.'
}
)
dunning_type.save()
dunning_type.save()

4
erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js

@ -31,7 +31,7 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
}, __('Create'));
}
}
});
});
}
},
@ -128,4 +128,4 @@ var get_account_details = function(frm, cdt, cdn) {
frm.events.get_total_gain_loss(frm);
}
});
};
};

4
erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py

@ -44,7 +44,7 @@ class ExchangeRateRevaluation(Document):
if total_amt != total_debit:
return True
return False
@frappe.whitelist()
@ -205,4 +205,4 @@ def get_account_details(account, company, posting_date, party_type=None, party=N
"new_balance_in_base_currency": new_balance_in_base_currency
}
return account_details
return account_details

2
erpnext/accounts/doctype/finance_book/test_finance_book.py

@ -19,7 +19,7 @@ class TestFinanceBook(unittest.TestCase):
finance_book = frappe.get_doc("Finance Book", "_Test Finance Book")
return finance_book
def test_finance_book(self):
finance_book = self.create_finance_book()

2
erpnext/accounts/doctype/invoice_discounting/invoice_discounting_dashboard.py

@ -17,4 +17,4 @@ def get_data():
'items': ['Payment Entry', 'Journal Entry']
}
]
}
}

2
erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js

@ -18,4 +18,4 @@ frappe.listview_settings['Invoice Discounting'] = {
return [__("Canceled"), "red", "status,=,Canceled"];
}
}
};
};

2
erpnext/accounts/doctype/journal_entry/regional/india.js

@ -14,4 +14,4 @@ frappe.ui.form.on("Journal Entry", {
};
});
}
});
});

2
erpnext/accounts/doctype/journal_entry/test_journal_entry.py

@ -100,7 +100,7 @@ class TestJournalEntry(unittest.TestCase):
"debit_in_account_currency": 0 if diff > 0 else abs(diff),
"credit_in_account_currency": diff if diff > 0 else 0
})
jv.append("accounts", {
"account": "Stock Adjustment - TCP1",
"cost_center": "Main - TCP1",

2
erpnext/accounts/doctype/journal_entry_template/journal_entry_template.js

@ -88,4 +88,4 @@ frappe.ui.form.on("Journal Entry Template", {
frappe.model.clear_table(frm.doc, "accounts");
frm.refresh_field("accounts");
}
});
});

2
erpnext/accounts/doctype/mode_of_payment/mode_of_payment.js

@ -14,4 +14,4 @@ frappe.ui.form.on('Mode of Payment', {
};
});
},
});
});

1
erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py

@ -39,4 +39,3 @@ class ModeofPayment(Document):
message = "POS Profile " + frappe.bold(", ".join(pos_profiles)) + " contains \
Mode of Payment " + frappe.bold(str(self.name)) + ". Please remove them to disable this mode."
frappe.throw(_(message), title="Not Allowed")

2
erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py

@ -55,4 +55,4 @@ def get_percentage(doc, start_date, period):
if d.month in months:
percentage += d.percentage_allocation
return percentage
return percentage

2
erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py

@ -20,4 +20,4 @@ def get_data():
'items': ['Budget']
}
]
}
}

2
erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js

@ -162,4 +162,4 @@ frappe.ui.form.on('Opening Invoice Creation Tool Item', {
invoices_add: (frm) => {
frm.trigger('update_invoice_table');
}
});
});

1
erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py

@ -241,4 +241,3 @@ def get_temporary_opening_account(company=None):
frappe.throw(_("Please add a Temporary Opening account in Chart of Accounts"))
return accounts[0].name

6
erpnext/accounts/doctype/payment_entry/payment_entry.py

@ -185,7 +185,7 @@ class PaymentEntry(AccountsController):
for field, value in iteritems(ref_details):
if d.exchange_gain_loss:
# for cases where gain/loss is booked into invoice
# exchange_gain_loss is calculated from invoice & populated
# exchange_gain_loss is calculated from invoice & populated
# and row.exchange_rate is already set to payment entry's exchange rate
# refer -> `update_reference_in_payment_entry()` in utils.py
continue
@ -417,7 +417,7 @@ class PaymentEntry(AccountsController):
net_total_for_tds = 0
if reference.reference_doctype == 'Purchase Order':
net_total_for_tds += flt(frappe.db.get_value('Purchase Order', reference.reference_name, 'net_total'))
if net_total_for_tds:
net_total = net_total_for_tds
@ -841,7 +841,7 @@ class PaymentEntry(AccountsController):
if account_details:
row.update(account_details)
if not row.get('amount'):
# if no difference amount
return

2
erpnext/accounts/doctype/payment_entry/payment_entry_list.js

@ -11,4 +11,4 @@ frappe.listview_settings['Payment Entry'] = {
};
}
}
};
};

2
erpnext/accounts/doctype/payment_entry/tests/test_payment_against_purchase_invoice.js

@ -57,4 +57,4 @@ QUnit.test("test payment entry", function(assert) {
() => frappe.timeout(3),
() => done()
]);
});
});

2
erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js

@ -25,4 +25,4 @@ QUnit.test("test payment entry", function(assert) {
() => frappe.timeout(0.3),
() => done()
]);
});
});

2
erpnext/accounts/doctype/payment_entry/tests/test_payment_entry_write_off.js

@ -64,4 +64,4 @@ QUnit.test("test payment entry", function(assert) {
},
() => done()
]);
});
});

10
erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.py

@ -9,19 +9,19 @@ from frappe.model.document import Document
class PaymentGatewayAccount(Document):
def autoname(self):
self.name = self.payment_gateway + " - " + self.currency
def validate(self):
self.currency = frappe.db.get_value("Account", self.payment_account, "account_currency")
self.update_default_payment_gateway()
self.set_as_default_if_not_set()
def update_default_payment_gateway(self):
if self.is_default:
frappe.db.sql("""update `tabPayment Gateway Account` set is_default = 0
where is_default = 1 """)
def set_as_default_if_not_set(self):
if not frappe.db.get_value("Payment Gateway Account",
if not frappe.db.get_value("Payment Gateway Account",
{"is_default": 1, "name": ("!=", self.name)}, "name"):
self.is_default = 1

2
erpnext/accounts/doctype/payment_order/payment_order.js

@ -136,4 +136,4 @@ frappe.ui.form.on('Payment Order', {
dialog.show();
},
});
});

2
erpnext/accounts/doctype/payment_order/payment_order_dashboard.py

@ -9,4 +9,4 @@ def get_data():
'items': ['Payment Entry', 'Journal Entry']
}
]
}
}

2
erpnext/accounts/doctype/payment_order/test_payment_order.py

@ -46,4 +46,4 @@ def create_payment_order_against_payment_entry(ref_doc, order_type):
doc = make_payment_order(ref_doc.name, payment_order)
doc.save()
doc.submit()
return doc
return doc

2
erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py

@ -307,4 +307,4 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
]
})
jv.flags.ignore_mandatory = True
jv.submit()
jv.submit()

2
erpnext/accounts/doctype/payment_request/payment_request.py

@ -541,4 +541,4 @@ def make_payment_order(source_name, target_doc=None):
}
}, target_doc, set_missing_values)
return doclist
return doclist

2
erpnext/accounts/doctype/payment_request/test_payment_request.py

@ -138,4 +138,4 @@ class TestPaymentRequest(unittest.TestCase):
# Try to make Payment Request more than SO amount, should give validation
pr2.grand_total = 900
self.assertRaises(frappe.ValidationError, pr2.save)
self.assertRaises(frappe.ValidationError, pr2.save)

2
erpnext/accounts/doctype/payment_term/payment_term.js

@ -19,4 +19,4 @@ frappe.ui.form.on('Payment Term', {
frm.set_df_property("discount", "description", description);
}
}
});
});

2
erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js

@ -3,6 +3,6 @@
frappe.ui.form.on('Payment Terms Template', {
setup: function(frm) {
}
});

2
erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py

@ -30,4 +30,4 @@ def get_data():
'items': ['Customer Group', 'Supplier Group']
}
]
}
}

4
erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py

@ -51,7 +51,7 @@ class PeriodClosingVoucher(AccountsController):
def make_gl_entries(self):
gl_entries = []
net_pl_balance = 0
net_pl_balance = 0
pl_accounts = self.get_pl_balances()
@ -79,7 +79,7 @@ class PeriodClosingVoucher(AccountsController):
from erpnext.accounts.general_ledger import make_gl_entries
make_gl_entries(gl_entries)
def get_pnl_gl_entry(self, net_pl_balance):
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entry = self.get_gl_dict({

2
erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py

@ -139,7 +139,7 @@ def create_company():
'company_name': "Test PCV Company",
'country': 'United States',
'default_currency': 'USD'
})
})
company.insert(ignore_if_duplicate = True)
return company.name

6
erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.js

@ -20,9 +20,9 @@ frappe.ui.form.on('POS Closing Entry', {
frm.set_query("pos_opening_entry", function(doc) {
return { filters: { 'status': 'Open', 'docstatus': 1 } };
});
if (frm.doc.docstatus === 0 && !frm.doc.amended_from) frm.set_value("period_end_date", frappe.datetime.now_datetime());
frappe.realtime.on('closing_process_complete', async function(data) {
await frm.reload_doc();
if (frm.doc.status == 'Failed' && frm.doc.error_message && data.user == frappe.session.user) {
@ -43,7 +43,7 @@ frappe.ui.form.on('POS Closing Entry', {
const issue = '<a id="jump_to_error" style="text-decoration: underline;">issue</a>';
frm.dashboard.set_headline(
__('POS Closing failed while running in a background process. You can resolve the {0} and retry the process again.', [issue]));
$('#jump_to_error').on('click', (e) => {
e.preventDefault();
frappe.utils.scroll_to(

6
erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.js

@ -5,10 +5,10 @@ frappe.ui.form.on('POS Invoice Merge Log', {
setup: function(frm) {
frm.set_query("pos_invoice", "pos_invoices", doc => {
return{
filters: {
filters: {
'docstatus': 1,
'customer': doc.customer,
'consolidated_invoice': ''
'customer': doc.customer,
'consolidated_invoice': ''
}
}
});

2
erpnext/accounts/doctype/pos_invoice_merge_log/pos_invoice_merge_log.py

@ -354,4 +354,4 @@ def safe_load_json(message):
except Exception:
json_message = message
return json_message
return json_message

1
erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py

@ -147,4 +147,3 @@ class TestPOSInvoiceMergeLog(unittest.TestCase):
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
frappe.db.sql("delete from `tabPOS Invoice`")

2
erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.js

@ -53,4 +53,4 @@ frappe.ui.form.on('POS Opening Entry', {
});
}
}
});
});

2
erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry.py

@ -38,4 +38,4 @@ class POSOpeningEntry(StatusUpdater):
frappe.throw(msg.format(", ".join(invalid_modes)), title=_("Missing Account"))
def on_submit(self):
self.set_status(update=True)
self.set_status(update=True)

6
erpnext/accounts/doctype/pos_opening_entry/test_pos_opening_entry.py

@ -21,8 +21,8 @@ def create_opening_entry(pos_profile, user):
balance_details.append(frappe._dict({
'mode_of_payment': d.mode_of_payment
}))
entry.set("balance_details", balance_details)
entry.submit()
return entry.as_dict()
return entry.as_dict()

2
erpnext/accounts/doctype/pos_settings/pos_settings.py

@ -8,4 +8,4 @@ from frappe.model.document import Document
class POSSettings(Document):
def validate(self):
pass
pass

2
erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py

@ -615,4 +615,4 @@ def delete_existing_pricing_rules():
for doctype in ["Pricing Rule", "Pricing Rule Item Code",
"Pricing Rule Item Group", "Pricing Rule Brand"]:
frappe.db.sql("delete from `tab{0}`".format(doctype))
frappe.db.sql("delete from `tab{0}`".format(doctype))

1
erpnext/accounts/doctype/pricing_rule/tests/test_pricing_rule.js

@ -26,4 +26,3 @@ QUnit.test("test pricing rule", function(assert) {
() => done()
]);
});

2
erpnext/accounts/doctype/process_deferred_accounting/process_deferred_accounting.py

@ -31,4 +31,4 @@ class ProcessDeferredAccounting(Document):
'against_voucher': self.name
})
make_reverse_gl_entries(gl_entries=gl_entries)
make_reverse_gl_entries(gl_entries=gl_entries)

2
erpnext/accounts/doctype/process_deferred_accounting/test_process_deferred_accounting.py

@ -45,4 +45,4 @@ class TestProcessDeferredAccounting(unittest.TestCase):
["Sales - _TC", 0.0, 33.85, "2019-01-31"]
]
check_gl_entries(self, si.name, expected_gle, "2019-01-10")
check_gl_entries(self, si.name, expected_gle, "2019-01-10")

2
erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py

@ -284,4 +284,4 @@ def send_auto_email():
selected = frappe.get_list('Process Statement Of Accounts', filters={'to_date': format_date(today()), 'enable_auto_email': 1})
for entry in selected:
send_emails(entry.name, from_scheduler=True)
return True
return True

2
erpnext/accounts/doctype/promotional_scheme/promotional_scheme.js

@ -48,4 +48,4 @@ frappe.ui.form.on('Promotional Scheme', {
frm.doc.apply_on === key ? 1 : 0);
}
}
});
});

2
erpnext/accounts/doctype/promotional_scheme/promotional_scheme_dashboard.py

@ -9,4 +9,4 @@ def get_data():
'items': ['Pricing Rule']
}
]
}
}

12
erpnext/accounts/doctype/promotional_scheme/test_promotional_scheme.py

@ -11,25 +11,25 @@ class TestPromotionalScheme(unittest.TestCase):
ps = make_promotional_scheme()
price_rules = frappe.get_all('Pricing Rule', fields = ["promotional_scheme_id", "name", "creation"],
filters = {'promotional_scheme': ps.name})
self.assertTrue(len(price_rules),1)
self.assertTrue(len(price_rules),1)
price_doc_details = frappe.db.get_value('Pricing Rule', price_rules[0].name, ['customer', 'min_qty', 'discount_percentage'], as_dict = 1)
self.assertTrue(price_doc_details.customer, '_Test Customer')
self.assertTrue(price_doc_details.min_qty, 4)
self.assertTrue(price_doc_details.discount_percentage, 20)
ps.price_discount_slabs[0].min_qty = 6
ps.append('customer', {
ps.append('customer', {
'customer': "_Test Customer 2"})
ps.save()
price_rules = frappe.get_all('Pricing Rule', fields = ["promotional_scheme_id", "name"],
filters = {'promotional_scheme': ps.name})
self.assertTrue(len(price_rules), 2)
self.assertTrue(len(price_rules), 2)
price_doc_details = frappe.db.get_value('Pricing Rule', price_rules[1].name, ['customer', 'min_qty', 'discount_percentage'], as_dict = 1)
self.assertTrue(price_doc_details.customer, '_Test Customer 2')
self.assertTrue(price_doc_details.min_qty, 6)
self.assertTrue(price_doc_details.discount_percentage, 20)
price_doc_details = frappe.db.get_value('Pricing Rule', price_rules[0].name, ['customer', 'min_qty', 'discount_percentage'], as_dict = 1)
self.assertTrue(price_doc_details.customer, '_Test Customer')
self.assertTrue(price_doc_details.min_qty, 6)
@ -38,7 +38,7 @@ class TestPromotionalScheme(unittest.TestCase):
price_rules = frappe.get_all('Pricing Rule', fields = ["promotional_scheme_id", "name"],
filters = {'promotional_scheme': ps.name})
self.assertEqual(price_rules, [])
def make_promotional_scheme():
ps = frappe.new_doc('Promotional Scheme')
ps.name = '_Test Scheme'
@ -57,4 +57,4 @@ def make_promotional_scheme():
})
ps.save()
return ps
return ps

2
erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js

@ -591,4 +591,4 @@ frappe.ui.form.on("Purchase Invoice", {
company: function(frm) {
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
},
})
})

2
erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py

@ -34,4 +34,4 @@ def get_data():
'items': ['Auto Repeat']
},
]
}
}

2
erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js

@ -26,4 +26,4 @@ frappe.listview_settings['Purchase Invoice'] = {
return [__("Paid"), "green", "outstanding_amount,=,0"];
}
}
};
};

1
erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js

@ -72,4 +72,3 @@ QUnit.test("test purchase invoice", function(assert) {
() => done()
]);
});

2
erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py

@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class PurchaseInvoiceAdvance(Document):
pass
pass

2
erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py

@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class PurchaseTaxesandCharges(Document):
pass
pass

2
erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py

@ -19,4 +19,4 @@ def get_data():
'items': ['Supplier Quotation', 'Tax Rule']
}
]
}
}

1
erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.js

@ -26,4 +26,3 @@ QUnit.test("test sales taxes and charges template", function(assert) {
() => done()
]);
});

8
erpnext/accounts/doctype/sales_invoice/regional/india_list.js

@ -67,7 +67,7 @@ frappe.listview_settings['Sales Invoice'].onload = function (list_view) {
"default": "1-Duplicate",
"options": ["1-Duplicate", "2-Data Entry Error", "3-Order Cancelled", "4-Other"]
},
{
{
"label": "Remark",
"fieldname": "remark",
"fieldtype": "Data",
@ -82,7 +82,7 @@ frappe.listview_settings['Sales Invoice'].onload = function (list_view) {
const data = d.get_values();
frappe.call({
method: 'erpnext.regional.india.e_invoice.utils.cancel_irns',
args: {
args: {
doctype: list_view.doctype,
docnames,
reason: data.reason.split('-')[0],
@ -122,7 +122,7 @@ frappe.listview_settings['Sales Invoice'].onload = function (list_view) {
frappe.realtime.on("bulk_einvoice_generation_complete", (data) => {
const { failures, user, invoices } = data;
if (invoices.length != failures.length) {
frappe.msgprint({
message: __('{0} e-invoices generated successfully', [invoices.length]),
@ -171,4 +171,4 @@ frappe.listview_settings['Sales Invoice'].onload = function (list_view) {
});
}
});
};
};

2
erpnext/accounts/doctype/sales_invoice/regional/italy.js

@ -1,3 +1,3 @@
{% include "erpnext/regional/italy/sales_invoice.js" %}
erpnext.setup_e_invoice_button('Sales Invoice')
erpnext.setup_e_invoice_button('Sales Invoice')

2
erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py

@ -33,4 +33,4 @@ def get_data():
'items': ['Auto Repeat']
},
]
}
}

1
erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice.js

@ -40,4 +40,3 @@ QUnit.test("test sales Invoice", function(assert) {
() => done()
]);
});

1
erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js

@ -33,4 +33,3 @@ QUnit.test("test sales invoice with margin", function(assert) {
() => done()
]);
});

1
erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js

@ -54,4 +54,3 @@ QUnit.test("test sales Invoice with payment", function(assert) {
() => done()
]);
});

1
erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment_request.js

@ -49,4 +49,3 @@ QUnit.test("test sales Invoice with payment request", function(assert) {
() => done()
]);
});

1
erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_serialize_item.js

@ -42,4 +42,3 @@ QUnit.test("test sales Invoice with serialize item", function(assert) {
() => done()
]);
});

2
erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py

@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class SalesInvoiceAdvance(Document):
pass
pass

2
erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py

@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class SalesTaxesandCharges(Document):
pass
pass

2
erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py

@ -21,4 +21,4 @@ def get_data():
'items': ['POS Profile', 'Subscription', 'Restaurant', 'Tax Rule']
}
]
}
}

1
erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.js

@ -26,4 +26,3 @@ QUnit.test("test sales taxes and charges template", function(assert) {
() => done()
]);
});

2
erpnext/accounts/doctype/share_transfer/share_transfer.js

@ -115,4 +115,4 @@ erpnext.share_transfer.make_jv = function (frm) {
frappe.set_route("Form", doc.doctype, doc.name);
}
});
};
};

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save