Skip to content

Commit

Permalink
fix: rename report to ICUtility
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanket322 committed Aug 10, 2024
1 parent fb9bae3 commit 9c6e411
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ frappe.ui.form.on("Purchase Reconciliation Tool", {
await frappe.require("purchase_reconciliation_tool.bundle.js");
frm.trigger("company");
frm.doc.__reconciliation_data = null;
set_date_range_description(frm);
add_gstr2b_alert(frm);
set_date_range_description(frm);
setup_filter_onchange_events(frm);
frm.purchase_reconciliation_tool = new PurchaseReconciliationTool(frm);

Expand All @@ -106,15 +106,15 @@ frappe.ui.form.on("Purchase Reconciliation Tool", {
});

frappe.realtime.on("data_reconciliation", message => {
const { data, filters, creation, report_name} = message;
const { data, filters, creation, report_name } = message;

frm.report_name = report_name
frm.is_latest_data = true
frm.report_name = report_name;
frm.is_latest_data = true;

const same_filter = filter_fields.every(
const is_filter_same = filter_fields.every(
field => frm.doc[field] === filters[field]
);
if (!same_filter) return;
if (!is_filter_same) return;

frappe.after_ajax(() => {
frm.doc.__reconciliation_data = JSON.stringify(
Expand Down Expand Up @@ -166,11 +166,11 @@ frappe.ui.form.on("Purchase Reconciliation Tool", {
method: "frappe.core.doctype.prepared_report.prepared_report.get_reports_in_queued_state",
args: {
filters: filetrs_to_pass,
report_name: "Purchase Reconciliation Tool",
report_name: "ICUtility",
},
});
if (message.length) {
frappe.msgprint("A report is alerady in queued");
frappe.msgprint(__("A report is alerady in queued"));
return;
}
frm.call("generate_reconciliation_data", {
Expand Down Expand Up @@ -298,7 +298,9 @@ frappe.ui.form.on("Purchase Reconciliation Tool", {
setTimeout(() => {
frm.dashboard.clear_headline();
}, 2000);
frm.save();
frm.call("generate_reconciliation_data", {
force_update: true,
});
}, 1000);
}
});
Expand Down Expand Up @@ -1127,13 +1129,13 @@ class DetailViewDialog {
}
}

update_report_status(){
if(this.frm.is_latest_data == false) return;
update_report_status() {
if (this.frm.is_latest_data == false) return;
frappe.call({
method: "india_compliance.gst_india.doctype.purchase_reconciliation_tool.purchase_reconciliation_tool.update_report_filters",
args : { report_name : this.frm.report_name },
})
this.frm.is_latest_data = false
args: { report_name: this.frm.report_name },
});
this.frm.is_latest_data = false;
}

_get_button_css(action) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def generate_reconciliation_data(self, force_update=False):

def reconcile(self, force_update=False):
doc_name = get_completed_prepared_report(
self.get_reco_doc(), frappe.session.user, "Purchase Reconciliation Tool"
self.get_reco_doc(), frappe.session.user, "ICUtility"
)
if doc_name and not force_update:
self.attachment_data(doc_name)
else:
make_prepared_report("Purchase Reconciliation Tool", self.get_reco_doc())
make_prepared_report("ICUtility", self.get_reco_doc())

@frappe.whitelist()
def attachment_data(self, name):
Expand All @@ -91,14 +91,16 @@ def attachment_data(self, name):
"attached_to_doctype": "Prepared Report",
},
)

self.reconciliation_data = None
self.file_name = None

if attachments:
attached_file = frappe.get_doc("File", attachments[0].name)
self.reconciliation_data = frappe.parse_json(
frappe.safe_decode(gzip.decompress(attached_file.get_content()))
)
self.file_name = attachments[0].name
else:
self.reconciliation_data = None

frappe.publish_realtime(
"data_reconciliation",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024, Resilient Tech and contributors
// For license information, please see license.txt

frappe.query_reports["Purchase Reconciliation Tool"] = {
frappe.query_reports["ICUtility"] = {
"filters": [

]
Expand Down
33 changes: 33 additions & 0 deletions india_compliance/gst_india/report/icutility/icutility.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2024-08-07 15:29:53.228497",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"letter_head": "",
"letterhead": null,
"modified": "2024-08-07 15:31:18.427400",
"modified_by": "Administrator",
"module": "GST India",
"name": "ICUtility",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Purchase Reconciliation Tool",
"report_name": "ICUtility",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
},
{
"role": "Accounts Manager"
},
{
"role": "Accounts User"
}
]
}

This file was deleted.

0 comments on commit 9c6e411

Please sign in to comment.