-
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: ITC Classification Refactor for GST Purchase Register Report (#2557
) <sub><a href="https://huly.app/guest/resilienttech?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsaW5rSWQiOiI2NmM4MjhmZDhjMmMxOTBhN2E1YWRhNmQiLCJndWVzdCI6InRydWUiLCJlbWFpbCI6IiNndWVzdEBoYy5lbmdpbmVlcmluZyIsIndvcmtzcGFjZSI6Inctc21pdHZvcmEyMDMtcmVzaWxpZW50dGVjLTY2N2U0MjkxLWEwNWMwNjY4N2EtNjM4MjY3IiwicHJvZHVjdElkIjoiIn0.QCr1VM9atI846CC1t3JpHzs8jP1iI9dbKKRPlEg1ldo">Huly®: <b>IC-2675</b></a></sub> (cherry picked from commit c099283)
- Loading branch information
1 parent
e325d23
commit 6eb2fc4
Showing
8 changed files
with
118 additions
and
18 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
60 changes: 60 additions & 0 deletions
60
india_compliance/gst_india/overrides/test_purchase_invoice.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,60 @@ | ||
import frappe | ||
from frappe.tests.utils import FrappeTestCase, change_settings | ||
from erpnext.accounts.doctype.account.test_account import create_account | ||
|
||
from india_compliance.gst_india.utils.tests import append_item, create_purchase_invoice | ||
|
||
|
||
class TestPurchaseInvoice(FrappeTestCase): | ||
@change_settings("GST Settings", {"enable_overseas_transactions": 1}) | ||
def test_itc_classification(self): | ||
pinv = create_purchase_invoice( | ||
supplier="_Test Foreign Supplier", | ||
do_not_submit=1, | ||
item_code="_Test Service Item", | ||
) | ||
self.assertEqual(pinv.itc_classification, "Import Of Service") | ||
|
||
append_item(pinv) | ||
pinv.save() | ||
self.assertEqual(pinv.itc_classification, "Import Of Goods") | ||
|
||
pinv = create_purchase_invoice( | ||
supplier="_Test Registered Supplier", | ||
is_reverse_charge=1, | ||
do_not_submit=1, | ||
) | ||
self.assertEqual(pinv.itc_classification, "ITC on Reverse Charge") | ||
|
||
pinv.is_reverse_charge = 0 | ||
pinv.save() | ||
self.assertEqual(pinv.itc_classification, "All Other ITC") | ||
|
||
company = "_Test Indian Registered Company" | ||
account = create_account( | ||
account_name="Unrealized Profit", | ||
parent_account="Current Assets - _TIRC", | ||
company=company, | ||
) | ||
|
||
frappe.db.set_value( | ||
"Company", company, "unrealized_profit_loss_account", account | ||
) | ||
pinv = create_purchase_invoice( | ||
supplier="Test Internal with ISD Supplier", | ||
qty=-1, | ||
is_return=1, | ||
) | ||
self.assertEqual(pinv.itc_classification, "Input Service Distributor") | ||
|
||
pinv = create_purchase_invoice( | ||
supplier="_Test Foreign Supplier", | ||
do_not_save=1, | ||
is_reverse_charge=1, | ||
) | ||
|
||
self.assertRaisesRegex( | ||
frappe.exceptions.ValidationError, | ||
"Reverse Charge is not applicable on Import of Goods", | ||
pinv.save, | ||
) |
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