Merge branch 'develop' into po-status-updater-dev-1
This commit is contained in:
commit
769024e2b6
@ -79,6 +79,7 @@ def get_events(start, end, filters=None):
|
|||||||
filters.append(['Holiday', 'holiday_date', '>', getdate(start)])
|
filters.append(['Holiday', 'holiday_date', '>', getdate(start)])
|
||||||
if end:
|
if end:
|
||||||
filters.append(['Holiday', 'holiday_date', '<', getdate(end)])
|
filters.append(['Holiday', 'holiday_date', '<', getdate(end)])
|
||||||
|
|
||||||
return frappe.get_list('Holiday List',
|
return frappe.get_list('Holiday List',
|
||||||
fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`.color'],
|
fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`.color'],
|
||||||
filters = filters,
|
filters = filters,
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
frappe.views.calendar["Holiday List"] = {
|
frappe.views.calendar["Holiday List"] = {
|
||||||
field_map: {
|
field_map: {
|
||||||
"start": "from_date",
|
"start": "holiday_date",
|
||||||
"end": "to_date",
|
"end": "holiday_date",
|
||||||
"id": "name",
|
"id": "name",
|
||||||
"title": "description",
|
"title": "description",
|
||||||
"allDay": "allDay"
|
"allDay": "allDay"
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -67,6 +67,7 @@ class Gstr1Report(object):
|
|||||||
row.append("Y" if invoice_details.posting_date <= date(2017, 7, 1) else "N")
|
row.append("Y" if invoice_details.posting_date <= date(2017, 7, 1) else "N")
|
||||||
row.append("C" if invoice_details.return_against else "R")
|
row.append("C" if invoice_details.return_against else "R")
|
||||||
|
|
||||||
|
if taxable_value:
|
||||||
self.data.append(row)
|
self.data.append(row)
|
||||||
|
|
||||||
def get_b2cs_data(self):
|
def get_b2cs_data(self):
|
||||||
@ -113,9 +114,14 @@ class Gstr1Report(object):
|
|||||||
row.append(export_type)
|
row.append(export_type)
|
||||||
else:
|
else:
|
||||||
row.append(invoice_details.get(fieldname))
|
row.append(invoice_details.get(fieldname))
|
||||||
|
taxable_value = 0
|
||||||
|
for item_code, net_amount in self.invoice_items.get(invoice).items():
|
||||||
|
if item_code in items:
|
||||||
|
if self.item_tax_rate.get(invoice) and tax_rate == self.item_tax_rate.get(invoice, {}).get(item_code):
|
||||||
|
taxable_value += abs(net_amount)
|
||||||
|
elif not self.item_tax_rate.get(invoice):
|
||||||
|
taxable_value += abs(net_amount)
|
||||||
|
|
||||||
taxable_value = sum([abs(net_amount)
|
|
||||||
for item_code, net_amount in self.invoice_items.get(invoice).items() if item_code in items])
|
|
||||||
row += [tax_rate or 0, taxable_value]
|
row += [tax_rate or 0, taxable_value]
|
||||||
|
|
||||||
return row, taxable_value
|
return row, taxable_value
|
||||||
@ -184,8 +190,10 @@ class Gstr1Report(object):
|
|||||||
|
|
||||||
def get_invoice_items(self):
|
def get_invoice_items(self):
|
||||||
self.invoice_items = frappe._dict()
|
self.invoice_items = frappe._dict()
|
||||||
|
self.item_tax_rate = frappe._dict()
|
||||||
|
|
||||||
items = frappe.db.sql("""
|
items = frappe.db.sql("""
|
||||||
select item_code, parent, base_net_amount
|
select item_code, parent, base_net_amount, item_tax_rate
|
||||||
from `tab%s Item`
|
from `tab%s Item`
|
||||||
where parent in (%s)
|
where parent in (%s)
|
||||||
""" % (self.doctype, ', '.join(['%s']*len(self.invoices))), tuple(self.invoices), as_dict=1)
|
""" % (self.doctype, ', '.join(['%s']*len(self.invoices))), tuple(self.invoices), as_dict=1)
|
||||||
@ -196,6 +204,12 @@ class Gstr1Report(object):
|
|||||||
sum(i.get('base_net_amount', 0) for i in items
|
sum(i.get('base_net_amount', 0) for i in items
|
||||||
if i.item_code == d.item_code and i.parent == d.parent))
|
if i.item_code == d.item_code and i.parent == d.parent))
|
||||||
|
|
||||||
|
item_tax_rate = json.loads(d.item_tax_rate)
|
||||||
|
|
||||||
|
if item_tax_rate:
|
||||||
|
for account, rate in item_tax_rate.items():
|
||||||
|
self.item_tax_rate.setdefault(d.parent, {}).setdefault(d.item_code, rate)
|
||||||
|
|
||||||
def get_items_based_on_tax_rate(self):
|
def get_items_based_on_tax_rate(self):
|
||||||
self.tax_details = frappe.db.sql("""
|
self.tax_details = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
|
@ -276,7 +276,8 @@ def get_items(warehouse, posting_date, posting_time, company):
|
|||||||
items = frappe.db.sql("""
|
items = frappe.db.sql("""
|
||||||
select i.name, i.item_name, bin.warehouse
|
select i.name, i.item_name, bin.warehouse
|
||||||
from tabBin bin, tabItem i
|
from tabBin bin, tabItem i
|
||||||
where i.name=bin.item_code and i.disabled=0
|
where i.name=bin.item_code and i.disabled=0 and i.is_stock_item = 1
|
||||||
|
and i.has_variants = 0 and i.has_serial_no = 0 and i.has_batch_no = 0
|
||||||
and exists(select name from `tabWarehouse` where lft >= %s and rgt <= %s and name=bin.warehouse)
|
and exists(select name from `tabWarehouse` where lft >= %s and rgt <= %s and name=bin.warehouse)
|
||||||
""", (lft, rgt))
|
""", (lft, rgt))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user