mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-15 12:55:10 +00:00
fix(sales invoice): check fetch_timesheet_in_sales_invoice enabled before fetching the timesheet
(cherry picked from commit 914ad357fd)
# Conflicts:
# erpnext/accounts/doctype/sales_invoice/sales_invoice.py
This commit is contained in:
@@ -897,8 +897,12 @@ frappe.ui.form.on("Sales Invoice", {
|
|||||||
|
|
||||||
project: function (frm) {
|
project: function (frm) {
|
||||||
if (frm.doc.project) {
|
if (frm.doc.project) {
|
||||||
frm.events.add_timesheet_data(frm, {
|
frappe.db.get_value("Projects Settings", {}, "fetch_timesheet_in_sales_invoice", (r) => {
|
||||||
project: frm.doc.project,
|
if (r.fetch_timesheet_in_sales_invoice) {
|
||||||
|
frm.events.add_timesheet_data(frm, {
|
||||||
|
project: frm.doc.project,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1090,7 +1090,15 @@ class SalesInvoice(SellingController):
|
|||||||
timesheet.billing_amount = ts_doc.total_billable_amount
|
timesheet.billing_amount = ts_doc.total_billable_amount
|
||||||
|
|
||||||
def update_timesheet_billing_for_project(self):
|
def update_timesheet_billing_for_project(self):
|
||||||
|
<<<<<<< HEAD
|
||||||
if not self.timesheets and self.project:
|
if not self.timesheets and self.project:
|
||||||
|
=======
|
||||||
|
if (
|
||||||
|
not self.timesheets
|
||||||
|
and self.project
|
||||||
|
and frappe.db.get_single_value("Projects Settings", "fetch_timesheet_in_sales_invoice")
|
||||||
|
):
|
||||||
|
>>>>>>> 914ad357fd (fix(sales invoice): check fetch_timesheet_in_sales_invoice enabled before fetching the timesheet)
|
||||||
self.add_timesheet_data()
|
self.add_timesheet_data()
|
||||||
else:
|
else:
|
||||||
self.calculate_billing_amount_for_timesheet()
|
self.calculate_billing_amount_for_timesheet()
|
||||||
|
|||||||
Reference in New Issue
Block a user