1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
This commit is contained in:
David Bomba 2022-02-19 16:11:30 +11:00
parent 25f8cd249d
commit 92e2c7c614
5 changed files with 16 additions and 13 deletions

View File

@ -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);
}
}
});
}

View File

@ -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] );

View File

@ -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 {

View File

@ -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'));

View File

@ -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() . "/";