20260726225220
This commit is contained in:
1 parent
e3c7c6f8da
commit
a8478d60ed
170 files changed
+6786
-1678
No files matched your search
@@ -169,3 +169,33 @@ export const WEEK_DAYS = [
|
||||
{ value: 6, label: "六" },
|
||||
{ value: 0, label: "日" },
|
||||
];
|
||||
|
||||
/**
|
||||
* 构造写入 b_finance 的自动记账记录。
|
||||
* 注意:b_finance 表没有 type 列(type 是 b_finance_category 的冗余字段),
|
||||
* 这里绝不能包含 type,否则后端 insert 会因未知列报错。
|
||||
*/
|
||||
export function buildAutoBillInserts(
|
||||
rule: { category_id: number; amount: number; remark?: string | null },
|
||||
missedDates: string[],
|
||||
ids: number[],
|
||||
userId: number,
|
||||
familyId: number,
|
||||
): any[] {
|
||||
const inserts: any[] = [];
|
||||
for (let i = 0; i < missedDates.length; i++) {
|
||||
if (!ids[i]) continue;
|
||||
inserts.push({
|
||||
id: ids[i],
|
||||
family_id: familyId,
|
||||
category_id: rule.category_id,
|
||||
amount: rule.amount,
|
||||
remark: rule.remark || "",
|
||||
record_time: missedDates[i],
|
||||
create_by: userId,
|
||||
update_by: userId,
|
||||
});
|
||||
}
|
||||
return inserts;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user