Game changing improvements for the Invoice Export report - #6835
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
NicolasDorier
marked this pull request as draft
July 8, 2025 08:06
Contributor
|
Reading just the description, the direction of this seems good to me. |
Member
|
+1 cACK, love to see these changes! |
NicolasDorier
marked this pull request as ready for review
July 10, 2025 03:23
dstrukt
self-requested a review
July 10, 2025 05:44
NicolasDorier
force-pushed
the
better-export
branch
from
July 11, 2025 01:04
a4abb38 to
f5ffd36
Compare
NicolasDorier
force-pushed
the
better-export
branch
from
July 11, 2025 07:13
f5ffd36 to
a130630
Compare
7 tasks
This was referenced Jul 9, 2026
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.
Talked with @pavlenex .
A common request we have from our users is that there are no good way of exporting the metadata from invoices in the reports. So I needed to approach the problem in several steps:
Legacy invoice exportreport is now calledInvoices.lightningAddressandlightningUsernameto metadata for lightning address payments, so it appears in the reportPayments, now it isInvoicesNewandExpiredinvoices which doesn't have any exception status nor any payment.Rewriting of fields in the Invoice Report
The old structure was:
ReceivedDate-> PaymentReceivedDateStoreId(Removed)OrderId(Removed)InvoiceExpirationDate(Removed)InvoiceMonitoringDate(Removed)Destination-> PaymentAddressPaymentType-> PaymentMethodIdCryptoCode-> PaymentCurrencyPaid-> PaymentAmountNetworkFee-> PaymentMethodFeeConversionRate-> RatePaidCurrency-> PaymentInvoiceAmountInvoiceTaxIncluded(Removed)InvoiceTip(Removed)InvoiceSubtotal(Removed)InvoiceItemCode(Removed)InvoiceItemDesc(Removed)BuyerEmail(Removed)Accounted(Removed)The new structure is
Export all metadata in the invoice export
The way I am handling this is by flattening the JSON into columns. For the carts, I create columns prefixed by the cart item id.
See here
Black-tea-countfor example.The field
SizeandNew Field 1comes from forms.Remove invoice specific data from lines if there is more than one payment
When an invoice have more than two payments, a user not being careful might use Excel and sum duplicated values of the same invoice more than once. For example, those two lines are from the same invoice, here was the data before:
Before:
Now:
The old behavior was very perverse, because for 99.999% of cases, the merchant will not have any issue. But one day, somebody makes two payments to the same invoice, then the merchant will end up counting things double.
For this reason, the metadata fields also only appears for the first payment.
Added a button in the invoice list to easily browse the report