fix: error message placeholders and sider issues

This commit is contained in:
Rucha Mahabal 2021-05-20 22:17:20 +05:30
parent 0d8b9a9d0a
commit be247ec3de
3 changed files with 11 additions and 11 deletions

View File

@ -146,10 +146,10 @@ frappe.ui.form.on("Timesheet", {
frm.set_currency_labels(["base_total_costing_amount", "base_total_billable_amount", "base_total_billed_amount"], base_currency);
frm.set_currency_labels(["total_costing_amount", "total_billable_amount", "total_billed_amount"], frm.doc.currency);
frm.toggle_display(["base_total_costing_amount", "base_total_billable_amount", "base_total_billed_amount"],
frm.toggle_display(["base_total_costing_amount", "base_total_billable_amount", "base_total_billed_amount"],
frm.doc.currency != base_currency)
if (frm.doc?.time_logs.length > 0) {
if (frm.doc.time_logs.length > 0) {
frm.set_currency_labels(["base_billing_rate", "base_billing_amount", "base_costing_rate", "base_costing_amount"], base_currency, "time_logs");
frm.set_currency_labels(["billing_rate", "billing_amount", "costing_rate", "costing_amount"], frm.doc.currency, "time_logs");

View File

@ -150,7 +150,7 @@ class Timesheet(Document):
def validate_project(self, data):
if self.parent_project and self.parent_project != data.project:
frappe.throw(_("Row {0}: Project must be same as the one set in the Timesheet: {1}.")).format(data.idx, self.parent_project)
frappe.throw(_("Row {0}: Project must be same as the one set in the Timesheet: {1}.").format(data.idx, self.parent_project))
def validate_overlap_for(self, fieldname, args, value, ignore_validation=False):
if not value or ignore_validation:
@ -221,14 +221,14 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to
if from_time and to_time:
condition += "AND CAST(tsd.from_time as DATE) BETWEEN %(from_time)s AND %(to_time)s"
return frappe.db.sql("""SELECT tsd.name as name,
tsd.parent as parent, tsd.billing_hours as billing_hours,
tsd.billing_amount as billing_amount, tsd.activity_type as activity_type,
return frappe.db.sql("""SELECT tsd.name as name,
tsd.parent as parent, tsd.billing_hours as billing_hours,
tsd.billing_amount as billing_amount, tsd.activity_type as activity_type,
tsd.description as description, ts.currency as currency
FROM `tabTimesheet Detail` tsd
INNER JOIN `tabTimesheet` ts ON ts.name = tsd.parent
WHERE tsd.parenttype = 'Timesheet'
and tsd.docstatus=1 {0}
FROM `tabTimesheet Detail` tsd
INNER JOIN `tabTimesheet` ts ON ts.name = tsd.parent
WHERE tsd.parenttype = 'Timesheet'
and tsd.docstatus=1 {0}
and tsd.is_billable = 1
and tsd.sales_invoice is null""".format(condition), {'project': project, 'parent': parent, 'from_time': from_time, 'to_time': to_time}, as_dict=1)

View File

@ -734,7 +734,7 @@ frappe.form.link_formatters['Project'] = function(value, doc) {
// if value is blank in report view or project name and name are the same, return as is
return value;
}
}
};
// add description on posting time
$(document).on('app_ready', function() {