Repository navigation
0.3.2: approval card totals invoices like CoinPay; never shows a discount value as the amount - #6
Merged
Merged
Conversation
…ount value as the amount
describeAction for a CoinPay draft invoice with lineItems [{quantity: 2,
unit_price: 150}] and discount {type: percent, value: 10} printed
"Amount 10": pick() fell through to the nested discount.value.
- pick() no longer descends into discount/tax/fee-like objects.
- Itemised invoices: subtotal, discount (percent or fixed), per-line tax
on the discounted share, and the total, in integer cents with CoinPay's
rounding (invoiceTotals, exported).
- When the amount cannot be pinned down (unusable items or discount, a
discount over the subtotal, an amount that disagrees with the items, or
an amount next to a discount/tax with no items) the card says
"see details" and shows the raw line items or arguments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan0 finding(s) No findings. |
ralyodio
added a commit
to InfernetProtocol/infernet-protocol
that referenced
this pull request
Nov 23, 2026
…otal discount and tax (#256) 0.2.1 backports the 0.3.2 fix (profullstack/chat-plugins#6): a CoinPay draft invoice with a 10% discount showed the discount value (10) as the Amount. The card now shows Subtotal, Discount, Tax and the total, or "see details" with the raw line items when the amount is ambiguous. Co-authored-by: riotcoder <riotcoder@profullstack.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The c0mpute CLI live check showed a CoinPay
invoice_create_draftcard reading Amount 10 for 2 x 150 with a 10% discount:pick()fell back to the nesteddiscount.value.pick()skips discount/tax/fee-like objects when it looks one level down.tax_rateon the discounted share) and Amount = total, computed in integer cents with the same rounding as CoinPay'scomputeInvoiceTotals. The newinvoiceTotalsis exported.Tests cover percent discounts, fixed discounts, tax, no line items, nested adjustment values and the ambiguous cases. All 44 pass.
🤖 Generated with Claude Code