mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for payment meta data types
This commit is contained in:
parent
5d6b86b6c2
commit
0d1c279f64
@ -162,7 +162,7 @@ class StepsController extends BaseController
|
|||||||
$companyService = (new CompanyService(session('MIGRATION_ACCOUNT_TOKEN')))
|
$companyService = (new CompanyService(session('MIGRATION_ACCOUNT_TOKEN')))
|
||||||
->endpoint(session('MIGRATION_ENDPOINT'))
|
->endpoint(session('MIGRATION_ENDPOINT'))
|
||||||
->start();
|
->start();
|
||||||
|
|
||||||
if ($companyService->isSuccessful()) {
|
if ($companyService->isSuccessful()) {
|
||||||
return view('migration.companies', ['companies' => $companyService->getCompanies()]);
|
return view('migration.companies', ['companies' => $companyService->getCompanies()]);
|
||||||
}
|
}
|
||||||
@ -245,8 +245,8 @@ class StepsController extends BaseController
|
|||||||
'invoices' => $this->getInvoices(),
|
'invoices' => $this->getInvoices(),
|
||||||
'recurring_invoices' => $this->getRecurringInvoices(),
|
'recurring_invoices' => $this->getRecurringInvoices(),
|
||||||
'quotes' => $this->getQuotes(),
|
'quotes' => $this->getQuotes(),
|
||||||
'payments' => array_merge($this->getPayments(), $this->getCredits()),
|
|
||||||
'credits' => $this->getCreditsNotes(),
|
'credits' => $this->getCreditsNotes(),
|
||||||
|
'payments' => array_merge($this->getPayments(), $this->getCredits()),
|
||||||
'documents' => $this->getDocuments(),
|
'documents' => $this->getDocuments(),
|
||||||
'company_gateways' => $this->getCompanyGateways(),
|
'company_gateways' => $this->getCompanyGateways(),
|
||||||
'client_gateway_tokens' => $this->getClientGatewayTokens(),
|
'client_gateway_tokens' => $this->getClientGatewayTokens(),
|
||||||
|
@ -217,14 +217,14 @@ trait GenerateMigrationResources
|
|||||||
'company_id' => $contact->account_id,
|
'company_id' => $contact->account_id,
|
||||||
'user_id' => $contact->user_id,
|
'user_id' => $contact->user_id,
|
||||||
'client_id' => $contact->client_id,
|
'client_id' => $contact->client_id,
|
||||||
'first_name' => $contact->first_name,
|
'first_name' => $contact->first_name ?: '',
|
||||||
'last_name' => $contact->last_name,
|
'last_name' => $contact->last_name ?: '',
|
||||||
'phone' => $contact->phone,
|
'phone' => $contact->phone ?: '',
|
||||||
'custom_value1' => $contact->custom_value1,
|
'custom_value1' => $contact->custom_value1 ?: '',
|
||||||
'custom_value2' => $contact->custom_value2,
|
'custom_value2' => $contact->custom_value2 ?: '',
|
||||||
'email' => $contact->email,
|
'email' => $contact->email,
|
||||||
'is_primary' => $contact->is_primary,
|
'is_primary' => (bool)$contact->is_primary,
|
||||||
'send_email' => $contact->send_invoice,
|
'send_email' => (bool)$contact->send_invoice,
|
||||||
'confirmed' => $contact->confirmation_token ? true : false,
|
'confirmed' => $contact->confirmation_token ? true : false,
|
||||||
'email_verified_at' => $contact->created_at->toDateTimeString(),
|
'email_verified_at' => $contact->created_at->toDateTimeString(),
|
||||||
'last_login' => $contact->last_login,
|
'last_login' => $contact->last_login,
|
||||||
@ -249,10 +249,10 @@ trait GenerateMigrationResources
|
|||||||
$transformed[] = [
|
$transformed[] = [
|
||||||
'company_id' => $product->account_id,
|
'company_id' => $product->account_id,
|
||||||
'user_id' => $product->user_id,
|
'user_id' => $product->user_id,
|
||||||
'custom_value1' => $product->custom_value1,
|
'custom_value1' => $product->custom_value1 ?: '',
|
||||||
'custom_value2' => $product->custom_value2,
|
'custom_value2' => $product->custom_value2 ?: '',
|
||||||
'product_key' => $product->product_key,
|
'product_key' => $product->product_key ?: '',
|
||||||
'notes' => $product->notes,
|
'notes' => $product->notes ?: '',
|
||||||
'cost' => $product->cost ?: 0,
|
'cost' => $product->cost ?: 0,
|
||||||
'quantity' => $product->qty ?: 0,
|
'quantity' => $product->qty ?: 0,
|
||||||
'tax_name1' => $product->tax_name1,
|
'tax_name1' => $product->tax_name1,
|
||||||
@ -279,9 +279,9 @@ trait GenerateMigrationResources
|
|||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
$transformed[] = [
|
$transformed[] = [
|
||||||
'id' => $user->id,
|
'id' => $user->id,
|
||||||
'first_name' => $user->first_name,
|
'first_name' => $user->first_name ?: '',
|
||||||
'last_name' => $user->last_name,
|
'last_name' => $user->last_name ?: '',
|
||||||
'phone' => $user->phone,
|
'phone' => $user->phone ?: '',
|
||||||
'email' => $user->email,
|
'email' => $user->email,
|
||||||
'confirmation_code' => $user->confirmation_code,
|
'confirmation_code' => $user->confirmation_code,
|
||||||
'failed_logins' => $user->failed_logins,
|
'failed_logins' => $user->failed_logins,
|
||||||
@ -323,24 +323,24 @@ trait GenerateMigrationResources
|
|||||||
'number' => $credit->invoice_number,
|
'number' => $credit->invoice_number,
|
||||||
'discount' => $credit->discount ?: 0,
|
'discount' => $credit->discount ?: 0,
|
||||||
'is_amount_discount' => $credit->is_amount_discount ?: false,
|
'is_amount_discount' => $credit->is_amount_discount ?: false,
|
||||||
'po_number' => $credit->po_number,
|
'po_number' => $credit->po_number ?: '',
|
||||||
'date' => $credit->invoice_date,
|
'date' => $credit->invoice_date,
|
||||||
'last_sent_date' => $credit->last_sent_date,
|
'last_sent_date' => $credit->last_sent_date,
|
||||||
'due_date' => $credit->due_date,
|
'due_date' => $credit->due_date,
|
||||||
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
||||||
'is_deleted' => $credit->is_deleted,
|
'is_deleted' => $credit->is_deleted,
|
||||||
'footer' => $credit->invoice_footer,
|
'footer' => $credit->invoice_footer ?: '',
|
||||||
'public_notes' => $credit->public_notes,
|
'public_notes' => $credit->public_notes ?: '',
|
||||||
'private_notes' => $credit->private_notes,
|
'private_notes' => $credit->private_notes ?: '',
|
||||||
'terms' => $credit->terms,
|
'terms' => $credit->terms ?: '',
|
||||||
'tax_name1' => $credit->tax_name1,
|
'tax_name1' => $credit->tax_name1,
|
||||||
'tax_name2' => $credit->tax_name2,
|
'tax_name2' => $credit->tax_name2,
|
||||||
'tax_rate1' => $credit->tax_rate1,
|
'tax_rate1' => $credit->tax_rate1,
|
||||||
'tax_rate2' => $credit->tax_rate2,
|
'tax_rate2' => $credit->tax_rate2,
|
||||||
'tax_name3' => '',
|
'tax_name3' => '',
|
||||||
'tax_rate3' => 0,
|
'tax_rate3' => 0,
|
||||||
'custom_value1' => $credit->custom_value1,
|
'custom_value1' => $credit->custom_value1 ?: '',
|
||||||
'custom_value2' => $credit->custom_value2,
|
'custom_value2' => $credit->custom_value2 ?: '',
|
||||||
'next_send_date' => null,
|
'next_send_date' => null,
|
||||||
'amount' => $credit->amount ?: 0,
|
'amount' => $credit->amount ?: 0,
|
||||||
'balance' => $credit->balance ?: 0,
|
'balance' => $credit->balance ?: 0,
|
||||||
@ -379,22 +379,22 @@ trait GenerateMigrationResources
|
|||||||
'number' => $invoice->invoice_number,
|
'number' => $invoice->invoice_number,
|
||||||
'discount' => $invoice->discount,
|
'discount' => $invoice->discount,
|
||||||
'is_amount_discount' => $invoice->is_amount_discount ?: false,
|
'is_amount_discount' => $invoice->is_amount_discount ?: false,
|
||||||
'po_number' => $invoice->po_number,
|
'po_number' => $invoice->po_number ?: '',
|
||||||
'date' => $invoice->invoice_date,
|
'date' => $invoice->invoice_date,
|
||||||
'last_sent_date' => $invoice->last_sent_date,
|
'last_sent_date' => $invoice->last_sent_date,
|
||||||
'due_date' => $invoice->due_date,
|
'due_date' => $invoice->due_date,
|
||||||
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
||||||
'is_deleted' => $invoice->is_deleted,
|
'is_deleted' => $invoice->is_deleted,
|
||||||
'footer' => $invoice->invoice_footer,
|
'footer' => $invoice->invoice_footer ?: '',
|
||||||
'public_notes' => $invoice->public_notes,
|
'public_notes' => $invoice->public_notes ?: '',
|
||||||
'private_notes' => $invoice->private_notes,
|
'private_notes' => $invoice->private_notes ?: '',
|
||||||
'terms' => $invoice->terms,
|
'terms' => $invoice->terms ?: '',
|
||||||
'tax_name1' => $invoice->tax_name1,
|
'tax_name1' => $invoice->tax_name1,
|
||||||
'tax_name2' => $invoice->tax_name2,
|
'tax_name2' => $invoice->tax_name2,
|
||||||
'tax_rate1' => $invoice->tax_rate1,
|
'tax_rate1' => $invoice->tax_rate1,
|
||||||
'tax_rate2' => $invoice->tax_rate2,
|
'tax_rate2' => $invoice->tax_rate2,
|
||||||
'custom_value1' => $invoice->custom_value1,
|
'custom_value1' => $invoice->custom_value1 ?: '',
|
||||||
'custom_value2' => $invoice->custom_value2,
|
'custom_value2' => $invoice->custom_value2 ?: '',
|
||||||
'next_send_date' => null,
|
'next_send_date' => null,
|
||||||
'amount' => $invoice->amount ?: 0,
|
'amount' => $invoice->amount ?: 0,
|
||||||
'balance' => $invoice->balance ?: 0,
|
'balance' => $invoice->balance ?: 0,
|
||||||
@ -441,24 +441,24 @@ trait GenerateMigrationResources
|
|||||||
'number' => '',
|
'number' => '',
|
||||||
'discount' => $invoice->discount,
|
'discount' => $invoice->discount,
|
||||||
'is_amount_discount' => $invoice->is_amount_discount ?: false,
|
'is_amount_discount' => $invoice->is_amount_discount ?: false,
|
||||||
'po_number' => $invoice->po_number,
|
'po_number' => $invoice->po_number ?: '',
|
||||||
'date' => $invoice->invoice_date,
|
'date' => $invoice->invoice_date,
|
||||||
'last_sent_date' => $invoice->last_sent_date,
|
'last_sent_date' => $invoice->last_sent_date,
|
||||||
'due_date' => $invoice->due_date,
|
'due_date' => $invoice->due_date,
|
||||||
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
||||||
'is_deleted' => $invoice->is_deleted,
|
'is_deleted' => (bool)$invoice->is_deleted,
|
||||||
'footer' => $invoice->invoice_footer,
|
'footer' => $invoice->invoice_footer,
|
||||||
'public_notes' => $invoice->public_notes,
|
'public_notes' => $invoice->public_notes ?: '',
|
||||||
'private_notes' => $invoice->private_notes,
|
'private_notes' => $invoice->private_notes ?: '',
|
||||||
'terms' => $invoice->terms,
|
'terms' => $invoice->terms ?: '',
|
||||||
'tax_name1' => $invoice->tax_name1,
|
'tax_name1' => $invoice->tax_name1,
|
||||||
'tax_name2' => $invoice->tax_name2,
|
'tax_name2' => $invoice->tax_name2,
|
||||||
'tax_rate1' => $invoice->tax_rate1,
|
'tax_rate1' => $invoice->tax_rate1,
|
||||||
'tax_rate2' => $invoice->tax_rate2,
|
'tax_rate2' => $invoice->tax_rate2,
|
||||||
'tax_name3' => '',
|
'tax_name3' => '',
|
||||||
'tax_rate3' => 0,
|
'tax_rate3' => 0,
|
||||||
'custom_value1' => $invoice->custom_value1,
|
'custom_value1' => $invoice->custom_value1 ?: '',
|
||||||
'custom_value2' => $invoice->custom_value2,
|
'custom_value2' => $invoice->custom_value2 ?: '',
|
||||||
'custom_value3' => '',
|
'custom_value3' => '',
|
||||||
'custom_value4' => '',
|
'custom_value4' => '',
|
||||||
'amount' => $invoice->amount ?: 0,
|
'amount' => $invoice->amount ?: 0,
|
||||||
@ -781,22 +781,22 @@ trait GenerateMigrationResources
|
|||||||
'number' => $quote->invoice_number,
|
'number' => $quote->invoice_number,
|
||||||
'discount' => $quote->discount,
|
'discount' => $quote->discount,
|
||||||
'is_amount_discount' => $quote->is_amount_discount ?: false,
|
'is_amount_discount' => $quote->is_amount_discount ?: false,
|
||||||
'po_number' => $quote->po_number,
|
'po_number' => $quote->po_number ?: '',
|
||||||
'date' => $quote->invoice_date,
|
'date' => $quote->invoice_date,
|
||||||
'last_sent_date' => $quote->last_sent_date,
|
'last_sent_date' => $quote->last_sent_date,
|
||||||
'due_date' => $quote->due_date,
|
'due_date' => $quote->due_date,
|
||||||
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
'uses_inclusive_taxes' => $this->account->inclusive_taxes,
|
||||||
'is_deleted' => $quote->is_deleted,
|
'is_deleted' => (bool)$quote->is_deleted,
|
||||||
'footer' => $quote->invoice_footer,
|
'footer' => $quote->invoice_footer ?: '',
|
||||||
'public_notes' => $quote->public_notes,
|
'public_notes' => $quote->public_notes ?: '',
|
||||||
'private_notes' => $quote->private_notes,
|
'private_notes' => $quote->private_notes ?: '',
|
||||||
'terms' => $quote->terms,
|
'terms' => $quote->terms ?: '',
|
||||||
'tax_name1' => $quote->tax_name1,
|
'tax_name1' => $quote->tax_name1,
|
||||||
'tax_name2' => $quote->tax_name2,
|
'tax_name2' => $quote->tax_name2,
|
||||||
'tax_rate1' => $quote->tax_rate1,
|
'tax_rate1' => $quote->tax_rate1,
|
||||||
'tax_rate2' => $quote->tax_rate2,
|
'tax_rate2' => $quote->tax_rate2,
|
||||||
'custom_value1' => $quote->custom_value1,
|
'custom_value1' => $quote->custom_value1 ?: '',
|
||||||
'custom_value2' => $quote->custom_value2,
|
'custom_value2' => $quote->custom_value2 ?: '',
|
||||||
'next_send_date' => null,
|
'next_send_date' => null,
|
||||||
'amount' => $quote->amount ?: 0,
|
'amount' => $quote->amount ?: 0,
|
||||||
'balance' => $quote->balance ?: 0,
|
'balance' => $quote->balance ?: 0,
|
||||||
@ -865,9 +865,9 @@ trait GenerateMigrationResources
|
|||||||
'applied' => $payment->amount ?: 0,
|
'applied' => $payment->amount ?: 0,
|
||||||
'refunded' => $payment->refunded ?: 0,
|
'refunded' => $payment->refunded ?: 0,
|
||||||
'date' => $payment->payment_date,
|
'date' => $payment->payment_date,
|
||||||
'transaction_reference' => $payment->transaction_reference,
|
'transaction_reference' => $payment->transaction_reference ?: '',
|
||||||
'payer_id' => $payment->payer_id,
|
'payer_id' => $payment->payer_id,
|
||||||
'is_deleted' => $payment->is_deleted,
|
'is_deleted' => (bool)$payment->is_deleted,
|
||||||
'exchange_rate' => $payment->exchange_rate ? number_format((float) $payment->exchange_rate, 6) : null,
|
'exchange_rate' => $payment->exchange_rate ? number_format((float) $payment->exchange_rate, 6) : null,
|
||||||
'exchange_currency_id' => $payment->exchange_currency_id,
|
'exchange_currency_id' => $payment->exchange_currency_id,
|
||||||
'currency_id' => isset($payment->client->currency->id) ? $payment->client->currency->id : $this->account->currency_id,
|
'currency_id' => isset($payment->client->currency->id) ? $payment->client->currency->id : $this->account->currency_id,
|
||||||
@ -1036,10 +1036,10 @@ trait GenerateMigrationResources
|
|||||||
}
|
}
|
||||||
|
|
||||||
$meta = new \stdClass();
|
$meta = new \stdClass();
|
||||||
$meta->exp_month = $exp_month;
|
$meta->exp_month = (string)$exp_month;
|
||||||
$meta->exp_year = $exp_year;
|
$meta->exp_year = (string)$exp_year;
|
||||||
$meta->brand = $payment_method->payment_type->name;
|
$meta->brand = (string)$payment_method->payment_type->name;
|
||||||
$meta->last4 = str_replace(',', '', ($payment_method->expiration));
|
$meta->last4 = (string)str_replace(',', '', ($payment_method->expiration));
|
||||||
$meta->type = $payment_method->payment_type->gateway_type_id;
|
$meta->type = $payment_method->payment_type->gateway_type_id;
|
||||||
|
|
||||||
return $meta;
|
return $meta;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user