fix(po): split T&C Others into editable + read-only fixed line

TC_FIXED_LINE_2 added for the packaging/asbestos clause, rendered as
read-only item 8 (same style as item 1) in both the New PO and Edit PO
forms. Others (item 7) now initialises empty instead of carrying the
fixed text.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hardik 2026-05-15 00:21:18 +05:30
parent c06745a9f9
commit 9d1496a3bf
3 changed files with 14 additions and 5 deletions

View file

@ -6,7 +6,7 @@ import { updatePo } from "./actions";
import type { Vessel, Account, Vendor, PurchaseOrder } from "@prisma/client"; import type { Vessel, Account, Vendor, PurchaseOrder } from "@prisma/client";
import { LineItemsEditor } from "@/components/po/po-line-items-editor"; import { LineItemsEditor } from "@/components/po/po-line-items-editor";
import type { LineItemInput } from "@/lib/validations/po"; import type { LineItemInput } from "@/lib/validations/po";
import { TC_DEFAULTS, TC_FIXED_LINE } from "@/lib/validations/po"; import { TC_DEFAULTS, TC_FIXED_LINE, TC_FIXED_LINE_2 } from "@/lib/validations/po";
const INPUT_CLS = const INPUT_CLS =
"w-full rounded-lg border border-neutral-300 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20"; "w-full rounded-lg border border-neutral-300 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20";
@ -231,10 +231,13 @@ export function EditPoForm({ po, vessels, accounts, vendors }: Props) {
<textarea <textarea
name="tcOthers" name="tcOthers"
rows={2} rows={2}
defaultValue={extPo.tcOthers ?? TC_DEFAULTS.tcOthers} defaultValue={extPo.tcOthers ?? ""}
className={INPUT_CLS} className={INPUT_CLS}
/> />
</div> </div>
<div className="rounded-lg bg-neutral-50 border border-neutral-200 px-3 py-2.5 text-sm text-neutral-500 select-none">
<span className="font-medium text-neutral-600">8.</span> {TC_FIXED_LINE_2}
</div>
</div> </div>
</section> </section>

View file

@ -8,7 +8,7 @@ import { LineItemsEditor } from "@/components/po/po-line-items-editor";
import { FileUploader } from "@/components/po/file-uploader"; import { FileUploader } from "@/components/po/file-uploader";
import { uploadAndLinkFiles } from "@/lib/upload-files"; import { uploadAndLinkFiles } from "@/lib/upload-files";
import type { LineItemInput } from "@/lib/validations/po"; import type { LineItemInput } from "@/lib/validations/po";
import { TC_DEFAULTS, TC_FIXED_LINE } from "@/lib/validations/po"; import { TC_DEFAULTS, TC_FIXED_LINE, TC_FIXED_LINE_2 } from "@/lib/validations/po";
const INPUT_CLS = const INPUT_CLS =
"w-full rounded-lg border border-neutral-300 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20"; "w-full rounded-lg border border-neutral-300 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20";
@ -201,10 +201,13 @@ export function NewPoForm({ vessels, accounts, vendors }: Props) {
<textarea <textarea
name="tcOthers" name="tcOthers"
rows={2} rows={2}
defaultValue={TC_DEFAULTS.tcOthers} defaultValue=""
className={INPUT_CLS} className={INPUT_CLS}
/> />
</div> </div>
<div className="rounded-lg bg-neutral-50 border border-neutral-200 px-3 py-2.5 text-sm text-neutral-500 select-none">
<span className="font-medium text-neutral-600">8.</span> {TC_FIXED_LINE_2}
</div>
</div> </div>
</section> </section>

View file

@ -14,13 +14,16 @@ export const lineItemSchema = z.object({
export const TC_FIXED_LINE = export const TC_FIXED_LINE =
"Please quote this purchase order no. for further communications and invoices pertaining to this indent."; "Please quote this purchase order no. for further communications and invoices pertaining to this indent.";
export const TC_FIXED_LINE_2 =
"We encourage bulk packaging and avoid plastic. No asbestos to be used in any product or packing material.";
export const TC_DEFAULTS = { export const TC_DEFAULTS = {
tcDelivery: "Within 4 to 5 days", tcDelivery: "Within 4 to 5 days",
tcDispatch: "To be transported to site address as above. Freight Supplier's A/C", tcDispatch: "To be transported to site address as above. Freight Supplier's A/C",
tcInspection: "NA", tcInspection: "NA",
tcTransitInsurance: "NA", tcTransitInsurance: "NA",
tcPaymentTerms: "Within 30 days from delivery.", tcPaymentTerms: "Within 30 days from delivery.",
tcOthers: "We encourage bulk packaging and avoid plastic. No asbestos to be used in any product or packing material.", tcOthers: "",
}; };
export const createPoSchema = z.object({ export const createPoSchema = z.object({