Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detailed CSV export option #2618

Merged
merged 11 commits into from
Sep 4, 2024
Merged

Add detailed CSV export option #2618

merged 11 commits into from
Sep 4, 2024

Conversation

talvasconcelos
Copy link
Collaborator

Optional detailed CSV export with the TPoS items list.

Normal behaviour:

"Status","Memo","Date","Amount (sats)","Fee (msats)","Tag","Payment Hash","Payment Proof","Webhook","Fiat Currency","Fiat Amount"
"success","Split payment: 10.0% for test split","2024-07-30 11:32","-162","0","splitpayments","fbd0dfdc19a53ec11adfb04773ebe560a9ed388b094de61a5ef2a5a853f23ea2","","","EUR","0.1"
"success","Split payment: 25.0% for wallet2","2024-07-30 11:32","-406","0","splitpayments","ba7537d0158dbe551c3e74c0ed0d3b5c2364d8a1df6df47c80b6ff4c8932a19c","","","EUR","0.25"
"success","€1.00 to normal","2024-07-30 11:31","1626","0","tpos","165d6b2c7e5bb1825d96c6866540b581080bd222ab3c95980a212eec110937a8","","","EUR","1.001"
"success","Split payment: 10.0% for test split","2024-07-30 11:29","-618","0","splitpayments","4cd9b47d126bddfbc18f1d3ca498b0932f99b79fccf349f5b1fc3c2e4b3803a9","","","EUR","0.38"

Detailed:

"Status","Memo","Date","Amount (sats)","Fee (msats)","Tag","Payment Hash","Payment Proof","Webhook","Fiat Currency","Fiat Amount","Items"
"success","Split payment: 10.0% for test split","2024-07-30 11:32","-162","0","splitpayments","fbd0dfdc19a53ec11adfb04773ebe560a9ed388b094de61a5ef2a5a853f23ea2","","","EUR","0.1",""
"success","Split payment: 25.0% for wallet2","2024-07-30 11:32","-406","0","splitpayments","ba7537d0158dbe551c3e74c0ed0d3b5c2364d8a1df6df47c80b6ff4c8932a19c","","","EUR","0.25",""
"success","€1.00 to normal","2024-07-30 11:31","1626","0","tpos","165d6b2c7e5bb1825d96c6866540b581080bd222ab3c95980a212eec110937a8","","","EUR","1.001",""
"success","Split payment: 10.0% for test split","2024-07-30 11:29","-618","0","splitpayments","4cd9b47d126bddfbc18f1d3ca498b0932f99b79fccf349f5b1fc3c2e4b3803a9","","","EUR","0.38",""
"success","Split payment: 25.0% for wallet2","2024-07-30 11:29","-1545","0","splitpayments","f0c886620b76fc1db730345c3605de3c8b96066fa67410128c6c95d4da09c785","","","EUR","0.95",""
"success","€3.80 to normal","2024-07-30 11:29","6183","0","tpos","88af00376b31b42049982366b8a828dcf7c2936beddaeef74678eba9436d3a25","","","EUR","3.801","{""currency"":""EUR"",""exchangeRate"":1627.013185264484,""items"":[{""price"":1,""formattedPrice"":""€1.00"",""quantity"":1,""title"":""test 1"",""tax"":10},{""price"":1.99,""formattedPrice"":""€1.99"",""quantity"":1,""title"":""test 2"",""tax"":23}],""taxIncluded"":false,""taxValue"":0.5577}"
"success","Split payment: 25.0% for wallet2","2024-07-30 11:24","-419","0","splitpayments","38c490645473c6608eaaa764de27c1ce464761d347b0c1ce420b0fc460037e4d","","","EUR","0.257",""
"success","Split payment: 10.0% for test split","2024-07-30 11:24","-167","0","splitpayments","90d2249aa557ad8f65b62a676779c28f58d01b0d969a3e06a61a7a1ad6b15fe0","","","EUR","0.103",""

Also fixed pending column on the paymentsCSV, it's now status

Closes #2325 , #2312

@talvasconcelos talvasconcelos added the feature request New feature request label Jul 31, 2024
@talvasconcelos

This comment was marked as resolved.

@dni

This comment was marked as resolved.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.29%. Comparing base (6341e1e) to head (b9072b0).
Report is 5 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2618      +/-   ##
==========================================
- Coverage   58.30%   58.29%   -0.01%     
==========================================
  Files          75       75              
  Lines       11400    11400              
==========================================
- Hits         6647     6646       -1     
- Misses       4753     4754       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@talvasconcelos

This comment was marked as resolved.

@motorina0

This comment was marked as resolved.

@motorina0

This comment was marked as resolved.

@talvasconcelos
Copy link
Collaborator Author

talvasconcelos commented Jul 31, 2024

Is this what one expects when exporting?

{""currency"":""USD"",""exchangeRate"":1512.4347447633495,""items"":[{""price"":10,""formattedPrice"":""$10.00"",""quantity"":1,""title"":""i1"",""tax"":20}],""taxIncluded"":false,""taxValue"":2}"

yes, it's JSON stringify of the items, the user can use it to build whatever type of report needed, i guess

looking at it now, maybe JSON.stringify is not needed (it's done in lnbits/tpos#86 )

@motorina0 motorina0 force-pushed the add_items_csv_export branch from 0d89afd to 7e803c6 Compare September 3, 2024 08:48
@motorina0
Copy link
Collaborator

export_details.mov

@dni
Copy link
Member

dni commented Sep 4, 2024

hitting enter does not add the tag, i think it should

@motorina0 motorina0 merged commit 8aa1716 into dev Sep 4, 2024
32 checks passed
@motorina0 motorina0 deleted the add_items_csv_export branch September 4, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants