calculate scheduler name for tasks/payment schedules
This commit is contained in:
parent
9d64bb333f
commit
a666addc28
|
|
@ -13,11 +13,14 @@
|
||||||
namespace App\Http\Requests\TaskScheduler;
|
namespace App\Http\Requests\TaskScheduler;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
use App\Http\ValidationRules\Scheduler\ValidClientIds;
|
use App\Http\ValidationRules\Scheduler\ValidClientIds;
|
||||||
use App\Http\ValidationRules\Scheduler\InvoiceWithNoExistingSchedule;
|
use App\Http\ValidationRules\Scheduler\InvoiceWithNoExistingSchedule;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
|
||||||
class StoreSchedulerRequest extends Request
|
class StoreSchedulerRequest extends Request
|
||||||
{
|
{
|
||||||
|
use MakesHash;
|
||||||
public array $client_statuses = [
|
public array $client_statuses = [
|
||||||
'all',
|
'all',
|
||||||
'draft',
|
'draft',
|
||||||
|
|
@ -121,6 +124,14 @@ class StoreSchedulerRequest extends Request
|
||||||
$input['remaining_cycles'] = count($input['parameters']['schedule']);
|
$input['remaining_cycles'] = count($input['parameters']['schedule']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($input['template'] == 'payment_schedule'){
|
||||||
|
$i = Invoice::withTrashed()->find($this->decodePrimaryKey($input['parameters']['invoice_id']));
|
||||||
|
$input['name'] = ctrans('texts.payment_schedule'). " " . ctrans('texts.invoice_number_short') . " " . $i->number;
|
||||||
|
}
|
||||||
|
elseif($input['template'] == 'invoice_outstanding_tasks'){
|
||||||
|
$input['name'] = ctrans('texts.invoice_outstanding_tasks');
|
||||||
|
}
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue