{#- หนังสือรับรองการหักภาษี ณ ที่จ่าย (Sec. 50 bis certificate) for a Purchase Invoice. The Revenue Department's fillable form (approve_wh3_081156.pdf, A4 = 595 x 842 pt) is the page background; every value sits in the rectangle of the corresponding AcroForm field, given here as the PDF's (x0, y0, x1, y1) with the origin at the bottom-left so the numbers can be checked against the form. Two identical copies are printed: copy 1 goes with the payee's tax return, copy 2 is the payee's record. -#} {%- set c = get_withholding_certificate(doc) -%} {%- set rows = { "1": {"date": (327, 533, 403, 546), "pay": (411, 533, 490, 547), "tax": (496, 534, 560, 547)}, "2": {"date": (328, 519, 403, 533), "pay": (410, 520, 489, 534), "tax": (496, 519, 560, 532)}, "3": {"date": (328, 504, 403, 518), "pay": (411, 504, 490, 517), "tax": (496, 504, 560, 517)}, "4a": {"date": (328, 490, 403, 505), "pay": (412, 490, 491, 504), "tax": (496, 490, 560, 503)}, "4b": {"date": (328, 402, 404, 416), "pay": (410, 403, 489, 417), "tax": (497, 403, 562, 416)}, "5": {"date": (327, 216, 403, 230), "pay": (409, 216, 489, 230), "tax": (496, 215, 561, 230)}, "6": {"date": (327, 199, 403, 213), "pay": (409, 199, 489, 213), "tax": (496, 198, 561, 213)}, } -%} {%- set pnd_boxes = { "1": (209, 603, 222, 615), "2": (395, 602, 407, 615), "3": (471, 602, 484, 615), "53": (395, 584, 407, 597), } -%} {#- Left edges of the printed 13-digit ID boxes (12 pt wide, grouped 1-4-5-2-1), measured on the form; the AcroForm comb field does not line up with them. -#} {%- set id_cells = (375, 393, 405, 417, 429, 447.5, 459.5, 471.5, 483.5, 495.5, 513.5, 525.5, 545) -%} {%- macro box(rect, text, align="left", size=10) -%}
{%- if doc.docstatus == 0 %}