mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
fix: skip timesheet link on return time
This commit is contained in:
@@ -486,7 +486,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
|
|||||||
currency() {
|
currency() {
|
||||||
var me = this;
|
var me = this;
|
||||||
super.currency();
|
super.currency();
|
||||||
if (this.frm.doc.timesheets) {
|
if (!this.frm.doc.is_return && this.frm.doc.timesheets) {
|
||||||
this.frm.doc.timesheets.forEach((d) => {
|
this.frm.doc.timesheets.forEach((d) => {
|
||||||
let row = frappe.get_doc(d.doctype, d.name)
|
let row = frappe.get_doc(d.doctype, d.name)
|
||||||
set_timesheet_detail_rate(row.doctype, row.name, me.frm.doc.currency, row.timesheet_detail)
|
set_timesheet_detail_rate(row.doctype, row.name, me.frm.doc.currency, row.timesheet_detail)
|
||||||
|
|||||||
@@ -757,6 +757,8 @@ class SalesInvoice(SellingController):
|
|||||||
def validate_time_sheets_are_submitted(self):
|
def validate_time_sheets_are_submitted(self):
|
||||||
for data in self.timesheets:
|
for data in self.timesheets:
|
||||||
if data.time_sheet:
|
if data.time_sheet:
|
||||||
|
if self.is_return:
|
||||||
|
continue
|
||||||
status = frappe.db.get_value("Timesheet", data.time_sheet, "status")
|
status = frappe.db.get_value("Timesheet", data.time_sheet, "status")
|
||||||
if status not in ["Submitted", "Payslip"]:
|
if status not in ["Submitted", "Payslip"]:
|
||||||
frappe.throw(_("Timesheet {0} is already completed or cancelled").format(data.time_sheet))
|
frappe.throw(_("Timesheet {0} is already completed or cancelled").format(data.time_sheet))
|
||||||
|
|||||||
Reference in New Issue
Block a user