1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00

Merge pull request #7663 from turbo124/v5-develop

Force delete activities on purge data
This commit is contained in:
David Bomba 2022-07-21 08:29:03 +10:00 committed by GitHub
commit c578ad48be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -147,7 +147,12 @@ class InvoiceItemExport extends BaseExport
if(str_contains($key, "item.")){
$key = str_replace("item.", "", $key);
$item_array[$key] = $item->{$key};
if(property_exists($item, $key))
$item_array[$key] = $item->{$key};
else
$item_array[$key] = '';
}
}

View File

@ -180,6 +180,7 @@ class MigrationController extends BaseController
$company->vendors()->forceDelete();
$company->expenses()->forceDelete();
$company->purchase_orders()->forceDelete();
$company->all_activities()->forceDelete();
$settings = $company->settings;

View File

@ -469,6 +469,7 @@ class CompanyImport implements ShouldQueue
private function purgeCompanyData()
{
$this->company->clients()->forceDelete();
$this->company->all_activities()->forceDelete();
$this->company->products()->forceDelete();
$this->company->projects()->forceDelete();
$this->company->tasks()->forceDelete();

View File

@ -301,11 +301,6 @@ class CompanyGateway extends BaseModel
$fee = $this->calcGatewayFee($amount, $gateway_type_id);
// if ($fee > 0) {
// $fee = Number::formatMoney(round($fee, 2), $client);
// $label = ' - '.$fee.' '.ctrans('texts.fee');
// }
if($fee > 0) {
$fees_and_limits = $this->fees_and_limits->{$gateway_type_id};