feat: Bank Fee expense account for every Thai company
Thai banks charge transfer and collection fees that customers net off their payments and that the bank nets off ours; Payment Entry books them as deductions, which need an expense account. The Standard chart has none, so every Thai company gets "Bank Fee" under Indirect Expenses (Company.on_update, after_install and a patch for existing sites).
This commit is contained in:
1 parent
6dd557ee97
commit
b4c7274dce
5 files changed
+34
No files matched your search
@@ -0,0 +1,25 @@
|
||||
from default_thai_company.tax_withholding import company_ready, get_or_create_account, thai_companies
|
||||
|
||||
# Thai banks charge transfer and collection fees that customers net off their
|
||||
# payments and that the bank nets off ours; Payment Entry books them as
|
||||
# deductions, which need an expense account. The Standard chart has none, so
|
||||
# every Thai company gets one under Indirect Expenses.
|
||||
BANK_FEE_ACCOUNT = "Bank Fee"
|
||||
BANK_FEE_ACCOUNT_GROUPS = ("Indirect Expenses", "Expenses")
|
||||
|
||||
|
||||
def ensure_bank_fee_account(company):
|
||||
return get_or_create_account(company, BANK_FEE_ACCOUNT, "Expense", "", BANK_FEE_ACCOUNT_GROUPS)
|
||||
|
||||
|
||||
def setup_company(doc, method=None):
|
||||
"""Company.on_update: Bank Fee account for a Thai company."""
|
||||
if company_ready(doc):
|
||||
ensure_bank_fee_account(doc.name)
|
||||
|
||||
|
||||
def setup_companies():
|
||||
"""after_install and the create_bank_fee_accounts patch: companies that
|
||||
exist before this code did never pass through `setup_company`."""
|
||||
for company in thai_companies():
|
||||
ensure_bank_fee_account(company)
|
||||
@@ -157,6 +157,7 @@ after_install = [
|
||||
"default_thai_company.vat.setup_companies",
|
||||
"default_thai_company.shipping.setup_companies",
|
||||
"default_thai_company.payroll.setup_companies",
|
||||
"default_thai_company.banking.setup_companies",
|
||||
]
|
||||
# Fixture import re-inserts the Location tree; restore lft/rgt for user-added nodes.
|
||||
after_migrate = "default_thai_company.assets.rebuild_locations"
|
||||
@@ -234,6 +235,7 @@ doc_events = {
|
||||
"default_thai_company.assets.setup_company",
|
||||
"default_thai_company.shipping.setup_company",
|
||||
"default_thai_company.payroll.setup_company",
|
||||
"default_thai_company.banking.setup_company",
|
||||
],
|
||||
},
|
||||
# HRMS doctype; the hook only fires on sites that have it.
|
||||
|
||||
@@ -9,3 +9,4 @@ default_thai_company.patches.create_vat_templates
|
||||
default_thai_company.patches.create_shipping_rules
|
||||
default_thai_company.patches.create_payroll_periods
|
||||
default_thai_company.patches.setup_salary_components
|
||||
default_thai_company.patches.create_bank_fee_accounts
|
||||
@@ -0,0 +1,5 @@
|
||||
from default_thai_company.banking import setup_companies
|
||||
|
||||
|
||||
def execute():
|
||||
setup_companies()
|
||||
@@ -79,6 +79,7 @@ Salary Deductions,รายการหักจากเงินเดือ
|
||||
Social Security,ประกันสังคม
|
||||
Social Security Payable,ประกันสังคมค้างจ่าย
|
||||
Social Security Fund contribution (Sec. 33 employee),เงินสมทบกองทุนประกันสังคม (ผู้ประกันตนมาตรา 33)
|
||||
Bank Fee,ค่าธรรมเนียมธนาคาร
|
||||
Withholding Tax Receivable,ภาษีถูกหัก ณ ที่จ่าย
|
||||
Output VAT,ภาษีขาย
|
||||
Input VAT,ภาษีซื้อ
|
||||
|
||||
|
Reference in new issue
Block a user