@@ -1,4 +1,9 @@
|
||||
import { Head, Link, useForm } from '@inertiajs/react';
|
||||
import AgreementOrderBindings, {
|
||||
type OrderAgreementBinding,
|
||||
type OrderAgreementOption,
|
||||
type OrderAgreementLine,
|
||||
} from '@/components/agreement-order-bindings';
|
||||
import { ComparisonPolicySummary } from '@/components/comparison-policy-summary';
|
||||
import type { ComparisonPolicy } from '@/components/comparison-policy-summary';
|
||||
import {
|
||||
@@ -14,6 +19,10 @@ import { money, roleLabels, date } from '@/types/procurement';
|
||||
import type { MatrixRow, PurchaseAward } from '@/types/purchase';
|
||||
|
||||
type Props = {
|
||||
agreementOrderLimitsReady?: boolean;
|
||||
agreementOptions?: OrderAgreementOption[];
|
||||
agreementLines?: OrderAgreementLine[];
|
||||
agreementSearch?: string;
|
||||
requisition: { id: number; number: string };
|
||||
comparison: {
|
||||
rows: MatrixRow[];
|
||||
@@ -37,6 +46,10 @@ export default function Award({
|
||||
canIssue,
|
||||
order,
|
||||
recommendation,
|
||||
agreementOrderLimitsReady = false,
|
||||
agreementOptions = [],
|
||||
agreementLines = [],
|
||||
agreementSearch = '',
|
||||
}: Props) {
|
||||
const selection = useForm({
|
||||
quotation_id: '',
|
||||
@@ -45,7 +58,9 @@ export default function Award({
|
||||
delivery_location: '',
|
||||
});
|
||||
const decision = useForm({ decision: 'approved', comment: '' });
|
||||
const issue = useForm({});
|
||||
const issue = useForm({
|
||||
agreement_bindings: [] as OrderAgreementBinding[],
|
||||
});
|
||||
return (
|
||||
<>
|
||||
<Head title={`Adjudicação · ${requisition.number}`} />
|
||||
@@ -415,6 +430,22 @@ export default function Award({
|
||||
description="O servidor revalida a matriz, os conflitos e as aprovações. A ordem emitida mantém um retrato dos dados e não pode ser reescrita."
|
||||
>
|
||||
<FormErrors errors={issue.errors} />
|
||||
{agreementOrderLimitsReady && (
|
||||
<AgreementOrderBindings
|
||||
key={requisition.id}
|
||||
requestId={requisition.id}
|
||||
lines={agreementLines}
|
||||
options={agreementOptions}
|
||||
value={issue.data.agreement_bindings}
|
||||
onChange={(value) =>
|
||||
issue.setData(
|
||||
'agreement_bindings',
|
||||
value,
|
||||
)
|
||||
}
|
||||
initialSearch={agreementSearch}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
className="mt-4"
|
||||
disabled={issue.processing}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Head, Link } from '@inertiajs/react';
|
||||
import { AgreementOrderLimitSummary } from '@/components/agreement-order-bindings';
|
||||
import type { FrozenOrderAgreement } from '@/types/purchase';
|
||||
import { Printer } from 'lucide-react';
|
||||
import { EvidenceBrief } from '@/components/evidence-brief';
|
||||
import type { EvidenceBriefData } from '@/components/evidence-brief';
|
||||
@@ -59,6 +61,7 @@ type ComparisonRow = {
|
||||
weights: Record<string, number>;
|
||||
};
|
||||
type Report = {
|
||||
agreement_limits?: Record<string, FrozenOrderAgreement>;
|
||||
generated_at: string;
|
||||
generated_by: string;
|
||||
company: string;
|
||||
@@ -720,6 +723,9 @@ export default function ReviewReport({
|
||||
</p>
|
||||
</div>
|
||||
</Panel>
|
||||
<AgreementOrderLimitSummary
|
||||
bindings={report.agreement_limits}
|
||||
/>
|
||||
<Panel
|
||||
title="Recepção, facturas e registos de pagamento"
|
||||
id="report-fulfilment"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Head, Link } from '@inertiajs/react';
|
||||
import { AgreementOrderLimitSummary } from '@/components/agreement-order-bindings';
|
||||
import { Printer } from 'lucide-react';
|
||||
import { ComparisonPolicySummary } from '@/components/comparison-policy-summary';
|
||||
import { QuotationCommercialTerms } from '@/components/quotation-commercial-terms';
|
||||
@@ -242,6 +243,9 @@ export default function OrderShow({
|
||||
</p>
|
||||
)}
|
||||
</Panel>
|
||||
<AgreementOrderLimitSummary
|
||||
bindings={snapshot.agreement_bindings}
|
||||
/>
|
||||
<Panel title="Fundamento e matriz congelada">
|
||||
{snapshot.comparison_policy && (
|
||||
<ComparisonPolicySummary
|
||||
|
||||
Reference in New Issue
Block a user