commit melhorias compras3
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-22 10:56:58 +02:00
parent 4fac443dda
commit efd97e265b
130 changed files with 8917 additions and 363 deletions
+7 -4
View File
@@ -538,7 +538,10 @@ class WorkflowTaskInbox
return [];
}
$rows = [];
foreach (['agreement', 'policy', 'auto_rule', 'history', 'alternative'] as $kind) {
foreach (['contract', 'agreement', 'policy', 'auto_rule', 'history', 'alternative'] as $kind) {
if ($kind === 'contract' && ! app(AgreementOrderLimits::class)->ready()) {
continue;
}
$permission = match ($kind) {
'history' => 'supply_history_review', 'alternative' => 'supply_technical_review', default => 'supply_review'
};
@@ -556,13 +559,13 @@ class WorkflowTaskInbox
continue;
}
$rows[] = ['id' => 'supply:'.$record->id.':review', 'module' => 'supply',
'reference' => trim(($record->snapshot['item']['code'] ?? 'Fornecimento').' '.($record->snapshot['warehouse']['code'] ?? '')),
'reference' => $kind === 'contract' ? $record->data['reference'] : trim(($record->snapshot['item']['code'] ?? 'Fornecimento').' '.($record->snapshot['warehouse']['code'] ?? '')),
'label' => match ($kind) {
'agreement' => 'Conferir acordo de fornecimento', 'policy' => 'Conferir política de reposição', 'history' => 'Conferir histórico de consumo', 'alternative' => 'Conferir alternativa técnica', default => 'Conferir parametrização de compra automática',
'contract' => 'Conferir contrato multiartigo', 'agreement' => 'Conferir acordo de fornecimento', 'policy' => 'Conferir política de reposição', 'history' => 'Conferir histórico de consumo', 'alternative' => 'Conferir alternativa técnica', default => 'Conferir parametrização de compra automática',
}, 'task' => $kind.'_review', 'status' => $record->state, 'blocked' => false, 'created_at' => $this->date($record->created_at), 'due_on' => null,
'href' => $kind === 'auto_rule' ? '/stock/reposicao?rule_id='.$record->id.'#supply-rule-'.$record->id
: '/compras/fornecimento?view='.match ($kind) {
'agreement' => 'agreements', 'history' => 'history', 'alternative' => 'alternatives', default => 'calendar'
'contract' => 'contracts', 'agreement' => 'agreements', 'history' => 'history', 'alternative' => 'alternatives', default => 'calendar'
}.'&record_id='.$record->id.'#supply-record-'.$record->id];
}
}