mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for ninja clients
This commit is contained in:
parent
7d1c236c27
commit
9b74091119
@ -444,11 +444,14 @@ trait GenerateMigrationResources
|
|||||||
return $transformed;
|
return $transformed;
|
||||||
|
|
||||||
$db = DB_NINJA_1;
|
$db = DB_NINJA_1;
|
||||||
|
$account_id = 20432;
|
||||||
|
|
||||||
if($this->account->id > 1000000)
|
if($this->account->id > 1000000){
|
||||||
$db = DB_NINJA_2;
|
$db = DB_NINJA_2;
|
||||||
|
$account_id = 1000002;
|
||||||
|
}
|
||||||
|
|
||||||
$ninja_client = Client::on($db)->where('public_id', $this->account->id)->first();
|
$ninja_client = Client::on($db)->where('public_id', $this->account->id)->where('account_id', $account_id)->first();
|
||||||
|
|
||||||
if(!$ninja_client)
|
if(!$ninja_client)
|
||||||
return $transformed;
|
return $transformed;
|
||||||
@ -458,7 +461,7 @@ trait GenerateMigrationResources
|
|||||||
|
|
||||||
if(count($agts) == 0) {
|
if(count($agts) == 0) {
|
||||||
$transformed[] = [
|
$transformed[] = [
|
||||||
'client' => $ninja_client
|
'client' => $ninja_client->toArray()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,7 +484,7 @@ trait GenerateMigrationResources
|
|||||||
'gateway_type_id' => $payment_method->payment_type->gateway_type_id,
|
'gateway_type_id' => $payment_method->payment_type->gateway_type_id,
|
||||||
'is_default' => $is_default,
|
'is_default' => $is_default,
|
||||||
'meta' => $this->convertMeta($payment_method),
|
'meta' => $this->convertMeta($payment_method),
|
||||||
'client' => $contact->client->toArray(),
|
'client' => $ninja_client->toArray(),
|
||||||
'contacts' => $contact->client->contacts->toArray(),
|
'contacts' => $contact->client->contacts->toArray(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user