Fixes for custom payment method name

This commit is contained in:
David Bomba 2021-06-01 08:09:38 +10:00
parent 171f5b23e4
commit c3946f44b0
4 changed files with 20 additions and 3 deletions

View File

@ -84,7 +84,7 @@ class ImportJsonController extends BaseController
$file_location = public_path("storage/backups/$filename/backup.json");
if (! file_exists($file_location))
throw new NonExistingMigrationFile('Backup file does not exist, or it is corrupted.');
throw new NonExistingMigrationFile('Backup file does not exist, or is corrupted.');
$data = json_decode(file_get_contents($file_location));

View File

@ -13,6 +13,7 @@ namespace App\Http\ViewComposers;
use App\Utils\Ninja;
use App\Utils\TranslationHelper;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Lang;
use Illuminate\View\View;

View File

@ -147,11 +147,24 @@ class CompanyImport implements ShouldQueue
$this->backup_file = Cache::get($this->hash);
if ( empty( $this->import_object ) )
if ( empty( $this->backup_file ) )
throw new \Exception('No import data found, has the cache expired?');
$this->backup_file = base64_decode($this->backup_file);
if(array_key_exists('import_settings', $request) && $request['import_settings'] == 'true') {
$this->preFlightChecks()->importSettings();
}
if(array_key_exists('import_data', $request) && $request['import_data'] == 'true') {
$this->preFlightChecks()
->purgeCompanyData()
->importData();
}
}
@ -191,6 +204,7 @@ class CompanyImport implements ShouldQueue
$this->company->tasks()->forceDelete();
$this->company->vendors()->forceDelete();
$this->company->expenses()->forceDelete();
$this->company->subscriptions()->forceDelete();
$this->company->save();
@ -226,6 +240,8 @@ class CompanyImport implements ShouldQueue
}
return $this;
}
private function import_payment_terms()

View File

@ -188,7 +188,7 @@ class PaymentMethod
$fee_label = $gateway->calcGatewayFeeLabel($this->amount, $this->client, $gateway_type_id);
if(!$gateway_type_id){
if(!$gateway_type_id || (GatewayType::CUSTOM == $gateway_type_id)){
$this->payment_urls[] = [
'label' => $gateway->getConfigField('name') . $fee_label,