laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.37k stars 671 forks source link

Invoice - Missing tax information #945

Closed AnalyzeMe closed 4 years ago

AnalyzeMe commented 4 years ago

Description:

I have configured tax rates in Stripe and the subscription is correctly generated (with the reverse charge) when i download the invoice from the stripe dashboard i can see on the invoice "Tax to be paid on reverse charge basis".

The problem is when i download the invoice in laravel cashier 11 the "Tax to be paid on reverse charge basis" is not shown, i also think it's a bit strange that the first check is about, if the invoice has tax, if it's set to reverse it whould never have tax on it.

What am i missing here?

Steps To Reproduce:

Just add reverse to customer in cashier and download invoice from cashier.

Code with issue

@if ($invoice->hasTax())
                        @unless ($invoice->isNotTaxExempt())
                            <tr>
                                <td colspan="{{ $invoice->hasTax() ? 3 : 2 }}" style="text-align: right;">
                                    @if ($invoice->isTaxExempt())
                                        Tax is exempted
                                    @else
                                        Tax to be paid on reverse charge basis
                                    @endif
                                </td>
                                <td></td>
                            </tr>
                        @else
                            @foreach ($invoice->taxes() as $tax)
                                <tr>
                                    <td colspan="3" style="text-align: right;">
                                        {{ $tax->display_name }} {{ $tax->jurisdiction ? ' - '.$tax->jurisdiction : '' }}
                                        ({{ $tax->percentage }}%{{ $tax->isInclusive() ? ' incl.' : '' }})
                                    </td>
                                    <td>{{ $tax->amount() }}</td>
                                </tr>
                            @endforeach
                        @endunless
                    @endif

I think is wrong to check @if ($invoice->hasTax()) when the customer has "reverse" it whould never contain any tax.

Screenshot attached. Invoice_Stripe_Cashier

Is this intended or is a bug? Thanks in advance for any clarification!

driesvints commented 4 years ago

Hey @AnalyzeMe, thanks for posting the screenshots. I think you're indeed correct that the first if check isn't needed. Feel free to send in a PR to remove them or I'll take care of it later today.

AnalyzeMe commented 4 years ago

I'm not sure how to send in a pull request.

Do u comment here or where can i see when you have changed the code? :)

driesvints commented 4 years ago

I'll let ya know.

driesvints commented 4 years ago

Didn't get around to this today. I'll tackle this on Monday and we'll release a fix on Tuesday.

driesvints commented 4 years ago

Fixed in https://github.com/laravel/cashier/pull/946