2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/backend/patches/createInventoryNumberSeries.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
549 B
TypeScript
Raw Normal View History

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 };