Merge pull request #22721 from deepeshgarg007/gstr_test
fix: Multiple fixes in GST
This commit is contained in:
commit
7e56e80057
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('GSTR 3B Report', {
|
frappe.ui.form.on('GSTR 3B Report', {
|
||||||
refresh : function(frm) {
|
refresh : function(frm) {
|
||||||
|
frm.doc.__unsaved = 1;
|
||||||
if(!frm.is_new()) {
|
if(!frm.is_new()) {
|
||||||
frm.set_intro(__("Please save the report again to rebuild or update"));
|
frm.set_intro(__("Please save the report again to rebuild or update"));
|
||||||
frm.add_custom_button(__('Download JSON'), function() {
|
frm.add_custom_button(__('Download JSON'), function() {
|
||||||
@ -45,10 +46,6 @@ frappe.ui.form.on('GSTR 3B Report', {
|
|||||||
frm.set_df_property('year', 'options', options);
|
frm.set_df_property('year', 'options', options);
|
||||||
},
|
},
|
||||||
|
|
||||||
validate: function(frm) {
|
|
||||||
frm.dirty();
|
|
||||||
},
|
|
||||||
|
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.set_query('company_address', function(doc) {
|
frm.set_query('company_address', function(doc) {
|
||||||
if(!doc.company) {
|
if(!doc.company) {
|
||||||
|
@ -322,7 +322,7 @@ class GSTR3BReport(Document):
|
|||||||
inter_state_supply_tax_mapping[d.name]['samt'] += d.tax_amount
|
inter_state_supply_tax_mapping[d.name]['samt'] += d.tax_amount
|
||||||
|
|
||||||
if d.account_head in [d.igst_account for d in self.account_heads]:
|
if d.account_head in [d.igst_account for d in self.account_heads]:
|
||||||
inter_state_supply_tax_mapping[d.name]['samt'] += d.tax_amount
|
inter_state_supply_tax_mapping[d.name]['iamt'] += d.tax_amount
|
||||||
|
|
||||||
if d.account_head in [d.cess_account for d in self.account_heads]:
|
if d.account_head in [d.cess_account for d in self.account_heads]:
|
||||||
inter_state_supply_tax_mapping[d.name]['csamt'] += d.tax_amount
|
inter_state_supply_tax_mapping[d.name]['csamt'] += d.tax_amount
|
||||||
@ -331,6 +331,7 @@ class GSTR3BReport(Document):
|
|||||||
if d.place_of_supply:
|
if d.place_of_supply:
|
||||||
osup_det = self.report_dict["sup_details"]["osup_det"]
|
osup_det = self.report_dict["sup_details"]["osup_det"]
|
||||||
osup_det["txval"] = flt(osup_det["txval"] + value['taxable_value'], 2)
|
osup_det["txval"] = flt(osup_det["txval"] + value['taxable_value'], 2)
|
||||||
|
osup_det["iamt"] = flt(osup_det["iamt"] + value['iamt'], 2)
|
||||||
osup_det["camt"] = flt(osup_det["camt"] + value['camt'], 2)
|
osup_det["camt"] = flt(osup_det["camt"] + value['camt'], 2)
|
||||||
osup_det["samt"] = flt(osup_det["samt"] + value['samt'], 2)
|
osup_det["samt"] = flt(osup_det["samt"] + value['samt'], 2)
|
||||||
osup_det["csamt"] = flt(osup_det["csamt"] + value['csamt'], 2)
|
osup_det["csamt"] = flt(osup_det["csamt"] + value['csamt'], 2)
|
||||||
|
@ -704,9 +704,10 @@ def update_totals(gst_tax, doc):
|
|||||||
doc.rounding_adjustment += flt(doc.rounded_total - doc.grand_total,
|
doc.rounding_adjustment += flt(doc.rounded_total - doc.grand_total,
|
||||||
doc.precision("rounding_adjustment"))
|
doc.precision("rounding_adjustment"))
|
||||||
|
|
||||||
doc.outstanding_amount = doc.base_rounded_total
|
doc.outstanding_amount = doc.rounded_total or doc.grand_total
|
||||||
|
|
||||||
doc.in_words = money_in_words(doc.grand_total, doc.currency)
|
doc.in_words = money_in_words(doc.grand_total, doc.currency)
|
||||||
|
doc.set_payment_schedule()
|
||||||
|
|
||||||
def make_regional_gl_entries(gl_entries, doc):
|
def make_regional_gl_entries(gl_entries, doc):
|
||||||
country = frappe.get_cached_value('Company', doc.company, 'country')
|
country = frappe.get_cached_value('Company', doc.company, 'country')
|
||||||
|
@ -118,7 +118,7 @@ class Gstr1Report(object):
|
|||||||
row.append(invoice_details.get(fieldname))
|
row.append(invoice_details.get(fieldname))
|
||||||
taxable_value = 0
|
taxable_value = 0
|
||||||
|
|
||||||
if invoice in self.cgst_igst_invoices:
|
if invoice in self.cgst_sgst_invoices:
|
||||||
division_factor = 2
|
division_factor = 2
|
||||||
else:
|
else:
|
||||||
division_factor = 1
|
division_factor = 1
|
||||||
@ -129,6 +129,8 @@ class Gstr1Report(object):
|
|||||||
taxable_value += abs(net_amount)
|
taxable_value += abs(net_amount)
|
||||||
elif not self.item_tax_rate.get(invoice):
|
elif not self.item_tax_rate.get(invoice):
|
||||||
taxable_value += abs(net_amount)
|
taxable_value += abs(net_amount)
|
||||||
|
elif tax_rate:
|
||||||
|
taxable_value += abs(net_amount)
|
||||||
|
|
||||||
row += [tax_rate or 0, taxable_value]
|
row += [tax_rate or 0, taxable_value]
|
||||||
|
|
||||||
@ -227,7 +229,7 @@ class Gstr1Report(object):
|
|||||||
|
|
||||||
self.items_based_on_tax_rate = {}
|
self.items_based_on_tax_rate = {}
|
||||||
self.invoice_cess = frappe._dict()
|
self.invoice_cess = frappe._dict()
|
||||||
self.cgst_igst_invoices = []
|
self.cgst_sgst_invoices = []
|
||||||
|
|
||||||
unidentified_gst_accounts = []
|
unidentified_gst_accounts = []
|
||||||
for parent, account, item_wise_tax_detail, tax_amount in self.tax_details:
|
for parent, account, item_wise_tax_detail, tax_amount in self.tax_details:
|
||||||
@ -251,8 +253,8 @@ class Gstr1Report(object):
|
|||||||
tax_rate = tax_amounts[0]
|
tax_rate = tax_amounts[0]
|
||||||
if cgst_or_sgst:
|
if cgst_or_sgst:
|
||||||
tax_rate *= 2
|
tax_rate *= 2
|
||||||
if parent not in self.cgst_igst_invoices:
|
if parent not in self.cgst_sgst_invoices:
|
||||||
self.cgst_igst_invoices.append(parent)
|
self.cgst_sgst_invoices.append(parent)
|
||||||
|
|
||||||
rate_based_dict = self.items_based_on_tax_rate\
|
rate_based_dict = self.items_based_on_tax_rate\
|
||||||
.setdefault(parent, {}).setdefault(tax_rate, [])
|
.setdefault(parent, {}).setdefault(tax_rate, [])
|
||||||
|
@ -44,6 +44,7 @@ class Gstr2Report(Gstr1Report):
|
|||||||
for inv, items_based_on_rate in self.items_based_on_tax_rate.items():
|
for inv, items_based_on_rate in self.items_based_on_tax_rate.items():
|
||||||
invoice_details = self.invoices.get(inv)
|
invoice_details = self.invoices.get(inv)
|
||||||
for rate, items in items_based_on_rate.items():
|
for rate, items in items_based_on_rate.items():
|
||||||
|
if rate:
|
||||||
if inv not in self.igst_invoices:
|
if inv not in self.igst_invoices:
|
||||||
rate = rate / 2
|
rate = rate / 2
|
||||||
row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items)
|
row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items)
|
||||||
@ -54,7 +55,6 @@ class Gstr2Report(Gstr1Report):
|
|||||||
tax_amount = taxable_value * rate / 100
|
tax_amount = taxable_value * rate / 100
|
||||||
row += [tax_amount, 0, 0]
|
row += [tax_amount, 0, 0]
|
||||||
|
|
||||||
|
|
||||||
row += [
|
row += [
|
||||||
self.invoice_cess.get(inv),
|
self.invoice_cess.get(inv),
|
||||||
invoice_details.get('eligibility_for_itc'),
|
invoice_details.get('eligibility_for_itc'),
|
||||||
@ -86,7 +86,7 @@ class Gstr2Report(Gstr1Report):
|
|||||||
conditions += opts[1]
|
conditions += opts[1]
|
||||||
|
|
||||||
if self.filters.get("type_of_business") == "B2B":
|
if self.filters.get("type_of_business") == "B2B":
|
||||||
conditions += "and ifnull(gst_category, '') != 'Overseas' and is_return != 1 "
|
conditions += "and ifnull(gst_category, '') in ('Registered Regular', 'Deemed Export', 'SEZ') and is_return != 1 "
|
||||||
|
|
||||||
elif self.filters.get("type_of_business") == "CDNR":
|
elif self.filters.get("type_of_business") == "CDNR":
|
||||||
conditions += """ and is_return = 1 """
|
conditions += """ and is_return = 1 """
|
||||||
|
Loading…
Reference in New Issue
Block a user