CORE-POS/IS4C

View on GitHub
documentation/Reference Code/Wedge/installation/mysql/translog/views/lttsubtotals.viw

Summary

Maintainability
Test Coverage
use translog;
DROP VIEW IF EXISTS `lttsubtotals`;

CREATE view lttsubtotals as
select
tdate,
card_no,
runningTotal,
tenderTotal,
chargeTotal,
ccTotal,
paymentTotal,
memChargeTotal,
discountTTL,
discountableTTL,
memSpecial,
staffSpecial,
refundTotal,
couponTotal,
memCoupon,
0 as madCoupon,
percentDiscount,
taxable *  ((100 - percentDiscount)/100) * 0.07 as taxTotal,
scTaxable *  ((100 - percentDiscount)/100) * 0.07 as scTaxTotal,
fsTendered,
fsItems  - (fsItems * (percentDiscount)/100) + fsTendered as fsEligible,
fsTendered * 0.07 as fsTendered07,
fsTaxable * ((100 - percentDiscount)/100) as fsTaxable,
fsTaxable * ((100 - percentDiscount)/100) * 0.07 as fsTax,
scDiscountableTTL * 0.1 as scDiscount,
discountableTTL * percentDiscount / 100 as transDiscount,
(discountableTTL - (scDiscountableTTL * 0.1)) * percentDiscount / 100 as scTransDiscount,
LastID

from lttsummary