This commit is contained in:
David Bomba 2023-11-01 17:07:12 +11:00
parent 62bdc708c1
commit bdc4e53a1b
3 changed files with 17 additions and 6 deletions

View File

@ -1 +1 @@
5.7.40
5.7.41

View File

@ -614,7 +614,7 @@ class PdfBuilder
} else {
$_type = Str::startsWith($type, '$') ? ltrim($type, '$') : $type;
foreach ($this->service->config->pdf_variables["{$_type}_columns"] as $key => $cell) {
foreach ($this->service->config->pdf_variables[$table_type] as $key => $cell) {
// We want to keep aliases like these:
// $task.cost => $task.rate
// $task.quantity => $task.hours
@ -773,7 +773,6 @@ class PdfBuilder
*/
public function buildTableHeader(string $type): array
{
$this->processTaxColumns($type);
$elements = [];
@ -785,11 +784,16 @@ class PdfBuilder
];
$table_type = "{$type}_columns";
$column_type = $type;
if ($type == 'product' && $this->service->config->entity instanceof Quote && !$this->service->config->settings_object?->sync_invoice_quote_columns) {
if ($type == 'product' && $this->service->config->entity instanceof Quote && !$this->service->config->settings?->sync_invoice_quote_columns) {
$table_type = "product_quote_columns";
$column_type = 'product_quote';
}
$this->processTaxColumns($column_type);
foreach ($this->service->config->pdf_variables[$table_type] as $column) {
if (array_key_exists($column, $aliases)) {
$elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($aliases[$column], 1) . '-th', 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]];
@ -831,6 +835,13 @@ class PdfBuilder
$type_id = 2;
}
/** 17-05-2023 need to explicity define product_quote here */
if ($type == 'product_quote') {
$type_id = 1;
$column_type = 'product_quote';
$type = 'product';
}
// At the moment we pass "task" or "product" as type.
// However, "pdf_variables" contains "$task.tax" or "$product.tax" <-- Notice the dollar sign.
// This sprintf() will help us convert "task" or "product" into "$task" or "$product" without

View File

@ -15,8 +15,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => env('APP_VERSION','5.7.40'),
'app_tag' => env('APP_TAG','5.7.40'),
'app_version' => env('APP_VERSION','5.7.41'),
'app_tag' => env('APP_TAG','5.7.41'),
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''),