J-curve would like to create the Debit Memo PDF template as per given layout

Our Solution
The requirement can be achieved by customizing the advanced PDF template of the Invoice and that template can be applied to the custom Invoice form (SCG Debit Memo). So, the users can generate the print by clicking the standard print button from the Invoice record.
Field Mapping can be followed as per the given mapping file.
The “Angsana” font can be used for the content
Also, a script needs to be deployed on save of the Invoice, which will create the Invoice Total in Thai words as well as amount in English words and store it in a separate custom body field. This Amount in words can be used on the print
The layout of the PDF will be designed as below
- Header will be displayed on every page
- The item body table can be considered as the Dynamic. So, the table will be end immediately after the item’s lines
- Summary section can be added immediately after the Item table
Assumptions
- Copies need to be generated per invoice. 1 Original and 1 or 2 copy in A4 page size.
If [Invoice.custbody_scg_ar_doctype] is ใบเพิ่มหนี้ – AR, then show 2 copies
- Copy 1 is fix text “1.ต้นฉบับ สำหรับลูกค้า/ Original for Customer”
- Copy 2 is fix text “2. สำเนา สำหรับเก็บเป็นหลักฐานทางบัญชี / Copy for Accounting”
If [Invoice.custbody_scg_ar_doctype] is ใบเพิ่มหนี้ (ใบกำกับภาษี) – AR, then show 3 copies
- Copy 1 is fix text “1.ต้นฉบับ สำหรับลูกค้า/ Original for Customer”
- Copy 2 is fix text “2. สำเนา 1 สำหรับลูกค้า / Copy 1 for Customer”
- Copy 2 is fix text “3. สำเนา 2 สำหรับเก็บเป็นสำเนาใบกำกับภาษีและหลักฐานทางบัญชี / Copy 2 For Tax Invoice and Accounting”
- The header and footer section (actions 1-23 and 68- 69) will be repeated on every page if the print has multiple pages
- For field mapping 70, will populated from Employe Id of Created By custom field on invoice record.
- For field mapping 71, fixed size will be given for signature image. We assume that all signatures will be in same size.
- The amount format is comma-separated.
- The Thai words/Labels will be provided by the JCurve Solutions Limited and we can hard code the Thai labels in the print.
- The font style should be Angsana and the font size should be the same as the file provided by the client.
- The field sourcing will be done based on the file that is provided by the client and we assume all the fields are available in Netsuite account
- The date format should be same as in the given sample print
Risks
- We can get data only from the current record and the next join record such as Subsidiary and Entity. If any data needs to be populated from record with more than one join/from item record, then that needs to be populated to a custom field on the corresponding transaction by sourcing or scripting. This is not included in the current scope
- If document has more than 1 page, Total will show only in the last page
- The withholding Tax in mapping no. 44, will be shown within bracket as per sample even if the withholding tax is positive value. It will show 0.00 if it has no value
- The item table will end immediately after the item lines and will begin the summary table (31-67,70,71)
- The contents in the summary part (31-67,70,71) may break into multiple pages due to the long content.

The summary section will split into 3 sections such as 31 to 48, 49 to 65, and 66 to 67, 70 ,71. So, here the page break will be done accordingly
Horizontal lines above mapping no. 31, 49, and 66 will be displayed along with Summary part 1, 2, and 3 respectively. So, if the 2nd or 3rd summary part is moving to a new page, then the Horizontal line above the corresponding section will be displayed on the new page along with the data on that section.

The horizontal line will not be displayed if the page starts with item lines (if item itself requires multiple pages)