mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-17 15:52:15 +00:00
Set up billing profile
This commit is contained in:
@@ -216,9 +216,7 @@ class InvoiceController extends Controller
|
||||
'value' => $client->id,
|
||||
];
|
||||
}),
|
||||
'isVatPayer' => $user->invoiceProfile->ic_dph
|
||||
? true
|
||||
: false,
|
||||
'isVatPayer' => $user->invoiceProfile->ic_dph ?? false,
|
||||
'latestInvoiceNumber' => $user->regularInvoices->first()
|
||||
? (int) $user->regularInvoices->first()->invoice_number
|
||||
: null,
|
||||
|
||||
@@ -17,10 +17,17 @@ class InvoiceProfileController extends Controller
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
return response(
|
||||
new InvoiceProfileResource(Auth::user()->invoiceProfile),
|
||||
200
|
||||
);
|
||||
$user = Auth::user();
|
||||
|
||||
if ($user->invoiceProfile) {
|
||||
|
||||
return response(
|
||||
new InvoiceProfileResource($user->invoiceProfile),
|
||||
200
|
||||
);
|
||||
}
|
||||
|
||||
return response("Profile didn't exists", 404);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,9 @@ class UserResource extends JsonResource
|
||||
'created_at_formatted' => format_date($this->created_at, '%d. %B. %Y'),
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
|
||||
// OasisDrive
|
||||
'has_billing_profile' => $this->invoiceProfile ? true : false,
|
||||
],
|
||||
'relationships' => [
|
||||
'settings' => [
|
||||
|
||||
Reference in New Issue
Block a user