SaleHist Table (157)
Some tooltip text!
• 6 minutes to read
• 6 minutes to read
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.
Fields
Name | Description | Type | Null |
---|---|---|---|
salehist_id | Primary key | PK | |
sale_id | The sale | FK sale | |
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 (open, closed, lost) | 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 | ● |
Indexes
Fields | Types | Description |
---|---|---|
salehist_id | PK | Clustered, Unique |
sale_id | FK | Index |
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 |
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 |
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 |
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 |
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 |
sale | 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. |
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 |
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 |
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.
Security Flags
- Sentry controls access to items in this table using user's Role and data rights matrix on the table's parent.