1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Minor fixes for imports

This commit is contained in:
David Bomba 2021-10-20 17:16:22 +11:00
parent f05fb9938e
commit 121c9d2cfd
2 changed files with 20 additions and 1 deletions

View File

@ -887,6 +887,7 @@ class CompanyImport implements ShouldQueue
[
'hashed_id',
'company_id',
'backup',
],
[
['users' => 'user_id'],
@ -1192,6 +1193,10 @@ class CompanyImport implements ShouldQueue
}
if(array_key_exists('deleted_at', $obj_array) && $obj_array['deleted_at'] > 1){
$obj_array['deleted_at'] = now();
}
$activity_invitation_key = false;
if($class == 'App\Models\Activity'){
@ -1270,6 +1275,10 @@ class CompanyImport implements ShouldQueue
}
}
if(array_key_exists('deleted_at', $obj_array) && $obj_array['deleted_at'] > 1){
$obj_array['deleted_at'] = now();
}
/* New to convert product ids from old hashes to new hashes*/
if($class == 'App\Models\Subscription'){
$obj_array['product_ids'] = $this->recordProductIds($obj_array['product_ids']);
@ -1320,6 +1329,10 @@ class CompanyImport implements ShouldQueue
}
}
if(array_key_exists('deleted_at', $obj_array) && $obj_array['deleted_at'] > 1){
$obj_array['deleted_at'] = now();
}
/* New to convert product ids from old hashes to new hashes*/
if($class == 'App\Models\Subscription'){
//$obj_array['product_ids'] = $this->recordProductIds($obj_array['product_ids']);

View File

@ -82,6 +82,9 @@ class MarkPaid extends AbstractService
->updateBalance($payment->amount * -1)
->updatePaidToDate($payment->amount)
->setStatus(Invoice::STATUS_PAID)
->save();
$this->invoice->service()
->applyNumber()
->deletePdf()
->save();
@ -103,7 +106,10 @@ class MarkPaid extends AbstractService
->updatePaidToDate($payment->amount)
->save();
$this->invoice->service()->workFlow()->save();
$this->invoice
->service()
->workFlow()
->save();
return $this->invoice;
}