mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Merge pull request #4617 from turbo124/v5-develop
Fixes for unique taxrate constraint on update 8653cc6
This commit is contained in:
commit
7c5fbda1bf
@ -32,6 +32,16 @@ class InvitationController extends Controller
|
||||
use MakesDates;
|
||||
|
||||
public function router(string $entity, string $invitation_key)
|
||||
{
|
||||
return $this->genericRouter($entity, $invitation_key);
|
||||
}
|
||||
|
||||
public function recurringRouter(string $invitation_key)
|
||||
{
|
||||
return $this->genericRouter('recurring_invoice', $invitation_key);
|
||||
}
|
||||
|
||||
private function genericRouter(string $entity, string $invitation_key)
|
||||
{
|
||||
$key = $entity.'_id';
|
||||
|
||||
|
@ -28,7 +28,8 @@ class UpdateTaxRateRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'unique:tax_rates,name,'.$this->tax_rate->name.',id,company_id,'.auth()->user()->companyId(),
|
||||
// 'name' => 'unique:tax_rates,name,'.$this->tax_rate->name.',id,company_id,'.auth()->user()->companyId(),
|
||||
'name' => 'unique:tax_rates,name,'.$this->id.',id,company_id,'.$this->company_id,
|
||||
'rate' => 'numeric',
|
||||
];
|
||||
}
|
||||
|
@ -300,6 +300,9 @@ class RecurringInvoice extends BaseModel
|
||||
public static function frequencyForKey(int $frequency_id) :string
|
||||
{
|
||||
switch ($frequency_id) {
|
||||
case self::FREQUENCY_DAILY:
|
||||
return ctrans('texts.freq_daily');
|
||||
break;
|
||||
case self::FREQUENCY_WEEKLY:
|
||||
return ctrans('texts.freq_weekly');
|
||||
break;
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\RecurringInvoice;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@ -36,6 +37,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
//
|
||||
parent::boot();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ Route::group(['middleware' => ['auth:contact', 'locale', 'check_client_existence
|
||||
Route::get('invoices/{invoice_invitation}', 'ClientPortal\InvoiceController@show')->name('invoice.show_invitation');
|
||||
|
||||
Route::get('recurring_invoices', 'ClientPortal\RecurringInvoiceController@index')->name('recurring_invoices.index')->middleware('portal_enabled');
|
||||
Route::get('recurring_invoices/{recurring_invoice}', 'ClientPortal\RecurringInvoiceController@show')->name('recurring_invoices.show');
|
||||
Route::get('recurring_invoices/{recurring_invoice}', 'ClientPortal\RecurringInvoiceController@show')->name('recurring_invoice.show');
|
||||
Route::get('recurring_invoices/{recurring_invoice}/request_cancellation', 'ClientPortal\RecurringInvoiceController@requestCancellation')->name('recurring_invoices.request_cancellation');
|
||||
|
||||
Route::post('payments/process', 'ClientPortal\PaymentController@process')->name('payments.process');
|
||||
@ -78,6 +78,7 @@ Route::group(['middleware' => ['auth:contact', 'locale', 'check_client_existence
|
||||
|
||||
Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'client.'], function () {
|
||||
/*Invitation catches*/
|
||||
Route::get('recurring_invoice/{invitation_key}', 'ClientPortal\InvitationController@recurringRouter');
|
||||
Route::get('{entity}/{invitation_key}', 'ClientPortal\InvitationController@router');
|
||||
Route::get('invoice/{invitation_key}/download_pdf', 'InvoiceController@downloadPdf')->name('invoice.download_invitation_key');
|
||||
Route::get('quote/{invitation_key}/download_pdf', 'QuoteController@downloadPdf')->name('quote.download_invitation_key');
|
||||
|
Loading…
Reference in New Issue
Block a user