mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
BIG-26: fix items preferences form.
This commit is contained in:
@@ -93,21 +93,21 @@ export default {
|
||||
auto_increment: {
|
||||
type: 'boolean',
|
||||
},
|
||||
deposit_account: {
|
||||
preferred_deposit_account: {
|
||||
type: 'number',
|
||||
},
|
||||
advance_deposit: {
|
||||
preferred_advance_deposit: {
|
||||
type: 'number',
|
||||
},
|
||||
},
|
||||
items: {
|
||||
sell_account: {
|
||||
preferred_sell_account: {
|
||||
type: 'number',
|
||||
},
|
||||
cost_account: {
|
||||
preferred_cost_account: {
|
||||
type: 'number',
|
||||
},
|
||||
inventory_account: {
|
||||
preferred_inventory_account: {
|
||||
type: 'number',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -16,10 +16,6 @@ exports.up = (knex) => {
|
||||
{ group: 'sales_invoices', key: 'number_prefix', value: 'INV-' },
|
||||
{ group: 'sales_invoices', key: 'auto_increment', value: true },
|
||||
|
||||
{ group: 'sales_invoices', key: 'next_number', value: '00001' },
|
||||
{ group: 'sales_invoices', key: 'number_prefix', value: 'INV-' },
|
||||
{ group: 'sales_invoices', key: 'auto_increment', value: true },
|
||||
|
||||
// Sale receipts settings.
|
||||
{ group: 'sales_receipts', key: 'next_number', value: '00001' },
|
||||
{ group: 'sales_receipts', key: 'number_prefix', value: 'REC-' },
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
exports.up = async (knex) => {
|
||||
const costAccount = await knex('accounts')
|
||||
.where('slug', 'cost-of-goods-sold')
|
||||
.first();
|
||||
|
||||
const sellAccount = await knex('accounts')
|
||||
.where('slug', 'sales-of-product-income')
|
||||
.first();
|
||||
|
||||
const inventoryAccount = await knex('accounts')
|
||||
.where('slug', 'inventory-asset')
|
||||
.first();
|
||||
|
||||
const settings = [
|
||||
// Items settings.
|
||||
{ group: 'items', key: 'preferred_sell_account', value: sellAccount?.id },
|
||||
{ group: 'items', key: 'preferred_cost_account', value: costAccount?.id },
|
||||
{
|
||||
group: 'items',
|
||||
key: 'preferred_inventory_account',
|
||||
value: inventoryAccount?.id,
|
||||
},
|
||||
];
|
||||
return knex('settings').insert(settings);
|
||||
};
|
||||
|
||||
exports.down = (knex) => {};
|
||||
Reference in New Issue
Block a user