Address lines, city, county and state are translatable (Property Setters), so the Address form offers a translate button that stores the other language as a Translation record. The Thailand Address Template renders those fields through _(), and the print formats re-render party addresses from the linked Address with get_print_address instead of printing the stored address_display, which is frozen in the language of whoever saved the document. The letter head already rendered the company address at print time. The withholding tax certificate takes the Thai translation whatever the print language, like its tax in words.
2.7 KiB
Default Thai Company
Default Company Settings
Installation
You can install this app using the bench CLI:
cd $PATH_TO_YOUR_BENCH
bench get-app $URL_OF_THIS_REPO --branch develop
bench install-app default_thai_company
Thai language
Every string the app adds (custom field labels, messages, print format and letter head
text, Tax Withholding Category names) is translated in translations/th.csv; the same
file overrides the upstream Thai for the standard labels the print formats show. The
print formats embed Sarabun (public/fonts, OFL) so PDFs render Thai on servers
without a Thai system font. Switch a user or the print language to th to use it.
Addresses in more than one language
Address lines, city, county and state are translatable: the Address form shows a translate
button next to each, which stores the other language in a Translation record. The Thailand
Address Template renders those fields through _(), so the print formats and letter head
show the company's and the party's address in the document's print language (the company
address is re-rendered at print time; party addresses are re-rendered from the linked
Address instead of printing the stored address_display). The withholding tax certificate
always takes the Thai translation. Translations are keyed on the exact text, so one
translation of a city or province serves every address that uses it.
Withholding tax certificate
A paid Purchase Invoice with Apply Tax Withholding Amount gets a Withholding Tax Certificate
button that downloads the Revenue Department's Sec. 50 bis form (หนังสือรับรองการหักภาษี ณ ที่จ่าย,
two copies) as a PDF: the Withholding Tax Certificate print format lays the invoice's data
over the official form (public/images). The row the payment is reported on comes from
Type of Income Paid on the Tax Withholding Category (set for the shipped categories; pick it
for your own), and the ภ.ง.ด. return is ticked from the Supplier's type: ภ.ง.ด.53 for juristic
payees, ภ.ง.ด.1ก / 2 / 3 by income type for individuals. เล่มที่ / เลขที่ (certificate book
numbers) and ลำดับที่ (the line in the return) are left for the accountant.
Contributing
This app uses pre-commit for code formatting and linting. Please install pre-commit and enable it for this repository:
cd apps/default_thai_company
pre-commit install
Pre-commit is configured to use the following tools for checking and formatting your code:
- ruff
- eslint
- prettier
- pyupgrade
License
gpl-3.0