Skip to content

Commit 1ef72c0

Browse files
committed
Merge branch 'hotfix'
2 parents d982e8f + 648191b commit 1ef72c0

File tree

3 files changed

+11
-33
lines changed

3 files changed

+11
-33
lines changed

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__ = '10.1.49'
8+
__version__ = '10.1.50'
99

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

erpnext/patches/v10_0/set_discount_amount.py

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,20 @@ def execute():
1515
buying_doctypes = ["Purchase Order Item", "Purchase Invoice Item", "Purchase Receipt Item", "Supplier Quotation Item"]
1616

1717
for doctype in selling_doctypes:
18-
values = frappe.db.sql('''
19-
SELECT
20-
discount_percentage, rate_with_margin, price_list_rate, name
21-
FROM
22-
`tab%s`
23-
WHERE
24-
ifnull(discount_percentage, 0) > 0
25-
''' % (doctype), as_dict=True)
26-
calculate_discount(doctype, values)
27-
28-
for doctype in buying_doctypes:
29-
values = frappe.db.sql('''
30-
SELECT
31-
discount_percentage, price_list_rate, name
32-
FROM
18+
frappe.db.sql('''
19+
UPDATE
3320
`tab%s`
21+
SET
22+
discount_amount = if(rate_with_margin > 0, rate_with_margin, price_list_rate) * discount_percentage / 100
3423
WHERE
3524
discount_percentage > 0
36-
''' % (doctype), as_dict=True)
37-
calculate_discount(doctype, values)
38-
39-
def calculate_discount(doctype, values):
40-
rate = None
41-
if not values: return
42-
for d in values:
43-
if d.rate_with_margin and d.rate_with_margin > 0:
44-
rate = d.rate_with_margin
45-
else:
46-
rate = d.price_list_rate
47-
48-
discount_value = rate * d.get('discount_percentage') / 100
25+
''' % (doctype))
26+
for doctype in buying_doctypes:
4927
frappe.db.sql('''
5028
UPDATE
5129
`tab%s`
5230
SET
53-
discount_amount = %s
31+
discount_amount = price_list_rate * discount_percentage / 100
5432
WHERE
55-
name = '%s'
56-
''' % (doctype, discount_value, d.get('name')))
33+
discount_percentage > 0
34+
''' % (doctype))

erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def execute(filters=None):
3333

3434
row = [cd.item_code, cd.item_name, cd.description, cd.stock_uom, \
3535
consumed_qty, consumed_amount, delivered_qty, delivered_amount, \
36-
total_qty, total_amount, list(set(suppliers))]
36+
total_qty, total_amount, ','.join(list(set(suppliers)))]
3737
data.append(row)
3838

3939
return columns, data

0 commit comments

Comments
 (0)