feat: discount coupons (front 8.3)

Gestão creates coupons in the Site tab: a code, a percentage or an amount
per billed metre, validity, a minimum of metres, use limits in all and per
customer, one product or all, and a note; they can be paused and deleted
(kept for history). The customer types the code at checkout; the server
checks it when the quote is made and again at approval, discounts only the
eligible items after the bands (never freight or the treatment) and keeps
the coupon on the order. Tiny gets the discount, the e-mail and receipt
show it, the order panel carries a badge and Números counts orders,
metres, discount and money per coupon.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-09 15:24:44 -03:00
parent 07ee38d677
commit 1d0353fe54
18 changed files with 698 additions and 15 deletions

View File

@@ -663,6 +663,15 @@ label.fopt{cursor:pointer;user-select:none}
#tab-site .siteScheduledRow .btn{height:30px;padding:0 10px;font-size:12.5px}
#tab-site .siteHistory{display:flex;flex-direction:column;gap:6px}
#tab-site .siteHistory h4{margin:0;font-size:12.5px;font-weight:600;color:var(--tx3)}
#tab-site .siteCouponList{display:flex;flex-direction:column;padding:0 18px 18px}
#tab-site .siteCouponRow{display:flex;flex-direction:column;gap:8px;padding:16px 0;border-top:1px solid var(--ln)}
#tab-site .siteCouponTop{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#tab-site .siteCouponTop b{font-size:14px}
#tab-site .siteCouponOffer{font-size:13.5px;font-weight:650;color:var(--tx2)}
#tab-site .siteCouponMeta{display:flex;gap:16px;flex-wrap:wrap;font-size:12.5px;color:var(--tx3)}
#tab-site .siteCouponActions{display:flex;gap:8px;flex-wrap:wrap}
#tab-site .siteCouponActions .btn{height:32px;padding:0 10px;font-size:12.5px}
#tab-site .siteCouponNote{margin:0;font-size:13px;color:var(--tx2)}
#tab-site .siteHistory .table{font-size:13px}
#tab-site .siteHistory .table th,#tab-site .siteHistory .table td{padding:8px 12px}
.page>*{flex-shrink:0}