1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fixes for migrations (#3578)

This commit is contained in:
David Bomba 2020-04-02 09:01:24 +11:00 committed by GitHub
parent 5c61c1c0f4
commit f11503567e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,7 +196,7 @@ trait GenerateMigrationResources
private function getClientSettings($client) private function getClientSettings($client)
{ {
$settings = new \stdClass; $settings = new \stdClass;
$settings->currency_id = $client->currency_id ?: $client->account->currency_id; $settings->currency_id = $client->currency_id ? (string) $client->currency_id : (string) $client->account->currency_id;
if($client->language_id) if($client->language_id)
$settings->language_id = $client->language_id; $settings->language_id = $client->language_id;
@ -439,13 +439,13 @@ trait GenerateMigrationResources
foreach ($items as $item) { foreach ($items as $item) {
$transformed[] = [ $transformed[] = [
'id' => $item->id, 'id' => $item->id,
'quantity' => $item->qty, 'quantity' => (float)$item->qty,
'cost' => $item->cost, 'cost' => (float)$item->cost,
'product_key' => $item->product_key, 'product_key' => $item->product_key,
'notes' => $item->notes, 'notes' => $item->notes,
'discount' => $item->discount, 'discount' => (float)$item->discount,
'tax_name1' => $item->tax_name1, 'tax_name1' => $item->tax_name1,
'tax_rate1' => $item->tax_rate1, 'tax_rate1' => (float)$item->tax_rate1,
'date' => $item->created_at, 'date' => $item->created_at,
'custom_value1' => $item->custom_value1, 'custom_value1' => $item->custom_value1,
'custom_value2' => $item->custom_value2, 'custom_value2' => $item->custom_value2,