"use client";
import { SpecializedOpsPage } from "@/src/modules/accounting/components/SpecializedOpsPage";
export function SalesPreReceiptsPage() {
  return (
    <SpecializedOpsPage
      title="پیش‌دریافت‌ها"
      description="پیش‌دریافت از مشتری — روش دریافت و صندوق/حساب بانکی را مشخص کنید."
      module="sales"
      docType="pre_receipt"
      createLabel="پیش‌دریافت جدید"
      fields={[
        { key: "party", label: "مشتری", kind: "party", module: "sales" },
        { 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,
        },
      ]}
    />
  );
}
