diff --git a/VERSION.txt b/VERSION.txt index 1dcfa2b73936..577d1e25e9a9 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.31 \ No newline at end of file +5.8.32 \ No newline at end of file diff --git a/app/Filters/DocumentFilters.php b/app/Filters/DocumentFilters.php index 15856a2e762d..f649ccca1767 100644 --- a/app/Filters/DocumentFilters.php +++ b/app/Filters/DocumentFilters.php @@ -57,7 +57,11 @@ class DocumentFilters extends QueryFilters \App\Models\Credit::class, \App\Models\Expense::class, \App\Models\Payment::class, - \App\Models\Task::class], function ($q2) use ($client_id) { + \App\Models\Task::class, + \App\Models\RecurringExpense::class, + \App\Models\RecurringInvoice::class, + \App\Models\Project::class, + ], function ($q2) use ($client_id) { $q2->where('client_id', $this->decodePrimaryKey($client_id)); })->orWhereHasMorph('documentable', [\App\Models\Client::class], function ($q3) use ($client_id) { $q3->where('id', $this->decodePrimaryKey($client_id)); diff --git a/app/Helpers/Invoice/InvoiceSum.php b/app/Helpers/Invoice/InvoiceSum.php index fd1472c18e7f..d6379356cd11 100644 --- a/app/Helpers/Invoice/InvoiceSum.php +++ b/app/Helpers/Invoice/InvoiceSum.php @@ -122,7 +122,7 @@ class InvoiceSum private function calculateInvoiceTaxes(): self { - if (is_string($this->invoice->tax_name1) && strlen($this->invoice->tax_name1) > 2) { + if (is_string($this->invoice->tax_name1) && strlen($this->invoice->tax_name1) >= 2) { $tax = $this->taxer($this->total, $this->invoice->tax_rate1); $tax += $this->getSurchargeTaxTotalForKey($this->invoice->tax_name1, $this->invoice->tax_rate1); @@ -130,7 +130,7 @@ class InvoiceSum $this->total_tax_map[] = ['name' => $this->invoice->tax_name1.' '.floatval($this->invoice->tax_rate1).'%', 'total' => $tax]; } - if (is_string($this->invoice->tax_name2) && strlen($this->invoice->tax_name2) > 2) { + if (is_string($this->invoice->tax_name2) && strlen($this->invoice->tax_name2) >= 2) { $tax = $this->taxer($this->total, $this->invoice->tax_rate2); $tax += $this->getSurchargeTaxTotalForKey($this->invoice->tax_name2, $this->invoice->tax_rate2); @@ -138,7 +138,7 @@ class InvoiceSum $this->total_tax_map[] = ['name' => $this->invoice->tax_name2.' '.floatval($this->invoice->tax_rate2).'%', 'total' => $tax]; } - if (is_string($this->invoice->tax_name3) && strlen($this->invoice->tax_name3) > 2) { + if (is_string($this->invoice->tax_name3) && strlen($this->invoice->tax_name3) >= 2) { $tax = $this->taxer($this->total, $this->invoice->tax_rate3); $tax += $this->getSurchargeTaxTotalForKey($this->invoice->tax_name3, $this->invoice->tax_rate3); diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 5f43373501e3..d6f8a8a8fd2d 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -49,6 +49,9 @@ use App\Http\Requests\Client\ClientDocumentsRequest; use App\Http\Requests\Client\ReactivateClientEmailRequest; use App\Models\Expense; use App\Models\Payment; +use App\Models\Project; +use App\Models\RecurringExpense; +use App\Models\RecurringInvoice; use App\Models\Task; use App\Transformers\DocumentTransformer; @@ -421,7 +424,7 @@ class ClientController extends BaseController $documents = Document::query() ->company() - ->whereHasMorph('documentable', [Invoice::class, Quote::class, Credit::class, Expense::class, Payment::class, Task::class], function ($query) use ($client) { + ->whereHasMorph('documentable', [Invoice::class, Quote::class, Credit::class, Expense::class, Payment::class, Task::class, RecurringInvoice::class, RecurringExpense::class, Project::class], function ($query) use ($client) { $query->where('client_id', $client->id); }) ->orWhereHasMorph('documentable', [Client::class], function ($query) use ($client) { diff --git a/app/Models/Document.php b/app/Models/Document.php index 53be87341a4d..896d3015a2de 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -214,15 +214,17 @@ class Document extends BaseModel $link = ''; match($this->documentable_type) { - 'App\Models\Vendor' => $link = "vendors/{$entity_id}", - 'App\Models\Project' => $link = "projects/{$entity_id}", - 'invoices' => $link = "invoices/{$entity_id}/edit", - 'App\Models\Quote' => $link = "quotes/{$entity_id}/edit", - 'App\Models\Credit' => $link = "credits/{$entity_id}/edit", - 'App\Models\Expense' => $link = "expenses/{$entity_id}/edit", - 'App\Models\Payment' => $link = "payments/{$entity_id}/edit", - 'App\Models\Task' => $link = "tasks/{$entity_id}/edit", - 'App\Models\Client' => $link = "clients/{$entity_id}", + 'App\Models\Vendor' => $link = "/vendors/{$entity_id}", + 'App\Models\Project' => $link = "/projects/{$entity_id}", + 'invoices' => $link = "/invoices/{$entity_id}/edit", + 'App\Models\Quote' => $link = "/quotes/{$entity_id}/edit", + 'App\Models\Credit' => $link = "/credits/{$entity_id}/edit", + 'App\Models\Expense' => $link = "/expenses/{$entity_id}/edit", + 'App\Models\Payment' => $link = "/payments/{$entity_id}/edit", + 'App\Models\Task' => $link = "/tasks/{$entity_id}/edit", + 'App\Models\Client' => $link = "/clients/{$entity_id}", + 'App\Models\RecurringExpense' => $link = "/recurring_expenses/{$entity_id}/edit", + 'App\Models\RecurringInvoice' => $link = "/recurring_invoices/{$entity_id}/edit", default => $link = '', }; diff --git a/config/ninja.php b/config/ninja.php index d9174d53721e..660b465a201b 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.8.31'), - 'app_tag' => env('APP_TAG', '5.8.31'), + 'app_version' => env('APP_VERSION', '5.8.32'), + 'app_tag' => env('APP_TAG', '5.8.32'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false), diff --git a/lang/en/texts.php b/lang/en/texts.php index 217ce04ed9f1..507dfdc76a88 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5241,6 +5241,7 @@ $lang = array( 'test_email_sent' => 'Successfully sent email', 'gateway_type' => 'Gateway Type', 'save_template_body' => 'Would you like to save this import mapping as a template for future use?', + 'save_as_template' => 'Save Template Mapping' ); return $lang; diff --git a/lang/fr_CA/texts.php b/lang/fr_CA/texts.php index 1020490d5777..497ed891308a 100644 --- a/lang/fr_CA/texts.php +++ b/lang/fr_CA/texts.php @@ -5234,6 +5234,10 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette 'user_sales' => 'Ventes de l\'utilisateur', 'iframe_url' => 'URL de l\'iFrame', 'user_unsubscribed' => 'Utilisateur désabonné des courriels :link', + 'use_available_payments' => 'Utilisez les paiements disponibles', + 'test_email_sent' => 'Le courriel a été envoyé', + 'gateway_type' => 'Type de passerelle', + 'save_template_body' => 'Souhaitez-vous enregistrer cette correspondance d\'importation en tant que modèle pour une utilisation future ?', ); return $lang;