Merge branch 'hotfix' into wrong_Casual_Leave_opening

This commit is contained in:
Anurag Mishra
2019-06-26 18:28:59 +05:30
committed by GitHub
5 changed files with 13 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '11.1.39'
__version__ = '11.1.41'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -487,7 +487,7 @@ class SalesInvoice(SellingController):
"""Set against account for debit to account"""
against_acc = []
for d in self.get('items'):
if d.income_account not in against_acc:
if d.income_account and d.income_account not in against_acc:
against_acc.append(d.income_account)
self.against_income_account = ','.join(against_acc)

View File

@@ -2,8 +2,8 @@
// For license information, please see license.txt
frappe.views.calendar["Attendance"] = {
field_map: {
"start": "date",
"end": "date",
"start": "attendance_date",
"end": "attendance_date",
"id": "name",
"docstatus": 1
},

View File

@@ -7,8 +7,9 @@ import frappe
def execute():
if frappe.get_all("Item Barcode", limit=1): return
frappe.reload_doc("stock", "doctype", "item_barcode")
if frappe.get_all("Item Barcode", limit=1): return
if "barcode" not in frappe.db.get_table_columns("Item"): return
items_barcode = frappe.db.sql("select name, barcode from tabItem where barcode is not null", as_dict=True)
frappe.reload_doc("stock", "doctype", "item")

View File

@@ -443,7 +443,12 @@ def make_sales_invoice(source_name, target_doc=None):
def get_pending_qty(item_row):
pending_qty = item_row.qty - invoiced_qty_map.get(item_row.name, 0)
returned_qty = flt(returned_qty_map.get(item_row.item_code, 0))
returned_qty = 0
if returned_qty_map.get(item_row.item_code) > 0:
returned_qty = flt(returned_qty_map.get(item_row.item_code, 0))
returned_qty_map[item_row.item_code] -= pending_qty
if returned_qty:
if returned_qty >= pending_qty:
pending_qty = 0
@@ -451,6 +456,7 @@ def make_sales_invoice(source_name, target_doc=None):
else:
pending_qty -= returned_qty
returned_qty = 0
return pending_qty, returned_qty
doc = get_mapped_doc("Delivery Note", source_name, {