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 #43891

Merged
merged 65 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b80a5f2
fix: set default warehouse for pos invoice
mmdanny89 Mar 27, 2024
2c21df2
fix: correct garbage value on Razorpay Payments Page
Abhishek-Chougule Aug 3, 2024
8db11d0
Merge branch 'frappe:version-15-hotfix' into version-15-hotfix
Abhishek-Chougule Aug 5, 2024
9f97018
fix: set proper currency format
Sanket322 Jul 24, 2024
58a3ef7
fix: map doc from purchase order
Ninad1306 Oct 22, 2024
40927c7
test: auto create purchase receipt
Ninad1306 Oct 22, 2024
41db040
fix: better implementation, handle missing purchase order
Ninad1306 Oct 22, 2024
9c0f17e
Merge pull request #43788 from frappe/mergify/bp/version-15-hotfix/pr…
vorasmit Oct 23, 2024
ced76ca
perf: performance optimizations for accounting reports by refactoring…
nabinhait Oct 23, 2024
33fa1e4
fix: add company filter for project
Oct 21, 2024
2fb4417
fix: consider gle based on balances in company currency (#43805)
nabinhait Oct 23, 2024
d0db3b0
Merge pull request #43807 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 23, 2024
a3bf320
Merge pull request #42764 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 23, 2024
cf25f4c
chore(Timesheet): add type hints (#43793)
barredterra Oct 23, 2024
bf4fb53
fix: Unnecessary validation for non deferred sales invoices (#43816)
mergify[bot] Oct 24, 2024
81297ce
fix: set bill_no before `against_voucher` gets concatenated
ruthra-kumar Oct 25, 2024
18f32b8
Merge pull request #43831 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 25, 2024
20478b6
fix: basic rate not editable in Stock Entry Detail (backport #43837) …
mergify[bot] Oct 25, 2024
07aaef2
fix(RFQ): make strings translatable (backport #43843) (#43848)
mergify[bot] Oct 26, 2024
11dd196
fix: backport translations from develop (#43849)
barredterra Oct 26, 2024
19db526
refactor: query for expense_account moved to setup hook in purchase i…
ljain112 Oct 25, 2024
ed01b4c
Merge pull request #43857 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 28, 2024
b95dfcb
Merge pull request #42607 from Abhishek-Chougule/version-15-hotfix
ruthra-kumar Oct 28, 2024
9a5604c
fix: do not check for payment terms details for return invoices.
ljain112 Oct 15, 2024
a826a89
fix: do not set payment terms for return invoices
ljain112 Oct 25, 2024
29aa5d6
fix: hide payment terms for return and paid purchase invoices
ljain112 Oct 25, 2024
2710887
chore: replace whitespace with tab
ruthra-kumar Oct 28, 2024
d5e1a46
Merge pull request #43866 from ruthra-kumar/fix_whitespace
ruthra-kumar Oct 28, 2024
303ae83
chore: resolve conflict
ruthra-kumar Oct 28, 2024
73a8b6a
Merge pull request #43864 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 28, 2024
7202939
Merge pull request #40813 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 29, 2024
935f2e1
feat: add party name in payment request
ravibharathi656 Oct 23, 2024
a937e32
chore: resolve conflict
ruthra-kumar Oct 29, 2024
8bfc212
fix: use period closing voucher object to call get_account_closing_ba…
mergify[bot] Oct 29, 2024
87e0d2f
Merge pull request #43882 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 29, 2024
c702826
fix: scrub "-" from fieldname in accounting dimension
ljain112 Oct 23, 2024
b21abf4
fix: validate fieldname
ljain112 Oct 23, 2024
61a11c8
Merge pull request #43888 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 29, 2024
218c51c
Merge pull request #43812 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 29, 2024
13557a2
refactor: include 'Project Name' in Project summary report
lbrandh Oct 16, 2024
603d2cf
fix: add parenttype clause to invoice tax query in sales_register report
IMS94 Oct 28, 2024
d06831e
fix: do not copy serial numbers from DN to SI (backport #43885) (#43893)
mergify[bot] Oct 29, 2024
4c9e17f
Merge pull request #43895 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 29, 2024
1755006
Merge pull request #43897 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 29, 2024
e22d0a3
fix: post account closing balance against pcv closing account (backpo…
mergify[bot] Oct 29, 2024
cd4746a
fix: incorrect value of available_qty_for_consumption in subcontracti…
mergify[bot] Oct 29, 2024
93d0db2
fix: Calculate gross margin on update of project costing from invoice…
mergify[bot] Oct 29, 2024
7189dab
fix: work order finish button not showing (backport #43875) (backport…
mergify[bot] Oct 29, 2024
8a72845
fix: Handle None value for item description in customer portal invoic…
mergify[bot] Oct 29, 2024
ab16207
fix: Patch for reposting account closing balance (backport #43905) (#…
mergify[bot] Oct 29, 2024
1af2326
fix: consider opening asset values while calculating asset depreciati…
khushi8112 Oct 29, 2024
9a93c89
Merge pull request #43912 from frappe/mergify/bp/version-15-hotfix/pr…
khushi8112 Oct 29, 2024
63668eb
fix: recalculate outstanding after save on checkout for POS Invoice
ljain112 Oct 29, 2024
302f049
Merge pull request #43915 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 30, 2024
8707090
fix: remarks field in payment reconciliation
penieldev Oct 29, 2024
ac121dd
chore: resolve conflict
ruthra-kumar Oct 30, 2024
8218ca9
fix: find first PCV to consider opening entries
nabinhait Oct 29, 2024
63ecf13
Merge pull request #43918 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 30, 2024
3ab31dc
Merge pull request #43917 from frappe/mergify/bp/version-15-hotfix/pr…
ruthra-kumar Oct 30, 2024
0171af4
Merge branch 'version-15' into version-15-hotfix
nabinhait Oct 30, 2024
9ac87bd
fix: rounding issue of required qty in subcontracting order (#43908)
nabinhait Oct 30, 2024
9a52661
fix: calculate tds with net amount when invoice exceeds single thresh…
mergify[bot] Oct 30, 2024
db3be41
fix: purchase return validation issue (backport #43871) (backport #43…
mergify[bot] Oct 30, 2024
4dcaf42
fix: cannot create opp from lead without prospect
shariquerik Oct 30, 2024
5ea4980
Merge pull request #43927 from frappe/mergify/bp/version-15-hotfix/pr…
shariquerik Oct 30, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ frappe.ui.form.on("Accounting Dimension", {
},

label: function (frm) {
frm.set_value("fieldname", frappe.model.scrub(frm.doc.label));
frm.set_value("fieldname", frm.doc.label.replace(/ /g, "_").replace(/-/g, "_").toLowerCase());
},

document_type: function (frm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import frappe
from frappe import _, scrub
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
from frappe.database.schema import validate_column_name
from frappe.model import core_doctypes_list
from frappe.model.document import Document
from frappe.utils import cstr
Expand Down Expand Up @@ -60,6 +61,7 @@ def validate(self):
if not self.is_new():
self.validate_document_type_change()

validate_column_name(self.fieldname)
self.validate_dimension_defaults()

def validate_document_type_change(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ def get_dr_or_cr_notes(self):
"posting_date": inv.posting_date,
"currency": inv.currency,
"cost_center": inv.cost_center,
"remarks": inv.remarks,
}
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"amount",
"difference_amount",
"sec_break1",
"remark",
"remarks",
"currency",
"exchange_rate",
"cost_center"
Expand Down Expand Up @@ -74,12 +74,6 @@
"fieldname": "sec_break1",
"fieldtype": "Section Break"
},
{
"fieldname": "remark",
"fieldtype": "Small Text",
"label": "Remark",
"read_only": 1
},
{
"fieldname": "currency",
"fieldtype": "Link",
Expand All @@ -105,12 +99,18 @@
"fieldtype": "Link",
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "remarks",
"fieldtype": "Small Text",
"label": "Remarks",
"read_only": 1
}
],
"is_virtual": 1,
"istable": 1,
"links": [],
"modified": "2023-11-17 17:33:34.818530",
"modified": "2024-10-29 16:24:43.021230",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Payment",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PaymentReconciliationPayment(Document):
reference_name: DF.DynamicLink | None
reference_row: DF.Data | None
reference_type: DF.Link | None
remark: DF.SmallText | None
remarks: DF.SmallText | None
# end: auto-generated types

@staticmethod
Expand Down
11 changes: 9 additions & 2 deletions erpnext/accounts/doctype/payment_request/payment_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"party_details",
"party_type",
"party",
"party_name",
"column_break_4",
"reference_doctype",
"reference_name",
Expand Down Expand Up @@ -422,13 +423,19 @@
"label": "Party Account Currency",
"options": "Currency",
"read_only": 1
},
{
"fieldname": "party_name",
"fieldtype": "Data",
"label": "Party Name",
"read_only": 1
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-09-16 17:50:54.440090",
"modified": "2024-10-23 12:23:40.117336",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
Expand Down Expand Up @@ -467,4 +474,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}
8 changes: 5 additions & 3 deletions erpnext/accounts/doctype/payment_request/payment_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class PaymentRequest(Document):
outstanding_amount: DF.Currency
party: DF.DynamicLink | None
party_account_currency: DF.Link | None
party_name: DF.Data | None
party_type: DF.Link | None
payment_account: DF.ReadOnly | None
payment_channel: DF.Literal["", "Email", "Phone", "Other"]
Expand Down Expand Up @@ -303,12 +304,12 @@ def get_payment_url(self):
return controller.get_payment_url(
**{
"amount": flt(self.grand_total, self.precision("grand_total")),
"title": data.company.encode("utf-8"),
"description": self.subject.encode("utf-8"),
"title": data.company,
"description": self.subject,
"reference_doctype": "Payment Request",
"reference_docname": self.name,
"payer_email": self.email_to or frappe.session.user,
"payer_name": frappe.safe_encode(data.customer_name),
"payer_name": data.customer_name,
"order_id": self.name,
"currency": self.currency,
}
Expand Down Expand Up @@ -609,6 +610,7 @@ def make_payment_request(**args):
"party_type": party_type,
"party": args.get("party") or ref_doc.get("customer"),
"bank_account": bank_account,
"party_name": args.get("party_name") or ref_doc.get("customer_name"),
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,16 @@ def get_closing_entries_for_closing_account(self):
return closing_entries

def is_first_period_closing_voucher(self):
return not frappe.db.exists(
first_pcv = frappe.db.get_value(
"Period Closing Voucher",
{"company": self.company, "docstatus": 1, "name": ("!=", self.name)},
{"company": self.company, "docstatus": 1},
"name",
order_by="period_end_date",
)

if not first_pcv or first_pcv == self.name:
return True

def cancel_gl_entries(self):
if self.get_gle_count_against_current_pcv() > 5000:
frappe.enqueue(
Expand Down
18 changes: 10 additions & 8 deletions erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
},
};
});

this.frm.set_query("expense_account", "items", function () {
return {
query: "erpnext.controllers.queries.get_expense_account",
filters: { company: doc.company },
};
});
}

onload() {
Expand Down Expand Up @@ -335,7 +342,9 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
party_type: "Supplier",
account: this.frm.doc.credit_to,
price_list: this.frm.doc.buying_price_list,
fetch_payment_terms_template: cint(!this.frm.doc.ignore_default_payment_terms_template),
fetch_payment_terms_template: cint(
(this.frm.doc.is_return == 0) & !this.frm.doc.ignore_default_payment_terms_template
),
},
function () {
me.apply_pricing_rule();
Expand Down Expand Up @@ -506,13 +515,6 @@ cur_frm.fields_dict["select_print_heading"].get_query = function (doc, cdt, cdn)
};
};

cur_frm.set_query("expense_account", "items", function (doc) {
return {
query: "erpnext.controllers.queries.get_expense_account",
filters: { company: doc.company },
};
});

cur_frm.set_query("wip_composite_asset", "items", function () {
return {
filters: { is_composite_asset: 1, docstatus: 0 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1134,12 +1134,14 @@
"label": "Payment Terms"
},
{
"depends_on": "eval:(!doc.is_paid && !doc.is_return)",
"fieldname": "payment_terms_template",
"fieldtype": "Link",
"label": "Payment Terms Template",
"options": "Payment Terms Template"
},
{
"depends_on": "eval:(!doc.is_paid && !doc.is_return)",
"fieldname": "payment_schedule",
"fieldtype": "Table",
"label": "Payment Schedule",
Expand Down Expand Up @@ -1631,7 +1633,7 @@
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2024-09-11 12:59:19.130593",
"modified": "2024-10-25 18:13:01.944477",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,11 @@ def update_project(self):
for proj, value in projects.items():
res = frappe.qb.from_(pj).select(pj.total_purchase_cost).where(pj.name == proj).for_update().run()
current_purchase_cost = res and res[0][0] or 0
frappe.db.set_value("Project", proj, "total_purchase_cost", current_purchase_cost + value)
# frappe.db.set_value("Project", proj, "total_purchase_cost", current_purchase_cost + value)
project_doc = frappe.get_doc("Project", proj)
project_doc.total_purchase_cost = current_purchase_cost + value
project_doc.calculate_gross_margin()
project_doc.db_update()

def validate_supplier_invoice(self):
if self.bill_date:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@
"fieldtype": "Link",
"label": "Project",
"options": "Project",
"print_hide": 1
"print_hide": 1,
"search_index": 1
},
{
"allow_on_submit": 1,
Expand Down Expand Up @@ -974,7 +975,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2024-07-19 12:12:42.449298",
"modified": "2024-10-28 15:06:19.246141",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
Expand Down
3 changes: 3 additions & 0 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
account: this.frm.doc.debit_to,
price_list: this.frm.doc.selling_price_list,
pos_profile: pos_profile,
fetch_payment_terms_template: cint(
(this.frm.doc.is_return == 0) & !this.frm.doc.ignore_default_payment_terms_template
),
},
function () {
me.apply_pricing_rule();
Expand Down
6 changes: 4 additions & 2 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1734,9 +1734,11 @@ def validate_serial_against_delivery_note(self):
)

def update_project(self):
if self.project:
project = frappe.get_doc("Project", self.project)
unique_projects = list(set([d.project for d in self.get("items") if d.project]))
for p in unique_projects:
project = frappe.get_doc("Project", p)
project.update_billed_amount()
project.calculate_gross_margin()
project.db_update()

def verify_payment_amount_is_positive(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,8 @@
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
"options": "Project",
"search_index": 1
},
{
"depends_on": "eval:parent.update_stock == 1",
Expand Down Expand Up @@ -927,7 +928,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2024-05-23 16:36:18.970862",
"modified": "2024-10-28 15:06:40.980995",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
payment_entry_filters.pop("apply_tax_withholding_amount", None)
payment_entry_filters.pop("tax_withholding_category", None)

supp_credit_amt = frappe.db.get_value("Purchase Invoice", invoice_filters, field) or 0.0
supp_inv_credit_amt = frappe.db.get_value("Purchase Invoice", invoice_filters, field) or 0.0

supp_jv_credit_amt = (
frappe.db.get_value(
Expand All @@ -538,7 +538,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
group_by="payment_type",
)

supp_credit_amt += supp_jv_credit_amt
supp_credit_amt = supp_jv_credit_amt
supp_credit_amt += inv.tax_withholding_net_total

for type in payment_entry_amounts:
Expand All @@ -556,18 +556,18 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
tax_withholding_net_total = inv.tax_withholding_net_total

if (threshold and tax_withholding_net_total >= threshold) or (
cumulative_threshold and supp_credit_amt >= cumulative_threshold
cumulative_threshold and (supp_credit_amt + supp_inv_credit_amt) >= cumulative_threshold
):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
net_total = (
frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(tax_withholding_net_total)") or 0.0
)
supp_credit_amt += net_total

if (cumulative_threshold and supp_credit_amt >= cumulative_threshold) and cint(
tax_details.tax_on_excess_amount
):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
net_total = (
frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(tax_withholding_net_total)")
or 0.0
)
net_total += inv.tax_withholding_net_total
supp_credit_amt = net_total - cumulative_threshold

if ldc and is_valid_certificate(ldc, inv.get("posting_date") or inv.get("transaction_date"), 0):
Expand Down
Loading
Loading