Ctrl K

PCE TW GUI MODULE — Operation Handbook

Audience: NetSuite administrators, accounting users, implementation consultants
Purpose: Operation handbook for features already in the account (first-time setup, day-to-day steps, CSV template downloads)
In-account copy: PCE GUI Portal → Help → User guide (includes direct template downloads)
繁中:使用說明
Related API docs: Integration guide · Technical notes

1. Product overview

PCE TW GUI MODULE (Publisher: com.netsuite, Project ID: pceguitw) is a SuiteCloud SDF SuiteApp for Taiwan VAT / purchase (AP) invoice capture, validation, and integration inside NetSuite.

Delivered capabilities:

ModuleWhat it does
Business infoTaxpayer master (tax ID, address, subsidiary, AP / AR feature flags)
Tax type mappingMap PCE tax types 1 / 2 / 3 to NetSuite (NS) tax codes (required before AR issue)
AP invoice recordsPCE AP Invoice on Vendor Bill / Expense Report (ER) / Vendor Credit (VC) / Vendor Prepayment (VP), or stand-alone
AP CSVUpload / paste, max 100 rows; Validate only dry run
AP Write APIIT / vendor integration (§5.4)
Invoice booksSearch / adjust allocation, manual create, CSV import (31 / 32 / 35)
Issue AR invoice / allowanceSingle / merge, allowance, net invoice; header button or search page
Background auto-issue (invoice)Queue multiple invoices (35-07 + platform upload); progress page (§5.8)
Void AR invoice / allowanceSuitelet lists issued AR masters; void or void-and-reissue (§5.7)
VAT media filesDownload input/output TXT and zero-rate T02 for a business and bi-monthly period (§5.9)
Custom item linesRewrite issue lines on Invoice / Credit Memo (CM) PCE Sales tab; issue merges same item + unit price + tax type + description
NavigationTop PCE GUI (Classic Center / BASIC)

In-account handbook and templates: PCE GUI Portal → Help → User guide. Scope and phasing: 銷項藍圖 (ZH).

How to use this handbook

  1. New accounts: finish §4 First-time setup (business info → tax mapping → tax IDs → books).
  2. Before any CSV import, download files from §1.1 Templates, edit in Excel, Save As CSV UTF-8.
  3. Day-to-day AP: §5.1–5.3. Day-to-day AR: §5.5–5.8.
  4. The in-account handbook downloads the same templates; you do not need to hunt them on each page.

1.2 Flow overview

The in-account PCE GUI Portal → Help → User guide uses the same structure (CSS flowcharts, no extra plugins).

flowchart TB
  deploy[Deploy SuiteApp] --> setup[First-time setup §4]
  setup --> ap[AP day-to-day §5.1–5.3]
  setup --> ar[AR day-to-day §5.0–5.7]
  setup --> book[Invoice books §5.6]
  ar --> void[Void §5.7]
  book --> ar

流程圖原文

1.3 Terms and abbreviations

Expanded names for abbreviations used in this handbook and flowcharts. In the in-account PCE GUI Portal → Help → User guide, §1.3 is a plain reference table; elsewhere, hover dotted-underline abbreviations for the same explanations:

Abbr.Full nameNotes
SEUISales Exempt from Uniform InvoicesSystem prefix for format 36; plus 10-digit timestamp = 14 characters (e.g. SEUI4567890123)
NSNetSuiteThis ERP platform; e.g. “NS tax code mapping” or “NS → value-added center upload”
APAccounts Payable (Purchases)Purchase / input VAT side in this SuiteApp
ARAccounts Receivable (Sales)Sales / output VAT; issue invoice or allowance
VBVendor BillAccounts payable invoice transaction
ERExpense ReportEmployee expense report
VCVendor CreditVendor credit memo
VPVendor PrepaymentVendor prepayment
CMCredit MemoCustomer credit memo; source document for allowances
CSVComma-Separated ValuesSpreadsheet text file; save as CSV UTF-8 in Excel
invCatCodeInvoice Category CodeCategory 01–08; required for formats 21 / 25 / 31 / 32 / 35
OAuthOpen AuthorizationAuthorization for AP Write API integration (IT setup)
M2MMachine-to-MachineOAuth client-credentials flow without user login

Screens at a glance

PCE GUI menu

Figure: Top PCE GUI menu (Help / Module Settings / Purchases / Sales).

1.1 Template downloads

Replace sample tax IDs, tracks, and amounts. Max 100 rows. Prefer Validate only first.

In account: PCE GUI Portal → Help → User guide → Download templates. Each module page offers the same files.

UseIn-account handbookProject sampleUsed on
AP CSV template?action=template&kind=apap-invoice-import-sample.csvPurchases → AP CSV Import
AP field guide?action=guide&kind=apap-invoice-import-field-guide.csvSame
AP invCatCode map?action=invcatmap&kind=apap-invCatCode-erp-mapping.csvSame
Invoice-book CSV?action=template&kind=arbookar-invoice-book-import-sample.csvModule Settings → Invoice books → CSV
Book field guide?action=guide&kind=arbookar-invoice-book-import-field-guide.csvSame
Book invCatCode map?action=invcatmap&kind=arbookar-invCatCode-mapping.csvSame

IT / integration also uses docs/postman/ (AP Write) and the integration guide.

2. Prerequisites

2.1 NetSuite features

Declared in manifest.xml:

FeatureRequired
Custom RecordsYes
Server SuiteScriptYes
SubsidiariesYes
AccountingRecommended for transaction flows

2.2 Permissions & roles

Most script deployments use All Roles (internal roles). In practice, grant at least:

  • Custom record access: PCE Business Info, PCE AP Invoice (and lookup tables if users maintain them)
  • Transaction access: Vendor Bill / Expense Report / Vendor Credit / Vendor Prepayment (as needed)
  • Suitelet / RESTlet: CSV import page; AP Write (integrations also need Integration + tokens)

2.3 Deploy (developers / consultants)

# Dev account (suitecloud auth configured)
npm run deploy:sdf

# Customer prod / UAT (lock top-level objects, hide server code, account guard)
npm run deploy:sdf:customer
  • Application ID: com.netsuite.pceguitw
  • After deploy, an install script seeds lookup-table instances (skips existing names; safe to re-run)
  • Customer lock/hide scope and allowlist: 客戶帳部署

3. SuiteApp inventory

3.1 Navigation (Center)

Script IDTypeLabel
custcentertab_pce_guiCenter TabPCE GUI (center=BASIC / Classic Center, allroles=T; overview Script Portlet enabled)
custpubdashboard_pce_guiPublished DashboardPCE GUI overview with SuiteApp User Guide portlet (Administrator / Full Access; existing users may need Publish / Personalize once)
custcentercategory_pce_workbenchCategoryFeature entry → PCE GUI Portal (customscript_pce_sl_workbench; sidebar + iframe)
custcentercategory_pce_basic_dataCategoryModule Settings (module settings / business info / invoice book profile). Tax mapping and invoice book management are in PCE GUI Portal
custcentercategory_pce_apCategoryPurchases (AP) — PCE AP data. Portal does not list it. CSV import or API intake review is in PCE GUI Portal
custcentercategory_pce_arCategorySales (AR) — PCE AR data. Issue, background issue, and void are in PCE GUI Portal → Sales. Upload monitor and errors are in PCE GUI Portal → Value-added center

PCE GUI → Feature entry → PCE GUI Portal

  • Centered on the top row, the page shows the mapped module-setting Name, that row’s NetSuite Account ID, user, and role: 測試區 (TD2905095) | 使用者: … | 角色: …. The name is the Name on the module system setting mapped to this account (正式區 or 測試區). When nothing is mapped, the name is — and no account id is shown.
  • Purchases appears only when 進項功能 (custrecord_pce_modsys_ap_feature) is checked on the mapped module system setting. Sales appears only when 銷項功能 (custrecord_pce_modsys_ar_feature) is checked. VAT filing → Input, output, and zero-rate appears only when 產報稅檔功能 (custrecord_pce_modsys_taxfile_feature) is checked. An unchecked feature hides that menu group. Check suiteTax (custrecord_pce_modsys_suite_tax) only on a SuiteTax account. When it is checked, sales reads tax from Tax Details, and purchases plus transaction create write tax onto Tax Details instead of tax1amt. Leave it unchecked for Legacy Tax. Keep the existing tax mapping. Do not map SuiteTax tax codes separately.
  • Single page for most PCE tools (help, module settings, AP, AR, value-added center, etc.); the right iframe loads each Suitelet.
  • ☰ collapses or expands the sidebar: expanded shows full labels; collapsed leaves only ☰ (menu hidden—expand before switching features). Tooltip: “收合選單” / “展開選單” (Traditional Chinese UI strings).
  • In-page tabs (invoice book, void, background issue, etc.) switch inside the iframe without a full reload.
  • Most Sales tools share a collapsible filter card. Background auto-issue and Void AR invoice / allowance use a unified workbench card (tabs in the card header; filters embedded in the card). Issue list and invoice book still use the legacy tab + filter layout. See PCE GUI Portal — 銷項內頁 UI(查詢條件/workbench).

PCE GUI Portal → Help → User guide

  • Suitelet (AP / invoice-book CSV templates; the PCE GUI overview portlet still shows a summary)

SuiteApp user guide Suitelet

Figure: Full guide page under Portal Help → User guide.

PCE GUI → Module Settings

  • PCE Business Info → customrecord_pce_business_info
  • Invoice book profile → customrecord_pce_ar_book_profile
  • Tax mapping and invoice book management → PCE GUI Portal → Module Settings

Basic data menu

Figure: PCE GUI → Module Settings → PCE Business Info.

PCE GUI → Purchases (AP)

  • PCE AP Invoices → customrecord_pce_ap_invoice (center tab. PCE GUI Portal does not list it)
  • AP CSV Import → PCE GUI Portal → Purchases when 進項功能 is checked (customscript_pce_sl_ap_csv_import)

Purchases menu

Figure: PCE GUI → Purchases (AP invoices / CSV import).

(UI labels in the account may appear in Traditional Chinese depending on localization.)

PCE GUI → Sales (AR)

  • PCE AR Invoice Data → customrecord_pce_ar_invoice
  • Issue, background issue, and void → PCE GUI Portal → Sales
  • Upload monitor and upload errors → PCE GUI Portal → Value-added center
  • Uploaded TXT and downloaded ACK files are kept in the File Cabinet folder PCE 加值中心交換檔 and linked from the upload log. The upload monitor can open them.

3.2 Business custom records

Script IDPurpose
customrecord_pce_business_infoTaiwan VAT taxpayer / business profile
customrecord_pce_biz_sys_settingFeature flags under business info (AP/AR/filing, etc.)
customrecord_pce_ap_invoicePurchase invoice detail (optional transaction link)
customrecord_pce_ap_write_logAP import logAudit trail for each CSV/API write
customrecord_pce_ar_invoicePCE AR invoice / allowance master; status and upload status — see §3.2.1. Form: Basic includes date created and last modified; Credited holds credited amounts and remaining allowance; Void includes void-and-reissue
customrecord_pce_ar_invoice_lineAR line items under master
customrecord_pce_ar_custom_lineCustom issue lines on Invoice / Credit Memo (PCE 銷項 tab)
customrecord_pce_ar_invoice_bookInvoice book (track / period / allocation profile)
customrecord_pce_ar_book_import_logInvoice book import job log
customrecord_pce_mof_trackMOF invoice track letters

3.2.1 AR master: lifecycle vs upload (not the same as transaction body)

PCE AR Invoice Data and Invoice / Credit Memo body each have their own “status” fields.

LayerFieldListRole
Mastercustrecord_pce_ar_statuscustomlist_pce_ar_statusDocument lifecycle: draft / issued / void / cancelled. Successful issue sets issued (not draft).
Mastercustrecord_pce_ar_upload_statuscustomlist_pce_ar_upload_statusUpload lifecycle: pending / in progress / failed / success / skipped. On issue: Upload on the confirm form → pending; Do not upload (paper 31/32, 35 no upload, 36, etc.) → skipped, so void gate passes without manual edits. E-invoice void still requires success after Phase 3 jobs or manual update.
Mastercustrecord_pce_ar_upload_error_msgLong TextUpload / integration error text; cleared on successful issue.
Transactioncustbody_pce_ar_inv_statuscustomlist_pce_ar_inv_statusNS Invoice / CM invoice upload / issue status. Issue: upload → issued pending upload; no upload → issued, not via NS upload. Void: skipped master → voided, not via NS upload; else voided pending upload. Phase 3 upload / ACK will set issued uploading / issued but upload failed, check the error message / issued and uploaded to platform and the matching voided … values.
Transactioncustbody_pce_ar_error_msgLong Text (read-only)Invoice error message on Invoice / Credit Memo / Customer Deposit (PCE AR subtab): background auto-issue failure (Invoice only), or—in Phase 3—VAC upload failure text with an upload failed status. Cleared on successful issue, re-queue, Make Copy, void-and-reissue, or when the upload is resent.

3.3 Lookup / code tables

Seeded by customscript_pce_sl_install_lookup on install:

Script IDPurposeSeeded rows
customrecord_pce_doc_format_codeDocument format codes (AP 21–29, 10 rows; AR 31–36; 21/31/32/35 split ×2; invoice category 01–08)Yes
customrecord_pce_tax_typeTax typeYes
customrecord_pce_deduction_codeDeduction codeYes
customrecord_pce_summary_markSummary / allocation markYes
customrecord_pce_customs_markCustoms markNo default AP rows
customrecord_pce_export_decl_catExport declaration category (G3, G5, D1, D5, B1, B2, B8, B9, F4, F5)Yes
customrecord_pce_zero_rate_markZero-rate markNo default AP rows
customrecord_pce_cityCity codesLookup
customrecord_pce_filing_typeFiling typeLookup
customrecord_pce_filing_markSelf / agent filing markLookup
customrecord_pce_consol_codeConsolidation codeLookup

Display names typically use code - description (e.g. 21 - …).

3.4 Entity custom fields (Vendor / Customer)

Script IDLabel (ZH)Applies to
custentity_pce_vendor_tax_idVendor tax IDVendor
custentity_pce_vendor_invoice_titleVendor invoice titleVendor
custentity_pce_vendor_reg_addrVendor registered addressVendor
custentity_pce_cust_tax_idBuyer tax IDCustomer
custentity_pce_cust_invoice_titleBuyer invoice titleCustomer
custentity_pce_cust_reg_addrBuyer registered addressCustomer

Usually shown on the PCE e-Invoice entity subtab (custtab_pce_einvoice).

3.5 Transaction subtab

Script IDTitleType
custtab_pce_trx_einvoicePCE AP Invoice DataTransaction
custtab_pce_trx_ar_einvoicePCE 銷項Transaction (Invoice / Credit Memo body fields + custom item lines)

Hosts the AP invoice sublist on AP transactions; AR tab hosts issue flags and optional custom lines (customrecord_pce_ar_custom_line).

3.5.1 Invoice / Credit Memo body fields (PCE 銷項)

Script IDLabelNotes
custbody_pce_ar_issue_invoiceIssue invoice / allowanceSynced from Module system settings Account mapping + per-subsidiary effective AR flag (see below)
custbody_pce_ar_use_custom_linesUse custom item linesWhen checked, issue reads custom lines sublist, not transaction items
custbody_pce_ar_inv_statusInvoice / allowance statusList customlist_pce_ar_inv_status on the transaction; distinct from master upload status — §3.2.1
custbody_pce_ar_error_msgInvoice error messageInvoice / Credit Memo / Customer Deposit (read-only); background issue or Phase 3 upload failure — §3.2.1
custbody_pce_ar_main_remarkMain remark (總備註)Invoice / Credit Memo / Customer Deposit; max 200 chars; prefills Invoice remarks on confirm-issue from transaction URL; saved to AR header main remark on issue

AR feature and custbody_pce_ar_issue_invoice

  • Account not mapped to Production/Test, no PCE business info for the transaction subsidiary, or AR disabled per effective settings: field disabled, unchecked, no issue button on the transaction; issue/void/book Suitelets reject POST.
  • AR enabled and customer (entity) set: checked automatically on create and copy. If the user clears it, a screen save and a later edit do not check it again. Changing the customer or subsidiary still recalculates the box.
  • AR enabled but no customer: unchecked.
  • Already issued (invoice/allowance no. or status): no issue button (unchanged).

Opening issue from a transaction URL shows an explicit message if AR is disabled for that subsidiary. A one-time Map/Reduce to clear stale checkboxes on old transactions is not shipped yet (planned optional cleanup).

The Issue button appears only on Invoice / Credit Memo View (not Edit), so issue always reads saved custom lines and header totals. Save the transaction, open View, then issue—or use the AR issue Suitelet list.

Key body field: custbody_pce_ar_use_custom_lines (Use custom item lines). When checked, issue reads the PCE 銷項自訂商品明細 sublist (customrecord_pce_ar_custom_line), not transaction items.

Custom sublist fields include:

FieldScript IDNotes
Itemcustrecord_pce_ar_cstmline_itemSeeded from source item when the box is first checked
Description / qty / unit / price / amount…_description etc.Untaxed amount. Amount 0 products are still issued. Description, subtotal, and group rows with amount 0 are skipped
Tax amountcustrecord_pce_ar_cstmline_tax_amountLine tax sum must match header taxtotal
Tax typecustrecord_pce_ar_cstmline_tax_typePCE tax type record (1 / 2 / 3)
Line remarkcustrecord_pce_ar_cstmline_remarkMax 120 chars; can be seeded from item column

Untaxed and tax totals must match the NetSuite header (tolerance 0.02). On save, if all line taxes are empty, the system derives tax from tax type (5% for taxable) and aligns to the header.

3.5.2 Invoice / Credit Memo item column

Script IDLabelNotes
custcol_pce_ar_line_remarkLine remarkSales item column (max 120 chars). Seeded into custom line 明細備註 when Use custom item lines is checked and the sublist is empty
Form setup: After deploy, add 明細備註 to the Items sublist on Invoice and Credit Memo transaction forms (Customization → Forms → Transaction Forms).

3.6 Scripts

Script IDTypeRole
customscript_pce_ue_apinv_defaultUser EventValidate AP invoice before submit (non-UI paths)
customscript_pce_cs_ap_invoiceClientField behavior on AP invoice form
customscript_pce_cs_trans_ap_sublistClientSublist logic on VB / ER / VC / VP
customscript_pce_rl_ap_writeRESTletAP Write API
customscript_pce_sl_ap_csv_importSuiteletAP CSV import UI
customscript_pce_sl_ar_issueSuiteletIssue AR invoice / allowance (search NS Invoice / Credit Memo)
customscript_pce_sl_ar_voidSuiteletVoid AR invoice / allowance (search issued AR masters)
customscript_pce_sl_ar_book_csv_importSuiteletInvoice book management UI (CSV / manual / search)
customscript_pce_mr_ar_book_importMap/ReduceInvoice book background create job
customscript_pce_mr_ar_book_alloc_updateMap/ReduceInvoice book allocation bulk update job
customscript_pce_ue_ar_book_defaultUser EventDefault book status 0 on create
customscript_pce_sl_install_lookupSuitelet (install)Seed lookup data
customscript_pce_sl_ap_write_smokeSuiteletSmoke test helper
customscript_pce_sl_ap_write_smoke_instInstall-relatedSmoke install helper

3.7 File Cabinet (main paths)

SuiteApps/com.netsuite.pceguitw/
├── ap/
│   ├── clientscripts/
│   ├── libraries/      # CSV, validation, payload, write log, …
│   ├── restlets/       # AP Write RESTlet
│   ├── suitelets/      # CSV Import, smoke
│   └── userevents/
└── common/             # Tax ID helpers, MOF track data, …

4. Post-install setup

Recommended order:

flowchart TD
  A[A Confirm menu] --> B[B Business info]
  B --> B2[B2 Tax type mapping]
  B2 --> C[C Vendor / Customer tax ID]
  C --> D[D Import or create invoice books]
  D --> E{Need API integration?}
  E -->|Yes| F[F OAuth + AP Write]
  E -->|No| done[Ready for day-to-day]
  F --> done

流程圖原文

Step A — Confirm navigation

  1. Refresh NetSuite (or switch role/center and return).
  2. Confirm the PCE GUI tab appears.
  3. Open:
    • PCE GUI Portal → Help → User guide (handbook and template downloads)
    • Module Settings → PCE Business Info, Invoice book profile (center tab). Tax type mapping and Invoice book management are in PCE GUI Portal
    • Purchases → PCE AP Invoices (center tab). Portal does not list AP invoices. Portal shows AP CSV Import when 進項功能 is checked
    • Sales (AR) → PCE AR Invoice Data, Issue AR invoice / allowance

If the tab is missing: check Classic Center role, tab audience, and More menus.

Optional on Module system settings → Issue line description source (custrecord_pce_modsys_desc_src): the saved-search field ID used as the item description when issuing an Invoice or Credit Memo. Leave blank to use the line description (memo), then the item name when that is blank. Allowed values are lowercase memo, item, a custcol_ line field, or item.fieldId (for example item.salesdescription). Do not enter description; that UI field is memo in search. An invalid value cannot be saved. Custom item lines and customer deposits do not use this field.

Optional check boxes Bind department and Bind class (custrecord_pce_modsys_bind_dept, custrecord_pce_modsys_bind_class): when checked, the issue confirmation page copies the source transaction’s department or class and uses it to allocate an invoice book. You can still pick another value on that page. When unchecked, a blank value uses a book that is not limited to a department or class.

Optional Force VAT file background (custrecord_pce_modsys_vat_force_bg, unchecked by default): when checked, the input/output TXT and zero-rate T02 always build in the background. When unchecked, up to 20,000 rows on one side download immediately, and a larger side waits for a background job.

Optional long text Extra search fields (custrecord_pce_modsys_extra_flt): add Invoice header filters under the existing issue-list criteria, including background issue. One field per line, up to 8, lowercase. Format: fieldId|sourceFrom|label, with an optional fourth segment for help text under the control. sourceFrom is the record type or list ID used to fill the dropdown, for example location|location|Location. A class filter uses the record type classification. Leave sourceFrom blank for a text, date, or checkbox field. Leave a dropdown at All to skip that filter. Do not enter custcol_ line fields, joins such as item.fieldId, or the built-in tax ID, customer, department, class, document number, and date filters. An invalid line cannot be saved. If sourceFrom cannot be searched, that dropdown has no options and the rest of the page still loads.

Step B — Maintain business (taxpayer) info

  1. PCE GUI → Module Settings → PCE Business Info → New
  2. Enter at least:
    • Business tax ID (8 digits)
    • Business name
    • Other filing fields as required (tax registration no., address, contacts/filer, etc.)
  3. For OneWorld, maintain subsidiary linkage as needed.
  4. Review system settings under the business record and enable AP and AR flags. AR issue requires the AR flag.

Step B2 — Map NetSuite tax codes

  1. PCE GUI → Module Settings → Tax type mapping
  2. For tax types 1 (taxable) / 2 (zero-rated) / 3 (exempt), select the matching NetSuite tax codes (multi-select allowed).
  3. Save. Custom item lines and AR issue use this map; unmapped tax codes block issue.

PCE Business Info list

Figure: PCE Business Info list.

PCE Business Info form

Figure: Sample business info fields (including subsidiary).

Step C — Maintain Vendor / Customer masters

  1. Open Vendor or Customer.
  2. Open PCE e-Invoice (or related fields).
  3. Enter tax ID, invoice title, registered address for validation and (seller) defaults.

Step D — (Optional) External API

  1. Configure OAuth 2.0 Integration (prefer Client Credentials M2M with RESTlets scope).
  2. Copy the AP Write RESTlet external URL.
  3. Follow the integration guide to obtain a Bearer token and call the API.
  4. Review AP import log entries for each run (linked from the CSV import page; NetSuite list title may still show “PCE AP Write call log”).

Step E — (Optional) Tighten script audiences

In production, restrict Suitelet / RESTlet audiences from “all roles” to accounting / integration roles.

5. Day-to-day usage

5.0 Prepare custom item lines on Invoice / Credit Memo

When accounting needs to rewrite issue descriptions or amounts (instead of using transaction items):

  1. (Optional) Enter Line remark on the Items sublist (custcol_pce_ar_line_remark; form setup §3.5.2).
  2. Open Invoice or Credit Memo → PCE 銷項.
  3. Check 使用自訂商品明細 (Use custom item lines). If the custom sublist is empty, the Client Script seeds from items (includes amount 0 products; skips description, subtotal, and group rows whose amount is 0): item, description, qty, price, amount, tax type, tax amount (5% or item tax1amt), line remark.
  4. Edit rows on PCE 銷項自訂商品明細; changing amount or tax type recalculates tax (manual tax edits are kept).
  5. Save. Untaxed total must match subtotal and tax total must match taxtotal (tolerance 0.02). If all line taxes are empty, User Event fills them from tax type before validation.
  6. On issue, the confirm page and PCE AR line records merge rows with the same item + unit price + tax type + description (品名) (sum qty, amount, tax; join remarks with ;). Different descriptions are not merged. The custom sublist on the Invoice still shows original rows for audit. On a foreign-currency Invoice or Credit Memo, custom lines stay in the transaction currency. Issue expands the foreign net by tax type, multiplies by that transaction’s exchange rate, rounds to whole TWD, then splits net and tax. Saved custom lines are not rewritten into TWD.
  7. Unchecking does not clear saved custom lines; issue reads items again.

5.1 Enter AP invoices on a transaction (recommended)

flowchart TD
  start[AP capture] --> path{Choose path}
  path -->|Recommended| trx[Transaction PCE AP sublist]
  path --> list[Stand-alone PCE AP list]
  path --> csv[CSV import]
  trx --> save[Save → create PCE AP records]
  list --> save
  csv --> validate{Validate only?}
  validate -->|Yes| preview[Dry-run result]
  validate -->|No| save
  preview --> csv

流程圖原文

Supported: Vendor Bill, Expense Report, Vendor Credit, Vendor Prepayment.

  1. Create or open the transaction; select Vendor when applicable.
  2. Go to the PCE AP Invoice Data subtab / sublist.
  3. Add a line and enter fields such as:
    • Document format code (21–29)
    • Document date
    • Document period / filing period (ROC 5-digit YYYMM)
    • Deduction code, tax type
    • Invoice number / other document number (by format)
    • Buyer / seller tax IDs
    • Sales amount, tax, total
    • Summary mark, etc. as needed
  4. Save. Client scripts assist field behavior; User Event validates on save. On the transaction AP sublist, the buyer tax ID is defaulted from PCE Business Info matched by the header subsidiary. When creating an AP invoice record alone, enter the buyer tax ID manually. The rule list (format, tax ID, tax amount, track, period) is in AP validation rules. UI, CSV, and API share it.

One transaction can link to many AP invoice records (1:N).

Vendor Bill PCE AP sublist

Figure: Vendor Bill → PCE AP Invoice Data sublist.

5.2 Maintain the AP invoice list directly

  1. PCE GUI → Purchases → PCE AP Invoices
  2. New / Edit.
  3. Optionally set Source Transaction to an existing Vendor Bill, Expense Report, Vendor Credit, or Vendor Prepayment; or leave unlinked and create AP invoice data only.

PCE AP Invoice list

Figure: PCE AP Invoice list.

PCE AP Invoice form

Figure: Sample AP invoice fields (format, tax IDs, amounts).

5.3 CSV import

  1. PCE GUI → Purchases → AP CSV Import
  2. Optionally download (handbook or this page):
    • Template CSV (action=template)
    • Field guide CSV (action=guide)
    • Invoice category map (action=invcatmap)
  3. Fill in Excel/spreadsheet, then Save As CSV (prefer CSV UTF-8 to avoid garbled Chinese), or paste CSV text on the page.
  4. (Recommended) Check Validate only (dry run, no records created) first; uncheck for a real import.
  5. Click Import to create PCE AP invoice records.
  6. After import, the browser is redirected to a GET result page (action=result with AP import log id). Refreshing the page does not resubmit the CSV.
  7. Review the result summary (failures first), download failed rows if any, open successful invoice links, and open AP import log for audit (Import batch id and Result code under Advanced).
  8. Limit: max 100 rows per submission.

AP CSV Import page

Figure: AP CSV Import (template download, upload/paste, validate only).

Common CSV columns (summary)

FieldRequiredNotes
docFormatCodeYes21–29; formats 21 and 25 require invCatCode when using code alone
invCatCodeConditionalInvoice category code; required for ambiguous codes (21: 01/05; 25: 06/07)
docDateYesYYYY/MM/DD or YYYY-MM-DD
docPeriodYesROC 5-digit period
filingPeriodYesROC 5-digit filing period
deductionCodeYes1–4
invoiceNoConditionalUsually required
buyerTaxIdYes8 digits
sellerTaxIdConditionalFormat-dependent
taxTypeYese.g. 1 / 2 / 3 / F / D
salesAmount / taxAmount / totalAmountAmountsSales and tax follow validation rules. Total is not validated
fileBizTaxOptionalInclude in VAT filing
filedOptionalAlready filed. true / T checks the box. Update existing rows with NetSuite CSV import using field ID custrecord_pce_ap_tax_filed
clientRefOptionalExternal reference
transactionOptionalLink to an existing NetSuite transaction (internal id required; ask IT)

See docs/samples/ap-invoice-import-sample.csv and the on-page field guide for full detail.

5.4 API write (system integration)

Typically run by IT / vendors:

actionPurpose
apInvoiceOnlyCreate AP invoices only
transactionOnlyCreate/reference transactions (max 10)
transactionWithApInvoicesTransaction + invoices (1:N)

This package has only the three actions above. API intake review and purchase requests (custompurchase_dfo_purchase_req) are not included.

  • POST only + OAuth 2.0 Bearer
  • API option options.validateOnly: true matches the UI Validate only (dry run, no records created)

Details: integration guide.

5.5 Issue AR invoice / allowance (Phase 1)

Full allocation flow, filters, and error codes: AR invoice numbering (ZH).

flowchart TD
  prep[Prepare Invoice/CM §5.0] --> search[Search or header button]
  search --> select[Select source rows]
  select --> mode{Issue mode}
  mode -->|Invoice only| inv[Single / merge issue]
  mode -->|Credit memo only| allow[Allowance 33/34]
  mode -->|Both| net[Net invoice]
  inv --> form[Confirm format / date / allocation]
  allow --> form
  net --> form
  form --> num[Resolve number]
  num --> ok[Create PCE AR + write back NS]

流程圖原文

flowchart TD
  start[Confirm format + upload flag] --> fmt{Format?}
  fmt -->|36| gen["System SEUI number<br/>Sales Exempt from Uniform Invoices"]
  fmt -->|35 + upload| auto[Auto-allocate from book]
  fmt -->|35 no upload / 31 / 32| manual[Manual + reverse lookup]
  fmt -->|33/34 allowance| allowNum[Manual number or business prefix plus timestamp]
  auto --> ok[Success write-back]
  manual --> ok
  gen --> ok
  allowNum --> ok

流程圖原文

  1. PCE GUI Portal → Sales → Issue invoice / allowance (開立發票/折讓單). You can also click 開立銷項發票 on an unissued Invoice, 開立折讓單 on an unissued Credit Memo, or 開立銷項發票 on an unissued Customer Deposit (convert deposit to invoice). The header button opens the same Portal: the confirm page is on the right, and the sidebar starts collapsed (use ☰ to expand). The button is hidden after the document already has an invoice number or invoice status.
  2. Set filters (tax ID / customer / department / class / NetSuite invoice # / NetSuite credit memo # / dates) and click Search (查詢).
  3. Lists include only sales invoice or credit memo rows where:
    • Issue invoice = Yes
    • Invoice status is empty
    • Locked = No
    • Invoice number is empty
    • NetSuite status is not Voided or Rejected. Those documents stay off the list and hide the issue button. Open and Paid In Full documents can still be issued.
  4. Click a result column heading to sort; click again to reverse. The checkbox column does not sort. 課稅別 on each row is 應稅, 免稅, 零稅率, or 混合稅 (from the lines that will be issued; more than one non-zero tax type is mixed. Checked Use custom item lines reads custom lines; otherwise it reads item tax codes). Select rows and issue:
    • Invoice only: single or merged issue
    • Credit memo only: Issue allowance (開立折讓單; offsets already issued invoices)
    • Invoice + Credit Memo: Issue net invoice (開立淨額發票)
  5. On the issue form, confirm document format, upload via value-added center, and invoice / allowance number. Invoice-only issue excludes 33 / 34. Issue allowance shows only 33 / 34; the allowance number can be typed or left blank (prefix from PCE business system settings, blank prefix means timestamp only). Format 33 can upload via the value-added center. Allowance forms omit carrier / donation fields and require the original invoice number being offset. When the tax type is zero-rated, the confirm page also requires customs clearance mark (1 not via customs, 2 via customs) and zero-tax reason (71–79). Allowances omit both. Those two values are stored on the AR master and written to the upload TXT. The same page can also take an optional export declaration category (pick from the list, for example G5 domestic goods export), export declaration number (14 letters or digits), export or FX settlement date, supporting document name, and supporting document number. Blank is allowed. They stay on the master and are not written to the upload TXT. Invoice department / class / custom book profile default to Unspecified. Unspecified matches only books that leave the same field blank. If module settings bind department or class, the confirm page fills that value from the invoice; it can be changed back to Unspecified. Custom profile stays Unspecified. List filters for department / class do not become the allocation default. If Use custom item lines is checked, the confirm page shows custom lines (not transaction items), possibly fewer rows after merge (same item + unit price + tax type + description). Merge issue across multiple sources also merges matching lines when all use custom lines; net issue (invoice + credit memo) does not merge signed lines. On the confirm page, the item description can be edited (max 500 characters). A blank description keeps the original name and is stored on the AR line.
  6. The system creates a PCE AR invoice data master with line items. From PCE GUI Portal (including a transaction header button), the record opens in a new browser tab and the portal keeps a short summary (date, format, buyer, amounts) with back to the search list. The master is issued; upload status is pending or skipped from the confirm form upload via value-added center flag (§3.2.1), with upload error cleared. Source transactions get invoice status = issued pending upload plus invoice / allowance numbers. When there are many lines, the form previews only part of them; use the saved search PCE AR Issue Item Lines reports to look up the rest by source document.
When creating sales invoices or credit memos, if AR feature is enabled for the transaction subsidiary’s PCE business profile, Issue invoice is checked automatically.
Custom item lines: See §5.0. Item column Line remark (custcol_pce_ar_line_remark) seeds into custom lines; save requires header totals to match in the transaction currency; on issue, foreign-currency custom lines are converted to TWD, and same item + unit price + tax type + description merge into one row (custom sublist on the Invoice unchanged and still in the transaction currency).

Customer Deposit → AR invoice (Phase 2)

Customer Deposit has no tax code and no item lines in NetSuite. From the deposit View page, Issue AR invoice will:

  • Treat the deposit total as tax-inclusive, reverse-calculate using default taxable (5%): net amount (and unit price) rounded to whole currency, tax = deposit total − net (header tax uses this value, not NS deposit header tax 0).
  • Prefill one line: description from deposit body Line description (if blank: PCE business system settings → Customer deposit line description when set, else Module system settings), quantity 1; validation only checks net + tax = deposit total.
  • Cannot merge or net with Invoice / Credit Memo; one deposit only, from the deposit View page Issue AR invoice (no multi-deposit merge from the issue Suitelet).
  • Write back invoice number and invoice status on the deposit (same body fields as Invoice).
  • Tax type is fixed taxable 5% reverse calculation (no configurable tax type).

Invoice number rules

Format and uploadInvoice numberInvoice book
36 (sales exempt from uniform invoice)System generates SEUI (Sales Exempt from Uniform Invoices) + last 10 timestamp digits (14 characters); do not type a numberNo book lookup or write-back
35 and value-added center = UploadSystem allocates (2-letter track + 8-digit sequence)Match seller tax ID, format, bi-monthly period from invoice date, allocation filters, and NS→value-added center checked
35 and Do not upload, or paper formats (31 / 32, etc.)Required manual entry (e.g. CA00000075)Reverse-lookup the book covering that sequence; only reject if the number is already used
33 / 34 (issue allowance)Type a number (max 16 characters), or leave blank: business allowance prefix (max 3, optional) + last 13 timestamp digitsNo book lookup or write-back

Auto allocation (35 + upload)

  1. Search unused/in-use books that are active, match tax ID, period, and format, and have NS→value-added center checked.
  2. Allocation filter: department, class, and custom book profile must match the invoice book exactly. Unspecified matches only books that leave the same field blank. Selecting department A, class B, and unspecified profile uses only a book with department A, class B, and no profile.
  3. When several books match, only the smallest internal id is used. If that book fails final validation (invoice date before last issue date, no remaining number, write-back conflict), the form shows an error with the book id and does not try another book.
  4. On success the book’s last_no and last_issue_dt are updated; unused becomes in-use, and a fully used book becomes exhausted.
  5. Invoice date must be on or after that book’s last issue date (same day is allowed; empty last-issue date is unrestricted).

Manual numbers (paper / 35 without upload)

  1. Number must be 2 English track letters plus a sequence (padded to 8 digits).
  2. The system finds the book whose track and begin–end range cover the number; no match or more than one covering book fails—narrow tax ID / period / format if needed.
  3. A number already used on an AR master or on Invoice / Credit Memo is rejected.
  4. Manual entry does not require continuity with last_no. After success, last_no becomes the greater of the previous last number and this number, and last-issue date is updated.

5.6 Invoice book management

How numbers are allocated or reverse-looked up at issue is in §5.5. This section covers creating and updating books.

  1. PCE GUI → Module Settings → Invoice book management (three tabs: Search / Update books, Manual entry, CSV import; search tab opens by default)
  2. Search / Update books: pick tax ID (required) to list that company’s invoice books; ROC period, format, and NetSuite→value-added center are optional filters. When a format is selected and it is not format 35-07 (general VAT e-invoice), the NS→value-added center filter is No only. To change department, class, or profile, select rows and use Bulk adjust allocation, or Adjust allocation on one row (over 25 books runs in the background—re-run the search later to confirm). Click ID to open a single record.
  3. Manual entry: switch to the Manual tab, pick tax ID (same dropdown as search), then format (excludes 33/34/36; invoice category is read-only after format selection), period, track, begin/end numbers (same rules as CSV). For 35-07, choose Transmit to VAC via NS (same as CSV nsToPlatform; Yes required for auto numbering on issue 35 + upload). Optionally set department, class, and custom invoice book profile (same options as search/update). Status defaults to unused. Check Validate only (dry run) if needed, then Create invoice book.
  4. CSV import: download the CSV template, field guide, and invoice category code mapping (download filename includes invCatCode); fill in Excel, Save As CSV (prefer CSV UTF-8), upload or paste; check Validate only first if unsure.
  5. After import or manual create, the browser is redirected to a GET result page (action=result with invoice book import log id). Refreshing does not resubmit.
  6. The result page shows Creating invoice books… (with spinner), then success/failure summary; detail rows update to invoice book links when background processing completes.
  7. Successful rows link to new PCE invoice book records; download failed rows (including failed background segments), fix, and re-import.
  8. Limit: max 100 CSV rows; No Name field; empty status defaults to 0 (unused). Writes run in the background and are logged in Invoice book import log; Background job id and other technical fields are under Advanced (IT).
  9. Begin/end suffix rules (last 2 digits after 8-digit padding): Example: one 50-number book 50–99 or 0–49; three triplicate books 0–149.
    • beginNo: multiple of 50 (00 or 50)
    • endNo: multiple of 50 minus 1 (49 or 99)
  10. Auto-split: one row may span multiple books via beginNo/endNo, split by invCatCode: Total count must be a multiple of the book size (e.g. invCat 01, 0–149 → 3 books).
    • Manual (01 triplicate, 02 duplicate, 05 computer) and e-invoice (07): 50 per book
    • POS (03 duplicate POS, 06 triplicate POS): 250 per book
  11. No duplicates: after the split, a book whose period, track, and begin/end already exist (including inactive books) is skipped. The other books from the same row are still created. When the same range appears twice in one file, only the first book is created.

Sample: docs/samples/ar-invoice-book-import-sample.csv Invoice category mapping: docs/samples/ar-invCatCode-mapping.csv (formats 31 / 32 / 35 require invCatCode to disambiguate)

Common CSV columns (summary)

FieldRequiredNotes
taxIdYes8-digit tax ID; must exist in PCE business info (customrecord_pce_business_info)
invCatCodeYes01–08; format 31: 01/05; 32: 02/03; 35: 06/07
docFormatCodeYesAR format 31–36; 31/32/35 need invCatCode or docFormatName
periodYesROC 5-digit YYYMM
trackYes2-letter uppercase track
beginNo / endNoYes8-digit; begin suffix 00/50, end suffix 49/99; may span multiple books (see §5.6)
statusCodeOptional0 / 1 / 2 / 9; default 0
profileNameOptionalCustom book profile name or id
nsToPlatformOptionalOnly for 35-07; all other formats import as false (CSV value ignored)
paperInvoiceOptionalSet on import: 35-07 → false, all others → true (CSV value ignored)
remarkOptionalLong-text remark
clientRefOptionalReconciliation reference

5.7 Void AR invoice / allowance

  1. PCE GUI Portal → Sales → Void invoice / allowance (Suitelet customscript_pce_sl_ar_void; search → void details → confirm).
  2. Filters include subsidiary, customer, invoice / allowance number, document date range, etc. Results list only masters with status = issued (not draft or already void), ordered by document date, oldest first.
  3. Enter void date (must fall in the current filing period), void reason (required, max 20 characters), and choose:
    • Void: master void; updates the linked NetSuite Invoice or Credit Memo per document kind. A Customer Deposit source only gets its invoice-status field updated; the deposit itself is not voided.
    • Void and reissue: master void (allowance void still reverses credited amounts on the original invoice). The source Invoice, Credit Memo, or Customer Deposit keeps the transaction, but invoice / allowance numbers, status, error message, and lock are cleared so it can be issued again.
  4. Upload gate on the master (§3.2.1): issued status and upload status success or skipped (no upload). Pending, in progress, or failed upload blocks void.
  5. Period rules (invoice and allowance): the current bi-monthly period can be voided. Through the 15th of an odd month (inclusive), the previous period can still be voided. On 15 November, period 11510 (September–October) is still voidable; from 16 November it is not. Invoices with credited amounts or open allowances must clear those first.
  6. After success: master void; upload status stays skipped if it was skipped before void, otherwise reset to pending. Both void and void and reissue enqueue a void upload when the status becomes pending, even if the source transaction void fails. A void-and-reissue upload, including in-progress and ACK, updates only the master. Error message cleared; void date / time / reason stored.
35 / 33 with upload: master stays pending until success before void. Paper / 35 no upload issues as skipped—no extra master edit needed (other void rules still apply).

5.8 Background auto-issue and progress

For multiple Invoices queued for background issue (fixed 35-07, transmit via value-added center). See 銷項背景自動開立發票(Phase 7) (ZH).

  1. PCE GUI Portal → Sales → Background auto-issue. The standard issue confirm page does not offer background issue.
  2. Search and eligible rows match §5.5 (issue flag, empty status, not locked, no invoice number, etc.); Invoice only, max 25 rows per submit.
  3. Optional specified issue date, department / class / custom book profile on the list (default Unspecified). All three must match the invoice book exactly; Unspecified matches only books that leave the same field blank. If department or class binding is on, Unspecified uses each invoice’s own value. Background auto-issue does not collect customs mark, zero-tax reason, export declaration, or supporting documents. Issue a zero-rated invoice from the standard confirm page.
  4. Next (background issue) → confirm → Submit background issue. Invoices lock immediately (custbody_pce_ar_inv_status = background auto-issue) and rows enqueue for Map/Reduce.
  5. On success the UI shows only Background auto-issue submitted → View progress and results (link). Batch IDs and Map/Reduce task IDs are not shown. Partial failures add “N row(s) not queued: …”.
  6. PCE GUI Portal → Sales → Background auto-issue progress tab: filter by created date (UTC+8, default today), NetSuite invoice number, status (no batch ID field). Success rows link invoice number to the PCE AR master; invoice date comes from the master. Auto-refresh about every 45 seconds while rows are pending or processing.

5.9 VAT input/output TXT and zero-rate T02

  1. PCE GUI Portal → VAT filing → Input, output, and zero-rate (customscript_pce_sl_vat_filing). The mapped module system setting must have 產報稅檔功能 checked; otherwise the Portal hides this menu.
  2. Choose the business, ROC year, and bi-monthly period. ROC years start at 115. On odd-month dates through the 15th, the page opens on the previous period (15 November stays on September–October; 16 November moves to November–December). Clear Include unused numbers to omit blank invoice numbers. Check Include already filed rows to put input rows marked Already filed into the TXT; leave it clear to leave those rows out.
  3. Preview counts lists input, output, unused-number, and zero-rate rows, plus items to check.
  4. Download input/output TXT writes {taxId}.TXT (81 characters per row). Download zero-rate T02 writes {taxId}.T02 (83 characters per row). Input rows are only those marked for VAT filing. Rows marked already filed stay out unless Include already filed rows is checked. Output rows include issued, void, and cancelled documents. Up to 20,000 input or output rows download immediately. Above that, the file is built in the background. Refresh keeps the same business selected, and the background download list appears without previewing the counts again. If Force VAT file background is checked on module system settings, every download uses the background job. A side with more than 100,000 rows does not produce a file.
  5. Fill the 9-digit tax registration number and city on the business record first. These files are not the VAT return form, and they do not print blank invoices.

6. Troubleshooting

SymptomLikely causeAction
No PCE GUI tabRole/center/cacheRefresh; check tab audience / More menu
Cannot switch Portal feature after collapseMenu hidden when sidebar collapsedClick ☰ to expand, then pick the feature
Tax type unmapped / cannot issueNS tax codes not mappedModule Settings → Tax type mapping for types 1 / 2 / 3
Zero-rated issue rejectedCustoms mark or zero-tax reason missingRequired on the standard confirm page when tax type is zero-rated (customs 1/2, reason 71–79). Background auto-issue does not collect these fields
Custom-line totals mismatchCustom untaxed / tax ≠ headerStay on confirm page; fix PCE Sales amount / tax then retry
Line remark missing on ItemsColumn not on formAdd custcol_pce_ar_line_remark to Invoice / CM Items sublist
Issue shows fewer lines than custom sublistIssue merges same item + unit price + tax type + descriptionExpected; Invoice custom sublist keeps original rows
Issue button missingAlready issued, or empty AudienceConfirm not issued; Script Deployment → Audience
CSV all failedHeader/date/tax ID formatUse field guide; download failed-row CSV
Garbled Chinese in CSVWrong file encodingExcel → Save As → CSV UTF-8
Invoice number rejectedTrack letter not allowedCheck MOF track data / period
Auto allocation fails / no book foundTax ID, bi-monthly period, format, or allocation mismatch, NS→value-added center not checked, or the selected book is exhaustedCheck books in Invoice book management; the error names the book id
Void rejected: upload statusMaster still pending / in progress / failedE-invoice needs success first; fix master if upload flag was wrong at issue (§5.7)
Book id: date before last issue dateIssue date is earlier than that book’s last allocation dateChange the invoice date or the allocation filters
Manual number already usedSame number exists on an AR master or NS transactionEnter a different number
Manual number matches multiple booksOverlapping track / rangeNarrow tax ID / period / format, or fix book ranges
API 401Expired token / IntegrationRenew token; confirm RESTlets scope
Deploy error “script ID already exists”Unbound account object with same IDDelete unbound object, then redeploy SuiteApp

8. Version

ItemValue
SuiteAppcom.netsuite.pceguitw
Project namePCE TW GUI MODULE
Manifest version1.0.0
Document date2026-10-03