1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

next send date

This commit is contained in:
David Bomba 2023-05-22 17:41:12 +10:00
parent 44dd0c975e
commit a38d011d56
3 changed files with 10 additions and 1 deletions

View File

@ -124,6 +124,7 @@ class TaskStatusController extends BaseController
*/
public function update(UpdateTaskStatusRequest $request, TaskStatus $task_status)
{
nlog($request->all());
$task_status->fill($request->all());
$reorder = $task_status->isDirty('status_order');

View File

@ -56,13 +56,20 @@ class TaskStatusRepository extends BaseRepository
public function reorder(TaskStatus $task_status)
{
nlog("i am dirty");
nlog(TaskStatus::query()
->where('company_id', $task_status->company_id)
->orderByRaw('ISNULL(status_order), status_order ASC')
->orderBy('status_order', 'DESC')->pluck('name'));
TaskStatus::query()
->where('company_id', $task_status->company_id)
->orderByRaw('ISNULL(status_order), status_order ASC')
->orderBy('updated_at', 'DESC')
->orderBy('status_order', 'DESC')
->cursor()
->each(function ($task_status, $index) {
nlog($index." ".$task_status->name);
$task_status->update(['status_order' => $index+1]);
});

View File

@ -91,6 +91,7 @@ class RecurringInvoiceTransformer extends EntityTransformer
'date' => $invoice->date ?: '',
'last_sent_date' => $invoice->last_sent_date ?: '',
'next_send_date' => $invoice->next_send_date_client ?: '',
'next_send_datetime' => $invoice->next_send_date ?: '',
'due_date' => $invoice->due_date ?: '',
'terms' => $invoice->terms ?: '',
'public_notes' => $invoice->public_notes ?: '',