HTML Variables for Printing Formats
This screen is a reference: for every AdmCloud document type (invoices, orders,
receptions, work orders, etc.) it lists the data (@Model.Property) you can use when
writing the code of an HTML Printing Format for that document: its
exact name, a description and its data type. It isn't a screen where documents are entered or
edited; it's a lookup guide for anyone designing or fine-tuning a custom printing format.
What is it and what is it for?
When you write an HTML Printing Format, your HTML is combined with
Razor expressions (for example @Model.Header.Number or
@Model.Relationship.Name) that AdmCloud replaces with the document's real data at print
time. But the exact set of properties available on Model changes depending on the
document type you're formatting: a Credit Invoice doesn't have the same properties as
a Work Order or a Location Transfer.
This screen solves exactly that: it's a catalog, document by document, of which properties exist,
what they represent and what type they are (text, date, a related AdmCloud record such as
SA_Relationships, or a list such as List SA_Trans_Items). When the data type
is an AdmCloud record or object, the link in that column takes you to the
Data Dictionary for that table, where you can see
its own fields in turn.
It's the same content shown on the Data Dictionary tab inside the HTML Printing Formats editor when that tab is enabled for your account: here you can browse it independently, by document, without needing to have a format open for editing.
How to use it
- Go to HTML Variables (address
/PFDocumentation). You'll see the list of every document type available to format. - Pick the document you're working on for your HTML Printing Format (for example, Credit Invoice or Sales Order).
- In that page's table, look up the field you need by its Field Name; the Description column tells you what it represents and the Data Type column tells you whether it's text, a date, a number, or a related object/list.
- If the data type links to a table (for example
SA_RelationshipsorList SA_Trans_Items), follow the link to open the Data Dictionary for that table and see the inner fields available inside that property (for example,Header.Items.Item.Descriptioninside an invoice's lines). - Use the exact field name, as it appears in the table, preceded by
Model., inside the code of your HTML Printing Format.
Data structure: common to every document
Every document type shares the same base group of properties, whether you're formatting an invoice, a reception or a work order:
| Field | What it's for | Data type |
|---|---|---|
Relationship | The customer, vendor or contact on the document. | SA_Relationships |
Logo | Your company's logo, as configured in the system. | SA_Files |
Address | The customer/vendor address linked to the document. | SA_Relationships_Addresses |
Division / Department | The document's division and department, if your company uses them. | GL_Divisions / SA_Departments |
ItemClass | The item's classification, available inside the document's lines. | IC_ItemClasses |
BarCodeBath | The document's barcode, for printing next to the document number. | Text |
CurrentUserName / CreatedBy | The user currently printing the document, and who originally created it. | Text |
CompanyInfo | Your company's data (legal name, tax ID, address, phone numbers, etc.). | _CompanyInfo |
Header | The transaction's full header (number, date, totals, currency, etc.). | SA_Transactions |
Header.Items | The document's lines (items or services), to loop over in your template. | List of SA_Trans_Items |
Header.Items.Item | The item or service on each line, with its own data (code, description, unit, etc.). | IC_Items |
Location | The location/warehouse linked to the document. | SA_Locations |
Caption | The document type's display name (for example, "Credit Invoice"), useful for generic titles. | Text |
BankAccountName | The name of the document's bank or cash account, when it applies. | Text |
On top of that base, each document type adds its own particular fields. For example, sales documents
commonly include Terms (payment terms), SalesRep, Taxes (tax
summary) or FiscalSequenceType (fiscal receipt type); purchasing and inventory documents
include fields such as PO_Items (items from the related purchase order) or
Prices (price levels); and Sales Orders also include Stock, with the item's
available inventory at print time. The exact detail for each document always lives on its own page
within this reference.
Documents covered in this reference
| Document | What it's used for |
|---|---|
| Credit Invoice / Cash Invoice | Sales invoiced on credit terms or in cash, with payment terms, sales rep, taxes and shipment method. |
| Cash Receipt | Collections received from customers and the documents they were applied to. |
| Cash Return | Merchandise returns with a cash refund. |
| Vendor Credit Note / Vendor Prepayment | Credits received from vendors and advances paid on account of purchases. |
| Quote / Quote Request | Price proposals sent to a customer and budget requests received. |
| Sales Order / Customer Return Request | Sales orders pending invoicing and merchandise return requests. |
| Purchase Order | Purchase orders sent to a vendor. |
| Reception / Vendor Reception / Reception Liquidation | Incoming merchandise from a purchase and its fiscal or cost liquidation. |
| Location Transfer / Location Transfer Settlement | Inventory movements between locations or warehouses. |
| Dispatch | Merchandise delivery or shipment linked to a sales document. |
| Maintenance Order / Work Order | Maintenance work on fixed assets or general work orders. |
| Service Order | Customer service jobs. |
| Promotion Invoice | Sales invoices with promotional items or terms. |
| Account Statement | A customer's or vendor's movements and outstanding balance as of a given date. |
Besides these documents, the reference includes two supporting pages: BaseModel, detailing the common fields described above, and GenericModel, with the generic fields reusable in any template regardless of the document.
Tips and common mistakes
Not sure a field exists for your document? Check that document's specific page first; if you can't find it there, check the BaseModel and GenericModel tables, since those are shared by every document type.
The field name must be typed exactly as it appears in the table (including
capitalization) and always preceded by Model.; a misspelled name causes a compile
error when previewing or printing the format.
When a field is a list (like Header.Items) or an object with its own fields (like
Header or Relationship), follow its Data Type link to the
Data Dictionary to see which inner properties you can use, for
example Header.Items.Item.Description or Relationship.Name.