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

Invoice Unit price! #4218

Open
UBT-FJ opened this issue Oct 6, 2023 · 11 comments
Open

Invoice Unit price! #4218

UBT-FJ opened this issue Oct 6, 2023 · 11 comments

Comments

@UBT-FJ
Copy link

UBT-FJ commented Oct 6, 2023

Screenshot 2023-10-06 at 11 11 47 Hello, been testing the system and set the pricing in Integration Settings>Pricing Dimesions>Energy as per kWh, and the calcs are correct but the unit price is not showing in the invoice!

This was done with the ev-simulator.

@UBT-FJ
Copy link
Author

UBT-FJ commented Dec 6, 2023

anybody?
I also tried in stripe but cant get it to work!

@Zakichanu
Copy link

Hi, can i see your pricing definition?

@UBT-FJ
Copy link
Author

UBT-FJ commented Dec 6, 2023

Screenshot 2023-12-06 at 11 03 27 Screenshot 2023-12-06 at 11 03 21

I tried also the step size but it didnt work!

@Zakichanu
Copy link

I think the unit price is associated to the flat fee. If you add a flat fee of test, the unit price might return the flat fee

@UBT-FJ
Copy link
Author

UBT-FJ commented Dec 6, 2023

but I want to use the Enrgy, isnt that possible?

@Zakichanu
Copy link

What I am telling you is, the first row of the stripe invoice is exclusively for the flat fee on your Price dimension.

If you want to have the energy price, you can change the code to put it in the first line

@UBT-FJ
Copy link
Author

UBT-FJ commented Dec 6, 2023

What I am telling you is, the first row of the stripe invoice is exclusively for the flat fee on your Price dimension.

If you want to have the energy price, you can change the code to put it in the first line

Do you happen to know where should I change it? :(

@UBT-FJ
Copy link
Author

UBT-FJ commented Dec 6, 2023

What I am telling you is, the first row of the stripe invoice is exclusively for the flat fee on your Price dimension.

If you want to have the energy price, you can change the code to put it in the first line

I have just tested with the flat fee and it doesnt show either!
Screenshot 2023-12-06 at 13 19 15

@Zakichanu
Copy link

Did you figured it out, or are you confronting the same issue?

@UBT-FJ
Copy link
Author

UBT-FJ commented Dec 14, 2023

Did you figured it out, or are you confronting the same issue?

Hello @Zakichanu , thanks for getting back to this thread.

I read and followed a lot of code to found out that the unitPrice doesnt get with the other values in one of the functions!

Instead I ended up getting that value from the Transactions class.

In StripeBillingIntegration.ts, in this function buildLineItemDescription4PricedDimension()
there is also this const unitPrice = Utils.createDecimal(pricedData.unitPrice).toNumber().toLocaleString(userLocale); which returns 0!

So I had to make it like this const unitPrice = transaction.pricingModel.pricingDefinitions[0].dimensions.energy.pricedData.unitPrice; to get something like what you can see in the screenshot.

If you know a better way please let me know.

Screenshot 2023-12-14 at 21 04 31

@Zakichanu
Copy link

Hi @UBT-FJ,

That's a great way to modify this in my opinion. I never use this part in my case so I don't know if there is a better way for this.

I think we can close this issue then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants