chore: whitespace cleanup from codebase

This commit is contained in:
Ankush Menat
2021-08-19 14:33:03 +05:30
parent e536f6d13f
commit 9bb69e711a
1218 changed files with 1391 additions and 1643 deletions

View File

@@ -4,4 +4,4 @@ from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Campaign')
test_records = frappe.get_test_records('Campaign')

View File

@@ -145,4 +145,4 @@ frappe.ui.form.on("Customer", {
if(frm.doc.lead_name) frappe.model.clear_doc("Lead", frm.doc.lead_name);
},
});
});

View File

@@ -1,3 +1,3 @@
{% include "erpnext/regional/india/party.js" %}
erpnext.setup_gst_reminder_button('Customer')
erpnext.setup_gst_reminder_button('Customer')

View File

@@ -1,13 +1,13 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
}
}

View File

@@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class IndustryType(Document):
pass
pass

View File

@@ -4,4 +4,4 @@ from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Industry Type')
test_records = frappe.get_test_records('Industry Type')

View File

@@ -57,4 +57,4 @@ erpnext.selling.InstallationNote = frappe.ui.form.Controller.extend({
},
});
$.extend(cur_frm.cscript, new erpnext.selling.InstallationNote({frm: cur_frm}));
$.extend(cur_frm.cscript, new erpnext.selling.InstallationNote({frm: cur_frm}));

View File

@@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class InstallationNoteItem(Document):
pass
pass

View File

@@ -33,4 +33,3 @@ QUnit.test("test sales order", function(assert) {
() => done()
]);
});

View File

@@ -17,4 +17,4 @@ def get_data():
'items': ['Auto Repeat']
},
]
}
}

View File

@@ -41,4 +41,3 @@ QUnit.test("test quotation with additional discount in grand total", function(as
() => done()
]);
});

View File

@@ -35,4 +35,3 @@ QUnit.test("test quotation with item wise discount", function(assert) {
() => done()
]);
});

View File

@@ -33,4 +33,3 @@ QUnit.test("test quotation with margin", function(assert) {
() => done()
]);
});

View File

@@ -36,4 +36,3 @@ QUnit.test("test quotation with multi uom", function(assert) {
() => done()
]);
});

View File

@@ -38,4 +38,3 @@ QUnit.test("test quotation with taxes and charges", function(assert) {
() => done()
]);
});

View File

@@ -41,4 +41,4 @@ def get_data():
'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
},
]
}
}

View File

@@ -1222,7 +1222,7 @@ class TestSalesOrder(unittest.TestCase):
def test_so_cancellation_when_si_drafted(self):
"""
Test to check if Sales Order gets cancelled if Sales Invoice is in Draft state
Expected result: sales order should not get cancelled
Expected result: sales order should not get cancelled
"""
so = make_sales_order()
so.submit()
@@ -1250,7 +1250,7 @@ class TestSalesOrder(unittest.TestCase):
self.assertEqual(so.payment_terms_template, si.payment_terms_template)
compare_payment_schedules(self, so, si)
automatically_fetch_payment_terms(enable=0)
automatically_fetch_payment_terms(enable=0)
def automatically_fetch_payment_terms(enable=1):
accounts_settings = frappe.get_doc("Accounts Settings")

View File

@@ -35,4 +35,3 @@ QUnit.test("test sales order with margin", function(assert) {
() => done()
]);
});

View File

@@ -56,4 +56,4 @@ QUnit.test("test: Sales Order", function (assert) {
},
() => done()
]);
});
});

View File

@@ -10,4 +10,4 @@ class SalesOrderItem(Document):
pass
def on_doctype_update():
frappe.db.add_index("Sales Order Item", ["item_code", "warehouse"])
frappe.db.add_index("Sales Order Item", ["item_code", "warehouse"])

View File

@@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class SalesTeam(Document):
pass
pass

View File

@@ -28,4 +28,4 @@ frappe.tour['Selling Settings'] = [
title: "Delivery Note Required for Sales Invoice Creation",
description: __("If this option is configured 'Yes', ERPNext will prevent you from creating a Sales Invoice without creating a Delivery Note first. This configuration can be overridden for a particular Customer by enabling the 'Allow Sales Invoice Creation Without Delivery Note' checkbox in the Customer master.")
}
];
];

View File

@@ -83,4 +83,3 @@ class SMSCenter(Document):
receiver_list = self.get_receiver_nos()
if receiver_list:
send_sms(receiver_list, cstr(self.message))

View File

@@ -19,4 +19,4 @@ frappe.pages['point-of-sale'].refresh = function(wrapper) {
wrapper.pos.wrapper.html("");
wrapper.pos.check_opening_entry();
}
};
};

View File

@@ -146,7 +146,7 @@ def filter_service_items(items):
if not item['is_stock_item']:
if not frappe.db.exists('Product Bundle', item['item_code']):
items.remove(item)
return items
def get_conditions(search_term):

View File

@@ -525,7 +525,7 @@ erpnext.PointOfSale.Controller = class {
}
} else {
if (!this.frm.doc.customer)
if (!this.frm.doc.customer)
return this.raise_customer_selection_alert();
const { item_code, batch_no, serial_no, rate } = item;
@@ -549,7 +549,7 @@ erpnext.PointOfSale.Controller = class {
await this.check_stock_availability(item_row, value, this.frm.doc.set_warehouse);
await this.trigger_new_item_events(item_row);
this.update_cart_html(item_row);
if (this.item_details.$component.is(':visible'))
@@ -708,4 +708,3 @@ erpnext.PointOfSale.Controller = class {
.catch(e => console.log(e));
}
};

View File

@@ -973,7 +973,7 @@ erpnext.PointOfSale.ItemCart = class {
load_invoice() {
const frm = this.events.get_frm();
this.attach_refresh_field_event(frm);
this.fetch_customer_details(frm.doc.customer).then(() => {

View File

@@ -65,7 +65,7 @@ erpnext.PointOfSale.ItemDetails = class {
// if item is null or highlighted cart item is clicked twice
const hide_item_details = !Boolean(item) || !current_item_changed;
this.events.toggle_item_selector(!hide_item_details);
this.toggle_component(!hide_item_details);
@@ -127,7 +127,7 @@ erpnext.PointOfSale.ItemDetails = class {
this.$item_price.html(format_currency(price_list_rate, this.currency));
if (!this.hide_images && image) {
this.$item_image.html(
`<img
`<img
onerror="cur_pos.item_details.handle_broken_image(this)"
class="h-full" src="${image}"
alt="${frappe.get_abbr(item_name)}"
@@ -416,4 +416,4 @@ erpnext.PointOfSale.ItemDetails = class {
toggle_component(show) {
show ? this.$component.css('display', 'flex') : this.$component.css('display', 'none');
}
}
}

View File

@@ -95,7 +95,7 @@ erpnext.PointOfSale.ItemSelector = class {
<span class="indicator-pill whitespace-nowrap ${indicator_color}">${qty_to_display}</span>
</div>
<div class="flex items-center justify-center h-32 border-b-grey text-6xl text-grey-100">
<img
<img
onerror="cur_pos.item_selector.handle_broken_image(this)"
class="h-full" src="${item_image}"
alt="${frappe.get_abbr(item.item_name)}"

View File

@@ -44,4 +44,4 @@ erpnext.PointOfSale.NumberPad = class {
me.events.numpad_event($btn);
});
}
}
}

View File

@@ -120,4 +120,4 @@ erpnext.PointOfSale.PastOrderList = class {
toggle_component(show) {
show ? this.$component.css('display', 'flex') && this.refresh_list() : this.$component.css('display', 'none');
}
};
};

View File

@@ -402,4 +402,4 @@ erpnext.PointOfSale.PastOrderSummary = class {
toggle_component(show) {
show ? this.$component.css('display', 'flex') : this.$component.css('display', 'none');
}
};
};

View File

@@ -1,4 +1,4 @@
.funnel-wrapper {
margin: 15px;
width: 100%;
}
}

View File

@@ -32,7 +32,7 @@ def get_funnel_data(from_date, to_date, company):
and (opportunity!="" or quotation_to="Lead") and company=%s""", (from_date, to_date, company))[0][0]
converted = frappe.db.sql("""select count(*) from `tabCustomer`
JOIN `tabLead` ON `tabLead`.name = `tabCustomer`.lead_name
JOIN `tabLead` ON `tabLead`.name = `tabCustomer`.lead_name
WHERE (date(`tabCustomer`.creation) between %s and %s)
and `tabLead`.company=%s""", (from_date, to_date, company))[0][0]
@@ -97,4 +97,4 @@ def get_pipeline_data(from_date, to_date, company):
return result
else:
return 'empty'
return 'empty'

View File

@@ -117,4 +117,4 @@ def get_party_group(party_type):
"Sales Partner": "partner_type"
}
return group[party_type]
return group[party_type]

View File

@@ -76,4 +76,4 @@ def get_item_warehouse_quantity_map():
last_sbom = line.get("parent")
actual_dict = sbom_map.setdefault(last_sbom, {})
actual_dict.setdefault(line.get("warehouse"), line.get("qty"))
return sbom_map
return sbom_map

View File

@@ -41,4 +41,4 @@ frappe.query_reports["Customer Acquisition and Loyalty"] = {
}
return value;
}
}
}

View File

@@ -60,4 +60,4 @@ frappe.query_reports["Item-wise Sales History"] = {
}
return value;
}
};
};

View File

@@ -266,4 +266,4 @@ def get_chart_data(data):
]
},
"type" : "bar"
}
}

View File

@@ -6,4 +6,3 @@ frappe.require("assets/erpnext/js/sales_trends_filters.js", function() {
filters: erpnext.get_sales_trends_filters()
}
});

View File

@@ -141,5 +141,3 @@ frappe.query_reports["Sales Analytics"] = {
});
},
}

View File

@@ -276,4 +276,4 @@ def get_columns(filters):
})
return columns
return columns

View File

@@ -5,4 +5,4 @@ frappe.require("assets/erpnext/js/sales_trends_filters.js", function() {
frappe.query_reports["Sales Order Trends"] = {
filters: erpnext.get_sales_trends_filters()
}
});
});

View File

@@ -110,4 +110,4 @@ def get_conditions(filters, date_field):
if filters.get("to_date"):
conditions += " and {0} <= %(to_date)s".format(date_field)
return conditions
return conditions

View File

@@ -208,4 +208,4 @@ def get_parents_data(filters, partner_doctype):
return frappe.get_all('Target Detail',
filters = filters_dict,
fields = ["parent", "item_group", target_qty_amt_field, "fiscal_year", "distribution_id"])
fields = ["parent", "item_group", target_qty_amt_field, "fiscal_year", "distribution_id"])

View File

@@ -47,9 +47,9 @@ frappe.query_reports["Sales Partner Target Variance based on Item Group"] = {
],
"formatter": function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (column.fieldname.includes('variance')) {
if (data[column.fieldname] < 0) {
value = "<span style='color:red'>" + value + "</span>";
}

View File

@@ -9,4 +9,3 @@ def execute(filters=None):
data = []
return get_data_column(filters, "Sales Partner")

View File

@@ -165,4 +165,4 @@ def get_conditions(filters, date_field):
`tabItem Group` where lft >= %s and rgt <= %s)""" % (lft, rgt)
return conditions
return conditions

View File

@@ -101,7 +101,7 @@ def get_columns(filters):
def get_entries(filters):
date_field = filters["doc_type"] == "Sales Order" and "transaction_date" or "posting_date"
conditions, values = get_conditions(filters, date_field)
entries = frappe.db.sql("""
select
@@ -111,7 +111,7 @@ def get_entries(filters):
`tab%s` dt, `tabSales Team` st
where
st.parent = dt.name and st.parenttype = %s
and dt.docstatus = 1 %s order by dt.name desc,st.sales_person
and dt.docstatus = 1 %s order by dt.name desc,st.sales_person
""" %(date_field, filters["doc_type"], '%s', conditions),
tuple([filters["doc_type"]] + values), as_dict=1)
@@ -138,5 +138,3 @@ def get_conditions(filters, date_field):
values.append(filters["to_date"])
return " and ".join(conditions), values

View File

@@ -47,9 +47,9 @@ frappe.query_reports["Sales Person Target Variance Based On Item Group"] = {
],
"formatter": function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (column.fieldname.includes('variance')) {
if (data[column.fieldname] < 0) {
value = "<span style='color:red'>" + value + "</span>";
}

View File

@@ -8,4 +8,4 @@ from erpnext.selling.report.sales_partner_target_variance_based_on_item_group.it
def execute(filters=None):
data = []
return get_data_column(filters, "Sales Person")
return get_data_column(filters, "Sales Person")

View File

@@ -67,4 +67,4 @@ frappe.query_reports["Sales Person-wise Transaction Summary"] = {
default: 0,
},
]
}
}

View File

@@ -47,9 +47,9 @@ frappe.query_reports["Territory Target Variance Based On Item Group"] = {
],
"formatter": function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (column.fieldname.includes('variance')) {
if (data[column.fieldname] < 0) {
value = "<span style='color:red'>" + value + "</span>";
}