sale Table (13)
• 8 minutes to read
Sales For every Sale record edited through the SuperOffice GUI, a copy of the current version of the record will be saved in the SaleHist table. This also applies to editing done through the SaleModel COM interface, but not to editing done through the OLE DB Provider or other channels.
Fields
Name |
Description |
Type |
Null |
sale_id |
Primary key |
PK |
|
associate_id |
Owning associate |
FK associate |
|
group_idx |
Owner's group whn sale was created |
FK UserGroup |
|
contact_id |
Optional contact reference |
FK contact |
|
person_id |
Optional person reference |
FK person |
● |
registered |
Registered date |
UtcDateTime |
● |
saledate |
(expected / lost / won) sales date |
DateTime |
|
amount |
Total sale amount |
Double |
● |
probability_idx |
Pointer to probability list value |
FK Prob |
|
appointment_id |
For future use |
FK appointment |
|
text_id |
Optional long description |
FK text |
● |
project_id |
Optional project reference |
FK project |
|
earning |
Earning on sale |
Double |
● |
earning_percent |
Earning as percent of total |
Double |
● |
userdef_id |
User-defined fields reference |
FK udsalesmall |
● |
userdef2_id |
User-defined fields reference |
FK udsalelarge |
● |
heading |
Sale heading (short description?) |
String(219) |
● |
credited_id |
Who is to be credited for the sale |
FK Credited |
● |
source_id |
Source of order |
FK Source |
● |
reason_id |
Why we lost it |
FK Reason |
● |
comptr_id |
Competitor |
FK Comptr |
● |
currency_id |
Currency of sale |
FK Currency |
● |
probability |
Actual probability, may differ from the one in the list |
UShort |
● |
status |
Status: 1 = open, 2 = sold, 3 = lost, 4 = stalled |
Enum SaleStatus |
● |
done |
Done (0=don't know, 1 = No, 2=Yes) |
Enum SaleDone |
● |
number1 |
Alphanumeric user field |
String(49) |
● |
visibility |
Obsolete, but still maintained denormalization of visiblefor |
UShort |
● |
source |
For future integration use; source of record |
UShort |
● |
registered_associate_id |
Registered by whom |
FK associate |
|
updated |
Last updated |
UtcDateTime |
|
updated_associate_id |
Last updated by whom |
FK associate |
|
updatedCount |
Number of updates made to this record |
UShort |
|
activeLinks |
Number of active links to documents and such |
UInt |
● |
saleType_id |
Link to list, sale type (big sale, small sale, no-process sale, ...) |
FK SaleType |
● |
postitText_id |
Paperclip text |
FK text |
● |
reasonStalled_id |
If the status is stalled, it should be commented here |
FK ReasonStalled |
● |
reopenDate |
Date the sale is to be reopened; valid only for status=stalled. Not necessarily the same as the nextDueDate. |
DateTime |
● |
nextDueDate |
Next due date, this is a denormalization of 'closest future activity date, or most recent if no future activities'. Maintained by the system, but very convenient for searching. |
DateTime |
● |
nddAppointment_id |
ID, can be 0, of the appointment that "caused" the nextDueDate |
FK appointment |
● |
reasonSold_id |
Reason why we made the sale |
FK ReasonSold |
● |
saleTypeCat_id |
Category of sale type, slaved from saletype |
FK SaleTypeCat |
● |
activeErpLinks |
The number of Erp Sync connections this record is synced with; count of the ErpExternalKey+ErpInternalKey relations |
Int |
● |
created_by_workflow_id |
The workflow this sale was created by |
FK workflow |
● |
Values for the 'done' field in the sale table
done |
ID |
Comment |
Unknown |
0 |
Sale Done/Not done state is unknown |
NotDone |
1 |
Sale is not done |
Done |
2 |
Sale is done |
Value for the 'status' field in the sale table
status |
ID |
Comment |
Unknown |
0 |
Sale status is unknown |
Open |
1 |
Sale is open |
Sold |
2 |
Sale has been sold (green $ in GUI) |
Lost |
3 |
Sale has been lost (red $ in GUI) |
Stalled |
4 |
Sale has been stalled, or "parked", awaiting further developments |
SaintAll |
1000 |
'All' choice for Saint. This is NOT an acceptable value for a sale, but is used by the Saint system for indexing all sales |
Indexes
Fields |
Types |
Description |
sale_id |
PK |
Clustered, Unique |
contact_id |
FK |
Index |
person_id |
FK |
Index |
saledate |
DateTime |
Index |
project_id |
FK |
Index |
userdef_id |
FK |
Index |
userdef2_id |
FK |
Index |
heading |
String(219) |
Index |
status |
Enum |
Index |
done |
Enum |
Index |
number1 |
String(49) |
Index |
source |
UShort |
Index |
associate_id, done, saledate |
FK, Enum, DateTime |
Index |
contact_id, saledate, associate_id |
FK, DateTime, FK |
Index |
project_id, saledate, associate_id |
FK, DateTime, FK |
Index |
created_by_workflow_id |
FK |
Index |
Relationships
Table |
Description |
appointment |
Tasks, appointments, followups, phone calls; and documents (document_id != 0). An appointment always has a corresponding record in VisibleFor specifying who may see this. |
associate |
Employees, resources and other users - except for External persons |
chat_session |
This table contains chat sessions. |
Comptr |
Comptr list table. List of all possible competitors (sale). |
contact |
Companies and Organizations. This table features a special record containing information about the contact that owns the database. |
Credited |
Credited list table. List of who is to be credited for the sale. |
Currency |
Currency list table |
email_item |
Email data |
person |
Persons in a company or an organizations. All associates have a corresponding person record |
Prob |
Prob list table. Probability, used in sales . |
project |
Projects |
Quote |
Quote root level, at most one per Sale, always connected to one Sale |
Reason |
Reason list table. Why we lost the sale (list) |
ReasonSold |
Why was the sale marked as sold (why did we succeed) |
ReasonStalled |
Why was the sale marked as stalled |
SaleHist |
Mirror image of the Sale table, providing a full transaction history. Every time you edit a sale, the current record of the sale is also saved here. |
SaleStakeholder |
Stakeholders in the sale, very similar to project members |
SaleType |
Type of sale - large solution, incremental, whatever fits the organization |
SaleTypeCat |
Category for sale type |
Source |
Source list table. Source for sale (list) |
text |
Long text fields from all over the system |
ticket |
This table contains the tickets (requests) of the system. Its purpose should be evident. |
udsalelarge |
User-defined fields |
udsalesmall |
User-defined fields |
UserGroup |
Secondary user groups |
VisibleFor |
Visible for rights, who may see this appointment/document, sale, salehist or selection |
workflow |
SuperOffice specific info about a workflow |
Replication Flags
- Area Management controlled table. Contents replicated to satellites and traveller databases.
- Replicate changes UP from satellites and travellers back to central.
- Copy to satellite and travel prototypes.
- Cache table during filtering.
Security Flags
- Sentry controls access to items in this table using user's Role and data rights matrix.
- Visibility controlled via matching VisibleFor row.