sap-labs-france / ev-server

The Open e-Mobility Charging Station management backend server (check also ev-dashboard and ev-mobile)
https://open-e-mobility.fr/
Apache License 2.0
154 stars 144 forks source link

Add tax codes on billing #1029

Closed Ninjeneer closed 3 years ago

LucasBrazi06 commented 4 years ago

For the tax codes you can use the same list as in User's badge IDs created by Sebastien with the following columns: a Radio Button, a Percentage, a Description. You can create as many tax code as you want with the Create button. You can Update/Delete the tax code only if it has not been yet used in the Billing system. We can have a meeting.

LucasBrazi06 commented 4 years ago

For the tax codes you can use the same list as in User's badge IDs created by Sebastien with the following columns: a Radio Button, a Percentage, a Description. You can create as many tax code as you want with the Create button. You can Update/Delete the tax code only if it has not been yet used in the Billing system. We can have a meeting.

On the other hand, if the tax is decorrelated from the invoices, meaning you can change the tax without changing all the invoices, we can live with only one tax and not handling a list in settings. To be discussed...

fcoutellier commented 4 years ago

Stripe Tax Code doc

https://stripe.com/docs/billing/taxes/tax-rates#creating-tax-rates and https://stripe.com/docs/api/customer_tax_ids

Sample using API

_// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_ZuJ9ZHJjLlEfinoKAl1aTgLi00U1lW0pG0');

const taxRates = await stripe.taxRates.create({ displayname: 'Sales Tax', description: 'SF Sales Tax', jurisdiction: 'CA - SF', percentage: 8.5, inclusive: false, });

Stripe Tax formular

image.png

LucasBrazi06 commented 4 years ago

Moved to icebox until all other tasks are done.

ClaudeROSSI commented 3 years ago

The life cycle of taxes (and tax codes) is quite strict and must be seen as a prerequisites to billing activities. It should not be possible to generate an invoice if the tax codes are not properly declared. In other words, the tax codes should NOT be an entity on the eMobility side. We should consider them as a prerequisite to the activation of the billing of the EV charging sessions.

With our STRIPE integration, the admin enters (centrally) the tax rate to use when charging transactions. With our first version, the tax rate is unique and defined in the billing settings. We will have for sure to make this more flexible (e.g.: per site and per product (energy / parking))

So, with the STRIPE integration, we do not manage on our side a list of tax codes. We simply make sure the external 'account' such as the STRIPE account is properly configured and only activate the billing of transactions after checking the prerequisites.

I will open new issues, to make sure the prerequisites are checked on a regular basis (everyday?) and clarify how to handle the situation where a tax rate gets archived and a new one needs to be used for subsequent invoices.