2019-02-17 11:34:46 +01:00
< ? php
2019-05-11 05:32:07 +02:00
/**
2020-09-06 11:38:10 +02:00
* Invoice Ninja ( https :// invoiceninja . com ) .
2019-05-11 05:32:07 +02:00
*
* @ link https :// github . com / invoiceninja / invoiceninja source repository
*
2024-04-12 06:15:41 +02:00
* @ copyright Copyright ( c ) 2024. Invoice Ninja LLC ( https :// invoiceninja . com )
2019-05-11 05:32:07 +02:00
*
2021-06-16 08:58:16 +02:00
* @ license https :// www . elastic . co / licensing / elastic - license
2019-05-11 05:32:07 +02:00
*/
2019-02-17 11:34:46 +01:00
namespace App\DataMapper ;
2020-03-06 12:10:59 +01:00
use App\Utils\Traits\MakesHash ;
2020-10-28 11:10:49 +01:00
use stdClass ;
2019-04-29 07:50:08 +02:00
2019-02-17 11:34:46 +01:00
/**
2020-09-06 11:38:10 +02:00
* CompanySettings .
2019-02-17 11:34:46 +01:00
*/
2020-03-21 06:37:30 +01:00
class CompanySettings extends BaseSettings
{
use MakesHash ;
/*Group settings based on functionality*/
2019-10-30 03:41:18 +01:00
2020-03-21 06:37:30 +01:00
/*Invoice*/
2020-11-04 06:22:51 +01:00
public $auto_archive_invoice = false ; // @implemented
2020-03-21 06:37:30 +01:00
2022-06-30 08:09:06 +02:00
public $qr_iban = '' ; //@implemented
2024-01-14 05:05:00 +01:00
2022-06-30 08:09:06 +02:00
public $besr_id = '' ; //@implemented
2022-06-30 06:29:18 +02:00
2024-06-06 05:06:07 +02:00
public $lock_invoices = 'off' ; //off,when_sent,when_paid,end_of_month //@implemented
2020-07-16 13:01:39 +02:00
2020-11-04 06:22:51 +01:00
public $enable_client_portal_tasks = false ; //@ben to implement
2022-06-21 11:57:17 +02:00
2021-06-22 23:54:06 +02:00
public $show_all_tasks_client_portal = 'invoiced' ; // all, uninvoiced, invoiced
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $enable_client_portal_password = false ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $enable_client_portal = true ; //@implemented
2022-06-21 11:57:17 +02:00
2021-01-13 08:47:14 +01:00
public $enable_client_portal_dashboard = false ; // @TODO There currently is no dashboard so this is pending
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $signature_on_pdf = false ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 09:43:20 +01:00
public $document_email_attachment = false ; //@TODO I assume this is 3rd party attachments on the entity to be included
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $portal_design_id = '1' ; //?@deprecated
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $timezone_id = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $date_format_id = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $military_time = false ; // @TODOImplemented in Tasks only?
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $language_id = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $show_currency_code = false ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $company_gateway_ids = '' ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $currency_id = '1' ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $custom_value1 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $custom_value2 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $custom_value3 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $custom_value4 = '' ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $default_task_rate = 0 ; // @TODO Where do we inject this?
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $payment_terms = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-30 08:43:33 +01:00
public $send_reminders = true ; //@TODO
2020-03-21 06:37:30 +01:00
2020-11-04 06:22:51 +01:00
public $custom_message_dashboard = '' ; // @TODO There currently is no dashboard so this is pending
2022-06-21 11:57:17 +02:00
2020-11-16 15:37:09 +01:00
public $custom_message_unpaid_invoice = '' ;
2022-06-21 11:57:17 +02:00
2020-11-16 15:37:09 +01:00
public $custom_message_paid_invoice = '' ;
2022-06-21 11:57:17 +02:00
2020-11-16 15:37:09 +01:00
public $custom_message_unapproved_quote = '' ;
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $auto_archive_quote = false ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $auto_convert_quote = true ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 06:22:51 +01:00
public $auto_email_invoice = true ; //@only used for Recurring Invoices, if set to false, we never send?
2020-03-21 06:37:30 +01:00
2022-03-10 21:45:23 +01:00
public $entity_send_time = 6 ;
2021-06-10 13:25:47 +02:00
2020-11-04 06:22:51 +01:00
public $inclusive_taxes = false ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $quote_footer = '' ; //@implmented
2020-03-21 06:37:30 +01:00
2021-08-24 15:37:16 +02:00
public $translations ;
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $counter_number_applied = 'when_saved' ; // when_saved , when_sent //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $quote_number_applied = 'when_saved' ; // when_saved , when_sent //@implemented
2020-03-21 06:37:30 +01:00
/* Counters */
2020-11-04 07:02:15 +01:00
public $invoice_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $invoice_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $recurring_invoice_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $recurring_invoice_number_counter = 1 ; //@implemented
2020-10-06 06:11:48 +02:00
2020-11-04 07:02:15 +01:00
public $quote_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $quote_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $client_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $client_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $credit_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $credit_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $task_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $task_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $expense_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $expense_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2022-06-05 05:59:33 +02:00
public $recurring_expense_number_pattern = '' ;
2022-06-21 11:57:17 +02:00
2022-06-05 05:59:33 +02:00
public $recurring_expense_number_counter = 1 ;
2021-08-24 03:29:56 +02:00
2022-06-05 05:59:33 +02:00
public $recurring_quote_number_pattern = '' ;
2022-06-21 11:57:17 +02:00
2022-06-05 05:59:33 +02:00
public $recurring_quote_number_counter = 1 ;
2021-08-24 07:32:22 +02:00
2020-11-04 07:02:15 +01:00
public $vendor_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $vendor_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $ticket_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $ticket_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $payment_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $payment_number_counter = 1 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $project_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $project_number_counter = 1 ; //@implemented
2020-10-19 23:18:09 +02:00
2022-05-31 00:28:32 +02:00
public $purchase_order_number_pattern = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2022-05-31 00:28:32 +02:00
public $purchase_order_number_counter = 1 ; //@implemented
2020-11-04 07:02:15 +01:00
public $shared_invoice_quote_counter = false ; //@implemented
2022-06-21 11:57:17 +02:00
2021-03-17 10:28:44 +01:00
public $shared_invoice_credit_counter = false ; //@implemented
2022-06-21 11:57:17 +02:00
2021-03-25 11:55:59 +01:00
public $recurring_number_prefix = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $reset_counter_frequency_id = '0' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $reset_counter_date = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $counter_padding = 4 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-04 07:02:15 +01:00
public $auto_bill = 'off' ; //off,always,optin,optout //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $auto_bill_date = 'on_due_date' ; // on_due_date , on_send_date //@implemented
2020-08-19 07:24:35 +02:00
2020-11-04 09:43:20 +01:00
public $invoice_terms = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $quote_terms = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $invoice_taxes = 0 ; // ? used in AP only?
2021-10-20 00:51:33 +02:00
public $invoice_design_id = 'Wpmbk5ezJn' ; //@implemented
2022-06-21 11:57:17 +02:00
2021-10-20 00:51:33 +02:00
public $quote_design_id = 'Wpmbk5ezJn' ; //@implemented
2022-06-21 11:57:17 +02:00
2021-10-20 00:51:33 +02:00
public $credit_design_id = 'Wpmbk5ezJn' ; //@implemented
2022-06-05 12:30:56 +02:00
public $purchase_order_design_id = 'Wpmbk5ezJn' ;
2022-06-21 11:57:17 +02:00
2022-06-05 12:30:56 +02:00
public $purchase_order_footer = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2022-06-05 12:30:56 +02:00
public $purchase_order_terms = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2022-06-05 12:30:56 +02:00
public $purchase_order_public_notes = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2022-06-05 12:30:56 +02:00
public $require_purchase_order_signature = false ; //@TODO ben to confirm
2022-06-21 11:57:17 +02:00
2020-11-04 09:43:20 +01:00
public $invoice_footer = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 09:43:20 +01:00
public $credit_footer = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 09:43:20 +01:00
public $credit_terms = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $invoice_labels = '' ; //@TODO used in AP only?
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $tax_name1 = '' ; //@TODO where do we use this?
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $tax_rate1 = 0 ; //@TODO where do we use this?
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $tax_name2 = '' ; //@TODO where do we use this?
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $tax_rate2 = 0 ; //@TODO where do we use this?
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $tax_name3 = '' ; //@TODO where do we use this?
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $tax_rate3 = 0 ; //@TODO where do we use this?
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $payment_type_id = '0' ; //@TODO where do we use this?
2021-04-01 10:07:32 +02:00
public $valid_until = '' ; //@implemented
2020-11-04 07:02:15 +01:00
public $show_accept_invoice_terms = false ; //@TODO ben to confirm
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $show_accept_quote_terms = false ; //@TODO ben to confirm
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $require_invoice_signature = false ; //@TODO ben to confirm
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $require_quote_signature = false ; //@TODO ben to confirm
2020-03-21 06:37:30 +01:00
//email settings
2024-03-17 13:00:19 +01:00
public $email_sending_method = 'default' ; //enum 'default','gmail','office365' 'client_postmark', 'client_mailgun', 'mailgun', 'client_brevo' //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $gmail_sending_user_id = '0' ; //@implemented
2021-06-17 13:55:56 +02:00
public $reply_to_email = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2021-06-17 13:55:56 +02:00
public $reply_to_name = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $bcc_email = '' ; //@TODO
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $pdf_email_attachment = false ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $ubl_email_attachment = false ; //@implemented
public $email_style = 'light' ; //plain, light, dark, custom //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_style_custom = '' ; //the template itself //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_invoice = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_quote = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_credit = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_payment = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_payment_partial = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_statement = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2022-06-07 00:12:06 +02:00
public $email_subject_purchase_order = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2022-06-07 00:12:06 +02:00
public $email_template_purchase_order = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_invoice = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_credit = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_quote = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_payment = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_payment_partial = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_statement = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_reminder1 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_reminder2 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_reminder3 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_reminder_endless = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_reminder1 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_reminder2 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_reminder3 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_reminder_endless = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_signature = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-25 15:19:52 +01:00
public $enable_email_markup = true ; //@TODO -
2020-11-04 07:02:15 +01:00
public $email_subject_custom1 = '' ; //@TODO
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_custom2 = '' ; //@TODO
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_subject_custom3 = '' ; //@TODO
2020-11-25 15:19:52 +01:00
public $email_template_custom1 = '' ; //@TODO
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_custom2 = '' ; //@TODO
2022-06-21 11:57:17 +02:00
2020-11-04 07:02:15 +01:00
public $email_template_custom3 = '' ; //@TODO
2020-11-12 02:43:32 +01:00
public $enable_reminder1 = false ; //@implmemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $enable_reminder2 = false ; //@implmemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $enable_reminder3 = false ; //@implmemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $enable_reminder_endless = false ; //@implmemented
2020-11-04 07:02:15 +01:00
2022-06-21 11:57:17 +02:00
public $num_days_reminder1 = 0 ; //@implmemented
public $num_days_reminder2 = 0 ; //@implmemented
public $num_days_reminder3 = 0 ; //@implmemented
2020-03-21 06:37:30 +01:00
2020-11-12 02:43:32 +01:00
public $schedule_reminder1 = '' ; // (enum: after_invoice_date, before_due_date, after_due_date) implmemented
2022-06-21 11:57:17 +02:00
2020-11-25 15:19:52 +01:00
public $schedule_reminder2 = '' ; // (enum: after_invoice_date, before_due_date, after_due_date) implmemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $schedule_reminder3 = '' ; // (enum: after_invoice_date, before_due_date, after_due_date) implmemented
2020-03-21 06:37:30 +01:00
2021-05-27 03:19:07 +02:00
public $reminder_send_time = 0 ; //number of seconds from UTC +0 to send reminders @TODO
2020-03-21 06:37:30 +01:00
2020-11-12 02:43:32 +01:00
public $late_fee_amount1 = 0 ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $late_fee_amount2 = 0 ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $late_fee_amount3 = 0 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-12 02:43:32 +01:00
public $late_fee_percent1 = 0 ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $late_fee_percent2 = 0 ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $late_fee_percent3 = 0 ; //@implemented
2020-11-04 10:32:49 +01:00
2020-11-04 08:57:16 +01:00
public $endless_reminder_frequency_id = '0' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $late_fee_endless_amount = 0 ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $late_fee_endless_percent = 0 ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-12 02:43:32 +01:00
public $client_online_payment_notification = true ; //@todo implement in notifications check this bool prior to sending payment notification to client
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $client_manual_payment_notification = true ; //@todo implement in notifications check this bool prior to sending manual payment notification to client
2020-03-21 06:37:30 +01:00
/* Company Meta data that we can use to build sub companies*/
2020-11-04 08:57:16 +01:00
public $name = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $company_logo = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $website = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $address1 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $address2 = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $city = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $state = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $postal_code = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $phone = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $email = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $country_id ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $vat_number = '' ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $id_number = '' ; //@implemented
2020-03-21 06:37:30 +01:00
2020-09-06 11:38:10 +02:00
public $page_size = 'A4' ; //Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6
2022-06-21 11:57:17 +02:00
2021-04-08 00:19:36 +02:00
public $page_layout = 'portrait' ;
2022-06-21 11:57:17 +02:00
2023-02-09 00:02:17 +01:00
public $font_size = 16 ; //@implemented
2022-06-21 11:57:17 +02:00
2020-09-06 11:38:10 +02:00
public $primary_font = 'Roboto' ;
2022-06-21 11:57:17 +02:00
2020-09-06 11:38:10 +02:00
public $secondary_font = 'Roboto' ;
2022-06-21 11:57:17 +02:00
2021-07-07 11:15:58 +02:00
public $primary_color = '#298AAB' ;
2022-06-21 11:57:17 +02:00
2021-01-29 13:05:03 +01:00
public $secondary_color = '#7081e0' ;
2020-09-08 06:02:00 +02:00
2022-05-25 08:34:43 +02:00
public $page_numbering = false ;
2022-06-21 11:57:17 +02:00
2022-05-25 08:34:43 +02:00
public $page_numbering_alignment = 'C' ; //C,R,L
2020-11-04 08:57:16 +01:00
public $hide_paid_to_date = false ; //@TODO where?
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $embed_documents = false ; //@TODO where?
2022-06-21 11:57:17 +02:00
2021-05-31 00:17:42 +02:00
public $all_pages_header = false ; //@deprecated 31-05-2021
2022-06-21 11:57:17 +02:00
2021-05-31 00:17:42 +02:00
public $all_pages_footer = false ; //@deprecated 31-05-2021
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $pdf_variables = '' ; //@implemented
2020-03-21 06:37:30 +01:00
2020-11-12 02:43:32 +01:00
public $portal_custom_head = '' ; //@TODO @BEN
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $portal_custom_css = '' ; //@TODO @BEN
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $portal_custom_footer = '' ; //@TODO @BEN
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $portal_custom_js = '' ; //@TODO @BEN
2020-04-17 12:15:26 +02:00
2021-06-05 12:31:11 +02:00
public $client_can_register = false ; //@deorecated 04/06/2021
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $client_portal_terms = '' ; //@TODO @BEN
2022-06-21 11:57:17 +02:00
2020-11-12 02:43:32 +01:00
public $client_portal_privacy_policy = '' ; //@TODO @BEN
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $client_portal_enable_uploads = false ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $client_portal_allow_under_payment = false ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $client_portal_under_payment_minimum = 0 ; //@implemented
2022-06-21 11:57:17 +02:00
2020-11-04 08:57:16 +01:00
public $client_portal_allow_over_payment = false ; //@implemented
2020-08-28 03:06:46 +02:00
2020-11-04 08:57:16 +01:00
public $use_credits_payment = 'off' ; //always, option, off //@implemented
2022-06-21 11:57:17 +02:00
2021-01-07 07:08:34 +01:00
public $hide_empty_columns_on_pdf = false ;
2022-06-21 11:57:17 +02:00
2021-09-03 14:59:48 +02:00
public $email_from_name = '' ;
2022-06-21 11:57:17 +02:00
2022-04-27 01:05:16 +02:00
public $auto_archive_invoice_cancelled = false ;
2020-10-26 20:10:04 +01:00
2022-09-02 12:43:35 +02:00
public $vendor_portal_enable_uploads = false ;
public $send_email_on_mark_paid = false ;
2022-07-06 07:18:41 +02:00
2023-01-11 09:29:27 +01:00
public $postmark_secret = '' ;
2023-02-01 22:26:20 +01:00
public $custom_sending_email = '' ;
2024-01-14 05:05:00 +01:00
2023-01-11 09:29:27 +01:00
public $mailgun_secret = '' ;
2024-01-14 05:05:00 +01:00
2023-01-11 09:29:27 +01:00
public $mailgun_domain = '' ;
2023-03-23 03:03:37 +01:00
public $mailgun_endpoint = 'api.mailgun.net' ; //api.eu.mailgun.net
2023-12-18 19:37:13 +01:00
public $brevo_secret = '' ;
2023-01-12 14:32:54 +01:00
public $auto_bill_standard_invoices = false ;
public $email_alignment = 'center' ; // center , left, right
2023-01-16 23:43:11 +01:00
public $show_email_footer = true ;
2023-01-27 12:49:25 +01:00
public $company_logo_size = '' ;
public $show_paid_stamp = false ;
public $show_shipping_address = false ;
2023-01-16 23:43:11 +01:00
2023-02-02 09:10:41 +01:00
public $accept_client_input_quote_approval = false ;
2023-02-23 12:39:51 +01:00
public $allow_billable_task_items = true ;
2023-02-16 23:34:50 +01:00
2023-02-17 11:05:01 +01:00
public $show_task_item_description = false ;
2023-03-15 01:41:59 +01:00
public $client_initiated_payments = false ;
public $client_initiated_payments_minimum = 0 ;
public $sync_invoice_quote_columns = true ;
2023-04-20 23:54:35 +02:00
public $e_invoice_type = 'EN16931' ;
2024-03-20 23:40:19 +01:00
public $e_quote_type = 'OrderX_Comfort' ;
2023-04-24 09:03:02 +02:00
public $default_expense_payment_type_id = '0' ;
2023-04-28 03:39:41 +02:00
public $enable_e_invoice = false ;
2023-10-04 06:29:31 +02:00
public $delivery_note_design_id = '' ;
2024-01-14 05:05:00 +01:00
2023-10-04 06:29:31 +02:00
public $statement_design_id = '' ;
2024-01-14 05:05:00 +01:00
2023-10-04 06:29:31 +02:00
public $payment_receipt_design_id = '' ;
2023-09-09 15:56:24 +02:00
2023-10-04 06:29:31 +02:00
public $payment_refund_design_id = '' ;
2023-09-09 15:56:24 +02:00
public $classification = '' ; // individual, business, partnership, trust, charity, government, other
2023-09-11 03:05:05 +02:00
2023-11-17 22:13:09 +01:00
public $payment_email_all_contacts = false ;
2024-01-28 05:05:30 +01:00
public $show_pdfhtml_on_mobile = true ;
2024-02-13 05:25:18 +01:00
2024-02-17 08:24:26 +01:00
public $use_unapplied_payment = 'off' ; //always, option, off //@implemented
2024-03-16 02:36:40 +01:00
public $enable_rappen_rounding = false ;
2024-04-28 10:16:56 +02:00
public bool $task_round_up = true ;
public int $task_round_to_nearest = 1 ;
2024-06-21 11:40:56 +02:00
/** quote reminders */
public $email_quote_template_reminder1 = '' ;
public $email_quote_subject_reminder1 = '' ;
public $enable_quote_reminder1 = false ;
public $quote_num_days_reminder1 = 0 ;
public $quote_schedule_reminder1 = '' ; //before_valid_until_date,after_valid_until_date,after_quote_date
public $quote_late_fee_amount1 = 0 ;
public $quote_late_fee_percent1 = 0 ;
2024-08-22 08:45:06 +02:00
2024-08-09 06:44:39 +02:00
public string $payment_flow = 'default' ; //smooth
2024-06-21 11:40:56 +02:00
2020-03-21 06:37:30 +01:00
public static $casts = [
2024-08-09 06:44:39 +02:00
'payment_flow' => 'string' ,
2024-06-21 11:40:56 +02:00
'enable_quote_reminder1' => 'bool' ,
2024-06-21 11:51:04 +02:00
'quote_num_days_reminder1' => 'int' ,
2024-06-21 11:40:56 +02:00
'quote_schedule_reminder1' => 'string' ,
'quote_late_fee_amount1' => 'float' ,
'quote_late_fee_percent1' => 'float' ,
'email_quote_template_reminder1' => 'string' ,
'email_quote_subject_reminder1' => 'string' ,
2024-04-28 10:16:56 +02:00
'task_round_up' => 'bool' ,
'task_round_to_nearest' => 'int' ,
2024-03-20 23:40:19 +01:00
'e_quote_type' => 'string' ,
2024-03-16 02:36:40 +01:00
'enable_rappen_rounding' => 'bool' ,
2024-02-17 08:24:26 +01:00
'use_unapplied_payment' => 'string' ,
2024-01-28 05:05:30 +01:00
'show_pdfhtml_on_mobile' => 'bool' ,
2023-11-17 22:13:09 +01:00
'payment_email_all_contacts' => 'bool' ,
2023-10-04 06:29:31 +02:00
'statement_design_id' => 'string' ,
'delivery_note_design_id' => 'string' ,
'payment_receipt_design_id' => 'string' ,
'payment_refund_design_id' => 'string' ,
2023-10-26 04:57:44 +02:00
'enable_e_invoice' => 'bool' ,
2023-09-11 03:05:05 +02:00
'classification' => 'string' ,
2023-04-24 09:03:02 +02:00
'default_expense_payment_type_id' => 'string' ,
2023-10-26 04:57:44 +02:00
'e_invoice_type' => 'string' ,
'mailgun_endpoint' => 'string' ,
2023-03-15 01:41:59 +01:00
'client_initiated_payments' => 'bool' ,
'client_initiated_payments_minimum' => 'float' ,
'sync_invoice_quote_columns' => 'bool' ,
2023-02-17 11:05:01 +01:00
'show_task_item_description' => 'bool' ,
2023-02-16 23:34:50 +01:00
'allow_billable_task_items' => 'bool' ,
2023-02-02 09:10:41 +01:00
'accept_client_input_quote_approval' => 'bool' ,
2023-12-18 19:37:13 +01:00
'custom_sending_email' => 'string' ,
'show_paid_stamp' => 'bool' ,
'show_shipping_address' => 'bool' ,
'company_logo_size' => 'string' ,
'show_email_footer' => 'bool' ,
'email_alignment' => 'string' ,
'auto_bill_standard_invoices' => 'bool' ,
'postmark_secret' => 'string' ,
'mailgun_secret' => 'string' ,
'mailgun_domain' => 'string' ,
'brevo_secret' => 'string' ,
'send_email_on_mark_paid' => 'bool' ,
'vendor_portal_enable_uploads' => 'bool' ,
'besr_id' => 'string' ,
'qr_iban' => 'string' ,
'email_subject_purchase_order' => 'string' ,
'email_template_purchase_order' => 'string' ,
'require_purchase_order_signature' => 'bool' ,
'purchase_order_public_notes' => 'string' ,
'purchase_order_terms' => 'string' ,
'purchase_order_design_id' => 'string' ,
'purchase_order_footer' => 'string' ,
'purchase_order_number_pattern' => 'string' ,
'page_numbering_alignment' => 'string' ,
'page_numbering' => 'bool' ,
'auto_archive_invoice_cancelled' => 'bool' ,
'email_from_name' => 'string' ,
'show_all_tasks_client_portal' => 'string' ,
'entity_send_time' => 'int' ,
'shared_invoice_credit_counter' => 'bool' ,
'reply_to_name' => 'string' ,
'hide_empty_columns_on_pdf' => 'bool' ,
'enable_reminder_endless' => 'bool' ,
'use_credits_payment' => 'string' ,
'recurring_invoice_number_pattern' => 'string' ,
'recurring_invoice_number_counter' => 'int' ,
2024-01-14 05:05:00 +01:00
'client_portal_under_payment_minimum' => 'float' ,
2023-12-18 19:37:13 +01:00
'auto_bill_date' => 'string' ,
'primary_color' => 'string' ,
'secondary_color' => 'string' ,
'client_portal_allow_under_payment' => 'bool' ,
'client_portal_allow_over_payment' => 'bool' ,
'auto_bill' => 'string' ,
'lock_invoices' => 'string' ,
'client_portal_terms' => 'string' ,
'client_portal_privacy_policy' => 'string' ,
'client_can_register' => 'bool' ,
'portal_design_id' => 'string' ,
'late_fee_endless_percent' => 'float' ,
'late_fee_endless_amount' => 'float' ,
'auto_email_invoice' => 'bool' ,
'reminder_send_time' => 'int' ,
'email_sending_method' => 'string' ,
'gmail_sending_user_id' => 'string' ,
'counter_number_applied' => 'string' ,
'quote_number_applied' => 'string' ,
'email_subject_custom1' => 'string' ,
'email_subject_custom2' => 'string' ,
'email_subject_custom3' => 'string' ,
'email_template_custom1' => 'string' ,
'email_template_custom2' => 'string' ,
'email_template_custom3' => 'string' ,
'enable_reminder1' => 'bool' ,
'enable_reminder2' => 'bool' ,
'enable_reminder3' => 'bool' ,
'num_days_reminder1' => 'int' ,
'num_days_reminder2' => 'int' ,
'num_days_reminder3' => 'int' ,
'schedule_reminder1' => 'string' , // (enum: after_invoice_date, before_due_date, after_due_date)
'schedule_reminder2' => 'string' , // (enum: after_invoice_date, before_due_date, after_due_date)
'schedule_reminder3' => 'string' , // (enum: after_invoice_date, before_due_date, after_due_date)
'late_fee_amount1' => 'float' ,
'late_fee_amount2' => 'float' ,
'late_fee_amount3' => 'float' ,
'late_fee_percent1' => 'float' ,
'late_fee_percent2' => 'float' ,
'late_fee_percent3' => 'float' ,
'endless_reminder_frequency_id' => 'integer' ,
2020-03-21 06:37:30 +01:00
'client_online_payment_notification' => 'bool' ,
'client_manual_payment_notification' => 'bool' ,
2023-12-18 19:37:13 +01:00
'document_email_attachment' => 'bool' ,
'enable_client_portal_password' => 'bool' ,
'enable_email_markup' => 'bool' ,
'enable_client_portal_dashboard' => 'bool' ,
'enable_client_portal' => 'bool' ,
'email_template_statement' => 'string' ,
'email_subject_statement' => 'string' ,
'signature_on_pdf' => 'bool' ,
'quote_footer' => 'string' ,
'page_size' => 'string' ,
'page_layout' => 'string' ,
'font_size' => 'int' ,
'primary_font' => 'string' ,
'secondary_font' => 'string' ,
'hide_paid_to_date' => 'bool' ,
'embed_documents' => 'bool' ,
'all_pages_header' => 'bool' ,
'all_pages_footer' => 'bool' ,
'project_number_pattern' => 'string' ,
'project_number_counter' => 'int' ,
'task_number_pattern' => 'string' ,
'task_number_counter' => 'int' ,
'expense_number_pattern' => 'string' ,
'expense_number_counter' => 'int' ,
'recurring_expense_number_pattern' => 'string' ,
'recurring_expense_number_counter' => 'int' ,
'recurring_quote_number_pattern' => 'string' ,
'recurring_quote_number_counter' => 'int' ,
'vendor_number_pattern' => 'string' ,
'vendor_number_counter' => 'int' ,
'ticket_number_pattern' => 'string' ,
'ticket_number_counter' => 'int' ,
'payment_number_pattern' => 'string' ,
'payment_number_counter' => 'int' ,
'reply_to_email' => 'string' ,
'bcc_email' => 'string' ,
'pdf_email_attachment' => 'bool' ,
'ubl_email_attachment' => 'bool' ,
'email_style' => 'string' ,
'email_style_custom' => 'string' ,
'company_gateway_ids' => 'string' ,
'address1' => 'string' ,
'address2' => 'string' ,
'city' => 'string' ,
'company_logo' => 'string' ,
'country_id' => 'string' ,
'client_number_pattern' => 'string' ,
'client_number_counter' => 'integer' ,
'credit_number_pattern' => 'string' ,
'credit_number_counter' => 'integer' ,
'currency_id' => 'string' ,
'custom_value1' => 'string' ,
'custom_value2' => 'string' ,
'custom_value3' => 'string' ,
'custom_value4' => 'string' ,
'custom_message_dashboard' => 'string' ,
'custom_message_unpaid_invoice' => 'string' ,
'custom_message_paid_invoice' => 'string' ,
'custom_message_unapproved_quote' => 'string' ,
'default_task_rate' => 'float' ,
'email_signature' => 'string' ,
'email_subject_invoice' => 'string' ,
'email_subject_quote' => 'string' ,
'email_subject_credit' => 'string' ,
'email_subject_payment' => 'string' ,
'email_subject_payment_partial' => 'string' ,
'email_template_invoice' => 'string' ,
'email_template_quote' => 'string' ,
'email_template_credit' => 'string' ,
'email_template_payment' => 'string' ,
'email_template_payment_partial' => 'string' ,
'email_subject_reminder1' => 'string' ,
'email_subject_reminder2' => 'string' ,
'email_subject_reminder3' => 'string' ,
'email_subject_reminder_endless' => 'string' ,
'email_template_reminder1' => 'string' ,
'email_template_reminder2' => 'string' ,
'email_template_reminder3' => 'string' ,
'email_template_reminder_endless' => 'string' ,
'inclusive_taxes' => 'bool' ,
'invoice_number_pattern' => 'string' ,
'invoice_number_counter' => 'integer' ,
'invoice_design_id' => 'string' ,
2021-02-22 23:08:43 +01:00
// 'invoice_fields' => 'string',
2023-12-18 19:37:13 +01:00
'invoice_taxes' => 'int' ,
2020-06-10 23:56:08 +02:00
//'enabled_item_tax_rates' => 'int',
2023-12-18 19:37:13 +01:00
'invoice_footer' => 'string' ,
'invoice_labels' => 'string' ,
'invoice_terms' => 'string' ,
'credit_footer' => 'string' ,
'credit_terms' => 'string' ,
'name' => 'string' ,
'payment_terms' => 'string' ,
'payment_type_id' => 'string' ,
'phone' => 'string' ,
'postal_code' => 'string' ,
'quote_design_id' => 'string' ,
'credit_design_id' => 'string' ,
'quote_number_pattern' => 'string' ,
'quote_number_counter' => 'integer' ,
'quote_terms' => 'string' ,
'recurring_number_prefix' => 'string' ,
'reset_counter_frequency_id' => 'integer' ,
'reset_counter_date' => 'string' ,
'require_invoice_signature' => 'bool' ,
'require_quote_signature' => 'bool' ,
'state' => 'string' ,
'email' => 'string' ,
'vat_number' => 'string' ,
'id_number' => 'string' ,
'tax_name1' => 'string' ,
'tax_name2' => 'string' ,
'tax_name3' => 'string' ,
'tax_rate1' => 'float' ,
'tax_rate2' => 'float' ,
'tax_rate3' => 'float' ,
'show_accept_quote_terms' => 'bool' ,
'show_accept_invoice_terms' => 'bool' ,
'timezone_id' => 'string' ,
'valid_until' => 'string' ,
'date_format_id' => 'string' ,
'military_time' => 'bool' ,
'language_id' => 'string' ,
'show_currency_code' => 'bool' ,
'send_reminders' => 'bool' ,
'enable_client_portal_tasks' => 'bool' ,
'auto_archive_invoice' => 'bool' ,
'auto_archive_quote' => 'bool' ,
'auto_convert_quote' => 'bool' ,
'shared_invoice_quote_counter' => 'bool' ,
'counter_padding' => 'integer' ,
2020-11-04 07:02:15 +01:00
//'design' => 'string',
2023-12-18 19:37:13 +01:00
'website' => 'string' ,
'pdf_variables' => 'object' ,
'portal_custom_head' => 'string' ,
'portal_custom_css' => 'string' ,
'portal_custom_footer' => 'string' ,
'portal_custom_js' => 'string' ,
'client_portal_enable_uploads' => 'bool' ,
'purchase_order_number_counter' => 'integer' ,
2020-03-21 06:37:30 +01:00
];
2020-04-21 07:16:45 +02:00
public static $free_plan_casts = [
2023-12-18 19:37:13 +01:00
'currency_id' => 'string' ,
'company_gateway_ids' => 'string' ,
'address1' => 'string' ,
'address2' => 'string' ,
'city' => 'string' ,
'company_logo' => 'string' ,
'country_id' => 'string' ,
'custom_value1' => 'string' ,
'custom_value2' => 'string' ,
'custom_value3' => 'string' ,
'custom_value4' => 'string' ,
'inclusive_taxes' => 'bool' ,
'name' => 'string' ,
'payment_terms' => 'string' ,
'payment_type_id' => 'string' ,
'phone' => 'string' ,
'postal_code' => 'string' ,
'state' => 'string' ,
'email' => 'string' ,
'vat_number' => 'string' ,
'id_number' => 'string' ,
'tax_name1' => 'string' ,
'tax_name2' => 'string' ,
'tax_name3' => 'string' ,
'tax_rate1' => 'float' ,
'tax_rate2' => 'float' ,
'tax_rate3' => 'float' ,
'timezone_id' => 'string' ,
'date_format_id' => 'string' ,
'military_time' => 'bool' ,
'language_id' => 'string' ,
'show_currency_code' => 'bool' ,
'website' => 'string' ,
'default_task_rate' => 'float' ,
2020-04-21 07:16:45 +02:00
];
2020-03-21 06:37:30 +01:00
/**
* Array of variables which
2020-09-06 11:38:10 +02:00
* cannot be modified client side .
2020-03-21 06:37:30 +01:00
*/
public static $protected_fields = [
// 'credit_number_counter',
// 'invoice_number_counter',
// 'quote_number_counter',
];
2020-04-21 07:16:45 +02:00
public static $string_casts = [
'invoice_design_id' ,
'quote_design_id' ,
'credit_design_id' ,
2022-06-08 00:27:47 +02:00
'purchase_order_design_id' ,
2023-09-09 15:56:24 +02:00
'statement_design_id' ,
'delivery_note_design_id' ,
2020-04-21 07:16:45 +02:00
];
2023-07-25 12:04:04 +02:00
// /**
// * Cast object values and return entire class
// * prevents missing properties from not being returned
// * and always ensure an up to date class is returned.
// *
// * @param $obj
// * @deprecated
// */
// public function __construct()
// {
// // parent::__construct($obj);
// }
2020-03-21 06:37:30 +01:00
/**
2020-09-06 11:38:10 +02:00
* Provides class defaults on init .
2020-11-25 15:19:52 +01:00
*
2020-11-01 06:09:09 +01:00
* @ return stdClass
2020-03-21 06:37:30 +01:00
*/
2020-10-28 11:10:49 +01:00
public static function defaults () : stdClass
2020-03-21 06:37:30 +01:00
{
2020-09-06 11:38:10 +02:00
$data = ( object ) get_class_vars ( self :: class );
2020-03-21 06:37:30 +01:00
unset ( $data -> casts );
unset ( $data -> protected_fields );
2020-04-21 07:16:45 +02:00
unset ( $data -> free_plan_casts );
unset ( $data -> string_casts );
2020-09-06 11:38:10 +02:00
$data -> timezone_id = ( string ) config ( 'ninja.i18n.timezone_id' );
$data -> currency_id = ( string ) config ( 'ninja.i18n.currency_id' );
$data -> language_id = ( string ) config ( 'ninja.i18n.language_id' );
$data -> payment_terms = ( string ) config ( 'ninja.i18n.payment_terms' );
$data -> military_time = ( bool ) config ( 'ninja.i18n.military_time' );
$data -> date_format_id = ( string ) config ( 'ninja.i18n.date_format_id' );
$data -> country_id = ( string ) config ( 'ninja.i18n.country_id' );
$data -> translations = ( object ) [];
$data -> pdf_variables = ( object ) self :: getEntityVariableDefaults ();
2020-03-21 06:37:30 +01:00
return self :: setCasts ( $data , self :: $casts );
}
/**
* In case we update the settings object in the future we
* need to provide a fallback catch on old settings objects which will
* set new properties to the object prior to being returned .
*
2023-08-11 09:14:54 +02:00
* @ param \stdClass $settings
2020-11-25 15:19:52 +01:00
*
2020-10-28 11:10:49 +01:00
* @ return stdClass
2020-03-21 06:37:30 +01:00
*/
2020-10-28 11:10:49 +01:00
public static function setProperties ( $settings ) : stdClass
2020-03-21 06:37:30 +01:00
{
2020-09-06 11:38:10 +02:00
$company_settings = ( object ) get_class_vars ( self :: class );
2024-01-14 05:05:00 +01:00
2020-03-21 06:37:30 +01:00
foreach ( $company_settings as $key => $value ) {
2023-12-18 19:37:13 +01:00
if ( ! property_exists ( $settings , $key )) {
2020-11-12 12:09:31 +01:00
$settings -> { $key } = self :: castAttribute ( $key , $company_settings -> { $key });
2020-03-21 06:37:30 +01:00
}
}
return $settings ;
}
2020-11-12 02:43:32 +01:00
/**
* Stubs the notification defaults
2020-11-25 15:19:52 +01:00
*
2020-11-12 02:43:32 +01:00
* @ return stdClass
*/
2024-01-14 05:05:00 +01:00
public static function notificationDefaults () : stdClass
2020-03-21 06:37:30 +01:00
{
2024-01-14 05:05:00 +01:00
$notification = new stdClass ();
2021-03-24 10:14:30 +01:00
$notification -> email = [];
2023-10-10 12:00:38 +02:00
$notification -> email = [ 'invoice_sent_all' ];
2021-03-24 10:14:30 +01:00
// $notification->email = ['all_notifications'];
2020-03-21 06:37:30 +01:00
return $notification ;
}
2023-09-11 01:51:52 +02:00
/**
* Stubs the notification defaults
*
* @ return stdClass
*/
2024-01-14 05:05:00 +01:00
public static function notificationAdminDefaults () : stdClass
2023-09-11 01:51:52 +02:00
{
2024-01-14 05:05:00 +01:00
$notification = new stdClass ();
2023-09-11 01:51:52 +02:00
$notification -> email = [];
2024-02-18 17:32:05 +01:00
$notification -> email = [ 'invoice_sent_all' , 'payment_success_all' , 'payment_manual_all' ];
2023-09-11 01:51:52 +02:00
return $notification ;
}
2020-11-12 02:43:32 +01:00
/**
* Defines entity variables for PDF generation
2020-11-25 15:19:52 +01:00
*
2020-11-12 02:43:32 +01:00
* @ return stdClass The stdClass of PDF variables
*/
2024-01-14 05:05:00 +01:00
public static function getEntityVariableDefaults () : stdClass
2020-03-21 06:37:30 +01:00
{
$variables = [
2020-03-28 04:45:11 +01:00
'client_details' => [
'$client.name' ,
2021-04-09 09:44:17 +02:00
'$client.number' ,
2020-03-28 04:45:11 +01:00
'$client.vat_number' ,
'$client.address1' ,
'$client.address2' ,
'$client.city_state_postal' ,
'$client.country' ,
2021-04-05 14:37:25 +02:00
'$client.phone' ,
2021-04-09 09:39:52 +02:00
'$contact.email' ,
2020-03-21 06:37:30 +01:00
],
2022-06-06 05:28:10 +02:00
'vendor_details' => [
'$vendor.name' ,
'$vendor.number' ,
'$vendor.vat_number' ,
'$vendor.address1' ,
'$vendor.address2' ,
'$vendor.city_state_postal' ,
'$vendor.country' ,
'$vendor.phone' ,
'$contact.email' ,
],
2022-06-07 12:36:47 +02:00
'purchase_order_details' => [
'$purchase_order.number' ,
'$purchase_order.po_number' ,
'$purchase_order.date' ,
'$purchase_order.due_date' ,
'$purchase_order.total' ,
'$purchase_order.balance_due' ,
],
2020-03-28 04:45:11 +01:00
'company_details' => [
2020-03-29 23:29:00 +02:00
'$company.name' ,
2020-03-28 04:45:11 +01:00
'$company.id_number' ,
'$company.vat_number' ,
'$company.website' ,
'$company.email' ,
'$company.phone' ,
2020-03-21 06:37:30 +01:00
],
2020-03-28 04:45:11 +01:00
'company_address' => [
'$company.address1' ,
'$company.address2' ,
'$company.city_state_postal' ,
'$company.country' ,
2020-03-21 06:37:30 +01:00
],
2020-03-28 04:45:11 +01:00
'invoice_details' => [
2020-08-10 17:21:56 +02:00
'$invoice.number' ,
2020-03-28 04:45:11 +01:00
'$invoice.po_number' ,
2020-08-10 17:21:56 +02:00
'$invoice.date' ,
2020-03-28 04:45:11 +01:00
'$invoice.due_date' ,
2020-08-10 17:21:56 +02:00
'$invoice.total' ,
2021-03-03 11:04:10 +01:00
'$invoice.balance_due' ,
2024-06-19 06:57:40 +02:00
'$invoice.project' ,
2020-03-21 06:37:30 +01:00
],
2020-03-28 04:45:11 +01:00
'quote_details' => [
2020-08-10 17:21:56 +02:00
'$quote.number' ,
2020-03-28 04:45:11 +01:00
'$quote.po_number' ,
2020-08-10 17:21:56 +02:00
'$quote.date' ,
2020-03-28 04:45:11 +01:00
'$quote.valid_until' ,
2020-08-10 17:21:56 +02:00
'$quote.total' ,
2024-06-19 06:57:40 +02:00
'$quote.project' ,
2020-03-21 06:37:30 +01:00
],
2020-03-28 04:45:11 +01:00
'credit_details' => [
2020-09-29 14:31:08 +02:00
'$credit.number' ,
2020-03-28 04:45:11 +01:00
'$credit.po_number' ,
2020-09-29 14:31:08 +02:00
'$credit.date' ,
'$credit.balance' ,
2020-09-30 00:42:55 +02:00
'$credit.total' ,
2020-03-21 06:37:30 +01:00
],
2020-03-28 04:45:11 +01:00
'product_columns' => [
2020-12-23 14:25:12 +01:00
'$product.item' ,
2020-11-13 12:52:11 +01:00
'$product.description' ,
'$product.unit_cost' ,
2020-03-28 04:45:11 +01:00
'$product.quantity' ,
2021-01-13 08:20:46 +01:00
'$product.discount' ,
2020-03-29 23:29:00 +02:00
'$product.tax' ,
2020-03-28 04:45:11 +01:00
'$product.line_total' ,
2020-03-21 06:37:30 +01:00
],
2023-03-15 01:41:59 +01:00
'product_quote_columns' => [
'$product.item' ,
'$product.description' ,
'$product.unit_cost' ,
'$product.quantity' ,
'$product.discount' ,
'$product.tax' ,
'$product.line_total' ,
],
2024-01-14 05:05:00 +01:00
'task_columns' => [
2020-12-08 16:10:29 +01:00
'$task.service' ,
2020-11-13 12:52:11 +01:00
'$task.description' ,
2020-11-04 11:22:43 +01:00
'$task.rate' ,
'$task.hours' ,
2021-01-13 08:20:46 +01:00
'$task.discount' ,
2020-03-29 23:29:00 +02:00
'$task.tax' ,
2020-03-28 04:45:11 +01:00
'$task.line_total' ,
2020-03-21 06:37:30 +01:00
],
2020-08-14 05:59:14 +02:00
'total_columns' => [
2021-07-18 10:57:26 +02:00
'$net_subtotal' ,
2020-08-14 05:59:14 +02:00
'$subtotal' ,
'$discount' ,
'$custom_surcharge1' ,
'$custom_surcharge2' ,
'$custom_surcharge3' ,
'$custom_surcharge4' ,
2021-02-25 11:41:18 +01:00
'$total_taxes' ,
'$line_taxes' ,
2021-04-09 09:44:17 +02:00
'$total' ,
2021-05-24 13:54:22 +02:00
'$paid_to_date' ,
'$outstanding' ,
2020-08-14 05:59:14 +02:00
],
2021-08-20 15:37:42 +02:00
'statement_invoice_columns' => [
'$invoice.number' ,
'$invoice.date' ,
'$due_date' ,
'$total' ,
2021-09-24 11:56:16 +02:00
'$balance' ,
2021-08-20 15:37:42 +02:00
],
2021-08-23 14:21:11 +02:00
'statement_payment_columns' => [
'$invoice.number' ,
2021-08-24 15:37:16 +02:00
'$payment.date' ,
2021-08-23 14:21:11 +02:00
'$method' ,
2021-09-24 11:56:16 +02:00
'$statement_amount' ,
2021-08-23 14:21:11 +02:00
],
2023-04-19 04:31:27 +02:00
'statement_credit_columns' => [
'$credit.number' ,
'$credit.date' ,
'$total' ,
'$credit.balance' ,
],
2023-09-09 15:56:24 +02:00
'statement_details' => [
'$statement_date' ,
'$balance'
],
'delivery_note_columns' => [
'$product.item' ,
'$product.description' ,
'$product.quantity' ,
],
2020-03-21 06:37:30 +01:00
];
2020-09-06 11:38:10 +02:00
2020-03-21 06:37:30 +01:00
return json_decode ( json_encode ( $variables ));
}
2019-02-17 11:34:46 +01:00
}