Skip to content

Catalog-backed payment terms

Payment terms read from the catalog with their net days and cash discount.

simple volume small PaymentsCatalog
Languages
eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table payment_terms catalog(paymentTerm) (
  code     varchar(12) primarykey catalogField(column: "code")
  name     text catalogField(column: "name")
  days     int16 catalogField(column: "net_days")
  discount decimal(4, 2) catalogField(column: "discount_pct")
)

output csv

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

Payment terms

A single-table recipe that reads payment terms from the catalog: each term's code, name, net days and cash discount.

What it demonstrates

  • Catalog table — the catalog(paymentTerm) table selects the terms as its rows.
  • Catalog fields — catalogField reads the code, name (localized), net_days (an integer) and discount_pct (a decimal) of each record.

Run it

Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it into Chef, to generate the data. The repository's local runner (run by task test) also generates it and verifies its output.

The recipe outputs one CSV table file, payment_terms.csv, holding the catalog terms.

Adapt it

  • Add catalogField(column: "discount_days") to expose the discount window.
  • Join the code from an invoice line with a foreign key.

Guarantees

Every row has a unique code; each row matches a real term in the catalog. Names are the catalog's own, not generated text.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

catalogFieldtable:catalogprimary-key