mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-15 09:07:00 +02:00
UI fixes in Invoices
This commit is contained in:
parent
abdf0bcb7b
commit
c78f3db100
2 changed files with 11 additions and 6 deletions
|
@ -9,6 +9,7 @@ use Mpociot\VatCalculator\VatCalculator;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Exception\RequestException;
|
use GuzzleHttp\Exception\RequestException;
|
||||||
use Ramsey\Uuid\Uuid;
|
use Ramsey\Uuid\Uuid;
|
||||||
|
use League\ISO3166\ISO3166;
|
||||||
|
|
||||||
class FinancialsController extends Controller
|
class FinancialsController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -39,6 +40,7 @@ class FinancialsController extends Controller
|
||||||
return $response->withHeader('Location', '/invoices')->withStatus(302);
|
return $response->withHeader('Location', '/invoices')->withStatus(302);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$iso3166 = new ISO3166();
|
||||||
$db = $this->container->get('db');
|
$db = $this->container->get('db');
|
||||||
// Get the current URI
|
// Get the current URI
|
||||||
$uri = $request->getUri()->getPath();
|
$uri = $request->getUri()->getPath();
|
||||||
|
@ -78,6 +80,8 @@ class FinancialsController extends Controller
|
||||||
$validVAT = null;
|
$validVAT = null;
|
||||||
}
|
}
|
||||||
$totalAmount = $grossPrice + $taxValue;
|
$totalAmount = $grossPrice + $taxValue;
|
||||||
|
$billing_country = $iso3166->alpha2($billing['cc']);
|
||||||
|
$billing_country = $billing_country['name'];
|
||||||
|
|
||||||
return view($response,'admin/financials/viewInvoice.twig', [
|
return view($response,'admin/financials/viewInvoice.twig', [
|
||||||
'invoice_details' => $invoice_details,
|
'invoice_details' => $invoice_details,
|
||||||
|
@ -92,11 +96,12 @@ class FinancialsController extends Controller
|
||||||
'phone' => $phone,
|
'phone' => $phone,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
'vatRate' => ($taxRate * 100) . "%",
|
'vatRate' => ($taxRate * 100) . "%",
|
||||||
'vatAmount' => $taxValue,
|
'vatAmount' => sprintf("%.2f", $taxValue),
|
||||||
'validVAT' => $validVAT,
|
'validVAT' => $validVAT,
|
||||||
'netPrice' => $netPrice,
|
'netPrice' => sprintf("%.2f", $netPrice),
|
||||||
'total' => $totalAmount,
|
'total' => sprintf("%.2f", $totalAmount),
|
||||||
'currentUri' => $uri
|
'currentUri' => $uri,
|
||||||
|
'billing_country' => $billing_country,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
{{ billing_vat }} {% if validVAT %}<svg xmlns="http://www.w3.org/2000/svg" class="icon text-success" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" /></svg>{% endif %}<br>
|
{{ billing_vat }} {% if validVAT %}<svg xmlns="http://www.w3.org/2000/svg" class="icon text-success" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" /></svg>{% endif %}<br>
|
||||||
{{ billing.street1 }}<br>
|
{{ billing.street1 }}<br>
|
||||||
{{ billing.city }}, {{ billing.sp }}<br>
|
{{ billing.city }}, {{ billing.sp }}<br>
|
||||||
{{ billing.pc }}, {{ billing.cc }}<br>
|
{{ billing.pc }}, {{ billing_country }}<br>
|
||||||
{{ billing.email }}
|
{{ billing.email }}
|
||||||
</address>
|
</address>
|
||||||
</div>
|
</div>
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="text-center">{{ __('No items found.') }}</td>
|
<td colspan="3" class="text-center">{{ __('No items found.') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue