CALL basketGetTax; SELECT o.id, o.date_send, o.note, o.company_id, ag.description agency, v.code method, ad.consignee, ad.zip_code, ad.city, ad.name address, t.*, c.credit, clientGetDebt(NULL) debt FROM basket o JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id LEFT JOIN address_view ad ON ad.id = o.address_id JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id JOIN customer_view c JOIN ( SELECT IFNULL(SUM(taxBase), 0) taxBase, IFNULL(SUM(tax + equalizationTax), 0) tax FROM tmp.orderTax ) t; DROP TEMPORARY TABLE tmp.orderTax; CALL basketConfirm

_Order summary

_Delivery at

_Agency {{order.agency}}

{{order.consignee}}

{{order.address}}

{{order.zipCode}}, {{order.city}}

_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 description, iban, entity_id, office, dc, number FROM vn2008.account_customer c