mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Stubs for schema
This commit is contained in:
parent
34eb936927
commit
483eec6c08
23
app/DataMapper/EDoc/Schema/RO.php
Normal file
23
app/DataMapper/EDoc/Schema/RO.php
Normal file
File diff suppressed because one or more lines are too long
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\DataMapper\EDoc\Schema\RO;
|
||||||
use App\Utils\Statics;
|
use App\Utils\Statics;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
@ -56,8 +57,15 @@ class StaticController extends BaseController
|
|||||||
/** @var \App\Models\User $user */
|
/** @var \App\Models\User $user */
|
||||||
$user = auth()->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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -822,8 +822,16 @@ class TemplateService
|
|||||||
$credits = collect($credits)
|
$credits = collect($credits)
|
||||||
->map(function ($credit) {
|
->map(function ($credit) {
|
||||||
|
|
||||||
|
$payments = [];
|
||||||
|
|
||||||
$this->entity = $credit;
|
$this->entity = $credit;
|
||||||
|
|
||||||
|
if($credit->payments ?? false) {
|
||||||
|
$payments = $credit->payments->map(function ($payment) {
|
||||||
|
return $this->transformPayment($payment);
|
||||||
|
})->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'amount' => Number::formatMoney($credit->amount, $credit->client),
|
'amount' => Number::formatMoney($credit->amount, $credit->client),
|
||||||
'balance' => Number::formatMoney($credit->balance, $credit->client),
|
'balance' => Number::formatMoney($credit->balance, $credit->client),
|
||||||
@ -879,7 +887,7 @@ class TemplateService
|
|||||||
'vat_number' => $credit->client->vat_number ?? '',
|
'vat_number' => $credit->client->vat_number ?? '',
|
||||||
'currency' => $credit->client->currency()->code ?? 'USD',
|
'currency' => $credit->client->currency()->code ?? 'USD',
|
||||||
],
|
],
|
||||||
'payments' => [],
|
'payments' => $payments,
|
||||||
'total_tax_map' => $credit->calc()->getTotalTaxMap(),
|
'total_tax_map' => $credit->calc()->getTotalTaxMap(),
|
||||||
'line_tax_map' => $credit->calc()->getTaxMap(),
|
'line_tax_map' => $credit->calc()->getTaxMap(),
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user