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:
parent
3429785314
commit
7a72cd9fc1
@ -400,7 +400,6 @@ class CheckData extends Command
|
||||
],
|
||||
'products' => [
|
||||
ENTITY_USER,
|
||||
ENTITY_TAX_RATE,
|
||||
],
|
||||
'vendors' => [
|
||||
ENTITY_USER,
|
||||
@ -415,25 +414,17 @@ class CheckData extends Command
|
||||
ENTITY_USER,
|
||||
ENTITY_CLIENT,
|
||||
],
|
||||
'accounts' => [
|
||||
ENTITY_TAX_RATE,
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($tables as $table => $entityTypes) {
|
||||
foreach ($entityTypes as $entityType) {
|
||||
$tableName = Utils::pluralizeEntityType($entityType);
|
||||
if ($entityType == ENTITY_TAX_RATE) {
|
||||
$field = 'default_' . $entityType;
|
||||
} else {
|
||||
$field = $entityType;
|
||||
}
|
||||
$field = $entityType;
|
||||
if ($table == 'accounts') {
|
||||
$accountId = 'id';
|
||||
} else {
|
||||
$accountId = 'account_id';
|
||||
}
|
||||
|
||||
$records = DB::table($table)
|
||||
->join($tableName, "{$tableName}.id", '=', "{$table}.{$field}_id")
|
||||
->where("{$table}.{$accountId}", '!=', DB::raw("{$tableName}.account_id"))
|
||||
|
@ -59,7 +59,7 @@ class PaymentTransformer extends EntityTransformer
|
||||
'payment_type_id' => (int) $payment->payment_type_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,
|
||||
'private_notes' => $client->private_notes,
|
||||
'private_notes' => $payment->private_notes,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user