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

Working on tests

This commit is contained in:
Hillel Coren 2017-05-17 14:23:35 +03:00
parent 3429785314
commit 7a72cd9fc1
2 changed files with 2 additions and 11 deletions

View File

@ -400,7 +400,6 @@ class CheckData extends Command
], ],
'products' => [ 'products' => [
ENTITY_USER, ENTITY_USER,
ENTITY_TAX_RATE,
], ],
'vendors' => [ 'vendors' => [
ENTITY_USER, ENTITY_USER,
@ -415,25 +414,17 @@ class CheckData extends Command
ENTITY_USER, ENTITY_USER,
ENTITY_CLIENT, ENTITY_CLIENT,
], ],
'accounts' => [
ENTITY_TAX_RATE,
]
]; ];
foreach ($tables as $table => $entityTypes) { foreach ($tables as $table => $entityTypes) {
foreach ($entityTypes as $entityType) { foreach ($entityTypes as $entityType) {
$tableName = Utils::pluralizeEntityType($entityType); $tableName = Utils::pluralizeEntityType($entityType);
if ($entityType == ENTITY_TAX_RATE) { $field = $entityType;
$field = 'default_' . $entityType;
} else {
$field = $entityType;
}
if ($table == 'accounts') { if ($table == 'accounts') {
$accountId = 'id'; $accountId = 'id';
} else { } else {
$accountId = 'account_id'; $accountId = 'account_id';
} }
$records = DB::table($table) $records = DB::table($table)
->join($tableName, "{$tableName}.id", '=', "{$table}.{$field}_id") ->join($tableName, "{$tableName}.id", '=', "{$table}.{$field}_id")
->where("{$table}.{$accountId}", '!=', DB::raw("{$tableName}.account_id")) ->where("{$table}.{$accountId}", '!=', DB::raw("{$tableName}.account_id"))

View File

@ -59,7 +59,7 @@ class PaymentTransformer extends EntityTransformer
'payment_type_id' => (int) $payment->payment_type_id, 'payment_type_id' => (int) $payment->payment_type_id,
'invoice_id' => (int) ($this->invoice ? $this->invoice->public_id : $payment->invoice->public_id), '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, 'invoice_number' => $this->invoice ? $this->invoice->invoice_number : $payment->invoice->invoice_number,
'private_notes' => $client->private_notes, 'private_notes' => $payment->private_notes,
]); ]);
} }
} }