Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| sale_id | INT | 10 | √ | null |  |  | The unique identifier for this record | ||||
| drug_id | INT | 10 | null |  | 
 | The id of the drug that was sold to the patient. 0 if the record is not dispensed to a patient | |||||
| inventory_id | INT | 10 | null |  |  | ||||||
| prescription_id | INT | 10 | 0 |  |  | ||||||
| pid | BIGINT | 19 | 0 |  | 
 | The internal patient identifier | |||||
| encounter | INT | 10 | 0 |  | 
 | The patient encounter which resulted in this drug being sold to the patient. | |||||
| user | VARCHAR | 255 | √ | NULL |  |  | |||||
| sale_date | DATE | 10 | null |  |  | The date the sale occurred on | |||||
| quantity | INT | 10 | 0 |  |  | The number of items sold of the drug | |||||
| fee | DECIMAL | 12,2 | 0.00 |  |  | The total price of the sale for the drug that was sold to the patient | |||||
| billed | BOOLEAN | 3 | 0 |  |  | indicates if the sale is posted to accounting | |||||
| xfer_inventory_id | INT | 10 | 0 |  |  | ||||||
| distributor_id | BIGINT | 19 | 0 |  |  | UNUSED - will be removed in the future | |||||
| notes | VARCHAR | 255 | '' |  |  | ||||||
| pricelevel | VARCHAR | 31 | √ | '' |  |  | |||||
| selector | VARCHAR | 255 | √ | '' |  |  | references drug_templates.selector | ||||
| bill_date | DATETIME | 19 | √ | NULL |  |  | |||||
| trans_type | TINYINT | 3 | 1 |  |  | 1=sale, 2=purchase, 3=return, 4=transfer, 5=adjustment | |||||
| chargecat | VARCHAR | 31 | √ | '' |  |  | 
Indexes
| Constraint Name | Type | Sort | Column(s) | 
|---|---|---|---|
| PRIMARY | Primary key | Asc | sale_id |