diff --git a/app/Traits/GenerateMigrationResources.php b/app/Traits/GenerateMigrationResources.php index 1ec884f000..10b2a24ae0 100644 --- a/app/Traits/GenerateMigrationResources.php +++ b/app/Traits/GenerateMigrationResources.php @@ -161,7 +161,7 @@ trait GenerateMigrationResources 'user_id' => $client->user_id, 'name' => $client->name, 'balance' => $client->balance ?: 0, - 'paid_to_date' => $client->paid_to_date, + 'paid_to_date' => $client->paid_to_date ?: 0, 'address1' => $client->address1, 'address2' => $client->address2, 'city' => $client->city, @@ -249,8 +249,8 @@ trait GenerateMigrationResources 'custom_value2' => $product->custom_value2, 'product_key' => $product->product_key, 'notes' => $product->notes, - 'cost' => $product->cost, - 'quantity' => $product->qty, + 'cost' => $product->cost ?: 0, + 'quantity' => $product->qty ?: 0, 'tax_name1' => $product->tax_name1, 'tax_name2' => $product->tax_name2, 'tax_rate1' => $product->tax_rate1, @@ -317,7 +317,7 @@ trait GenerateMigrationResources 'status_id' => $credit->invoice_status_id, 'design_id' => $credit->invoice_design_id, 'number' => $credit->invoice_number, - 'discount' => $credit->discount, + 'discount' => $credit->discount ?: 0, 'is_amount_discount' => $credit->is_amount_discount ?: false, 'po_number' => $credit->po_number, 'date' => $credit->invoice_date, @@ -336,9 +336,9 @@ trait GenerateMigrationResources 'custom_value1' => $credit->custom_value1, 'custom_value2' => $credit->custom_value2, 'next_send_date' => null, - 'amount' => $credit->amount, - 'balance' => $credit->balance, - 'partial' => $credit->partial, + 'amount' => $credit->amount ?: 0, + 'balance' => $credit->balance ?: 0, + 'partial' => $credit->partial ?: 0, 'partial_due_date' => $credit->partial_due_date, 'line_items' => $this->getInvoiceItems($credit->invoice_items), 'created_at' => $credit->created_at ? $credit->created_at->toDateString() : null, @@ -388,9 +388,9 @@ trait GenerateMigrationResources 'custom_value1' => $invoice->custom_value1, 'custom_value2' => $invoice->custom_value2, 'next_send_date' => null, - 'amount' => $invoice->amount, - 'balance' => $invoice->balance, - 'partial' => $invoice->partial, + 'amount' => $invoice->amount ?: 0, + 'balance' => $invoice->balance ?: 0, + 'partial' => $invoice->partial ?: 0, 'partial_due_date' => $invoice->partial_due_date, 'line_items' => $this->getInvoiceItems($invoice->invoice_items), 'created_at' => $invoice->created_at ? $invoice->created_at->toDateString() : null, @@ -537,9 +537,9 @@ trait GenerateMigrationResources 'custom_value1' => $quote->custom_value1, 'custom_value2' => $quote->custom_value2, 'next_send_date' => null, - 'amount' => $quote->amount, - 'balance' => $quote->balance, - 'partial' => $quote->partial, + 'amount' => $quote->amount ?: 0, + 'balance' => $quote->balance ?: 0, + 'partial' => $quote->partial ?: 0, 'partial_due_date' => $quote->partial_due_date, 'line_items' => $this->getInvoiceItems($quote->invoice_items), 'created_at' => $quote->created_at ? $quote->created_at->toDateString() : null, @@ -600,9 +600,9 @@ trait GenerateMigrationResources 'company_gateway_id' => $payment->account_gateway_id, 'type_id' => $payment->payment_type_id, 'status_id' => $payment->payment_status_id, - 'amount' => $payment->amount, - 'applied' => $payment->amount, - 'refunded' => $payment->refunded, + 'amount' => $payment->amount ?: 0, + 'applied' => $payment->amount ?: 0, + 'refunded' => $payment->refunded ?: 0, 'date' => $payment->payment_date, 'transaction_reference' => $payment->transaction_reference, 'payer_id' => $payment->payer_id, @@ -633,7 +633,7 @@ trait GenerateMigrationResources 'user_id' => $credit->user_id, 'company_id' => $credit->account_id, 'is_deleted' => $credit->is_deleted, - 'amount' => $credit->balance, + 'amount' => $credit->balance ?: 0, 'applied' => 0, 'refunded' => 0, 'date' => $credit->date,