Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.9k
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat withCodeRabbit:
SupportNeed help? Create a ticket on oursupport page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
IzyPro commentedJul 8, 2025
@NicolasDorier do let me know if this concept is in alignment |
dstrukt commentedJul 9, 2025
!!! Excited to see this one come together. |
| Refunds = invoices.Sum(x => x.Refunds.Count), | ||
| SalesCount = invoices.LongLength, | ||
| Currency = invoices.FirstOrDefault()?.GetPayments(false)?.FirstOrDefault()?.Currency, | ||
| Taxes = invoices.Sum(x => x.TaxInPaymentCurrency()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why are you using payment currency here?
You are summing amounts that may be in different currencies. Not only payments can be in different currencies, but invoices too. So you can't just sum them.
NicolasDorier commentedJul 10, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@IzyPro if this is for the app, I think you should rather expose this API in the plugin of the app than in Core. Reports also have summaries, though they are calculated client side currently, so some non trivial work would need to be done for an endpoint that expose only the summaries. However, your API as is isn't good, even in the plugin. See my comment (you are adding different currencies together) |
IzyPro commentedJul 15, 2025
Alright |
feat: Store Sales Summary
Time-based store specific sales metrics
Provides API endpoint forbtcpayserver/app#91 andbtcpayserver/app#107