Merge branch 'develop' into opening-stock-entry-dev
This commit is contained in:
commit
f3ccf0e949
@ -79,6 +79,7 @@ def get_events(start, end, filters=None):
|
||||
filters.append(['Holiday', 'holiday_date', '>', getdate(start)])
|
||||
if end:
|
||||
filters.append(['Holiday', 'holiday_date', '<', getdate(end)])
|
||||
|
||||
return frappe.get_list('Holiday List',
|
||||
fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`.color'],
|
||||
filters = filters,
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
frappe.views.calendar["Holiday List"] = {
|
||||
field_map: {
|
||||
"start": "from_date",
|
||||
"end": "to_date",
|
||||
"start": "holiday_date",
|
||||
"end": "holiday_date",
|
||||
"id": "name",
|
||||
"title": "description",
|
||||
"allDay": "allDay"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -67,7 +67,8 @@ class Gstr1Report(object):
|
||||
row.append("Y" if invoice_details.posting_date <= date(2017, 7, 1) else "N")
|
||||
row.append("C" if invoice_details.return_against else "R")
|
||||
|
||||
self.data.append(row)
|
||||
if taxable_value:
|
||||
self.data.append(row)
|
||||
|
||||
def get_b2cs_data(self):
|
||||
b2cs_output = {}
|
||||
@ -113,9 +114,14 @@ class Gstr1Report(object):
|
||||
row.append(export_type)
|
||||
else:
|
||||
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]
|
||||
|
||||
return row, taxable_value
|
||||
@ -184,8 +190,10 @@ class Gstr1Report(object):
|
||||
|
||||
def get_invoice_items(self):
|
||||
self.invoice_items = frappe._dict()
|
||||
self.item_tax_rate = frappe._dict()
|
||||
|
||||
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`
|
||||
where parent in (%s)
|
||||
""" % (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
|
||||
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):
|
||||
self.tax_details = frappe.db.sql("""
|
||||
select
|
||||
|
@ -276,7 +276,8 @@ def get_items(warehouse, posting_date, posting_time, company):
|
||||
items = frappe.db.sql("""
|
||||
select i.name, i.item_name, bin.warehouse
|
||||
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)
|
||||
""", (lft, rgt))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user