Data
CRM Data Model
Quote
The Quote model represents a formal offer made to a customer, including detailed pricing for products or services. Each quote contains multiple EntryLots which in turn contain QuoteLines defining the detailed items and terms proposed.
Fields
| Field | Type | Description |
|---|---|---|
| quotenumber | string (PK) | [Primary Key] Quote Number. |
| name | string | Descriptive name for the quote. |
| description | string | Additional information to describe the quote, such as the products or services offered or details about the customer’s product preferences. |
| statecode | int | Shows whether the quote is draft, active, won, or closed. Only draft quotes can be edited. |
| versionnumber | int | Version Number. Used to prevent writing stale data. TODO: Is this true? |
| revisionnumber | int | Version number of the quote for revision history tracking. |
| billto_composite | string | Complete Bill To address. |
| shipto_composite | string | Complete Ship To address. |
| contact_composite | string | Complete Griesser Contact address/name. |
| totalamount | decimal | Total amount due, calculated as the sum of the products, discounts, freight, and taxes for the quote. |
| totalamountlessfreight | decimal | Total product amount for the quote, minus any discounts. This value is added to freight and tax amounts in the calculation for the total amount due for the quote. |
| totaldiscountamount | decimal | Total discount amount, based on the discount price and rate entered on the quote. |
| totallineitemamount | decimal | Sum of all existing and write-in products included on the quote, based on the specified price list and quantities. |
| totallineitemdiscountamount | decimal | Total of the Manual Discount amounts specified on all products included in the quote. This value is reflected in the Detail Amount field on the quote and is added to any discount amount or rate specified on the quote. |
| totaltax | decimal | Total of the Tax amounts specified on all products included in the quote, included in the Total Amount due calculation for the quote. |
| gri_amountbeforediscount | decimal | Amount Before Discount. |
| gri_customerdiscountpercentage | decimal | Customer discount percentage. |
| gri_manualdiscountamount write | decimal | Manual discount amount. |
| gri_manualdiscountpercentage | decimal | Manual discount percentage. |
| printinformation write | json[QuotePrintInformation] | JSON encoded information required for the Sunny Calculator AddOn & Quote printing. |
| pricingerrorcode | int | Pricing Error Code. |
| entrylots | EntryLot[] | Entry Lots included in this quote. |
State Code Values: See the section bellow
Pricing Error Code Values: See the section bellow.
QuotePrintInformation
The QuotePrintInformation model contains information required for the Sunny Calculator AddOn and quote printing. It includes details about surcharges and discounts associated with the quote, allowing for accurate display of the quote’s financial terms. It is embedded within the Quote model (encoded as a json object) and is not a separate entity.
Fields
| Field | Type | Description |
|---|---|---|
| surcharges | QuoteSurcharge[] | Surcharges included in the quote. |
| discounts | QuoteDiscount[] | Discounts included in the quote. |
| additionaldiscountsconsidered | bool | True if additional discounts are considered (checklist) in the quote. False if not. |
QuoteSurcharge & QuoteDiscount
The QuoteSurcharge and QuoteDiscount models represent additional surcharges (Aufschläge) and discounts (Abschläge) applied to the quote.
Fields
| Field | Type | Description |
|---|---|---|
| name | string | Name of the surcharge or discount. |
| percentage | decimal | Percentage of the surcharge or discount. Must always be positive (eg. 10% surcharge or discount). |
| price | decimal | Price of the surcharge or discount. Must always be positive (eg. a 10% surcharge on 1000.0 is 100.0, and a 10% discount is also 100.0). |
EntryLot (Work in Progress)
The EntryLot model represents a logical grouping of quote line items within a quote.
Each Entry Lot is uniquely identified by an ID and is associated with a specific quote via the quotenumber foreign key.
Entry Lots are used to organize and manage subsets of products or services quoted to a customer, allowing for structured presentation, processing, or categorization of quote components.
Each Entry Lot contains one or more QuoteLine entries, which define the detailed items included in that lot.
Fields
| Field | Type | Description |
|---|---|---|
| id | string (PK) | Entry Lot ID. |
| quotenumber | string (FK) | References Quote.number. Used to populate the Quote.entrylots list. |
| name | string | Optional (user provided) name for the Entry Lot. |
| quotelines write | QuoteLine[] | Quote Lines included in this entry lot. |
QuoteLine
The QuoteLine model represents a single product or service entry within a quote or entry lot. Each line item specifies key details such as the product name, quantity, unit price, discounts, and tax amounts. It is uniquely identified by an id and optionally grouped under an EntryLot via the entry_lot_id foreign key.
This model supports both catalog products and write-in (custom) items.
Fields
| Field | Type | Description |
|---|---|---|
| quotedetailid | string (PK) | Quote Line Detail ID. |
| enrylotid | string (FK) | References EntryLot.id. Used to populate the EntryLot.quotelines list (ordered by ‘QuoteLine.line_number’). |
| linenumber | int | Line item number for the quote product to identify and order the product correctly. |
| description | string | Additional product information (e.g., manufacturing details, substitutions). |
| producdescription | string | Description of the write-in product included in the quote. |
| productname | string | Name and description of the product. |
| productnumber | string | User-defined product ID. |
| perposition | string | Designates a Quote Line as a per-position. |
| quantity | decimal | Quantity of the product requested by the customer. |
| unit | string | Unit displayed to the user. TODO: How to do i18n? |
| priceperunit | decimal | Price per unit of the product. |
| amount | decimal | Total price/cost of the quote product, based on the price per unit without any discounts. |
| baseamount write | decimal | Base price based on unit price, volume discount, and quantity. |
| extendedamount | decimal | Total amount due (unit price × quantity + discounts and tax). |
| tax | decimal | Tax amount for the product. |
| gri_manualdiscountamount | decimal | Manual discount for the product. |
| gri_manualdiscountpercentage | decimal | Discount amount per unit if a specified volume is purchased. |
| gri_volumediscountamount | decimal | Discount percentage per unit if a specified volume is purchased. |
| gri_volumediscountpercentage | decimal | Volume-based discount percentage. |
| gri_measuringcost | decimal | Value of the Measuring Cost. Designated as ‘Planung’ in the design prototype. |
| gri_measuringhours write | decimal | Measuring hours. |
| gri_measuringprice | decimal | Measuring price. TODO: Not yet in CRM? |
| gri_mountingcost | decimal | Value of the Mounting Cost. Designated as ‘Montage’ in the design prototype. |
| gri_mountinghours write | decimal | Mounting hours. |
| gri_mountingprice | decimal | Mounting price. TODO: Not yet in CRM? |
| gri_m2 | decimal | Surface of items in Quote Line (in m^2).“ |
| printinformation write | json[QuoteLinePrintInformation] | JSON encoded information required for the Sunny Calculator AddOn & Quote printing. |
| pricingerrorcode | int | Pricing Error Code. |
Pricing Error Code Values: See the section bellow.
QuoteLinePrintInformation
The QuoteLinePrintInformation model contains information required for the Sunny Calculator AddOn and quote printing. It includes details about the dimensions and drive type of the items in the quote line, allowing for accurate display and processing of the quote’s product specifications. It is embedded within the QuoteLine model (encoded as a json object) and is not a separate entity.
| Field | Type | Description |
|---|---|---|
| width | decimal | Length/Width? of items in Quote Line. Designated as BK in the design prototype. |
| height | decimal | Height? of items in Quote Line. Designated as HL in the design prototype. |
| drive | string | Drive of the items in Quote Line. Designated as Antrieb in the design prototype. |
Notes
Quote State Code Values
| Code | Meaning |
|---|---|
| 0 | Draft (default, Quote still editable) |
| 1 | Active |
| 2 | Won |
| 3 | Closed |
“States: 0: Draft 1: Active 2: Won 3: Closed”
Pricing Error Code Values
| Code | Meaning |
|---|---|
| 0 | None (default) |
| 1 | Detail Error |
| 2 | Missing Price Level |
| 3 | Inactive Price Level |
| 4 | Missing Quantity |
| 5 | Missing Unit Price |
| 6 | Missing Product |
| 7 | Invalid Product |
| 8 | Missing Pricing Code |
| 9 | Invalid Pricing Code |
| 10 | Missing UOM |
| 11 | Product Not In Price Level |
| 12 | Missing Price Level Amount |
| 13 | Missing Price Level Percentage |
| 14 | Missing Price |
| 15 | Missing Current Cost |
| 16 | Missing Standard Cost |
| 17 | Invalid Price Level Amount |
| 18 | Invalid Price Level Percentage |
| 19 | Invalid Price |
| 20 | Invalid Current Cost |
| 21 | Invalid Standard Cost |
| 22 | Invalid Rounding Policy |
| 23 | Invalid Rounding Option |
| 24 | Invalid Rounding Amount |
| 25 | Price Calculation Error |
| 26 | Invalid Discount Type |
| 27 | Discount Type Invalid State |
| 28 | Invalid Discount |
| 29 | Invalid Quantity |
| 30 | Invalid Pricing Precision |
| 31 | Missing Product Default UOM |
| 32 | Missing Product UOM Schedule |
| 33 | Inactive Discount Type |
| 34 | Invalid Price Level Currency |
| 35 | Price Attribute Out Of Range |
| 36 | Base Currency Attribute Overflow |
| 37 | Base Currency Attribute Underflow |
| 38 | Transaction currency not set for product price list item |