Skip to content

Commit 949f170

Browse files
committed
Merge branch 'hotfix'
2 parents dc35138 + 576e68e commit 949f170

23 files changed

Lines changed: 337 additions & 87 deletions

File tree

erpnext/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from erpnext.hooks import regional_overrides
66
from frappe.utils import getdate
77

8-
__version__ = '11.1.35'
8+
__version__ = '11.1.36'
99

1010
def get_default_company(user=None):
1111
'''Get default company for user'''

erpnext/accounts/report/accounts_receivable/accounts_receivable.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ def get_columns(self, party_naming_by, args):
6868

6969
if self.filters.based_on_payment_terms:
7070
columns.append({
71-
"label": "Payment Term",
71+
"label": _("Payment Term"),
7272
"fieldname": "payment_term",
7373
"fieldtype": "Data",
7474
"width": 120
7575
})
7676
columns.append({
77-
"label": "Invoice Grand Total",
77+
"label": _("Invoice Grand Total"),
7878
"fieldname": "invoice_grand_total",
7979
"fieldtype": "Currency",
8080
"options": "currency",
@@ -83,7 +83,7 @@ def get_columns(self, party_naming_by, args):
8383

8484
for label in ("Invoiced Amount", "Paid Amount", credit_or_debit_note, "Outstanding Amount"):
8585
columns.append({
86-
"label": label,
86+
"label": _(label),
8787
"fieldname": frappe.scrub(label),
8888
"fieldtype": "Currency",
8989
"options": "currency",

erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ def execute(filters=None):
1818
data = []
1919
for d in entries:
2020
invoice = invoice_details.get(d.against_voucher) or frappe._dict()
21-
21+
2222
if d.reference_type=="Purchase Invoice":
2323
payment_amount = flt(d.debit) or -1 * flt(d.credit)
2424
else:
2525
payment_amount = flt(d.credit) or -1 * flt(d.debit)
2626

27-
row = [d.voucher_type, d.voucher_no, d.party_type, d.party, d.posting_date, d.against_voucher,
27+
row = [d.voucher_type, d.voucher_no, d.party_type, d.party, d.posting_date, d.against_voucher,
2828
invoice.posting_date, invoice.due_date, d.debit, d.credit, d.remarks]
2929

3030
if d.against_voucher:
31-
row += get_ageing_data(30, 60, 90, d.posting_date, invoice.posting_date, payment_amount)
31+
row += get_ageing_data(30, 60, 90, 120, d.posting_date, invoice.posting_date, payment_amount)
3232
else:
3333
row += ["", "", "", "", ""]
3434
if invoice.due_date:
3535
row.append((getdate(d.posting_date) - getdate(invoice.due_date)).days or 0)
36-
36+
3737
data.append(row)
3838

3939
return columns, data
@@ -48,19 +48,19 @@ def get_columns(filters):
4848
return [
4949
_("Payment Document") + ":: 100",
5050
_("Payment Entry") + ":Dynamic Link/"+_("Payment Document")+":140",
51-
_("Party Type") + "::100",
51+
_("Party Type") + "::100",
5252
_("Party") + ":Dynamic Link/Party Type:140",
5353
_("Posting Date") + ":Date:100",
5454
_("Invoice") + (":Link/Purchase Invoice:130" if filters.get("payment_type") == "Outgoing" else ":Link/Sales Invoice:130"),
55-
_("Invoice Posting Date") + ":Date:130",
56-
_("Payment Due Date") + ":Date:130",
57-
_("Debit") + ":Currency:120",
55+
_("Invoice Posting Date") + ":Date:130",
56+
_("Payment Due Date") + ":Date:130",
57+
_("Debit") + ":Currency:120",
5858
_("Credit") + ":Currency:120",
59-
_("Remarks") + "::150",
59+
_("Remarks") + "::150",
6060
_("Age") +":Int:40",
61-
"0-30:Currency:100",
62-
"30-60:Currency:100",
63-
"60-90:Currency:100",
61+
"0-30:Currency:100",
62+
"30-60:Currency:100",
63+
"60-90:Currency:100",
6464
_("90-Above") + ":Currency:100",
6565
_("Delay in payment (Days)") + "::150"
6666
]
@@ -79,21 +79,21 @@ def get_conditions(filters):
7979

8080
if filters.party:
8181
conditions.append("party=%(party)s")
82-
82+
8383
if filters.party_type:
8484
conditions.append("against_voucher_type=%(reference_type)s")
8585
filters["reference_type"] = "Sales Invoice" if filters.party_type=="Customer" else "Purchase Invoice"
8686

8787
if filters.get("from_date"):
8888
conditions.append("posting_date >= %(from_date)s")
89-
89+
9090
if filters.get("to_date"):
9191
conditions.append("posting_date <= %(to_date)s")
9292

9393
return "and " + " and ".join(conditions) if conditions else ""
9494

9595
def get_entries(filters):
96-
return frappe.db.sql("""select
96+
return frappe.db.sql("""select
9797
voucher_type, voucher_no, party_type, party, posting_date, debit, credit, remarks, against_voucher
9898
from `tabGL Entry`
9999
where company=%(company)s and voucher_type in ('Journal Entry', 'Payment Entry') {0}

erpnext/buying/doctype/purchase_order/purchase_order.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ frappe.ui.form.on("Purchase Order", {
3333
}
3434
}
3535
});
36+
37+
frm.set_query("expense_account", "items", function() {
38+
return {
39+
query: "erpnext.controllers.queries.get_expense_account",
40+
filters: {'company': frm.doc.company}
41+
}
42+
});
43+
3644
},
3745

3846
refresh: function(frm) {

erpnext/controllers/taxes_and_totals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def apply_discount_amount(self):
390390
net_total += item.net_amount
391391

392392
# discount amount rounding loss adjustment if no taxes
393-
if (not taxes or self.doc.apply_discount_on == "Net Total") \
393+
if (self.doc.apply_discount_on == "Net Total" or not taxes or total_for_discount_amount==self.doc.net_total) \
394394
and i == len(self.doc.get("items")) - 1:
395395
discount_amount_loss = flt(self.doc.net_total - net_total - self.doc.discount_amount,
396396
self.doc.precision("net_total"))

erpnext/crm/doctype/lead/lead.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ cur_frm.email_field = "email_id";
66

77
erpnext.LeadController = frappe.ui.form.Controller.extend({
88
setup: function () {
9+
10+
this.frm.make_methods = {
11+
'Quotation': () => erpnext.utils.create_new_doc('Quotation', {
12+
'quotation_to': this.frm.doc.doctype,
13+
'party_name': this.frm.doc.name
14+
}),
15+
'Opportunity': () => erpnext.utils.create_new_doc('Opportunity', {
16+
'opportunity_from': this.frm.doc.doctype,
17+
'party_name': this.frm.doc.name
18+
})
19+
}
20+
921
this.frm.fields_dict.customer.get_query = function (doc, cdt, cdn) {
1022
return { query: "erpnext.controllers.queries.customer_query" }
1123
}

erpnext/hr/doctype/salary_component/salary_component.json

Lines changed: 65 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,49 @@
122122
"bold": 0,
123123
"collapsible": 0,
124124
"columns": 0,
125-
"default": "1",
126-
"depends_on": "eval:doc.type == \"Earning\"",
127125
"fetch_if_empty": 0,
128-
"fieldname": "is_tax_applicable",
129-
"fieldtype": "Check",
126+
"fieldname": "description",
127+
"fieldtype": "Small Text",
128+
"hidden": 0,
129+
"ignore_user_permissions": 0,
130+
"ignore_xss_filter": 0,
131+
"in_filter": 0,
132+
"in_global_search": 0,
133+
"in_list_view": 1,
134+
"in_standard_filter": 0,
135+
"label": "Description",
136+
"length": 0,
137+
"no_copy": 0,
138+
"permlevel": 0,
139+
"precision": "",
140+
"print_hide": 0,
141+
"print_hide_if_no_value": 0,
142+
"read_only": 0,
143+
"remember_last_selected_value": 0,
144+
"report_hide": 0,
145+
"reqd": 0,
146+
"search_index": 0,
147+
"set_only_once": 0,
148+
"translatable": 0,
149+
"unique": 0
150+
},
151+
{
152+
"allow_bulk_edit": 0,
153+
"allow_in_quick_entry": 0,
154+
"allow_on_submit": 0,
155+
"bold": 0,
156+
"collapsible": 0,
157+
"columns": 0,
158+
"fetch_if_empty": 0,
159+
"fieldname": "column_break_4",
160+
"fieldtype": "Column Break",
130161
"hidden": 0,
131162
"ignore_user_permissions": 0,
132163
"ignore_xss_filter": 0,
133164
"in_filter": 0,
134165
"in_global_search": 0,
135166
"in_list_view": 0,
136167
"in_standard_filter": 0,
137-
"label": "Is Tax Applicable",
138168
"length": 0,
139169
"no_copy": 0,
140170
"permlevel": 0,
@@ -225,8 +255,10 @@
225255
"bold": 0,
226256
"collapsible": 0,
227257
"columns": 0,
258+
"default": "1",
259+
"depends_on": "eval:doc.type == \"Earning\"",
228260
"fetch_if_empty": 0,
229-
"fieldname": "do_not_include_in_total",
261+
"fieldname": "is_tax_applicable",
230262
"fieldtype": "Check",
231263
"hidden": 0,
232264
"ignore_user_permissions": 0,
@@ -235,7 +267,7 @@
235267
"in_global_search": 0,
236268
"in_list_view": 0,
237269
"in_standard_filter": 0,
238-
"label": "Do not include in total",
270+
"label": "Is Tax Applicable",
239271
"length": 0,
240272
"no_copy": 0,
241273
"permlevel": 0,
@@ -258,6 +290,7 @@
258290
"bold": 0,
259291
"collapsible": 0,
260292
"columns": 0,
293+
"depends_on": "is_tax_applicable",
261294
"fetch_if_empty": 0,
262295
"fieldname": "deduct_full_tax_on_selected_payroll_date",
263296
"fieldtype": "Check",
@@ -292,15 +325,16 @@
292325
"collapsible": 0,
293326
"columns": 0,
294327
"fetch_if_empty": 0,
295-
"fieldname": "column_break_4",
296-
"fieldtype": "Column Break",
328+
"fieldname": "round_to_the_nearest_integer",
329+
"fieldtype": "Check",
297330
"hidden": 0,
298331
"ignore_user_permissions": 0,
299332
"ignore_xss_filter": 0,
300333
"in_filter": 0,
301334
"in_global_search": 0,
302335
"in_list_view": 0,
303336
"in_standard_filter": 0,
337+
"label": "Round to the Nearest Integer",
304338
"length": 0,
305339
"no_copy": 0,
306340
"permlevel": 0,
@@ -323,8 +357,9 @@
323357
"bold": 0,
324358
"collapsible": 0,
325359
"columns": 0,
360+
"description": "If selected, the value specified or calculated in this component will not contribute to the earnings or deductions. However, it's value can be referenced by other components that can be added or deducted. ",
326361
"fetch_if_empty": 0,
327-
"fieldname": "disabled",
362+
"fieldname": "statistical_component",
328363
"fieldtype": "Check",
329364
"hidden": 0,
330365
"ignore_user_permissions": 0,
@@ -333,7 +368,7 @@
333368
"in_global_search": 0,
334369
"in_list_view": 0,
335370
"in_standard_filter": 0,
336-
"label": "Disabled",
371+
"label": "Statistical Component",
337372
"length": 0,
338373
"no_copy": 0,
339374
"permlevel": 0,
@@ -357,16 +392,16 @@
357392
"collapsible": 0,
358393
"columns": 0,
359394
"fetch_if_empty": 0,
360-
"fieldname": "description",
361-
"fieldtype": "Small Text",
395+
"fieldname": "do_not_include_in_total",
396+
"fieldtype": "Check",
362397
"hidden": 0,
363398
"ignore_user_permissions": 0,
364399
"ignore_xss_filter": 0,
365400
"in_filter": 0,
366401
"in_global_search": 0,
367-
"in_list_view": 1,
402+
"in_list_view": 0,
368403
"in_standard_filter": 0,
369-
"label": "Description",
404+
"label": "Do Not Include in Total",
370405
"length": 0,
371406
"no_copy": 0,
372407
"permlevel": 0,
@@ -389,9 +424,8 @@
389424
"bold": 0,
390425
"collapsible": 0,
391426
"columns": 0,
392-
"description": "If selected, the value specified or calculated in this component will not contribute to the earnings or deductions. However, it's value can be referenced by other components that can be added or deducted. ",
393427
"fetch_if_empty": 0,
394-
"fieldname": "statistical_component",
428+
"fieldname": "disabled",
395429
"fieldtype": "Check",
396430
"hidden": 0,
397431
"ignore_user_permissions": 0,
@@ -400,7 +434,7 @@
400434
"in_global_search": 0,
401435
"in_list_view": 0,
402436
"in_standard_filter": 0,
403-
"label": "Statistical Component",
437+
"label": "Disabled",
404438
"length": 0,
405439
"no_copy": 0,
406440
"permlevel": 0,
@@ -861,18 +895,18 @@
861895
"bold": 0,
862896
"collapsible": 0,
863897
"columns": 0,
864-
"default": "",
898+
"depends_on": "eval:doc.amount_based_on_formula!==1",
865899
"fetch_if_empty": 0,
866-
"fieldname": "amount_based_on_formula",
867-
"fieldtype": "Check",
900+
"fieldname": "amount",
901+
"fieldtype": "Currency",
868902
"hidden": 0,
869903
"ignore_user_permissions": 0,
870904
"ignore_xss_filter": 0,
871905
"in_filter": 0,
872906
"in_global_search": 0,
873907
"in_list_view": 0,
874908
"in_standard_filter": 0,
875-
"label": "Amount based on formula",
909+
"label": "Amount",
876910
"length": 0,
877911
"no_copy": 0,
878912
"permlevel": 0,
@@ -895,18 +929,18 @@
895929
"bold": 0,
896930
"collapsible": 0,
897931
"columns": 0,
898-
"depends_on": "eval:doc.amount_based_on_formula!==0",
932+
"default": "",
899933
"fetch_if_empty": 0,
900-
"fieldname": "formula",
901-
"fieldtype": "Code",
934+
"fieldname": "amount_based_on_formula",
935+
"fieldtype": "Check",
902936
"hidden": 0,
903937
"ignore_user_permissions": 0,
904938
"ignore_xss_filter": 0,
905939
"in_filter": 0,
906940
"in_global_search": 0,
907941
"in_list_view": 0,
908942
"in_standard_filter": 0,
909-
"label": "Formula",
943+
"label": "Amount based on formula",
910944
"length": 0,
911945
"no_copy": 0,
912946
"permlevel": 0,
@@ -929,18 +963,18 @@
929963
"bold": 0,
930964
"collapsible": 0,
931965
"columns": 0,
932-
"depends_on": "eval:doc.amount_based_on_formula!==1",
966+
"depends_on": "amount_based_on_formula",
933967
"fetch_if_empty": 0,
934-
"fieldname": "amount",
935-
"fieldtype": "Currency",
968+
"fieldname": "formula",
969+
"fieldtype": "Code",
936970
"hidden": 0,
937971
"ignore_user_permissions": 0,
938972
"ignore_xss_filter": 0,
939973
"in_filter": 0,
940974
"in_global_search": 0,
941975
"in_list_view": 0,
942976
"in_standard_filter": 0,
943-
"label": "Amount",
977+
"label": "Formula",
944978
"length": 0,
945979
"no_copy": 0,
946980
"permlevel": 0,
@@ -1034,7 +1068,7 @@
10341068
"issingle": 0,
10351069
"istable": 0,
10361070
"max_attachments": 0,
1037-
"modified": "2019-05-13 12:55:55.424370",
1071+
"modified": "2019-06-05 11:19:15.926608",
10381072
"modified_by": "Administrator",
10391073
"module": "HR",
10401074
"name": "Salary Component",

0 commit comments

Comments
 (0)