"use client";
import { SpecializedOpsPage } from "@/src/modules/accounting/components/SpecializedOpsPage";
export function PurchasePrepaymentsPage() {
  return (
    <SpecializedOpsPage
      title="پیش‌پرداخت‌ها"
      description="پیش‌پرداخت به تأمین‌کننده — روش پرداخت و صندوق/حساب بانکی را مشخص کنید."
      module="purchase"
      docType="prepayment"
      createLabel="پیش‌پرداخت جدید"
      fields={[
        { key: "party", label: "تأمین‌کننده", kind: "party", module: "purchase" },
        { key: "amount", label: "مبلغ", kind: "money" },
        { key: "due_date", label: "سررسید", kind: "date" },
        {
          key: "method",
          label: "روش پرداخت",
          kind: "select",
          options: [
            { value: "cash", label: "نقد / صندوق" },
            { value: "bank", label: "حواله بانکی" },
            { value: "cheque", label: "چک" },
          ],
        },
        {
          key: "cash_box_id",
          label: "صندوق",
          kind: "cash_box",
          showWhen: { key: "method", value: "cash" },
        },
        {
          key: "bank_account_id",
          label: "حساب بانکی",
          kind: "bank_account",
          showWhen: { key: "method", value: "bank" },
        },
        {
          key: "cheque_number",
          label: "شماره چک",
          kind: "text",
          showWhen: { key: "method", value: "cheque" },
          required: false,
        },
      ]}
    />
  );
}
