Adding Fields to Custom SCIS Receipt Templates

This topic applies to

Applies to

SuiteCommerce InStore

You can add transaction fields to the receipt templates you use in SuiteCommerce InStore (SCIS). To add a field that does not already appear on a receipt, you must first modify the CustomConfiguration.js file. Next, modify your custom receipt template, adding the field to the receipt template code.

To add a field to a receipt template:

  1. Modify the CustomConfiguration.js file. Add the following code snippet, including the field you want to add inside the corresponding array. You can add more than one field to your custom receipt template. Note the following example, which includes various fields added for display on the receipt template:

    // Add custom fields to show in receipt
    customMappingFields: {
    //Define extra fields in the order
    order: ['ismultishipto'],
    //Define extra fields in the creditmemo
    creditMemo: ['billcountry'],
    //Define extra fields in the lines of the order
    line: ['itemtype'],
    //Define extra fields in the lines of the creditmemo
    creditMemoline: ['printitems']
    },

    Note

    All field types are supported except fields of type Select.


    View the SuiteScript Records Browser to see a complete list of the fields you can add to each array. Note the following:

    • For order, the supported fields are listed in the SuiteScript records browser, under Cash Sale. Only objects listed under Fields are supported.

    • For creditMemo, the supported fields are listed in the SuiteScript records browser, under Credit Memo. Only objects listed under Fields are supported.

    • For line, the supported fields are listed in the SuiteScript records browser, under Cash Sale. Only objects listed under item-Items are supported.

    • For creditMemoLine, the supported fields are listed in the SuiteScript records browser, under Credit Memo. Only objects listed under item-Items are supported. Also note that only and/or operations are supported.

    • A custom field can be placed in any of the following arrays: order, creditMemo, line, or creditMemoLine.

  2. Save your changes to the CustomConfiguration.js file.

  3. Modify your custom SCIS Receipt Template.

    1. Go to Customization > Forms > Advanced PDF/HTML Templates.

    2. Click Edit next to the custom SCIS Receipt Template you want to modify.

      Important

      Do not modify the default SCIS Receipt Templates, because these templates may be overwritten during periodic SuiteApp updates.


    3. Add lines to the receipt template code to display additional fields. Refer to the following examples:

      //Show an additional field on the order
      Multiship: ${JSON.customExtraFields.ismultishipto}
       
      //Show an additional field on the creditmemo
      Country: ${JSON.creditmemo.customExtraFields.billcountry}
       
      //Show an additional field on the line
      <#list JSON.lines as line>
                    Type: ${line.customExtraFields.itemtype}
      </#list> 

      For more information, read JSON Object Field Mapping.

  4. Go to Customization > Lists, Records, & Fields > Record Types.

  5. Find SCIS Receipt Templates in the list, and click New Record.

  6. Create a new SCIS Receipt Template with the new custom template selected.

  7. Click Save.

JSON Object Field Mapping

To generate the receipt template, SCIS includes logic that gets data from a global JSON object. The following bulleted list provides a high-level description of the structure. Use the following information as a guide to get the fields you require:

  • creditmemo (object)

    • lines (array)

      • customExtraFields (array)

        If you want to get a field that you defined in the creditMemoline array, you can get that field from the creditmemo object (in the lines array, in customExtraFields . )

    • customExtraFields (array)

      If you want to get a field that you defined in the creditMemo array, you can get that field from the customExtraFields array, in the creditmemo object.

  • customExtraFields (array)

    If you want to get a field that you defined in the order array, you need to get that field from the customExtraFields array.

  • lines (array)

    • customExtraFields (array)

      If you want to get a field that you defined on the line array, you need to get that field from the customExtraFields array in the lines array.

JSON Object Data for SCIS Receipt Templates

The following tables describe the global JSON object included in receipt templates, as well as other objects included in the global object. For your convenience, some fields are exposed here that you can also access through the existing SuiteScript API.

Object Name

Object Type

Description

createddate

String

Date that was created the order. Format MM/DD/YYYY HH:mm

creditmemo

JSON object

Order summary information, such as total amount, discounts, and tax amount and lines of a credit memo

customer

JSON object

Customer assigned to the order.

customExtraFields

JSON object

Additional fields on the custom receipt template form. For more information, read JSON Object Field Mapping.

includeTaxInPrices

Boolean

Flag to indicate when the prices have tax included.

internalid

String

Internal ID for the transaction record.

labels

JSON object

Translated text that appears in the default template.

lines

Array of objects

Lines added to the order, each line contain an item.

line

JSON object

Contains information about each line item on an order.

location

JSON object

Current location from the employee.

Location information from the employee record.

operation

String

Type of order. Possible values [ "Suspend" | "Exchange" | "Return" | "Purchase" ]

payments

Array of objects

Payments made to the order.

payment

JSON object

Contains information about the payment associated with the order.

posStatus

String

Status of the order, mapped from the POS Status field. A numeric ID is displayed for each status value:

  • 1 - Open

  • 2 - Tendering

  • 3 - Closed

  • 4 - Suspended

  • 5 - Canceled

  • 6 - partially returned

  • 7 - returned

  • 8 - tendering and suspended

receiptType

String

Possible value ["purchase"].

recordtype

String

Contains the transaction record type. Possible values are, ["cashsale" | "invoice" | "creditmemo"].

returnType

String

Contains the type of return transaction. Possible values are [ "unvalidated" | "validated" ].

salesassoc

JSON object

Sales associate assigned to the order.

status

String

Contains the status of the order transaction. Possible values [ "open" | "paidInFull"].

subsidiary

JSON object

Subsidiary assigned to the employee record.

summary

JSON object

Order summary information, such as total amount, discounts, and tax amount.

taxes

Array of objects

Contains an array of tax Objects grouped by rate, it is added to the order summary and creditmemo summary. 

tax

JSON object

Contains information about the tax charged on an order.

templateId

String

Internal ID of the receipt template record.

urlLogo

String

URL for company logo.

creditmemo

This object only exists if the recordtype is invoice.

Object Name

Object Type

Description

customer

JSON object

Customer assigned to the credit memo.

customExtraFields

JSON object

Additional fields on the custom receipt template form. For more information, read JSON Object Field Mapping.

discountitem

JSON object

Global discount applied of the creditmemo

entity

String

Customer Name as it appears in NetSuite, for example, 3832 John Smith.

internalid

String

ID for the transaction.

lines

Array of objects

Lines returned in a credit memo, each line contain an item.

posStatus

String

Status of the order, mapped from the POS Status field. A numeric ID is displayed for each status value. For more information, see JSON Object Data for SCIS Receipt Templates.

refunds

Array of objects

Refund from credit memo.

salesassoc

JSON object

Sales associate assigned to the credit memo.

salesrep

JSON object

Sales rep assigned to the credit memo.

summary

JSON object

Order summary information, such as total amount, discounts, and tax amount on the credit memo.

customer

This JSON object includes information about customer records including the default customer record used at point of sale.

Object Name

Object Type

Description

email

String

Customer email address.

entityid

String

Default customer record. This includes the following: ID, name of customer, name of employee and subsidiary in parentheses. For example, 11 Default Customer (Jane Smith, Parent Company).

internalid

Number

Customer record internal ID.

isdefault

Boolean

Returns true if this is a default customer record.

isinactive

Boolean

Returns true if this customer record is marked inactive.

isperson

Boolean

Returns true if this customer record is an individual as opposed to a company.

name

String

Name, if the customer is an individual. If the customer is a company, this is the company name.

labels

This JSON object contains labels from the default template.

Object Name

Object Type

English Translated Text

change

String

"Change"

customer

String

"Customer"

discount

String

"Discount"

giftcards

JSON object

  • giftcard

String

"Giftcard"

  • giftcertnumber

String

"Gift Certificate Number"

handlingCost

String

"Handling Cost"

operation

String

"Operation"

payments

JSON object

  • authcode

String

"Autorization Code"

  • ccexpiredate

String

"CC Expiration"

  • ccname

String

"Name"

  • ccnumber

String

"CC Number"

refunds

JSON object

  • checknum

String

"Checknum"

  • refund

String

"Refund"

returnDiscount

String

"Returned Items Discount"

returnSubtotal

String

"Returned Items Subtotal"

returnTax1

String

"Returned Tax" or "Returned GST/HST"

returnTax2

String

"Returned PST"

returnTotal

String

"Returned Item TOTAL"

salesAssoc

String

"Sales Assoc."

salesRep

String

"Sales Rep."

shippingCost

String

"Shipping Cost"

subtotal

String

"Subtotal"

tax1

String

"GST/HST"

tax2

String

"PST"

thanks

String

"Thanks for coming!"

total

String

"TOTAL"

lines

This is an array of line objects added to the order. JSON format is the same as creditmemo.lines.

line

This JSON object contains information about each line item on an order.

Object Name

Object Type

Description

amount

String

Amount on the line item.

customExtraFields

String

Additional fields on the custom receipt template form. For more information, read JSON Object Field Mapping.

item

JSON object

Describes the line item.

  • displayname

String

Item display name.

  • internalid

String

Item ID of the item record.

  •  isVoid

Boolean

Defines the void item.

  • itemType

String

Defines the type of item.

  • thumbnail

String

Defines the thumbnail image.

  • voidqty

Number

Stores the original quantity of the line, if the line is voided from the order.

  • price

Number

Defines the item price.

line

Number

Defines the line item.

order

String

True if the line was marked as an order, or False if the line is a cash sale.

quantity

String

Quantity on the item line.

tax_code

String

Contains the internal ID of the tax code associated with this line, for example if the item is Not Taxable it shows -7 or -8.

location

This object contains information about the location associated with the transaction.

Object Name

Object Type

Description

address

String

SCIS location where the transaction occurred.

city

String

City where the transaction occurred.

country

String

Country where the transaction occurred.

custrecord_ns_pos_location_diffaccount

String

Difference account associated with the sales associate on the order.

custrecord_ns_pos_location_safeaccount

String

Safe account (or initial loan) associated with the sales associate on the order.

custrecord_ns_pos_servicehours

String

Service hours for the SCIS location.

internalid

String

ID for the location record associated with the transaction.

name

String

Name of the location associated with the transaction.

state

String

State from the location record associated with the transaction.

zip

String

Postal code from the location record associated with the transaction.

payments

This is an array of Payment objects.

payment

This object contains information about the payment associated with the order.

Object Name

Object Type

Description

changeDue

String

Change due after cash payment on the order.

internalid

String

Internal ID of the payment method.

paymentmethod

String

Contains the ID of the payment method record from the Accounting List. (Setup > Accounting > Accounting Lists.)

paymentmethodname

String

Name of the payment method associated with the transaction.

total

String

Contains the total of each payment made on the order.

totalTendered

String

Total amount paid.

salesassoc

This object contains information about the sales associate on the order.

Object Name

Object Type

Description

id

String

Internal ID from the employee record of the sales associate.

name

String

Name of the employee.

subsidiary

This object contains information about the subsidiary associated with a transaction. This is applicable for accounts using OneWorld.

Object Name

Object Type

Description

legalname

String

Subsidiary legal name.

tin

Boolean

Taxpayer Identification Number.

summary

This object contains information from the order summary section of an order.

Object Name

Object Type

Description

amountdue

Number

Amount due on the order.

changedue

String

Change due after cash payment on the order.

createddate

String

Date the order was created.

discounttotal

String

Total discount applied to the order.

giftcertapplied

String

Gift certificate applied to the order.

handlingcost

String

Handling cost applied to the order, if applicable.

shippingcostoverriden

String

Contains a value related to the Shipping cost activation/deactivation in SCIS (sidebar). If you changed the shipping cost to zero, the value is T. If shipping cost was not modified it shows F.

subtotal

String

Subtotal of the order.

taxes

Array of objects

Contains a list of taxes grouped by rate

taxtotal

String

Total tax charged on the order.

tax2total

String

If multiple taxes were applied, then this shows the other tax amount. For example if both GST and PST tax is incurred.

total

String

Total amount of the order.

tranid

String

Transaction ID of the order.

taxes

This object contains an array of tax objects grouped by rate, it is added to the order summary and creditmemo summary. 

tax

This object contains information about the tax charged on an order.

Object Name

Object Type

Description

amount

Number

Amount of tax on the order.

amountCharged

Number

When the tax applied to the order is a Tax Group, the amount charged is the total amount of the order (taxes not included).

fromTax

String

Describes the number of the tax which belongs to a tax groups. It can be tax1 or tax2. This value is used internally.

rate

Number

Describes the tax that was applied in the line. Examples tax1 or tax2.