Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release v15 beta #37246

Merged
merged 39 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
426350e
fix: Update `advance_paid` in SO/PO after unlinking from advance entry
marination Sep 13, 2023
8a4954d
test: Impact on SO of advance PE submit and unlinking/replacement by SI
marination Sep 13, 2023
a9c85e4
fix: handle multiple references with same name
vorasmit Sep 17, 2023
7bc8ff2
fix: payment url display as link
blaggacao Sep 16, 2023
c99c486
Merge branch 'develop' into fix/payment-url
blaggacao Sep 18, 2023
dd4769e
feat: allow to edit Stock Quantity in the Sales and Purchase Transact…
rohitwaghchaure Sep 20, 2023
f0859ec
fix: labels for `Stock Ledger Invariant Check` report (#37150)
s-aga-r Sep 20, 2023
acda72d
feat: `Stock Ledger Variance` report (#37165)
s-aga-r Sep 21, 2023
f31a527
Merge pull request #37120 from vorasmit/fix-dup-advance
ruthra-kumar Sep 21, 2023
fb84492
feat: Customer and Supplier - Primary Address and Contact on the same…
FHenry Sep 21, 2023
c5667a6
fix: missing french translation on Lead and Prospect
FHenry Sep 21, 2023
8b6430c
refactor(minor): `Stock Reservation Entry`
s-aga-r Sep 21, 2023
b6437e3
fix: `Item Dashboard`
s-aga-r Sep 21, 2023
c679d54
Merge pull request #37185 from s-aga-r/REFACTOR-SRE
s-aga-r Sep 21, 2023
d477387
Merge pull request #37069 from marination/advance-unlink-impact
ruthra-kumar Sep 22, 2023
150728d
refactor: button on PE to filter associated Journals
ruthra-kumar Sep 22, 2023
5353f19
Merge pull request #37200 from ruthra-kumar/ui_element_to_filter_on_p…
ruthra-kumar Sep 22, 2023
301092d
refactor: ignore PLE's on PCV cancellation
ruthra-kumar Sep 22, 2023
c5e4e01
Merge pull request #37202 from ruthra-kumar/ignore_ple_on_pcv_cancell…
ruthra-kumar Sep 22, 2023
dc1294e
refactor: missing translation
FHenry Sep 22, 2023
d1c69aa
Merge branch 'develop' of https://github.com/frappe/erpnext into dev_…
FHenry Sep 22, 2023
b2d5206
refactor: missing translation
FHenry Sep 22, 2023
f156030
refactor: missing translation
FHenry Sep 22, 2023
06a4589
feat: Toggle net values in Trial Balance report
deepeshgarg007 Sep 23, 2023
5346c67
fix: apply gl report filters
GursheenK Sep 23, 2023
7f98100
fix: german translation of Purchase Receipt
barredterra Sep 23, 2023
b578317
Merge pull request #37213 from GursheenK/process-soa-gl-filters
deepeshgarg007 Sep 24, 2023
9dbb9e7
Merge pull request #37211 from deepeshgarg007/trial_balance_net_values
deepeshgarg007 Sep 24, 2023
62ea097
fix: set customer currency in pos_invoice if exists
milanpethani Sep 20, 2023
0856620
Merge pull request #37219 from frappe/mergify/bp/develop/pr-37167
deepeshgarg007 Sep 24, 2023
b8ff9e8
Merge pull request #37214 from barredterra/german-purchase-receipt
deepeshgarg007 Sep 24, 2023
7c4ebe2
fix(Material Request): consider project for item details (#37215)
barredterra Sep 24, 2023
12e16aa
Merge pull request #37190 from FHenry/dev_feat_adress_contact_postion
deepeshgarg007 Sep 24, 2023
c7969b4
Merge pull request #37116 from blaggacao/fix/payment-url
deepeshgarg007 Sep 24, 2023
ee178ff
chore: add disabled field for bank account (#37226)
anandbaburajan Sep 25, 2023
a444906
Merge pull request #37191 from FHenry/dev_fr_translation
deepeshgarg007 Sep 25, 2023
0f6b530
feat: Added ledger for Botswana VAT (#37212)
kalungia Sep 26, 2023
73fc974
fix: incorrect `Parent Task` getting set for 2nd to nth child Task (#…
s-aga-r Sep 26, 2023
656c758
chore: Add missing comma
deepeshgarg007 Sep 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion erpnext/accounts/doctype/bank_account/bank_account.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"account_type",
"account_subtype",
"column_break_7",
"disabled",
"is_default",
"is_company_account",
"company",
Expand Down Expand Up @@ -199,10 +200,16 @@
"fieldtype": "Data",
"in_global_search": 1,
"label": "Branch Code"
},
{
"default": "0",
"fieldname": "disabled",
"fieldtype": "Check",
"label": "Disabled"
}
],
"links": [],
"modified": "2022-05-04 15:49:42.620630",
"modified": "2023-09-22 21:31:34.763977",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Account",
Expand Down
6 changes: 6 additions & 0 deletions erpnext/accounts/doctype/payment_entry/payment_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ frappe.ui.form.on('Payment Entry', {
frm.events.set_dynamic_labels(frm);
frm.events.show_general_ledger(frm);
erpnext.accounts.ledger_preview.show_accounting_ledger_preview(frm);
if(frm.doc.references.find((elem) => {return elem.exchange_gain_loss != 0})) {
frm.add_custom_button(__("View Exchange Gain/Loss Journals"), function() {
frappe.set_route("List", "Journal Entry", {"voucher_type": "Exchange Gain Or Loss", "reference_name": frm.doc.name});
}, __('Actions'));

}
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm);
},

Expand Down
21 changes: 19 additions & 2 deletions erpnext/accounts/doctype/payment_entry/payment_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,8 +1152,25 @@ def make_advance_gl_entries(self, against_voucher_type=None, against_voucher=Non
)

make_reverse_gl_entries(gl_entries=gl_entries, partial_cancel=True)
else:
make_gl_entries(gl_entries)
return

# same reference added to payment entry
for gl_entry in gl_entries.copy():
if frappe.db.exists(
"GL Entry",
{
"account": gl_entry.account,
"voucher_type": gl_entry.voucher_type,
"voucher_no": gl_entry.voucher_no,
"voucher_detail_no": gl_entry.voucher_detail_no,
"debit": gl_entry.debit,
"credit": gl_entry.credit,
"is_cancelled": 0,
},
):
gl_entries.remove(gl_entry)

make_gl_entries(gl_entries)

def make_invoice_liability_entry(self, gl_entries, invoice):
args_dict = {
Expand Down
70 changes: 36 additions & 34 deletions erpnext/accounts/doctype/payment_request/payment_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@
"fieldtype": "Read Only",
"label": "SWIFT Number"
},
{
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions"
},
{
"fieldname": "cost_center",
"fieldtype": "Link",
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"depends_on": "eval: doc.payment_request_type == 'Inward'",
"fieldname": "recipient_and_message",
Expand All @@ -246,7 +268,8 @@
"fieldname": "email_to",
"fieldtype": "Data",
"in_global_search": 1,
"label": "To"
"label": "To",
"options": "Email"
},
{
"depends_on": "eval: doc.payment_channel != \"Phone\"",
Expand Down Expand Up @@ -317,9 +340,10 @@
},
{
"fieldname": "payment_url",
"fieldtype": "Small Text",
"hidden": 1,
"label": "payment_url",
"fieldtype": "Data",
"length": 500,
"options": "URL",
"read_only": 1
},
{
Expand All @@ -343,6 +367,14 @@
"label": "Payment Account",
"read_only": 1
},
{
"fetch_from": "payment_gateway_account.payment_channel",
"fieldname": "payment_channel",
"fieldtype": "Select",
"label": "Payment Channel",
"options": "\nEmail\nPhone",
"read_only": 1
},
{
"fieldname": "payment_order",
"fieldtype": "Link",
Expand All @@ -358,43 +390,13 @@
"options": "Payment Request",
"print_hide": 1,
"read_only": 1
},
{
"fetch_from": "payment_gateway_account.payment_channel",
"fieldname": "payment_channel",
"fieldtype": "Select",
"label": "Payment Channel",
"options": "\nEmail\nPhone",
"read_only": 1
},
{
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions"
},
{
"fieldname": "cost_center",
"fieldtype": "Link",
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2022-12-21 16:56:40.115737",
"modified": "2023-09-16 14:15:02.510890",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def on_submit(self):
def on_cancel(self):
self.validate_future_closing_vouchers()
self.db_set("gle_processing_status", "In Progress")
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry")
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry")
gle_count = frappe.db.count(
"GL Entry",
{"voucher_type": "Period Closing Voucher", "voucher_no": self.name, "is_cancelled": 0},
Expand Down
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/pos_invoice/pos_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def set_pos_fields(self, for_validate=False):
selling_price_list = (
customer_price_list or customer_group_price_list or profile.get("selling_price_list")
)
if customer_currency != profile.get("currency"):
if customer_currency and customer_currency != profile.get("currency"):
self.set("currency", customer_currency)

else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def get_report_pdf(doc, consolidated=True):
filters = get_common_filters(doc)

if doc.report == "General Ledger":
filters.update(get_gl_filters(doc, entry, tax_id, presentation_currency))
col, res = get_soa(filters)
for x in [0, -2, -1]:
res[x]["account"] = res[x]["account"].replace("'", "")
Expand Down
32 changes: 28 additions & 4 deletions erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,10 @@ def test_outstanding_amount_after_advance_jv_cancellation(self):
)

def test_outstanding_amount_after_advance_payment_entry_cancellation(self):
"""Test impact of advance PE submission/cancellation on SI and SO."""
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order

sales_order = make_sales_order(item_code="138-CMS Shoe", qty=1, price_list_rate=500)
pe = frappe.get_doc(
{
"doctype": "Payment Entry",
Expand All @@ -1820,17 +1824,33 @@ def test_outstanding_amount_after_advance_payment_entry_cancellation(self):
"paid_to": "_Test Cash - _TC",
}
)
pe.append(
"references",
{
"reference_doctype": "Sales Order",
"reference_name": sales_order.name,
"total_amount": sales_order.grand_total,
"outstanding_amount": sales_order.grand_total,
"allocated_amount": 300,
},
)
pe.insert()
pe.submit()

sales_order.reload()
self.assertEqual(sales_order.advance_paid, 300)

si = frappe.copy_doc(test_records[0])
si.items[0].sales_order = sales_order.name
si.items[0].so_detail = sales_order.get("items")[0].name
si.is_pos = 0
si.append(
"advances",
{
"doctype": "Sales Invoice Advance",
"reference_type": "Payment Entry",
"reference_name": pe.name,
"reference_row": pe.references[0].name,
"advance_amount": 300,
"allocated_amount": 300,
"remarks": pe.remarks,
Expand All @@ -1839,19 +1859,23 @@ def test_outstanding_amount_after_advance_payment_entry_cancellation(self):
si.insert()
si.submit()

si.load_from_db()
si.reload()
pe.reload()
sales_order.reload()

# Check if SO is unlinked/replaced by SI in PE & if SO advance paid is 0
self.assertEqual(pe.references[0].reference_name, si.name)
self.assertEqual(sales_order.advance_paid, 0.0)

# check outstanding after advance allocation
self.assertEqual(
flt(si.outstanding_amount),
flt(si.rounded_total - si.total_advance, si.precision("outstanding_amount")),
)

# added to avoid Document has been modified exception
pe = frappe.get_doc("Payment Entry", pe.name)
pe.cancel()
si.reload()

si.load_from_db()
# check outstanding after advance cancellation
self.assertEqual(
flt(si.outstanding_amount),
Expand Down
6 changes: 6 additions & 0 deletions erpnext/accounts/report/trial_balance/trial_balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"label": __("Include Default Book Entries"),
"fieldtype": "Check",
"default": 1
},
{
"fieldname": "show_net_values",
"label": __("Show net values in opening and closing columns"),
"fieldtype": "Check",
"default": 1
}
],
"formatter": erpnext.financial_statements.formatter,
Expand Down
11 changes: 7 additions & 4 deletions erpnext/accounts/report/trial_balance/trial_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def get_data(filters):
ignore_opening_entries=True,
)

calculate_values(accounts, gl_entries_by_account, opening_balances)
calculate_values(
accounts, gl_entries_by_account, opening_balances, filters.get("show_net_values")
)
accumulate_values_into_parents(accounts, accounts_by_name)

data = prepare_data(accounts, filters, parent_children_map, company_currency)
Expand Down Expand Up @@ -310,7 +312,7 @@ def get_opening_balance(
return gle


def calculate_values(accounts, gl_entries_by_account, opening_balances):
def calculate_values(accounts, gl_entries_by_account, opening_balances, show_net_values):
init = {
"opening_debit": 0.0,
"opening_credit": 0.0,
Expand All @@ -335,7 +337,8 @@ def calculate_values(accounts, gl_entries_by_account, opening_balances):
d["closing_debit"] = d["opening_debit"] + d["debit"]
d["closing_credit"] = d["opening_credit"] + d["credit"]

prepare_opening_closing(d)
if show_net_values:
prepare_opening_closing(d)


def calculate_total_row(accounts, company_currency):
Expand Down Expand Up @@ -375,7 +378,7 @@ def prepare_data(accounts, filters, parent_children_map, company_currency):

for d in accounts:
# Prepare opening closing for group account
if parent_children_map.get(d.account):
if parent_children_map.get(d.account) and filters.get("show_net_values"):
prepare_opening_closing(d)

has_value = False
Expand Down
11 changes: 11 additions & 0 deletions erpnext/accounts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,10 @@ def update_reference_in_journal_entry(d, journal_entry, do_not_save=False):
"""
jv_detail = journal_entry.get("accounts", {"name": d["voucher_detail_no"]})[0]

# Update Advance Paid in SO/PO since they might be getting unlinked
if jv_detail.get("reference_type") in ("Sales Order", "Purchase Order"):
frappe.get_doc(jv_detail.reference_type, jv_detail.reference_name).set_total_advance_paid()

if flt(d["unadjusted_amount"]) - flt(d["allocated_amount"]) != 0:
# adjust the unreconciled balance
amount_in_account_currency = flt(d["unadjusted_amount"]) - flt(d["allocated_amount"])
Expand Down Expand Up @@ -647,6 +651,13 @@ def update_reference_in_payment_entry(

if d.voucher_detail_no:
existing_row = payment_entry.get("references", {"name": d["voucher_detail_no"]})[0]

# Update Advance Paid in SO/PO since they are getting unlinked
if existing_row.get("reference_doctype") in ("Sales Order", "Purchase Order"):
frappe.get_doc(
existing_row.reference_doctype, existing_row.reference_name
).set_total_advance_paid()

original_row = existing_row.as_dict().copy()
existing_row.update(reference_details)

Expand Down
13 changes: 9 additions & 4 deletions erpnext/buying/doctype/supplier/supplier.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@
"column_break1",
"contact_html",
"primary_address_and_contact_detail_section",
"supplier_primary_contact",
"mobile_no",
"email_id",
"column_break_44",
"supplier_primary_address",
"primary_address",
"column_break_mglr",
"supplier_primary_contact",
"mobile_no",
"email_id",
"accounting_tab",
"payment_terms",
"default_accounts_section",
Expand Down Expand Up @@ -469,6 +470,10 @@
{
"fieldname": "column_break_1mqv",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_mglr",
"fieldtype": "Column Break"
}
],
"icon": "fa fa-user",
Expand All @@ -481,7 +486,7 @@
"link_fieldname": "party"
}
],
"modified": "2023-06-26 14:20:00.961554",
"modified": "2023-09-21 12:24:20.398889",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",
Expand Down
Loading
Loading