Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 9 additions & 6 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,15 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
},

currency() {
var me = this;
this._super();
$.each(cur_frm.doc.timesheets, function(i, d) {
let row = frappe.get_doc(d.doctype, d.name)
set_timesheet_detail_rate(row.doctype, row.name, cur_frm.doc.currency, row.timesheet_detail)
});
calculate_total_billing_amount(cur_frm)
if (this.frm.doc.timesheets) {
this.frm.doc.timesheets.forEach((d) => {
let row = frappe.get_doc(d.doctype, d.name)
set_timesheet_detail_rate(row.doctype, row.name, me.frm.doc.currency, row.timesheet_detail)
});
frm.trigger("calculate_timesheet_totals");
}
}
});

Expand Down Expand Up @@ -999,7 +1002,7 @@ frappe.ui.form.on('Sales Invoice', {


frappe.ui.form.on("Sales Invoice Timesheet", {
timesheets_remove(frm, cdt, cdn) {
timesheets_remove(frm) {
frm.trigger("calculate_timesheet_totals");
}
});
Expand Down
22 changes: 10 additions & 12 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.json
Original file line number Diff line number Diff line change
Expand Up @@ -1990,16 +1990,6 @@
"label": "Additional Discount Account",
"options": "Account"
},
{
"default": "0",
"fieldname": "ignore_default_payment_terms_template",
"fieldtype": "Check",
"hidden": 1,
"label": "Ignore Default Payment Terms Template",
"read_only": 1,
"show_days": 1,
"show_seconds": 1
},
{
"allow_on_submit": 1,
"fieldname": "dispatch_address_name",
Expand All @@ -2015,6 +2005,14 @@
"label": "Dispatch Address",
"read_only": 1
},
{
"default": "0",
"fieldname": "ignore_default_payment_terms_template",
"fieldtype": "Check",
"hidden": 1,
"label": "Ignore Default Payment Terms Template",
"read_only": 1
},
{
"fieldname": "total_billing_hours",
"fieldtype": "Float",
Expand All @@ -2033,7 +2031,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2021-09-28 13:09:34.391799",
"modified": "2021-10-02 03:36:10.251715",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
Expand Down Expand Up @@ -2088,4 +2086,4 @@
"title_field": "title",
"track_changes": 1,
"track_seen": 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"column_break_9",
"billing_amount",
"section_break_11",
"timesheet_detail",
"column_break_5",
"time_sheet",
"timesheet_detail",
"column_break_13",
"project_name"
],
"fields": [
Expand Down Expand Up @@ -91,7 +91,6 @@
"fieldtype": "Column Break"
},
{

"fieldname": "section_break_7",
"fieldtype": "Section Break",
"label": "Totals"
Expand All @@ -110,11 +109,15 @@
"fieldtype": "Data",
"label": "Project Name",
"read_only": 1
},
{
"fieldname": "column_break_13",
"fieldtype": "Column Break"
}
],
"istable": 1,
"links": [],
"modified": "2021-08-15 18:37:08.084930",
"modified": "2021-10-02 03:48:44.979777",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Timesheet",
Expand Down
8 changes: 1 addition & 7 deletions erpnext/projects/doctype/timesheet/timesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to

query = f"""
SELECT

tsd.name as name,
tsd.parent as time_sheet,
tsd.from_time as from_time,
Expand All @@ -235,21 +234,16 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to
tsd.activity_type as activity_type,
tsd.description as description,
ts.currency as currency,
tsd.project_name as project_name

tsd.project_name as project_name
FROM `tabTimesheet Detail` tsd

INNER JOIN `tabTimesheet` ts
ON ts.name = tsd.parent

WHERE

tsd.parenttype = 'Timesheet'
AND tsd.docstatus = 1
AND tsd.is_billable = 1
AND tsd.sales_invoice is NULL
{condition}

ORDER BY tsd.from_time ASC
"""

Expand Down