Release 2.0.6 (#3900)
* cleanup invoice templates * cleanup invoice translations * fix invoice datetime for now * support invoice archive order by number and status * bump version * allow meta-field sub-classing * removed unused translation task.delete * prevent null in str_replace
This commit is contained in:
@@ -17,11 +17,11 @@ class Constants
|
||||
/**
|
||||
* The current release version
|
||||
*/
|
||||
public const VERSION = '2.0.5';
|
||||
public const VERSION = '2.0.6';
|
||||
/**
|
||||
* The current release: major * 10000 + minor * 100 + patch
|
||||
*/
|
||||
public const VERSION_ID = 20005;
|
||||
public const VERSION_ID = 20006;
|
||||
/**
|
||||
* The software name
|
||||
*/
|
||||
|
||||
@@ -109,7 +109,7 @@ final class InvoiceController extends AbstractController
|
||||
$total += \count($model->getCalculator()->getEntries());
|
||||
|
||||
$values = [
|
||||
'invoiceDate' => $query->getInvoiceDate(),
|
||||
'invoiceDate' => null,
|
||||
'template' => $customerTpl
|
||||
];
|
||||
|
||||
@@ -364,10 +364,10 @@ final class InvoiceController extends AbstractController
|
||||
$table->addColumn('mf_' . $metaColumn->getName(), ['title' => $metaColumn->getLabel(), 'class' => 'd-none', 'orderBy' => false]);
|
||||
}
|
||||
|
||||
$table->addColumn('invoice_number', ['class' => 'd-none d-md-table-cell w-min', 'title' => 'invoice.number', 'orderBy' => false]);
|
||||
$table->addColumn('invoice_number', ['class' => 'd-none d-md-table-cell w-min', 'title' => 'invoice.number', 'orderBy' => 'invoice.number']);
|
||||
$table->addColumn('due_date', ['class' => 'd-none w-min', 'title' => 'invoice.due_days', 'orderBy' => false]);
|
||||
$table->addColumn('payment_date', ['class' => 'd-none w-min', 'title' => 'invoice.payment_date', 'orderBy' => false]);
|
||||
$table->addColumn('status', ['class' => 'd-none d-sm-table-cell w-min', 'orderBy' => false]);
|
||||
$table->addColumn('status', ['class' => 'd-none d-sm-table-cell w-min', 'orderBy' => 'status']);
|
||||
$table->addColumn('subtotal', ['class' => 'd-none text-end w-min', 'title' => 'invoice.subtotal', 'orderBy' => false]);
|
||||
$table->addColumn('tax', ['class' => 'd-none text-end w-min', 'title' => 'invoice.tax']);
|
||||
$table->addColumn('total_rate', ['class' => 'd-none d-md-table-cell text-end w-min']);
|
||||
|
||||
@@ -61,13 +61,16 @@ final class InvoiceRendererType extends AbstractType
|
||||
|
||||
$type = array_pop($parts);
|
||||
|
||||
if (!\is_string($type)) {
|
||||
return 'programmatic';
|
||||
}
|
||||
|
||||
return match (strtolower($type)) {
|
||||
'json', 'txt', 'xml' => 'programmatic',
|
||||
'pdf' => 'PDF',
|
||||
'docx', 'doc' => 'Word',
|
||||
'xls', 'xlsx' => 'Excel',
|
||||
'ods' => 'LibreOffice',
|
||||
default => ucfirst($type),
|
||||
default => strtoupper($type),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ abstract class AbstractSpreadsheetRenderer extends AbstractRenderer
|
||||
if (\is_string($content) && str_starts_with($content, '=')) {
|
||||
$contentLooksLikeFormula = true;
|
||||
}
|
||||
$value = str_replace($searchKey, $content, $value);
|
||||
$value = str_replace($searchKey, $content ?? '', $value);
|
||||
}
|
||||
|
||||
if ($contentLooksLikeFormula && $firstReplacerPos === 0) {
|
||||
|
||||
@@ -204,7 +204,7 @@ class InvoiceRepository extends EntityRepository
|
||||
case 'date':
|
||||
$orderBy = 'i.createdAt';
|
||||
break;
|
||||
case 'number':
|
||||
case 'invoice.number':
|
||||
$orderBy = 'i.invoiceNumber';
|
||||
break;
|
||||
case 'payed':
|
||||
@@ -213,9 +213,11 @@ class InvoiceRepository extends EntityRepository
|
||||
case 'total_rate':
|
||||
$orderBy = 'i.total';
|
||||
break;
|
||||
case 'tax':
|
||||
case 'status':
|
||||
$orderBy = 'i.' . $orderBy;
|
||||
$orderBy = 'i.status';
|
||||
break;
|
||||
case 'tax':
|
||||
$orderBy = 'i.tax';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ class InvoiceArchiveQuery extends BaseQuery
|
||||
use DateRangeTrait;
|
||||
|
||||
public const INVOICE_ARCHIVE_ORDER_ALLOWED = [
|
||||
'date', 'total_rate',
|
||||
'date', 'invoice.number', 'status', 'total_rate'
|
||||
// TODO other fields have a problem with translation
|
||||
// 'number', 'tax', 'payed', 'status'
|
||||
// , 'tax', 'payed'
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user