Business classification

This commit is contained in:
David Bomba 2023-09-09 23:56:24 +10:00
parent f55a6022ce
commit 22367c1f19
3 changed files with 22 additions and 2 deletions

View File

@ -481,7 +481,14 @@ class CompanySettings extends BaseSettings
public $enable_e_invoice = false; public $enable_e_invoice = false;
public $statement_design_id = 'VolejRejNm';
public $delivery_note_design_id = 'VolejRejNm';
public $classification = ''; // individual, business, partnership, trust, charity, government, other
public static $casts = [ public static $casts = [
'classification' => 'string',
'enable_e_invoice' => 'bool', 'enable_e_invoice' => 'bool',
'default_expense_payment_type_id' => 'string', 'default_expense_payment_type_id' => 'string',
'e_invoice_type' => 'string', 'e_invoice_type' => 'string',
@ -711,6 +718,8 @@ class CompanySettings extends BaseSettings
'portal_custom_js' => 'string', 'portal_custom_js' => 'string',
'client_portal_enable_uploads' => 'bool', 'client_portal_enable_uploads' => 'bool',
'purchase_order_number_counter' => 'integer', 'purchase_order_number_counter' => 'integer',
'statement_design_id' => 'string',
'delivery_note_design_id' => 'string',
]; ];
public static $free_plan_casts = [ public static $free_plan_casts = [
@ -765,6 +774,8 @@ class CompanySettings extends BaseSettings
'quote_design_id', 'quote_design_id',
'credit_design_id', 'credit_design_id',
'purchase_order_design_id', 'purchase_order_design_id',
'statement_design_id',
'delivery_note_design_id',
]; ];
// /** // /**
@ -977,6 +988,15 @@ class CompanySettings extends BaseSettings
'$total', '$total',
'$credit.balance', '$credit.balance',
], ],
'statement_details' => [
'$statement_date',
'$balance'
],
'delivery_note_columns' => [
'$product.item',
'$product.description',
'$product.quantity',
],
]; ];
return json_decode(json_encode($variables)); return json_decode(json_encode($variables));

View File

@ -1318,7 +1318,6 @@ class PdfBuilder
{ {
$elements = []; $elements = [];
foreach ($variables as $variable) { foreach ($variables as $variable) {
$_variable = explode('.', $variable)[1]; $_variable = explode('.', $variable)[1];
$_customs = ['custom1', 'custom2', 'custom3', 'custom4']; $_customs = ['custom1', 'custom2', 'custom3', 'custom4'];

View File

@ -322,8 +322,9 @@ class Design extends BaseDesign
public function entityDetails(): array public function entityDetails(): array
{ {
if ($this->type === 'statement') { if ($this->type === 'statement') {
// $s_date = $this->translateDate(now(), $this->client->date_format(), $this->client->locale());
$variables = $this->context['pdf_variables']['statement_details'] ?? [];
$s_date = $this->translateDate($this->options['start_date'], $this->client->date_format(), $this->client->locale()) . " - " . $this->translateDate($this->options['end_date'], $this->client->date_format(), $this->client->locale()); $s_date = $this->translateDate($this->options['start_date'], $this->client->date_format(), $this->client->locale()) . " - " . $this->translateDate($this->options['end_date'], $this->client->date_format(), $this->client->locale());
return [ return [