mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Clean up
This commit is contained in:
parent
25f8cd249d
commit
92e2c7c614
@ -75,16 +75,19 @@ class BackupUpdate extends Command
|
||||
|
||||
private function handleOnDb()
|
||||
{
|
||||
set_time_limit(0);
|
||||
|
||||
Backup::chunk(100, function ($backups) {
|
||||
foreach ($backups as $backup) {
|
||||
|
||||
if($backup->activity->client()->exists()){
|
||||
|
||||
Backup::whereHas('activity')->whereNotNull('html_backup')->cursor()->each(function($backup){
|
||||
$client = $backup->activity->client;
|
||||
$backup->storeRemotely($backup->html_backup, $client);
|
||||
|
||||
if($backup->activity->client()->exists()){
|
||||
|
||||
$client = $backup->activity->client;
|
||||
$backup->storeRemotely($backup->html_backup, $client);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -417,6 +417,7 @@ class CheckData extends Command
|
||||
payments.id = paymentables.payment_id
|
||||
WHERE paymentable_type = 'App\\Models\\Credit'
|
||||
AND paymentables.deleted_at is NULL
|
||||
AND payments.is_deleted = 0
|
||||
AND payments.client_id = ?;
|
||||
"), [$client->id] );
|
||||
|
||||
|
@ -265,15 +265,16 @@ class MigrationController extends BaseController
|
||||
|
||||
foreach($request->all() as $input){
|
||||
|
||||
if($input instanceof UploadedFile)
|
||||
nlog('is file');
|
||||
if($input instanceof UploadedFile){
|
||||
|
||||
}
|
||||
else
|
||||
$companies[] = json_decode($input,1);
|
||||
}
|
||||
}
|
||||
|
||||
if (app()->environment() === 'local') {
|
||||
nlog($request->all());
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -132,8 +132,6 @@ class TemplateEmail extends Mailable
|
||||
if($this->invitation && $this->invitation->invoice && $settings->ubl_email_attachment && $this->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)){
|
||||
|
||||
$ubl_string = CreateUbl::dispatchNow($this->invitation->invoice);
|
||||
|
||||
nlog($ubl_string);
|
||||
|
||||
if($ubl_string)
|
||||
$this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml'));
|
||||
|
@ -26,10 +26,10 @@ class Backup extends BaseModel
|
||||
return $this->belongsTo(Activity::class);
|
||||
}
|
||||
|
||||
public function storeRemotely(string $html, Client $client)
|
||||
public function storeRemotely(?string $html, Client $client)
|
||||
{
|
||||
|
||||
if(strlen($html) == 0)
|
||||
if(!$html || strlen($html) == 0)
|
||||
return;
|
||||
|
||||
$path = $client->backup_path() . "/";
|
||||
|
Loading…
Reference in New Issue
Block a user