Financial Data
1 min
essential financial tables these tables are required to build sales and payment reports these tables are required to build sales and payment reports all sales totals can be derived from the sales table; however, for a detailed sales analysis link to the treatments and sold service packages tables all sales totals can be derived from the sales table; however, for a detailed sales analysis link to the treatments and sold service packages tables the charges table contains each payment received, with the payments table showing how each payment was allocated across different sales the charges table contains each payment received, with the payments table showing how each payment was allocated across different sales sales > all high level sales data total = sale total discount = total discount tax amount = total tax customer id = client ( users id ) taxable at > used to generate sales report first assigned when record is created and the first line item added updated when sale is closed updated when an invoice is generated for the sale closed at > used with taxable at to generate an immutable sale value assigned when a sale is closed or assigned when a invoice is genereated type 0 = counter sales 1 = record (soap) sales 2 = consolidated sales > omit avoid duplication of values status 0 = no sale 1 = pending 2 = paid 3 = partial 4 = overdraft edit state 1 = open ( taxable at can be updated) 2 = ready for check out ( taxable at can be updated) 3 = closed ( taxable at can be updated only by invoice generation) treatments > sold products sale id = sale id to reference the sales table vet id = user assigned to line entry product id = products id nir product id = reception notes products id sold service packages > sold services sale id = sale id to reference the sales table vet id = user assigned to line entry sold service packages products > products bundled as part of a service sold service package id = sold service packages id product id = products id nir product id = reception notes products id charges > payment received sale id = sale id to reference the sales table amount = total payment received amount refunded = total refunded card brand for card type (e g visa, master card, etc ) type 0 = none 1 = cash 2 = card 3 = bank transfer 4 = (not in use) 5 = online payment 6 = check 7 = other 8 = client credit 9 = care credit 10 = auto paid from owner change process payments > payment allocation sale id = sale id indicating charge allocation charge id = charge id to reference charges table refunds > refund detail charge id = charge id to reference charges table new invoice > invoice details sale id = sale id to reference the sales table
