-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
262 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
35 changes: 35 additions & 0 deletions
35
india_compliance/gst_india/report/itc_04_beta/itc_04_beta.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2024, Resilient Tech and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.query_reports["ITC-04 Beta"] = { | ||
filters: [ | ||
{ | ||
fieldname: "company", | ||
label: "Company", | ||
fieldtype: "Link", | ||
options: "Company", | ||
}, | ||
{ | ||
fieldname: "company_gstin", | ||
label: "Company GSTIN", | ||
fieldtype: "Data", | ||
}, | ||
{ | ||
fieldname: "from_date", | ||
label: "From Date", | ||
fieldtype: "Date", | ||
}, | ||
{ | ||
fieldname: "to_date", | ||
label: "To Date", | ||
fieldtype: "Date", | ||
}, | ||
{ | ||
fieldname: "category", | ||
label: "Invoice Category", | ||
fieldtype: "Select", | ||
options: ["", "Table 4", "Table 5A"], | ||
reqd: 1 | ||
}, | ||
], | ||
}; |
50 changes: 50 additions & 0 deletions
50
india_compliance/gst_india/report/itc_04_beta/itc_04_beta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"add_total_row": 0, | ||
"columns": [], | ||
"creation": "2024-08-07 16:20:53.275110", | ||
"disabled": 0, | ||
"docstatus": 0, | ||
"doctype": "Report", | ||
"filters": [], | ||
"idx": 0, | ||
"is_standard": "Yes", | ||
"letterhead": null, | ||
"modified": "2024-08-07 16:20:53.275110", | ||
"modified_by": "Administrator", | ||
"module": "GST India", | ||
"name": "ITC-04 Beta", | ||
"owner": "Administrator", | ||
"prepared_report": 0, | ||
"ref_doctype": "Item", | ||
"report_name": "ITC-04 Beta", | ||
"report_type": "Script Report", | ||
"roles": [ | ||
{ | ||
"role": "Item Manager" | ||
}, | ||
{ | ||
"role": "Stock Manager" | ||
}, | ||
{ | ||
"role": "Stock User" | ||
}, | ||
{ | ||
"role": "Sales User" | ||
}, | ||
{ | ||
"role": "Purchase User" | ||
}, | ||
{ | ||
"role": "Maintenance User" | ||
}, | ||
{ | ||
"role": "Accounts User" | ||
}, | ||
{ | ||
"role": "Manufacturing User" | ||
}, | ||
{ | ||
"role": "Desk User" | ||
} | ||
] | ||
} |
175 changes: 175 additions & 0 deletions
175
india_compliance/gst_india/report/itc_04_beta/itc_04_beta.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
# Copyright (c) 2024, Resilient Tech and contributors | ||
# For license information, please see license.txt | ||
from india_compliance.gst_india.utils.itc_04.itc_04_data import ITC04Query | ||
|
||
|
||
def execute(filters=None): | ||
if not filters: | ||
filters = {} | ||
|
||
_class = ITC04Query(filters) | ||
data = [] | ||
|
||
if filters.category == "Table 4": | ||
columns = get_columns_table_4() | ||
data = _class.get_query_table_4_se().run(as_dict=True) | ||
data.extend(_class.get_query_table_4_sr().run(as_dict=True)) | ||
else: | ||
columns = get_columns_table_5A() | ||
data = _class.get_query_table_5A_se().run(as_dict=True) | ||
data.extend(_class.get_query_table_5A_sr().run(as_dict=True)) | ||
|
||
return columns, data | ||
|
||
|
||
def get_common_columns(): | ||
return [ | ||
{ | ||
"fieldname": "company_gstin", | ||
"label": "Company GSTIN", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "posting_date", | ||
"label": "Posting Date", | ||
"fieldtype": "Date", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "invoice_no", | ||
"label": "Invoice No (Challan No)", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "supplier", | ||
"label": "Supplier", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "gst_category", | ||
"label": "GST Category", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "supplier_gstin", | ||
"label": "Supplier GSTIN", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "place_of_supply", | ||
"label": "Destination of Supply", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "is_return", | ||
"label": "Is Return", | ||
"fieldtype": "Check", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "item_code", | ||
"label": "Item Code", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "gst_hsn_code", | ||
"label": "HSN Code", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "uom", | ||
"label": "UOM", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "gst_treatment", | ||
"label": "GST Treatment", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "qty", | ||
"label": "Qty", | ||
"fieldtype": "Float", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "item_type", | ||
"label": "Item Type (Input/Capital Goods)", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
] | ||
|
||
|
||
def get_columns_table_4(): | ||
return get_common_columns() + [ | ||
{ | ||
"fieldname": "taxable_value", | ||
"label": "Taxable Value", | ||
"fieldtype": "Currency", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "gst_rate", | ||
"label": "GST Rate", | ||
"fieldtype": "Percent", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "cgst_amount", | ||
"label": "CGST Amount", | ||
"fieldtype": "Currency", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "sgst_amount", | ||
"label": "SGST Amount", | ||
"fieldtype": "Currency", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "igst_amount", | ||
"label": "IGST Amount", | ||
"fieldtype": "Currency", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "total_cess_amount", | ||
"label": "Total Cess Amount", | ||
"fieldtype": "Currency", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "total_tax", | ||
"label": "Total Tax", | ||
"fieldtype": "Currency", | ||
"width": 180, | ||
}, | ||
{ | ||
"fieldname": "total_amount", | ||
"label": "Total Amount", | ||
"fieldtype": "Currency", | ||
"width": 180, | ||
}, | ||
] | ||
|
||
|
||
def get_columns_table_5A(): | ||
return [ | ||
{ | ||
"fieldname": "original_challan_no", | ||
"label": "Original Challan No", | ||
"fieldtype": "Data", | ||
"width": 180, | ||
}, | ||
] + get_common_columns() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters