diff --git a/app/DataMapper/ClientSettings.php b/app/DataMapper/ClientSettings.php index bc2648bc7f..14a499b9b4 100644 --- a/app/DataMapper/ClientSettings.php +++ b/app/DataMapper/ClientSettings.php @@ -50,7 +50,7 @@ class ClientSettings extends BaseSettings 'military_time' => 'bool', 'start_of_week' => 'int', 'financial_year_start' => 'int', - 'payment_terms' => 'int', + 'payment_terms' => 'string', 'language_id' => 'string', 'precision' => 'int', 'default_task_rate' => 'float', diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index 145d83c0a6..2f8a457210 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -30,7 +30,7 @@ class CompanySettings extends BaseSettings public $show_currency_symbol = true; public $show_currency_code = false; - public $payment_terms_id = 1; + public $payment_terms = 1; public $custom_label1 = ''; public $custom_label2 = ''; @@ -169,7 +169,7 @@ class CompanySettings extends BaseSettings 'precision' => 'int', 'show_currency_symbol' => 'bool', 'show_currency_code' => 'bool', - 'payment_terms_id' => 'string', + 'payment_terms' => 'int', 'custom_label1' => 'string', 'custom_label2' => 'string', 'custom_label3' => 'string', @@ -257,7 +257,7 @@ class CompanySettings extends BaseSettings $data->timezone_id = (string)config('ninja.i18n.timezone_id'); $data->language_id = (string)config('ninja.i18n.language_id'); - $data->payment_terms = (string)config('ninja.i18n.payment_terms'); + $data->payment_terms = (int)config('ninja.i18n.payment_terms'); $data->datetime_format_id = (string)config('ninja.i18n.datetime_format_id'); $data->military_time = (bool )config('ninja.i18n.military_time'); $data->date_format_id = (string)config('ninja.i18n.date_format_id'); diff --git a/app/Transformers/InvoiceTransformer.php b/app/Transformers/InvoiceTransformer.php index 6e58acf08d..2d64412c7f 100644 --- a/app/Transformers/InvoiceTransformer.php +++ b/app/Transformers/InvoiceTransformer.php @@ -98,11 +98,11 @@ class InvoiceTransformer extends EntityTransformer 'public_notes' => $invoice->public_notes ?: '', 'private_notes' => $invoice->private_notes ?: '', 'is_deleted' => (bool) $invoice->is_deleted, - 'invoice_type_id' => (int) $invoice->invoice_type_id ?: '', + 'invoice_type_id' => (string) $invoice->invoice_type_id ?: '', 'tax_name1' => $invoice->tax_name1 ? $invoice->tax_name1 : '', - 'tax_rate1' => (float) $invoice->tax_rate1 ?: '', + 'tax_rate1' => (float) $invoice->tax_rate1, 'tax_name2' => $invoice->tax_name2 ? $invoice->tax_name2 : '', - 'tax_rate2' => (float) $invoice->tax_rate2 ?: '', + 'tax_rate2' => (float) $invoice->tax_rate2, 'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false), 'invoice_footer' => $invoice->invoice_footer ?: '', 'partial' => (float) ($invoice->partial ?: 0.0), diff --git a/app/Transformers/PaymentTransformer.php b/app/Transformers/PaymentTransformer.php index f2f244c621..091c7a6c70 100644 --- a/app/Transformers/PaymentTransformer.php +++ b/app/Transformers/PaymentTransformer.php @@ -56,21 +56,20 @@ class PaymentTransformer extends EntityTransformer return [ 'id' => $this->encodePrimaryKey($payment->id), 'amount' => (float) $payment->amount, - /* 'transaction_reference' => $payment->transaction_reference ?: '', 'payment_date' => $payment->payment_date ?: '', 'updated_at' => $this->getTimestamp($payment->updated_at), 'archived_at' => $this->getTimestamp($payment->deleted_at), 'is_deleted' => (bool) $payment->is_deleted, - 'payment_type_id' => (int) ($payment->payment_type_id ?: 0), - 'invoice_id' => (int) ($this->invoice ? $this->invoice->public_id : $payment->invoice->public_id), - 'invoice_number' => $this->invoice ? $this->invoice->invoice_number : $payment->invoice->invoice_number, + 'payment_type_id' => (string) $payment->payment_type_id ?: '', + 'invitation_id' => (string) $payment->invitation_id ?: '', +/* 'private_notes' => $payment->private_notes ?: '', 'exchange_rate' => (float) $payment->exchange_rate, 'exchange_currency_id' => (int) $payment->exchange_currency_id, 'refunded' => (float) $payment->refunded, - 'payment_status_id' => (int) $payment->payment_status_id, - */ + 'payment_status_id' => (string) $payment->payment_status_id, +*/ ]; } }