Store estimated chore execution date at execution.

Show this value in Chore execution journal.
This way you know if Chore has been executed at expected time.
This commit is contained in:
Wasinix 2023-10-09 13:30:20 +02:00
parent c9215a9a4e
commit 4120bd9fc7
35 changed files with 108 additions and 1 deletions

View File

@ -2651,3 +2651,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2830,3 +2830,6 @@ msgstr[0] "Vytiskne se 1nálepka"
msgstr[1] "Vytisknou se %1$s nálepky"
msgstr[2] "Vytiskne se %1$s nálepek"
msgstr[3] "Vytiskne se %1$s nálepek"
msgid "Estimated tracking"
msgstr ""

View File

@ -2684,3 +2684,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2790,3 +2790,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] "Dies bedeutet 1 Bestandseintragsetikett wird gedruckt"
msgstr[1] "Dies bedeutet %1$s Bestandseintragsetiketten werden gedruckt"
msgid "Estimated tracking"
msgstr "Geplante Ausführung"

View File

@ -2655,3 +2655,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -1205,3 +1205,6 @@ msgstr "This is required and can only contain letters and numbers"
msgid "Edit userfield"
msgstr "Edit userfield"
msgid "Estimated tracking"
msgstr "Estimated tracking"

View File

@ -2672,3 +2672,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr "Estimated tracking"

View File

@ -2849,3 +2849,6 @@ msgid_plural "This means %1$s labels will be printed"
msgstr[0] "Esto significa que 1 etiqueta será impresa"
msgstr[1] "Esto significa que %1$s etiqueta será impresa"
msgstr[2] "Esto significa que %1$s etiquetas serán impresas"
msgid "Estimated tracking"
msgstr ""

View File

@ -2741,3 +2741,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] "See tähendab, et prinditakse üks etikett"
msgstr[1] "See tähendab, et prinditakse %1$s etiketti"
msgid "Estimated tracking"
msgstr ""

View File

@ -2685,3 +2685,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2854,3 +2854,6 @@ msgid_plural "This means %1$s labels will be printed"
msgstr[0] "Cela signifie que 1 étiquette sera imprimée"
msgstr[1] "Cela signifie que %1$s étiquettes seront imprimées"
msgstr[2] "Cela signifie que %1$s étiquettes seront imprimées"
msgid "Estimated tracking"
msgstr ""

View File

@ -2769,3 +2769,6 @@ msgstr[0] "משמעות הדבר היא שתודפס תווית אחת"
msgstr[1] "משמעות הדבר היא שתודפסנה %1$s תוויות"
msgstr[2] "משמעות הדבר היא שתודפסנה %1$s תוויות"
msgstr[3] "משמעות הדבר היא שתודפסנה %1$s תוויות"
msgid "Estimated tracking"
msgstr ""

View File

@ -2748,3 +2748,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2850,3 +2850,6 @@ msgid_plural "This means %1$s labels will be printed"
msgstr[0] "Questo significa che verrà stampata 1 etichetta"
msgstr[1] "Questo significa che verranno stampate %1$s etichette"
msgstr[2] "Questo significa che verranno stampate %1$s etichette"
msgid "Estimated tracking"
msgstr ""

View File

@ -2553,3 +2553,6 @@ msgstr ""
msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2570,3 +2570,6 @@ msgstr ""
msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2826,3 +2826,6 @@ msgstr[0] "Tai reiškia, kad bus atspausdinta 1 etiketė"
msgstr[1] "Tai reiškia, kad bus atspausdintos %1$s etiketės"
msgstr[2] "Tai reiškia, kad bus atspausdintos %1$s etikečių"
msgstr[3] "Tai reiškia, kad bus atspausdintos %1$s etikečių"
msgid "Estimated tracking"
msgstr ""

View File

@ -2817,3 +2817,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] "Dit betekend dat 1 label wordt geprint"
msgstr[1] "Dit betekend dat %1$s labels worden geprint"
msgid "Estimated tracking"
msgstr ""

View File

@ -2727,3 +2727,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2836,3 +2836,6 @@ msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgstr[3] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2826,3 +2826,6 @@ msgid_plural "This means %1$s labels will be printed"
msgstr[0] "Significa que 1 etiqueta será impressa"
msgstr[1] "Significa que %1$s etiquetas serão impressas"
msgstr[2] "Significa que %1$s etiquetas serão impressas"
msgid "Estimated tracking"
msgstr ""

View File

@ -2687,3 +2687,6 @@ msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2700,3 +2700,6 @@ msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2794,3 +2794,6 @@ msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgstr[3] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2693,3 +2693,6 @@ msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgstr[3] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2671,3 +2671,6 @@ msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgstr[3] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2666,3 +2666,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2586,3 +2586,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2607,3 +2607,6 @@ msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgstr[1] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2759,3 +2759,6 @@ msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgstr[3] ""
msgid "Estimated tracking"
msgstr ""

View File

@ -2556,3 +2556,6 @@ msgstr "显示此产品价格时,将此产品数量单位做为产品价格的
msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] "%1$s个标签将被打印"
msgid "Estimated tracking"
msgstr ""

View File

@ -2554,3 +2554,6 @@ msgstr ""
msgid "This means 1 label will be printed"
msgid_plural "This means %1$s labels will be printed"
msgstr[0] ""
msgid "Estimated tracking"
msgstr ""

3
migrations/0235.sql Normal file
View File

@ -0,0 +1,3 @@
ALTER TABLE chores_log
ADD estimated_execution_time DATETIME;

View File

@ -187,11 +187,13 @@ class ChoresService extends BaseService
}
}
$estimatedExecutionTime = $this->getDatabase()->chores_current()->where('chore_id', $choreId)->min('next_estimated_execution_time');
$logRow = $this->getDatabase()->chores_log()->createRow([
'chore_id' => $choreId,
'tracked_time' => $trackedTime,
'done_by_user_id' => $doneBy,
'skipped' => BoolToInt($skipped)
'skipped' => BoolToInt($skipped),
'estimated_execution_time' => $estimatedExecutionTime
]);
$logRow->save();
$lastInsertId = $this->getDatabase()->lastInsertId();

View File

@ -91,6 +91,7 @@
</th>
<th class="allow-grouping">{{ $__t('Chore') }}</th>
<th>{{ $__t('Tracked time') }}</th>
<th>{{ $__t('Estimated tracking') }}</th>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<th class="allow-grouping">{{ $__t('Done by') }}</th>
@endif
@ -131,6 +132,11 @@
<span class="text-muted">{{ $__t('Skipped') }}</span>
@endif
</td>
<td>
<span>{{ $choreLogEntry->estimated_execution_time }}</span>
<time class="timeago-contextual @if(FindObjectInArrayByPropertyValue($chores, 'id', $choreLogEntry->chore_id)->track_date_only == 1) timeago-date-only @endif"
datetime="{{ $choreLogEntry->estimated_execution_time }}"></time>
</td>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<td>
@if ($choreLogEntry->done_by_user_id !== null && !empty($choreLogEntry->done_by_user_id))