Merge branch 'master' into staging

This commit is contained in:
mbauskar
2017-08-14 09:31:01 +05:30
15 changed files with 328 additions and 25 deletions

View File

@@ -83,10 +83,12 @@ class BuyingController(StockController):
def set_landed_cost_voucher_amount(self):
for d in self.get("items"):
lc_voucher_amount = frappe.db.sql("""select sum(applicable_charges)
lc_voucher_data = frappe.db.sql("""select sum(applicable_charges), cost_center
from `tabLanded Cost Item`
where docstatus = 1 and purchase_receipt_item = %s""", d.name)
d.landed_cost_voucher_amount = lc_voucher_amount[0][0] if lc_voucher_amount else 0.0
d.landed_cost_voucher_amount = lc_voucher_data[0][0] if lc_voucher_data else 0.0
if not d.cost_center and lc_voucher_data and lc_voucher_data[0][1]:
d.db_set('cost_center', lc_voucher_data[0][1])
def set_total_in_words(self):
from frappe.utils import money_in_words