Skip to content

Data

CRM Data Model

contains

has inlined in 'printinformation'

contains

contains

contains

has inlined in 'printinformation'

Quote

string

quotenumber

PK

string

name

string

description

int

statecode

int

versionnumber

int

revisionnumber

string

billto_composite

string

shipto_composite

string

contact_composite

decimal

totalamount

decimal

totalamountlessfreight

decimal

totaldiscountamount

decimal

totallineitemamount

decimal

totallineitemdiscountamount

decimal

totaltax

decimal

gri_amountbeforediscount

decimal

gri_customerdiscountpercentage

decimal

gri_manualdiscountamount

decimal

gri_manualdiscountpercentage

QuotePrintInformation

printinformation

int

pricingerrorcode

EntryLot[]

entrylots

EntryLot

string

id

PK

string

quotenumber

FK

string

name

QuoteLine[]

quotelines

QuotePrintInformation

QuoteSurcharge[]

surcharges

QuoteDiscount[]

discounts

bool

additionaldiscountsconsidered

QuoteSurcharge

string

name

decimal

percentage

decimal

price

QuoteDiscount

string

name

decimal

percentage

decimal

price

QuoteLine

string

entrylotid

FK

int

lineitemnumber

FK

string

description

string

productdescription

string

productname

string

productnumber

bool

perposition

decimal

quantity

string

unit

decimal

priceperunit

decimal

amount

decimal

baseamount

decimal

extendedamount

decimal

tax

decimal

gri_manualdiscountamount

decimal

gri_manualdiscountpercentage

decimal

gri_volumediscountamount

decimal

gri_volumediscountpercentage

decimal

gri_measuringcost

decimal

gri_measuringhours

decimal

gri_measuringprice

decimal

gri_measuringpricemanual

decimal

gri_measuringhoursmanual

decimal

gri_mountingcost

decimal

gri_mountinghours

decimal

gri_mountingprice

decimal

gri_mountingpricemanual

decimal

gri_mountinghoursmanual

decimal

gri_m2

QuoteLinePrintInformation

printinformation

int

pricingerrorcode

QuoteLinePrintInformation

decimal

width

decimal

height

string

drive

CRM(ish) Data Model (Simplified)

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

FieldTypeDescription
quotenumberstring (PK)[Primary Key] Quote Number.
namestringDescriptive name for the quote.
descriptionstringAdditional information to describe the quote, such as the products or services offered or details about the customer’s product preferences.
statecodeintShows whether the quote is draft, active, won, or closed. Only draft quotes can be edited.
versionnumberintVersion Number. Used to prevent writing stale data. TODO: Is this true?
revisionnumberintVersion number of the quote for revision history tracking.
billto_compositestringComplete Bill To address.
shipto_compositestringComplete Ship To address.
contact_compositestringComplete Griesser Contact address/name.
totalamountdecimalTotal amount due, calculated as the sum of the products, discounts, freight, and taxes for the quote.
totalamountlessfreightdecimalTotal 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.
totaldiscountamountdecimalTotal discount amount, based on the discount price and rate entered on the quote.
totallineitemamountdecimalSum of all existing and write-in products included on the quote, based on the specified price list and quantities.
totallineitemdiscountamountdecimalTotal 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.
totaltaxdecimalTotal of the Tax amounts specified on all products included in the quote, included in the Total Amount due calculation for the quote.
gri_amountbeforediscountdecimalAmount Before Discount.
gri_customerdiscountpercentagedecimalCustomer discount percentage.
gri_manualdiscountamount writedecimalManual discount amount.
gri_manualdiscountpercentagedecimalManual discount percentage.
printinformation writejson[QuotePrintInformation]JSON encoded information required for the Sunny Calculator AddOn & Quote printing.
pricingerrorcodeintPricing Error Code.
entrylotsEntryLot[]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

FieldTypeDescription
surchargesQuoteSurcharge[]Surcharges included in the quote.
discountsQuoteDiscount[]Discounts included in the quote.
additionaldiscountsconsideredboolTrue 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

FieldTypeDescription
namestringName of the surcharge or discount.
percentagedecimalPercentage of the surcharge or discount. Must always be positive (eg. 10% surcharge or discount).
pricedecimalPrice 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

FieldTypeDescription
idstring (PK)Entry Lot ID.
quotenumberstring (FK)References Quote.number. Used to populate the Quote.entrylots list.
namestringOptional (user provided) name for the Entry Lot.
quotelines writeQuoteLine[]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

FieldTypeDescription
quotedetailidstring (PK)Quote Line Detail ID.
enrylotidstring (FK)References EntryLot.id. Used to populate the EntryLot.quotelines list (ordered by ‘QuoteLine.line_number’).
linenumberintLine item number for the quote product to identify and order the product correctly.
descriptionstringAdditional product information (e.g., manufacturing details, substitutions).
producdescriptionstringDescription of the write-in product included in the quote.
productnamestringName and description of the product.
productnumberstringUser-defined product ID.
perpositionstringDesignates a Quote Line as a per-position.
quantitydecimalQuantity of the product requested by the customer.
unitstringUnit displayed to the user. TODO: How to do i18n?
priceperunitdecimalPrice per unit of the product.
amountdecimalTotal price/cost of the quote product, based on the price per unit without any discounts.
baseamount writedecimalBase price based on unit price, volume discount, and quantity.
extendedamountdecimalTotal amount due (unit price × quantity + discounts and tax).
taxdecimalTax amount for the product.
gri_manualdiscountamountdecimalManual discount for the product.
gri_manualdiscountpercentagedecimalDiscount amount per unit if a specified volume is purchased.
gri_volumediscountamountdecimalDiscount percentage per unit if a specified volume is purchased.
gri_volumediscountpercentagedecimalVolume-based discount percentage.
gri_measuringcostdecimalValue of the Measuring Cost. Designated as ‘Planung’ in the design prototype.
gri_measuringhours writedecimalMeasuring hours.
gri_measuringpricedecimalMeasuring price. TODO: Not yet in CRM?
gri_mountingcostdecimalValue of the Mounting Cost. Designated as ‘Montage’ in the design prototype.
gri_mountinghours writedecimalMounting hours.
gri_mountingpricedecimalMounting price. TODO: Not yet in CRM?
gri_m2decimalSurface of items in Quote Line (in m^2).“
printinformation writejson[QuoteLinePrintInformation]JSON encoded information required for the Sunny Calculator AddOn & Quote printing.
pricingerrorcodeintPricing 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.

FieldTypeDescription
widthdecimalLength/Width? of items in Quote Line. Designated as BK in the design prototype.
heightdecimalHeight? of items in Quote Line. Designated as HL in the design prototype.
drivestringDrive of the items in Quote Line. Designated as Antrieb in the design prototype.

Notes

Quote State Code Values

CodeMeaning
0Draft (default, Quote still editable)
1Active
2Won
3Closed

“States: 0: Draft 1: Active 2: Won 3: Closed”

Pricing Error Code Values

CodeMeaning
0None (default)
1Detail Error
2Missing Price Level
3Inactive Price Level
4Missing Quantity
5Missing Unit Price
6Missing Product
7Invalid Product
8Missing Pricing Code
9Invalid Pricing Code
10Missing UOM
11Product Not In Price Level
12Missing Price Level Amount
13Missing Price Level Percentage
14Missing Price
15Missing Current Cost
16Missing Standard Cost
17Invalid Price Level Amount
18Invalid Price Level Percentage
19Invalid Price
20Invalid Current Cost
21Invalid Standard Cost
22Invalid Rounding Policy
23Invalid Rounding Option
24Invalid Rounding Amount
25Price Calculation Error
26Invalid Discount Type
27Discount Type Invalid State
28Invalid Discount
29Invalid Quantity
30Invalid Pricing Precision
31Missing Product Default UOM
32Missing Product UOM Schedule
33Inactive Discount Type
34Invalid Price Level Currency
35Price Attribute Out Of Range
36Base Currency Attribute Overflow
37Base Currency Attribute Underflow
38Transaction currency not set for product price list item