fix: Multiple fixes in GSTR-3b Report
This commit is contained in:
parent
8d70073cf8
commit
3a83c7bd7d
@ -222,17 +222,17 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>  (1) {{__("As per rules 42 & 43 of CGST Rules")}}</td>
|
<td>  (1) {{__("As per rules 42 & 43 of CGST Rules")}}</td>
|
||||||
<td></td>
|
<td class="right">{{ flt(data.itc_elg.itc_rev[0].iamt, 2) }}</td>
|
||||||
<td></td>
|
<td class="right">{{ flt(data.itc_elg.itc_rev[0].camt, 2) }}</td>
|
||||||
<td></td>
|
<td class="right">{{ flt(data.itc_elg.itc_rev[0].samt, 2) }}</td>
|
||||||
<td></td>
|
<td class="right">{{ flt(data.itc_elg.itc_rev[0].csamt, 2) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>  (2) {{__("Others")}}</td>
|
<td>  (2) {{__("Others")}}</td>
|
||||||
<td></td>
|
<td class="right">{{ flt(data.itc_elg.itc_rev[1].iamt, 2) }}</td>
|
||||||
<td></td>
|
<td class="right">{{ flt(data.itc_elg.itc_rev[1].camt, 2) }}</td>
|
||||||
<td></td>
|
<td class="right">{{ flt(data.itc_elg.itc_rev[1].samt, 2) }}</td>
|
||||||
<td></td>
|
<td class="right">{{ flt(data.itc_elg.itc_rev[1].csamt, 2) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>(C) {{__("Net ITC Available(A) - (B)")}}</b></td>
|
<td><b>(C) {{__("Net ITC Available(A) - (B)")}}</b></td>
|
||||||
|
|||||||
@ -91,10 +91,10 @@ class GSTR3BReport(Document):
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ty": "ISD",
|
"ty": "ISD",
|
||||||
"iamt": 1,
|
"iamt": 0,
|
||||||
"camt": 1,
|
"camt": 0,
|
||||||
"samt": 1,
|
"samt": 0,
|
||||||
"csamt": 1
|
"csamt": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"samt": 0,
|
"samt": 0,
|
||||||
@ -104,6 +104,22 @@ class GSTR3BReport(Document):
|
|||||||
"iamt": 0
|
"iamt": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"itc_rev": [
|
||||||
|
{
|
||||||
|
"ty": "RUL",
|
||||||
|
"iamt": 0,
|
||||||
|
"camt": 0,
|
||||||
|
"samt": 0,
|
||||||
|
"csamt": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ty": "OTH",
|
||||||
|
"iamt": 0,
|
||||||
|
"camt": 0,
|
||||||
|
"samt": 0,
|
||||||
|
"csamt": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
"itc_net": {
|
"itc_net": {
|
||||||
"samt": 0,
|
"samt": 0,
|
||||||
"csamt": 0,
|
"csamt": 0,
|
||||||
@ -173,6 +189,10 @@ class GSTR3BReport(Document):
|
|||||||
net_itc = self.report_dict["itc_elg"]["itc_net"]
|
net_itc = self.report_dict["itc_elg"]["itc_net"]
|
||||||
|
|
||||||
for d in self.report_dict["itc_elg"]["itc_avl"]:
|
for d in self.report_dict["itc_elg"]["itc_avl"]:
|
||||||
|
|
||||||
|
itc_type = itc_type_map.get(d["ty"])
|
||||||
|
gst_category = "Registered Regular"
|
||||||
|
|
||||||
if d["ty"] == 'ISRC':
|
if d["ty"] == 'ISRC':
|
||||||
reverse_charge = "Y"
|
reverse_charge = "Y"
|
||||||
else:
|
else:
|
||||||
@ -180,24 +200,22 @@ class GSTR3BReport(Document):
|
|||||||
|
|
||||||
for account_head in self.account_heads:
|
for account_head in self.account_heads:
|
||||||
|
|
||||||
d["iamt"] = flt(itc_details.get((itc_type_map.get(d["ty"]), reverse_charge, account_head.get('igst_account')), {}).get("amount"), 2)
|
d["iamt"] += flt(itc_details.get((gst_category, itc_type, reverse_charge, account_head.get('igst_account')), {}).get("amount"), 2)
|
||||||
|
d["camt"] += flt(itc_details.get((gst_category, itc_type, reverse_charge, account_head.get('cgst_account')), {}).get("amount"), 2)
|
||||||
|
d["samt"] += flt(itc_details.get((gst_category, itc_type, reverse_charge, account_head.get('sgst_account')), {}).get("amount"), 2)
|
||||||
|
d["csamt"] += flt(itc_details.get((gst_category, itc_type, reverse_charge, account_head.get('cess_account')), {}).get("amount"), 2)
|
||||||
|
|
||||||
net_itc["iamt"] += flt(d["iamt"], 2)
|
net_itc["iamt"] += flt(d["iamt"], 2)
|
||||||
|
|
||||||
d["camt"] = flt(itc_details.get((itc_type_map.get(d["ty"]), reverse_charge, account_head.get('cgst_account')), {}).get("amount"), 2)
|
|
||||||
net_itc["camt"] += flt(d["camt"], 2)
|
net_itc["camt"] += flt(d["camt"], 2)
|
||||||
|
|
||||||
d["samt"] = flt(itc_details.get((itc_type_map.get(d["ty"]), reverse_charge, account_head.get('sgst_account')), {}).get("amount"), 2)
|
|
||||||
net_itc["samt"] += flt(d["samt"], 2)
|
net_itc["samt"] += flt(d["samt"], 2)
|
||||||
|
|
||||||
d["csamt"] = flt(itc_details.get((itc_type_map.get(d["ty"]), reverse_charge, account_head.get('cess_account')), {}).get("amount"), 2)
|
|
||||||
net_itc["csamt"] += flt(d["csamt"], 2)
|
net_itc["csamt"] += flt(d["csamt"], 2)
|
||||||
|
|
||||||
for account_head in self.account_heads:
|
for account_head in self.account_heads:
|
||||||
|
itc_inelg = self.report_dict["itc_elg"]["itc_inelg"][1]
|
||||||
self.report_dict["itc_elg"]["itc_inelg"][1]["iamt"] = flt(itc_details.get(("Ineligible", "N", account_head.get("igst_account")), {}).get("amount"), 2)
|
itc_inelg["iamt"] = flt(itc_details.get(("Ineligible", "N", account_head.get("igst_account")), {}).get("amount"), 2)
|
||||||
self.report_dict["itc_elg"]["itc_inelg"][1]["camt"] = flt(itc_details.get(("Ineligible", "N", account_head.get("cgst_account")), {}).get("amount"), 2)
|
itc_inelg["camt"] = flt(itc_details.get(("Ineligible", "N", account_head.get("cgst_account")), {}).get("amount"), 2)
|
||||||
self.report_dict["itc_elg"]["itc_inelg"][1]["samt"] = flt(itc_details.get(("Ineligible", "N", account_head.get("sgst_account")), {}).get("amount"), 2)
|
itc_inelg["samt"] = flt(itc_details.get(("Ineligible", "N", account_head.get("sgst_account")), {}).get("amount"), 2)
|
||||||
self.report_dict["itc_elg"]["itc_inelg"][1]["csamt"] = flt(itc_details.get(("Ineligible", "N", account_head.get("cess_account")), {}).get("amount"), 2)
|
itc_inelg["csamt"] = flt(itc_details.get(("Ineligible", "N", account_head.get("cess_account")), {}).get("amount"), 2)
|
||||||
|
|
||||||
def prepare_data(self, doctype, tax_details, supply_type, supply_category, gst_category_list, reverse_charge="N"):
|
def prepare_data(self, doctype, tax_details, supply_type, supply_category, gst_category_list, reverse_charge="N"):
|
||||||
|
|
||||||
@ -226,20 +244,22 @@ class GSTR3BReport(Document):
|
|||||||
|
|
||||||
def set_inter_state_supply(self, inter_state_supply):
|
def set_inter_state_supply(self, inter_state_supply):
|
||||||
|
|
||||||
|
osup_det = self.report_dict["sup_details"]["osup_det"]
|
||||||
|
|
||||||
for d in inter_state_supply.get("Unregistered", []):
|
for d in inter_state_supply.get("Unregistered", []):
|
||||||
self.report_dict["inter_sup"]["unreg_details"].append(d)
|
self.report_dict["inter_sup"]["unreg_details"].append(d)
|
||||||
self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d["txval"], 2)
|
osup_det["txval"] = flt(osup_det["txval"] + d["txval"], 2)
|
||||||
self.report_dict["sup_details"]["osup_det"]["iamt"] += flt(d["iamt"], 2)
|
osup_det["iamt"] = flt(osup_det["iamt"] + d["iamt"], 2)
|
||||||
|
|
||||||
for d in inter_state_supply.get("Registered Composition", []):
|
for d in inter_state_supply.get("Registered Composition", []):
|
||||||
self.report_dict["inter_sup"]["comp_details"].append(d)
|
self.report_dict["inter_sup"]["comp_details"].append(d)
|
||||||
self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d["txval"], 2)
|
osup_det["txval"] = flt(osup_det["txval"] + d["txval"], 2)
|
||||||
self.report_dict["sup_details"]["osup_det"]["iamt"] += flt(d["iamt"], 2)
|
osup_det["iamt"] = flt(osup_det["iamt"] + d["iamt"], 2)
|
||||||
|
|
||||||
for d in inter_state_supply.get("UIN Holders", []):
|
for d in inter_state_supply.get("UIN Holders", []):
|
||||||
self.report_dict["inter_sup"]["uin_details"].append(d)
|
self.report_dict["inter_sup"]["uin_details"].append(d)
|
||||||
self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d["txval"], 2)
|
osup_det["txval"] = flt(osup_det["txval"] + d["txval"], 2)
|
||||||
self.report_dict["sup_details"]["osup_det"]["iamt"] += flt(d["iamt"], 2)
|
osup_det["iamt"] = flt(osup_det["iamt"] + d["iamt"], 2)
|
||||||
|
|
||||||
def get_total_taxable_value(self, doctype, reverse_charge):
|
def get_total_taxable_value(self, doctype, reverse_charge):
|
||||||
|
|
||||||
@ -268,7 +288,7 @@ class GSTR3BReport(Document):
|
|||||||
itc_details = {}
|
itc_details = {}
|
||||||
|
|
||||||
for d in itc_amount:
|
for d in itc_amount:
|
||||||
itc_details.setdefault((d.eligibility_for_itc, d.reverse_charge, d.account_head),{
|
itc_details.setdefault((d.gst_category, d.eligibility_for_itc, d.reverse_charge, d.account_head),{
|
||||||
"amount": d.tax_amount
|
"amount": d.tax_amount
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -315,9 +335,10 @@ class GSTR3BReport(Document):
|
|||||||
"iamt": flt(inter_state_supply_tax_mapping.get(d.place_of_supply), 2)
|
"iamt": flt(inter_state_supply_tax_mapping.get(d.place_of_supply), 2)
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d.total, 2)
|
osup_det = self.report_dict["sup_details"]["osup_det"]
|
||||||
self.report_dict["sup_details"]["osup_det"]["camt"] += flt(inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2)
|
osup_det["txval"] = flt(osup_det["txval"] + d.total, 2)
|
||||||
self.report_dict["sup_details"]["osup_det"]["samt"] += flt(inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2)
|
osup_det["camt"] = flt(osup_det["camt"] + inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2)
|
||||||
|
osup_det["samt"] = flt(osup_det["samt"] + inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2)
|
||||||
|
|
||||||
return inter_state_supply_details
|
return inter_state_supply_details
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user