Merge branch 'develop'
This commit is contained in:
commit
a5007db902
@ -1,2 +1,2 @@
|
||||
from __future__ import unicode_literals
|
||||
__version__ = '6.7.1'
|
||||
__version__ = '6.7.2'
|
||||
|
@ -98,11 +98,17 @@ class GrossProfitGenerator(object):
|
||||
|
||||
row.base_amount = flt(row.base_net_amount)
|
||||
|
||||
product_bundles = self.product_bundles.get(row.parenttype, {}).get(row.parent, frappe._dict())
|
||||
|
||||
if row.update_stock:
|
||||
product_bundles = self.product_bundles.get(row.parenttype, {}).get(row.parent, frappe._dict())
|
||||
elif row.dn_detail:
|
||||
product_bundles = self.product_bundles.get("Delivery Note", {})\
|
||||
.get(row.delivery_note, frappe._dict())
|
||||
row.item_row = row.dn_detail
|
||||
|
||||
# get buying amount
|
||||
if row.item_code in product_bundles:
|
||||
row.buying_amount = self.get_buying_amount_from_product_bundle(row, product_bundles[row.item_code])
|
||||
row.buying_amount = self.get_buying_amount_from_product_bundle(row,
|
||||
product_bundles[row.item_code])
|
||||
else:
|
||||
row.buying_amount = self.get_buying_amount(row, row.item_code)
|
||||
|
||||
@ -142,7 +148,6 @@ class GrossProfitGenerator(object):
|
||||
new_row.qty += row.qty
|
||||
new_row.buying_amount += row.buying_amount
|
||||
new_row.base_amount += row.base_amount
|
||||
# new_row.allocated_amount += (row.allocated_amount or 0) if new_row.allocated_amount else 0
|
||||
|
||||
new_row.gross_profit = new_row.base_amount - new_row.buying_amount
|
||||
new_row.gross_profit_percent = ((new_row.gross_profit / new_row.base_amount) * 100.0) \
|
||||
@ -158,9 +163,9 @@ class GrossProfitGenerator(object):
|
||||
|
||||
def get_buying_amount_from_product_bundle(self, row, product_bundle):
|
||||
buying_amount = 0.0
|
||||
for bom_item in product_bundle:
|
||||
if bom_item.get("parent_detail_docname")==row.item_row:
|
||||
buying_amount += self.get_buying_amount(row, bom_item.item_code)
|
||||
for packed_item in product_bundle:
|
||||
if packed_item.get("parent_detail_docname")==row.item_row:
|
||||
buying_amount += self.get_buying_amount(row, packed_item.item_code)
|
||||
|
||||
return buying_amount
|
||||
|
||||
@ -176,14 +181,14 @@ class GrossProfitGenerator(object):
|
||||
else:
|
||||
my_sle = self.sle.get((item_code, row.warehouse))
|
||||
if (row.update_stock or row.dn_detail) and my_sle:
|
||||
parenttype, parent, item_row = row.parenttype, row.parent, row.item_row
|
||||
parenttype, parent = row.parenttype, row.parent
|
||||
if row.dn_detail:
|
||||
parenttype, parent, item_row = "Delivery Note", row.delivery_note, row.dn_detail
|
||||
parenttype, parent = "Delivery Note", row.delivery_note
|
||||
|
||||
for i, sle in enumerate(my_sle):
|
||||
# find the stock valution rate from stock ledger entry
|
||||
if sle.voucher_type == parenttype and parent == sle.voucher_no and \
|
||||
sle.voucher_detail_no == item_row:
|
||||
sle.voucher_detail_no == row.item_row:
|
||||
previous_stock_value = len(my_sle) > i+1 and \
|
||||
flt(my_sle[i+1].stock_value) or 0.0
|
||||
return previous_stock_value - flt(sle.stock_value)
|
||||
|
@ -29,7 +29,7 @@ blogs.
|
||||
"""
|
||||
app_icon = "icon-th"
|
||||
app_color = "#e74c3c"
|
||||
app_version = "6.7.1"
|
||||
app_version = "6.7.2"
|
||||
source_link = "https://github.com/frappe/erpnext"
|
||||
|
||||
error_report_email = "support@erpnext.com"
|
||||
|
@ -230,3 +230,4 @@ erpnext.patches.v6_5.show_in_website_for_template_item
|
||||
erpnext.patches.v6_4.fix_expense_included_in_valuation
|
||||
execute:frappe.delete_doc_if_exists("Report", "Item-wise Last Purchase Rate")
|
||||
erpnext.patches.v6_6.fix_website_image
|
||||
erpnext.patches.v6_6.remove_fiscal_year_from_leave_allocation
|
||||
|
@ -78,11 +78,6 @@ frappe.ui.form.on("Item", {
|
||||
frm.set_value("description", frm.doc.item_code);
|
||||
},
|
||||
|
||||
tax_type: function(frm, cdt, cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
return get_server_fields('get_tax_rate', d.tax_type, 'taxes', doc, cdt, cdn, 1);
|
||||
},
|
||||
|
||||
copy_from_item_group: function(frm) {
|
||||
return frm.call({
|
||||
doc: frm.doc,
|
||||
@ -315,3 +310,4 @@ cur_frm.add_fetch('attribute', 'numeric_values', 'numeric_values');
|
||||
cur_frm.add_fetch('attribute', 'from_range', 'from_range');
|
||||
cur_frm.add_fetch('attribute', 'to_range', 'to_range');
|
||||
cur_frm.add_fetch('attribute', 'increment', 'increment');
|
||||
cur_frm.add_fetch('tax_type', 'tax_rate', 'tax_rate');
|
||||
|
@ -398,9 +398,6 @@ class Item(WebsiteGenerator):
|
||||
item_description=%s, modified=NOW() where item_code=%s""",
|
||||
(self.item_name, self.description, self.name))
|
||||
|
||||
def get_tax_rate(self, tax_type):
|
||||
return { "tax_rate": frappe.db.get_value("Account", tax_type, "tax_rate") }
|
||||
|
||||
def on_trash(self):
|
||||
super(Item, self).on_trash()
|
||||
frappe.db.sql("""delete from tabBin where item_code=%s""", self.item_code)
|
||||
|
@ -143,22 +143,23 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
|
||||
make_purchase_order: function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order",
|
||||
frm: cur_frm
|
||||
})
|
||||
frm: cur_frm,
|
||||
run_link_triggers: true
|
||||
});
|
||||
},
|
||||
|
||||
make_supplier_quotation: function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
|
||||
frm: cur_frm
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
make_stock_entry: function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.material_request.material_request.make_stock_entry",
|
||||
frm: cur_frm
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user