Skip to content
Astera Technology

Specify guest shares per bill item

Keep item-level allocation fractions and reconcile each line before preparing guest bill previews.

Assign shares to the original item

Synthetic bill has shared dish S costing HKD 60, split two-thirds to A and one-third to B, plus A’s drink at HKD 30. No tax, service charge or payment record is supplied. Each item’s fractions must be nonnegative and sum to one under the local allocation rule; therefore no individual share can exceed one. The guest previews are A70 and B20.

Synthetic guest-share requirements
ConstraintRequired recordExample decision rule
Item relationOriginal line ID + guest sharesS allocated once across A/B
Fraction reconciliationNonnegative shares; 2/3 + 1/3 = 1Reject negative shares or a sum other than one
Amount projectionA40 + drink30; B20Preview sum 90 matches original
Download editable CSV ↓

Test complete and overlapping shares

Filled synthetic acceptance cases
CaseInputExpected decision
A2/3,B1/3Shared S6040/20; allocation reconciles
A2/3,B2/3Shares total 4/3Reject overlapping allocation
A−1,B2Sum 1 but negative A shareReject invalid share domain
Download editable CSV ↓
  1. Read original bill lines
  2. Record shares per guest
  3. Check nonnegative shares and a sum of one
  4. Prepare reconciled guest previews

Unknown shares stay pending; equal splitting must not be assumed when the recorded request is different.

What are A and B’s preview amounts, and does that prove payment?

Show the worked answer

A HKD 70 and B HKD 20, totalling 90. No payment is established because no payment record is supplied.

Request line-level fractions in the export so a corrected share can be traced without replacing the full original bill.

Related resources