Commit Graph
33 Commits
Author SHA1 Message Date
efrilmandClaude Opus 5 992bb04816 feat(order): support weight-based products
Products like fish are sold per weighing (4.2 ons, 5.6 ons), which the
order line could not represent: quantity is INTEGER and prices are always
computed as quantity * unit_price.

Model one weighing as one order line. quantity stays INTEGER and keeps
meaning "how many items"; the measured amount goes into a new nullable
order_items.weight, and the line is priced weight * unit_price. Two
weighings of the same product are two lines, never merged into one.

Keeping quantity integral avoids float comparisons in void, refund and
split bill, where accumulated rounding error would silently misbehave —
"1.4 + 1.4 + 1.4" is not 4.2 in float64, which would leave a fully paid
split-bill item marked unpaid.

BillableQuantity() is now the single place that decides between weight
and count; every price and cost calculation goes through it. Missing one
would bill a 4.2 ons fish as a single ons — wrong money, no error.

Two database constraints back the design: a weighed line always carries a
positive weight, and its quantity is pinned to 1. The latter also makes
void all-or-nothing for weighed lines, so the row-splitting branch can
never produce a zero-weight remainder row.

Also wires product.unit_id through the API, which was previously not
settable at all, and corrects the misleading comment on the request's
unit_price field — that value has never been used; price always comes
from the database.

Design notes and the audit of every price multiplication site are in
docs/rfc-weight-based-products.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 17:14:42 +07:00
Efril 2c6864147b feat: cash advance 2026-08-13 14:38:28 +07:00
Efril e6078e3c0b feat(purchase 2026-08-11 22:41:10 +07:00
efrilm 9ae5be2c33 feat(purchasae): added team with category parent and central 2026-08-11 21:00:39 +07:00
Efril b9ac97178f feat: profit sharing 2026-08-05 19:28:38 +07:00
Efril e345aeee97 feat: new users role 2026-06-19 13:31:33 +07:00
ryan 69d8c8ce5e Add category table 2026-06-08 12:29:59 +07:00
ryan dc13bb5f93 update due date and range date 2026-05-29 18:24:14 +07:00
ryan da87d659df Add expense CRUD 2026-05-25 14:59:40 +07:00
ryan 4130cb66df refactor and add outlet product table 2026-05-13 21:58:54 +07:00
ryan d38a770ec5 Add omset milestone scheduler with owner role and revenue tracking 2026-05-13 09:48:17 +07:00
Efril 9d71b339b5 notification 2026-05-10 10:57:38 +07:00
Efril bbd6666299 user devices 2026-05-10 10:42:09 +07:00
Efril a7022dd4c1 ingredient composition 2026-04-27 21:17:12 +07:00
Aditya Siregar a520d0ed11 fix campaign rules 2025-09-18 13:39:37 +07:00
Aditya Siregar 65f61b65cf user auth register 2025-09-18 01:32:01 +07:00
Aditya Siregar 155016dec8 Add Campaign 2025-09-17 23:55:11 +07:00
Aditya Siregar 201e24041b Add Tiers and Game Prize 2025-09-17 19:30:17 +07:00
Aditya Siregar efe09c21e4 Add coa purchase and vendors 2025-09-12 01:12:11 +07:00
Aditya Siregar 8e9c14b860 Add order items 2025-08-08 22:33:08 +07:00
Aditya Siregar 96743cf50b Update 2025-08-03 00:34:25 +07:00
Aditya Siregar a759e0f57c init 2025-07-30 23:18:20 +07:00
aditya.siregar 4f5950543e init 2025-07-18 20:10:29 +07:00
aditya.siregar 1201b2e45b Add void print 2025-06-24 02:47:44 +07:00
aditya.siregar 09c9a4d59d update 2025-04-10 11:21:08 +07:00
aditya.siregar c41826bb1b Update Member 2025-03-15 15:51:18 +08:00
aditya.siregar 18003313dd Update template email 2025-03-08 00:35:23 +07:00
aditya.siregar 764ea68bf9 Update Payment VA 2024-10-15 11:52:34 +07:00
fernanda-one b1c1c0260b feat: filter order history 2024-08-10 23:21:01 +07:00
aditya.siregar bdf930445c Customer Order 2024-08-04 01:16:25 +07:00
aditya.siregar 4ae9079ff9 add order and payment 2024-06-04 02:59:31 +07:00
aditya.siregar 8a23e72230 Add User Partner and Product 2024-06-03 14:40:50 +07:00
aditya.siregar 67f1dbc850 init project 2024-05-28 14:14:55 +07:00