Hide a zero discount on a NetSuite Cash Sale PDF

Wrap the complete Discount row in a FreeMarker condition, then print zero and nonzero Cash Sales through the assigned Advanced PDF template.

The quick answer

Put a FreeMarker condition around the entire Discount table row in the Advanced PDF/HTML template used by the Cash Sale form. Save the template, then print a known zero-discount sale and a separate nonzero sale. The zero case should lose the whole row; the nonzero case should keep its label and amount.

These screens show sample Cash Sales. The person and operating-company names are fictional example data. Use your own controlled transactions and template copy.

Before you start

You need Advanced PDF/HTML Templates enabled and a role allowed to inspect Cash Sales, transaction forms, and templates. Set aside two saved Cash Sales: one with a known zero discount and one with a known nonzero discount. In this example, CS-7201 has a $2,400.00 subtotal and no discount; CS-7202 has a $180.00 discount and a $2,220.00 total with no tax or other adjustments. Use a test form and a copy of the assigned template before changing the intended form. Note the original Print Template and Email Template assignments so you can restore them if validation fails.

01. Find the template used by Print

Open the zero-discount Cash Sale, note its Custom Form, and print it once. In the starting PDF, the Discount row appears with $0.00. Then open Customization → Forms → Transaction Forms, edit that form, and check its Printing Type and Print Template. The template you edit must be the one the form actually uses when you click Print.

Before the edit, the printed zero-discount Cash Sale still shows a $0.00 Discount row.
Check the form's Print Template rather than assuming the editor preview is the live print route.

02. Wrap the complete Discount row

Open Customization → Forms → Advanced PDF/HTML Templates and make a separate copy of the assigned Cash Sale template. In Source Code, find the transaction-level discount totals row. Confirm the displayed amount comes from record.discounttotal; if your template uses another field, test that same field in the condition. Keep the row's existing label and amount cells, their formatting, and the complete <tr>...</tr> together. Put this condition immediately around that row, without enclosing Subtotal, Tax Amount, or Total:

<#assign discountDigits = ((record.discounttotal!"")?string)?replace("[^0-9]", "", "r")>
<#if discountDigits?has_content && discountDigits?number != 0>
  <tr>
    <!-- Keep the existing Discount label and amount cells here. -->
  </tr>
</#if>

The digits-only value is a visibility check for the demonstrated formatted discount amount, including a parenthesized negative amount. It is not a currency parser; confirm the account's field and locale format before using it. Missing or nonnumeric-only values also hide the row, which does not prove the sale has no discount. Save in Source Code mode and preview to catch syntax errors. Avoid switching back to the visual editor and saving afterward because it can rewrite source markup. The editor's sample preview does not verify actual transaction printing.

The condition starts before the Discount row and closes after its entire table row.

03. Test both discount cases

Assign the copied template to a controlled test Cash Sale form. Verify Custom Form on each saved test transaction; assigning a form default does not change existing Cash Sales. If necessary, edit and save each test sale with the test form, then use each transaction's Print action. CS-7201 should show Subtotal, Tax Amount, and Total with no Discount row. CS-7202 should retain the complete Discount row and its ($180.00) amount. In this zero-tax example, its Total remains $2,220.00. If either result is wrong, check the active form/template pairing and the actual discount field value before rolling the change out.

Use the copied template on a test form for the first print checks.

04. Assign and check the intended form

After both test prints pass, assign the validated template copy to the intended Cash Sale form. Confirm Custom Form on both saved transactions, changing and saving it where needed, then print both again. In this recorded check, CS-7201 omits the Discount row; CS-7202 still shows Discount ($180.00) and Total $2,220.00. Check emailed output separately: the form's Email Template or an automated send route may differ from its Print Template. This change controls the printed PDF presentation; it does not recalculate the transaction discount.

The intended form's zero-discount print has Subtotal, Tax Amount, and Total, with no Discount row.
The same template keeps the nonzero Discount row and the $2,220.00 total.

Common questions

Why wrap the whole Discount row?

Hiding only the amount can leave its label, border, or blank space. Place the opening condition before the row's <tr> and close it after </tr>.

Why did my Cash Sale ignore the editor preview?

The preview uses sample data. Check the saved Cash Sale's Custom Form and that form's Print Template, then print the actual transaction. Existing Cash Sales do not switch forms merely because you change a form default.

What if the nonzero Discount row disappears too?

Confirm that the condition tests the same field the row displays, and inspect its rendered value in your account. The digits-only test is suited to the demonstrated format; missing or nonnumeric-only values also hide the row.

Does this change discount calculations or emailed PDFs?

No. It changes the printed row's visibility. The discount calculation stays on the transaction, and an emailed PDF may use a different template or route.