Create invoice form part 1.

This commit is contained in:
Peter Papp
2021-04-30 17:53:19 +02:00
parent 5167ae520e
commit 3c3e82758d
51 changed files with 1890 additions and 763 deletions

View File

@@ -21,7 +21,7 @@ function base64_from_storage_image($filepath)
return null;
}
if (!Storage::exists($filepath)) {
if (! Storage::exists($filepath)) {
return null;
}
@@ -84,7 +84,6 @@ function invoice_total_discount($invoice, $format = false)
{
// Percent discount
if ($invoice['discount_type'] === 'percent') {
$discount = (int) (invoice_total_net($invoice) + invoice_total_tax($invoice)) * ($invoice['discount_rate'] / 100);
if ($format) {
@@ -96,7 +95,6 @@ function invoice_total_discount($invoice, $format = false)
// Value discount
if ($invoice['discount_type'] === 'value') {
if ($format) {
return Cashier::formatAmount($invoice['discount_rate'] * 100, $invoice['currency'], 'cs');
}
@@ -154,4 +152,4 @@ function invoice_total_tax($invoice, $format = false)
function format_to_currency($value, $currency = 'CZK', $locale = 'cs')
{
return Cashier::formatAmount(((int) $value * 100), $currency, $locale);
}
}