commit de compras
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
$settlementNav = static function (string $key) use ($data, $e): void {
|
||||
if (! isset($data['settlement_pagination'][$key])) return;
|
||||
$p = $data['settlement_pagination'][$key];
|
||||
$param = ['payments' => 'payments_page', 'allocation_proposals' => 'allocation_proposals_page', 'allocations' => 'allocations_page', 'payment_events' => 'payment_events_page'][$key];
|
||||
$anchor = ['payments' => 'payments', 'allocation_proposals' => 'allocation-proposals', 'allocations' => 'allocation-history', 'payment_events' => 'payment-history'][$key];
|
||||
$label = ['payments' => 'pagamentos', 'allocation_proposals' => 'propostas de afectação', 'allocations' => 'afectações confirmadas', 'payment_events' => 'eventos de pagamentos'][$key];
|
||||
echo '<nav aria-label="Paginação de '.$e($label).'"><p>Página '.$e($p['page']).' de '.$e($p['last_page']).' · '.$e($p['total']).' registos</p>';
|
||||
foreach ([-1 => 'Anterior', 1 => 'Seguinte'] as $delta => $text) {
|
||||
$target = $p['page'] + $delta;
|
||||
if ($target < 1 || $target > $p['last_page']) continue;
|
||||
$query = array_replace($data['settlement_query'], [$param => $target]);
|
||||
echo '<a href="'.$e('/supplier-payments?'.http_build_query($query, '', '&', PHP_QUERY_RFC3986).'#'.$anchor).'">'.$text.'</a> ';
|
||||
}
|
||||
echo '</nav>';
|
||||
};
|
||||
$paymentFocusUrl = static function (int $id) use ($data): string {
|
||||
$query = array_replace($data['settlement_query'], ['payment' => $id, 'payment_state' => 'all', 'payment_q' => '',
|
||||
'payments_page' => 1, 'allocation_proposals_page' => 1, 'allocations_page' => 1, 'payment_events_page' => 1]);
|
||||
return '/supplier-payments?'.http_build_query($query, '', '&', PHP_QUERY_RFC3986).'#payments';
|
||||
};
|
||||
if (! isset($data['settlement_pagination'])) return;
|
||||
$sq = $data['settlement_query'];
|
||||
?>
|
||||
<section><h2>Filtrar pagamentos e histórico</h2><form method="get" action="/supplier-payments">
|
||||
<?php foreach($data['obligation_query'] as $name=>$value): ?><input type="hidden" name="<?= $e($name) ?>" value="<?= $e($value) ?>"><?php endforeach ?>
|
||||
<?php if(isset($sq['payment'])): ?><input type="hidden" name="payment" value="<?= $e($sq['payment']) ?>"><?php endif ?>
|
||||
<label>Referência do pagamento<input name="payment_q" maxlength="100" value="<?= $e($sq['payment_q']) ?>"></label>
|
||||
<label>Estado do pagamento<select name="payment_state"><?php foreach(['all'=>'Todos','proposed'=>'Propostos','confirmed'=>'Confirmados','rejected'=>'Rejeitados'] as $value=>$label): ?><option value="<?= $value ?>" <?= $sq['payment_state']===$value?'selected':'' ?>><?= $label ?></option><?php endforeach ?></select></label>
|
||||
<label>Registos por página<select name="payment_per_page"><?php foreach([25,100] as $size): ?><option value="<?= $size ?>" <?= $sq['payment_per_page']===$size?'selected':'' ?>><?= $size ?></option><?php endforeach ?></select></label><button>Aplicar filtros ao histórico</button></form>
|
||||
<p>Estes filtros abrangem pagamentos, propostas de afectação, afectações e eventos. Cada lista tem paginação própria. Os filtros de documentos escolhem as obrigações e não restringem este histórico. Os montantes por afectar incluem todo o histórico do pagamento, também fora da página.</p>
|
||||
<?php if(isset($sq['payment'])): $all=$sq; unset($all['payment']); foreach(['payments_page','allocation_proposals_page','allocations_page','payment_events_page'] as $key)$all[$key]=1; ?><p>Conferência do pagamento #<?= $e($sq['payment']) ?> · <a href="<?= $e('/supplier-payments?'.http_build_query($all,'','&',PHP_QUERY_RFC3986)) ?>">Consultar outros pagamentos</a></p><?php endif ?>
|
||||
</section>
|
||||
Reference in New Issue
Block a user