2
0
mirror of https://github.com/frappe/books.git synced 2025-01-25 16:18:33 +00:00
books/backend/patches/createInventoryNumberSeries.ts
18alantom 2c0540bfd5 incr: add enable inventory
- add basic inventory schemas
- add basic inventory models
- patch stockmovement number series
2022-11-07 13:28:35 +05:30

23 lines
549 B
TypeScript

import { getDefaultMetaFieldValueMap } from '../../backend/helpers';
import { DatabaseManager } from '../database/manager';
async function execute(dm: DatabaseManager) {
const schemaName = 'NumberSeries';
const name = 'SMOV-';
const exists = await dm.db?.exists(schemaName, name);
if (exists) {
return;
}
await dm.db?.insert(schemaName, {
name,
start: 1001,
padZeros: 4,
current: 0,
referenceType: 'StockMovement',
...getDefaultMetaFieldValueMap(),
});
}
export default { execute, beforeMigrate: true };