Commit Graph
15 Commits
Author SHA1 Message Date
kurogeek f0961de744 feat: customer contact column on Default Standard Sales Invoice
- Split the Customer block into two columns: name / address / tax id on
  the left, contact person with phone, mobile and email on the right
  (only when the invoice has a contact person; phone read from Contact)
- Thailand Address Template: drop the blank line between the address and
  the phone / fax / email lines
2026-09-14 09:42:27 +00:00
kurogeek dc8509d6d7 feat: tidy Default Standard Sales Invoice layout
- Hide Total Quantity, Update Billed Amount in Delivery Note, Amount
  Eligible for Commission and Company Tax ID (already in the letterhead)
- Move Posting Date / Payment Due Date into the print heading, right-aligned
- Add a Customer block (name, address, contact, tax id) under the heading
- Render Total (Without Tax) in the same right-half grid as Taxes / Totals
- Put In Words in the empty left column of Totals, level with Grand Total
- Print Format CSS: one 1.8 line-height rhythm with no row margins, 5px
  letterhead margin, 5px margins around the item table
2026-09-14 08:57:08 +00:00
kurogeek 2d93fe45c2 fix: get_payment_entry override rejected request-only args
frappe.call filters kwargs to the target signature; the *args/**kwargs
wrapper accepted 'cmd' and forwarded it to ERPNext's function. Mirror
the original signature.
2026-09-13 07:59:49 +00:00
kurogeek 9b99be9abd feat: apply customer withholding automatically on new receipts
Tick Apply Tax Withholding Amount on unsaved customer receipts whose
references include a Sales Invoice carrying withholding: in the
get_payment_entry override (Create > Payment), in the
allocate_amount_to_references doc method (Get Outstanding Invoices /
Paid Amount changes, so the tax row updates live) and on first save.
Saved entries keep the user's choice; unticking now removes the row.
Client script recomputes the row when the checkbox or category changes.
2026-09-13 07:56:21 +00:00
kurogeek 6a082edc56 fix: post customer withholding as a Deduct tax row, not a deduction
With a deduction row ERPNext treats Paid Amount as cash received and
credits the party for paid + deduction, so a gross Paid Amount (what Get
Outstanding Invoices fills) over-credited Debtors and posted the gross
to the bank. Use the taxes table with add_deduct_tax=Deduct like
supplier TDS: Paid Amount is the gross settlement, bank receives paid
minus withholding, receivable is debited. Override Payment Entry
build_gl_map to flag the bank entry post_net_value so the merged bank
line shows the net amount.
2026-09-13 07:45:11 +00:00
kurogeek abeb2af0c8 refactor: ship Custom Fields and Property Setters as module customizations
Move the Sales Invoice withholding fields and both Property Setters from
fixtures to default_thai_company/custom/{sales_invoice,payment_entry}.json
with sync_on_migrate. sync_customizations updates Custom Fields in place
instead of the delete/re-insert that fixtures do on every migrate.
2026-09-12 13:13:49 +00:00
kurogeek ed4062590a feat: show expected withholding tax on Sales Invoice
Custom fields Tax Withholding Category (fetched from Customer),
Withholding Tax and Net Payable After Withholding Tax on Sales Invoice;
computed in the Thai set_tax_withholding override from the category
rate and single threshold, informational only (totals/GL unchanged),
printed under Rounded Total by the standard layout. Payment Entry now
prefers each invoice's category over the customer's.
2026-09-11 10:20:03 +00:00
kurogeek 4767d4bb46 test: withholding tax accounts, fixture re-import, and customer receipts
Integration tests on a throwaway Thai company: account creation and
category linking on Company insert, site-configured account surviving
fixture re-import, Sales Invoice left un-grossed, and Payment Entry
deductions (full, prorated, below threshold, unchecked). Run with
CI=1 bench --site <site> run-tests --app default_thai_company.
2026-09-11 10:09:01 +00:00
kurogeek 6819242521 feat: customer-side withholding tax on Payment Entry
Thai customers withhold tax at payment; ERPNext's customer-side handling
is Indian TCS which adds tax on top of the Sales Invoice. Override
SalesInvoice.set_tax_withholding to no-op for Thai companies, expose
"Apply Tax Withholding Amount" on Customer/Receive Payment Entries, and
on validate compute rate x pre-VAT amount of each allocated reference
(prorated, single threshold honoured) as a deduction to "Withholding Tax
Receivable". Client script fetches the Customer's category when the box
is ticked.
2026-09-11 10:00:24 +00:00
kurogeek 8b3cf9af1e feat: Thai Tax Withholding Category fixtures with per-company accounts
Add 22 Tax Withholding Category fixtures covering Thailand domestic
withholding (Taw.Paw. 4/2528, Sec. 50(2), Sec. 70) with rates and
thresholds. Fixtures ship without accounts; on import each Thai company
gets "Withholding Tax Payable" (Liability) and "Withholding Tax
Receivable" (Asset) created and the payable account linked. Company
on_update does the same for companies created later. Site-configured
accounts survive fixture re-import on migrate.
2026-09-11 09:13:45 +00:00
kurogeek 8d3b843da8 default Sales Invoice Print Format 2026-09-11 15:35:06 +07:00
kurogeek c82666d563 feat: default letter head 2026-09-10 10:45:22 +07:00
kurogeek d081af7ece package.json 2026-09-01 17:20:43 +07:00
kurogeek ecc2a1445c add yarn.lock 2026-09-01 16:34:04 +07:00
kurogeek 43416a2433 feat: Initialize App 2026-09-01 16:01:23 +07:00