1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Stubs for schema

This commit is contained in:
David Bomba 2024-05-12 20:11:01 +10:00
parent 34eb936927
commit 483eec6c08
3 changed files with 42 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,7 @@
namespace App\Http\Controllers;
use App\DataMapper\EDoc\Schema\RO;
use App\Utils\Statics;
use Illuminate\Http\Response;
@ -56,8 +57,15 @@ class StaticController extends BaseController
/** @var \App\Models\User $user */
$user = auth()->user();
$response = Statics::company($user->getLocale() ?? $user->company()->getLocale());
$response_data = Statics::company($user->getLocale() ?? $user->company()->getLocale());
return response()->json($response, 200, ['Content-type' => 'application/json; charset=utf-8'], JSON_PRETTY_PRINT);
if(request()->has('einvoice')){
$ro = new RO;
$response_data['einvoice_schema'] = $ro();
}
return response()->json($response_data, 200, ['Content-type' => 'application/json; charset=utf-8'], JSON_PRETTY_PRINT);
}
}

View File

@ -822,8 +822,16 @@ class TemplateService
$credits = collect($credits)
->map(function ($credit) {
$payments = [];
$this->entity = $credit;
if($credit->payments ?? false) {
$payments = $credit->payments->map(function ($payment) {
return $this->transformPayment($payment);
})->toArray();
}
return [
'amount' => Number::formatMoney($credit->amount, $credit->client),
'balance' => Number::formatMoney($credit->balance, $credit->client),
@ -879,7 +887,7 @@ class TemplateService
'vat_number' => $credit->client->vat_number ?? '',
'currency' => $credit->client->currency()->code ?? 'USD',
],
'payments' => [],
'payments' => $payments,
'total_tax_map' => $credit->calc()->getTotalTaxMap(),
'line_tax_map' => $credit->calc()->getTaxMap(),
];