-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: New GST Category
Input Service Distributor
Introduced (#2555)
* fix: new gst category introduced * fix: update usage of ISD at other places * fix: update usage of ISD at other places * fix: update classification for purchase reco tool * fix: warning for users already using ISD classification * fix: show notification conditionally --------- Co-authored-by: Smit Vora <smitvora203@gmail.com> Co-authored-by: Smit Vora <mailsmitvora@gmail.com> (cherry picked from commit 6635a91)
- Loading branch information
1 parent
9a475b4
commit c0b41a4
Showing
10 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
19 changes: 19 additions & 0 deletions
19
india_compliance/patches/v15/set_default_for_new_gst_category_notification.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,19 @@ | ||
import frappe | ||
import frappe.defaults | ||
from frappe.utils.user import get_users_with_role | ||
|
||
|
||
def execute(): | ||
if not frappe.db.exists("Company", {"country": "India"}): | ||
return | ||
|
||
# Users affected by creation of new GST category | ||
if not frappe.db.exists( | ||
"Purchase Invoice", {"itc_classification": "Input Service Distributor"} | ||
): | ||
return | ||
|
||
for user in get_users_with_role("Accounts Manager"): | ||
frappe.defaults.set_user_default( | ||
"needs_new_gst_category_notification", 1, user=user | ||
) |
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
31 changes: 31 additions & 0 deletions
31
india_compliance/public/js/new_gst_category_notification.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,31 @@ | ||
$(document).on("app_ready", async function () { | ||
if (!frappe.boot.needs_new_gst_category_notification) return; | ||
|
||
// let other processes finish | ||
await new Promise(resolve => setTimeout(resolve, 700)); | ||
const d = frappe.msgprint({ | ||
title: __("New GST Category Introduced"), | ||
indicator: "orange", | ||
message: __( | ||
`Dear India Compliance User, | ||
<br><br> | ||
We would like to inform you about an important update regarding the GST category for Input Service Distributors (ISD). | ||
<br><br> | ||
Previously, <strong>ISD was categorized under Registered Regular</strong> in our system. However, we have now introduced a dedicated GST category <strong>Input Service Distributor</strong> specifically for Input Service Distributors. | ||
<br><br> | ||
<strong>Action Required:</strong> | ||
<br> | ||
If you have been using the ISD under the <strong>Registered Regular</strong> GST category, please update your records to reflect the new <strong>Input Service Distributor</strong> category. | ||
` | ||
), | ||
}); | ||
|
||
d.onhide = () => { | ||
frappe.xcall( | ||
"india_compliance.gst_india.utils.disable_new_gst_category_notification" | ||
); | ||
}; | ||
}); |