CALL basketGetTax; SELECT o.id, o.sent, o.notes, o.companyFk, ag.description agency, v.code method, ad.nickname, ad.postalCode, ad.city, ad.street, t.*, c.credit, myClientGetDebt(NULL) debt FROM myBasket o JOIN vn.agencyMode ag ON ag.id = o.agencyModeFk LEFT JOIN myAddress ad ON ad.id = o.addressFk JOIN vn.deliveryMethod v ON v.id = o.deliveryMethodFk JOIN myClient c JOIN ( SELECT IFNULL(SUM(taxableBase), 0) taxableBase, IFNULL(SUM(tax), 0) tax FROM tmp.orderAmount ) t; DROP TEMPORARY TABLE tmp.orderAmount; DROP TEMPORARY TABLE tmp.orderTax; CALL basketConfirm

Order summary

Delivery at

Agency

,

Previous balance
Order total
Order VAT
Total debt
Credit
Exceeded credit

Amount to pay

Pay method

You have a favorable balance.
You have a favorable credit.
You will be redirected to the payment.
Make a transfer to one account. SELECT name, iban FROM mainAccountBank