Skip to content

Commit

Permalink
Merge branch 'staging' into Task-subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
hrwX committed Sep 25, 2020
2 parents a49c71a + 472413f commit 42edd93
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"actions": [],
"allow_import": 1,
"autoname": "naming_series:",
"creation": "2013-05-21 16:16:39",
Expand Down Expand Up @@ -924,6 +923,7 @@
{
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Outstanding Amount",
"no_copy": 1,
"oldfieldname": "outstanding_amount",
Expand Down Expand Up @@ -1298,8 +1298,7 @@
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2020-04-18 13:05:25.199832",
"modified": "2020-09-24 06:26:03.007443",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
Expand Down
14 changes: 7 additions & 7 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"actions": [],
"allow_import": 1,
"autoname": "naming_series:",
"creation": "2013-05-24 19:29:05",
Expand Down Expand Up @@ -76,9 +75,9 @@
"base_total",
"base_net_total",
"column_break_32",
"total_net_weight",
"total",
"net_total",
"total_net_weight",
"taxes_section",
"taxes_and_charges",
"column_break_38",
Expand Down Expand Up @@ -150,9 +149,9 @@
"edit_printing_settings",
"letter_head",
"group_same_items",
"select_print_heading",
"column_break_84",
"language",
"column_break_84",
"select_print_heading",
"more_information",
"inter_company_invoice_reference",
"customer_group",
Expand Down Expand Up @@ -398,7 +397,8 @@
{
"allow_on_submit": 1,
"fieldname": "po_no",
"fieldtype": "Small Text",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Customer's Purchase Order",
"no_copy": 1,
"print_hide": 1
Expand Down Expand Up @@ -600,6 +600,7 @@
"print_hide": 1
},
{
"description": "Scan item barcodes, serial numbers and batch numbers",
"fieldname": "scan_barcode",
"fieldtype": "Data",
"label": "Scan Barcode"
Expand Down Expand Up @@ -1576,8 +1577,7 @@
"icon": "fa fa-file-text",
"idx": 181,
"is_submittable": 1,
"links": [],
"modified": "2020-07-16 06:13:14.139976",
"modified": "2020-09-24 06:18:55.305060",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
Expand Down
12 changes: 6 additions & 6 deletions erpnext/compliance/taxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def calculate_item_cultivation_tax(doc, item, cultivation_taxes=None):
filters={'is_compliance_item': True},
fields=['item_code', 'enable_cultivation_tax', 'item_category'])

item = next((data for data in compliance_items if data.get("item_code") == item.get("item_code")), None)
if not item or not item.enable_cultivation_tax:
compliance_item = next((data for data in compliance_items if data.get("item_code") == item.get("item_code")), None)
if not compliance_item or not compliance_item.enable_cultivation_tax:
return cultivation_taxes

flower_tax_account = get_company_default(doc.get("company"), "default_cultivation_tax_account_flower")
Expand All @@ -83,16 +83,16 @@ def calculate_item_cultivation_tax(doc, item, cultivation_taxes=None):

qty_in_ounces = convert_to_ounces(item.get("uom"), item.get("qty"))

if item.item_category == "Dry Flower":
if compliance_item.item_category == "Dry Flower":
cultivation_tax = qty_in_ounces * DRY_FLOWER_TAX_RATE
cultivation_taxes[flower_tax_account] += cultivation_tax
elif item.item_category == "Dry Leaf":
elif compliance_item.item_category == "Dry Leaf":
cultivation_tax = qty_in_ounces * DRY_LEAF_TAX_RATE
cultivation_taxes[leaf_tax_account] += cultivation_tax
elif item.item_category == "Fresh Plant":
elif compliance_item.item_category == "Fresh Plant":
cultivation_tax = qty_in_ounces * FRESH_PLANT_TAX_RATE
cultivation_taxes[plant_tax_account] += cultivation_tax
elif item.item_category == "Based on Raw Materials":
elif compliance_item.item_category == "Based on Raw Materials":
# calculate cultivation tax based on weight of raw materials
if not item.get("cultivation_weight_uom"):
frappe.throw(_("Row #{0}: Please set a cultivation weight UOM".format(item.get("idx"))))
Expand Down
5 changes: 3 additions & 2 deletions erpnext/stock/doctype/pick_list/pick_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def before_submit(self):
def validate_delivery_date(self):
order_delivery_dates = [frappe.db.get_value("Sales Order Item", location.get("sales_order_item"), "delivery_date")
for location in self.locations if location.get("sales_order_item")]
self.delivery_date = min(order_delivery_dates)
if order_delivery_dates:
self.delivery_date = min(order_delivery_dates)

def validate_stock_qty(self):
"""User should not allowed to create pick list if sales order item qty exceed."""
Expand All @@ -55,7 +56,7 @@ def validate_stock_qty(self):

if prev_picked_qty:
prev_picked_qty = prev_picked_qty[0].prev_picked_qty
pick_list_qty = ordered_item_qty - prev_picked_qty
pick_list_qty = flt(ordered_item_qty) - flt(prev_picked_qty)
if pick_list_qty > 0 and item.qty > pick_list_qty:
frappe.throw(_("Row #{0}: Picked quantity ({1}) for {2} cannot exceed unused ordered qty ({3})").format(item.idx, frappe.bold(item.qty), frappe.bold(item.item_name), frappe.bold(pick_list_qty)))

Expand Down

0 comments on commit 42edd93

Please sign in to comment.