diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index ab73fd7bb3a3..cb409a45f1d9 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -610,17 +610,17 @@ class CompanySettings extends BaseSettings '$task.line_total', ], 'total_columns' => [ - '$total_taxes', - '$line_taxes', '$subtotal', '$discount', + '$total_taxes', + '$line_taxes', '$custom_surcharge1', '$custom_surcharge2', '$custom_surcharge3', '$custom_surcharge4', - '$paid_to_date', - '$client.balance', '$total', + '$paid_to_date', + '$outstanding', ], ]; diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 7745f0942bd7..f3601b784bc8 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -74,8 +74,8 @@ class SelfUpdateController extends BaseController try { $res = $repo->pull(); } catch (GitException $e) { - info($e->getMessage()); + info($e->getMessage()); return response()->json(['message'=>$e->getMessage()], 500); } info('Are there any changes to pull? '.$repo->hasChanges()); diff --git a/app/Http/Requests/Design/StoreDesignRequest.php b/app/Http/Requests/Design/StoreDesignRequest.php index e7ce3d132608..1420a12484e7 100644 --- a/app/Http/Requests/Design/StoreDesignRequest.php +++ b/app/Http/Requests/Design/StoreDesignRequest.php @@ -51,6 +51,10 @@ class StoreDesignRequest extends Request $input['design']['includes'] = ''; } + if (! array_key_exists('footer', $input['design']) || is_null($input['design']['footer'])) { + $input['design']['footer'] = ''; + } + $this->replace($input); } } diff --git a/app/Http/Requests/Design/UpdateDesignRequest.php b/app/Http/Requests/Design/UpdateDesignRequest.php index e042a4b366a9..331bcc96d653 100644 --- a/app/Http/Requests/Design/UpdateDesignRequest.php +++ b/app/Http/Requests/Design/UpdateDesignRequest.php @@ -14,7 +14,6 @@ namespace App\Http\Requests\Design; use App\Http\Requests\Request; use App\Models\Design; use App\Utils\Traits\ChecksEntityStatus; -use Illuminate\Support\Facades\Log; class UpdateDesignRequest extends Request { @@ -47,6 +46,14 @@ class UpdateDesignRequest extends Request $input['design']['task'] = ''; } + if (! array_key_exists('includes', $input['design']) || is_null($input['design']['includes'])) { + $input['design']['includes'] = ''; + } + + if (! array_key_exists('footer', $input['design']) || is_null($input['design']['footer'])) { + $input['design']['footer'] = ''; + } + $this->replace($input); } } diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 54bb3c296309..abe051a35c59 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -237,6 +237,7 @@ class HtmlEngine $data['$client.email'] = &$data['$email']; $data['$client.balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; + $data['$outstanding'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; $data['$client_balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; $data['$paid_to_date'] = ['value' => Number::formatMoney($this->client->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')]; diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index 54f2a56513d4..b958be54a098 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -314,6 +314,8 @@ trait MakesInvoiceValues $data['$client_name'] = ['value' => $this->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')]; $data['$client.name'] = &$data['$client_name']; $data['$client.balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; + $data['$outstanding'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; + $data['$client_balance'] = ['value' => Number::formatMoney($this->client->balance, $this->client), 'label' => ctrans('texts.account_balance')]; $data['$paid_to_date'] = ['value' => Number::formatMoney($this->client->paid_to_date, $this->client), 'label' => ctrans('texts.paid_to_date')];