Skip to content

Commit

Permalink
modify: change payment pid from increment num to string
Browse files Browse the repository at this point in the history
  • Loading branch information
BigSillyTiger committed Apr 13, 2024
1 parent c73f5a3 commit f706e3a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/configs/columnDefs/defPayments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { Torder } from "@/configs/schema/orderSchema";
import { dateFormat } from "@/lib/time";

const orderPaymentsColumns: ColumnDef<Torder>[] = [
{
/* {
header: i18n.t("label.id"),
cell: ({ row }) => {
return <span>{row.index + 1}</span>;
},
},
}, */
{
header: i18n.t("label.paid"),
accessorKey: "paid",
Expand Down
3 changes: 2 additions & 1 deletion src/configs/schema/orderSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const orderServiceSchema = z.object({
});

export const orderPaymentSchema = z.object({
fk_oid: z.number(),
pid: z.string(),
fk_oid: z.string(),
paid: z.number(),
paid_date: z.string().datetime(),
});
Expand Down
2 changes: 1 addition & 1 deletion src/pageComponents/DayPicker/RangedDayPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const RangedDayPicker: FC = () => {
}, [newStaffWL, setStaffWL]);

useEffect(() => {
setDeduction(newDeduct);
newDeduct && setDeduction(newDeduct);
}, [newDeduct, setDeduction]);

const css = `
Expand Down
3 changes: 2 additions & 1 deletion src/pageComponents/modals/mOrderPay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const MOrderPay: FC = memo(() => {
const [clientOrder] = useAtom(atOrder);
const [modalOpen, setModalOpen] = useAtom(atModalOpen);
const [payment, setPayment] = useState<TorderPayment>({
fk_oid: 0,
pid: "",
fk_oid: "",
paid: 0,
paid_date: dateFormat(new Date()),
});
Expand Down
4 changes: 3 additions & 1 deletion src/pages/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ const Client = () => {
switch (status) {
case RES_STATUS.SUCCESS:
if (modalOpen === mOpenOps.add) {
setModalOpen("");
toastSuccess(t("toastS.addOrder"));
} else if (modalOpen === mOpenOps.edit) {
toastSuccess(t("toastS.updateOrder"));
}
setModalOpen("");
break;
case RES_STATUS.SUC_DEL:
setModalOpen("");
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit f706e3a

Please sign in to comment.