Skip to content

Commit

Permalink
Merge pull request #1654 from resilient-tech/mergify/bp/version-15-ho…
Browse files Browse the repository at this point in the history
…tfix/pr-1645

chore: update pre-commit hooks to latest (backport #1645)
  • Loading branch information
mergify[bot] authored Jan 31, 2024
2 parents 7ed0dad + 0fa9799 commit 577697f
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ dec2438be2d63eff24da45d6c936ec846d8ab0df

# refactor window.ic => window.india_compliance
38a53480c70a2c820049f023cbabbdaa3ea8aad6

# updated black in pre-commit
d8c2469651974cc82a2bb50c93e22f723cbb5b42
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fail_fast: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.5.0
hooks:
- id: trailing-whitespace
files: "india_compliance.*"
Expand All @@ -16,17 +16,17 @@ repos:
- id: check-ast

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 24.1.1
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-isort, flake8-bugbear]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -950,9 +950,9 @@ def get_manually_matched_data(self, purchase_name: str, inward_supply_name: str)
reconciliation_data = [
frappe._dict(
{
"_inward_supply": inward_supplies[0]
if inward_supplies
else frappe._dict(),
"_inward_supply": (
inward_supplies[0] if inward_supplies else frappe._dict()
),
"_purchase_invoice": purchases.get(purchase_name, frappe._dict()),
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,16 @@ def get_import_history(self, return_type, date_range, for_download=True):
status = status.replace("Downloaded", "Uploaded")

_dict = {
"Classification": category.value
if return_type is ReturnType.GSTR2A
else "ALL",
"Classification": (
category.value if return_type is ReturnType.GSTR2A else "ALL"
),
"Status": status,
columns[-1]: "✅  "
+ download.last_updated_on.strftime("%d-%m-%Y %H:%M:%S")
if download
else "",
columns[-1]: (
"✅  "
+ download.last_updated_on.strftime("%d-%m-%Y %H:%M:%S")
if download
else ""
),
}
if _dict not in data[period]:
data[period].append(_dict)
Expand Down
6 changes: 3 additions & 3 deletions india_compliance/gst_india/overrides/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,9 @@ def test_invalid_gst_account_outstate(self):

def test_invalid_gst_account_instate(self):
if self.is_sales_doctype:
self.transaction_details.customer = (
self.transaction_details.party_name
) = "_Test Registered Composition Customer"
self.transaction_details.customer = self.transaction_details.party_name = (
"_Test Registered Composition Customer"
)
else:
self.transaction_details.supplier = "_Test Registered InterState Supplier"

Expand Down
6 changes: 3 additions & 3 deletions india_compliance/gst_india/utils/e_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,9 @@ def update_payment_details(self):

self.transaction_details.update(
{
"payee_name": self.sanitize_value(self.doc.company)
if paid_amount
else "",
"payee_name": (
self.sanitize_value(self.doc.company) if paid_amount else ""
),
"mode_of_payment": self.get_mode_of_payment(),
"paid_amount": paid_amount,
"credit_days": credit_days,
Expand Down
16 changes: 10 additions & 6 deletions india_compliance/gst_india/utils/e_waybill.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ def _generate_e_waybill(doc, throw=True, force=False):
return

frappe.msgprint(
_("e-Waybill generated successfully")
if result.validUpto or result.EwbValidTill
else _("e-Waybill (Part A) generated successfully"),
(
_("e-Waybill generated successfully")
if result.validUpto or result.EwbValidTill
else _("e-Waybill (Part A) generated successfully")
),
indicator="green",
alert=True,
)
Expand Down Expand Up @@ -1560,9 +1562,11 @@ def get_transaction_data(self):
self.transaction_details.update(
{
"company_gstin": REGISTERED_GSTIN,
"name": random_string(6).lstrip("0")
if not frappe.flags.in_test
else "test_invoice_no",
"name": (
random_string(6).lstrip("0")
if not frappe.flags.in_test
else "test_invoice_no"
),
}
)

Expand Down
8 changes: 5 additions & 3 deletions india_compliance/gst_india/utils/transaction_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,11 @@ def update_item_tax_details(self, item_details, item):

# considers senarios where same item is there multiple times
tax_amount = self.get_progressive_item_tax_amount(
tax_rate * item.qty
if row.charge_type == "On Item Quantity"
else tax_rate * item.taxable_value / 100,
(
tax_rate * item.qty
if row.charge_type == "On Item Quantity"
else tax_rate * item.taxable_value / 100
),
tax,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ def execute():

settings.db_set(
"generate_e_waybill_with_e_invoice",
0
if (settings.auto_generate_e_invoice and not settings.auto_generate_e_waybill)
else 1,
(
0
if (
settings.auto_generate_e_invoice
and not settings.auto_generate_e_waybill
)
else 1
),
)

0 comments on commit 577697f

Please sign in to comment.