mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
feat: auto-increment invoices.
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
import { Model, raw } from 'objection';
|
import { Model, raw } from 'objection';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import knex from 'knex';
|
||||||
import TenantModel from 'models/TenantModel';
|
import TenantModel from 'models/TenantModel';
|
||||||
import { defaultToTransform } from 'utils';
|
|
||||||
import { QueryBuilder } from 'knex';
|
|
||||||
import { query } from 'winston';
|
|
||||||
|
|
||||||
export default class SaleInvoice extends TenantModel {
|
export default class SaleInvoice extends TenantModel {
|
||||||
/**
|
/**
|
||||||
@@ -91,7 +89,9 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
*/
|
*/
|
||||||
get remainingDays() {
|
get remainingDays() {
|
||||||
// Can't continue in case due date not defined.
|
// Can't continue in case due date not defined.
|
||||||
if (!this.dueDate) { return null; }
|
if (!this.dueDate) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const date = moment();
|
const date = moment();
|
||||||
const dueDate = moment(this.dueDate);
|
const dueDate = moment(this.dueDate);
|
||||||
@@ -112,12 +112,14 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {*} asDate
|
* @param {*} asDate
|
||||||
*/
|
*/
|
||||||
getOverdueDays(asDate = moment().format('YYYY-MM-DD')) {
|
getOverdueDays(asDate = moment().format('YYYY-MM-DD')) {
|
||||||
// Can't continue in case due date not defined.
|
// Can't continue in case due date not defined.
|
||||||
if (!this.dueDate) { return null; }
|
if (!this.dueDate) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const date = moment(asDate);
|
const date = moment(asDate);
|
||||||
const dueDate = moment(this.dueDate);
|
const dueDate = moment(this.dueDate);
|
||||||
@@ -198,7 +200,7 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
* Filters the sale invoices from the given date.
|
* Filters the sale invoices from the given date.
|
||||||
*/
|
*/
|
||||||
fromDate(query, fromDate) {
|
fromDate(query, fromDate) {
|
||||||
query.where('invoice_date', '<=', fromDate)
|
query.where('invoice_date', '<=', fromDate);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Sort the sale invoices by full-payment invoices.
|
* Sort the sale invoices by full-payment invoices.
|
||||||
@@ -210,7 +212,25 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
* Sort the sale invoices by the due amount.
|
* Sort the sale invoices by the due amount.
|
||||||
*/
|
*/
|
||||||
sortByDueAmount(query, order) {
|
sortByDueAmount(query, order) {
|
||||||
query.orderByRaw(`BALANCE - PAYMENT_AMOUNT ${order}`)
|
query.orderByRaw(`BALANCE - PAYMENT_AMOUNT ${order}`);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the max invoice
|
||||||
|
*/
|
||||||
|
maxInvoiceNo(query, prefix, number) {
|
||||||
|
query
|
||||||
|
.select(
|
||||||
|
raw(`REPLACE(INVOICE_NO, "${prefix}", "") AS INV_NUMBER`)
|
||||||
|
)
|
||||||
|
.havingRaw('CHAR_LENGTH(INV_NUMBER) = ??', [number.length])
|
||||||
|
.orderBy('invNumber', 'DESC')
|
||||||
|
.limit(1)
|
||||||
|
.first();
|
||||||
|
},
|
||||||
|
|
||||||
|
byPrefixAndNumber(query, prefix, number) {
|
||||||
|
query.where('invoice_no', `${prefix}${number}`)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -247,7 +267,7 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
},
|
},
|
||||||
filter(query) {
|
filter(query) {
|
||||||
query.where('contact_service', 'Customer');
|
query.where('contact_service', 'Customer');
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
transactions: {
|
transactions: {
|
||||||
@@ -255,7 +275,7 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
modelClass: AccountTransaction.default,
|
modelClass: AccountTransaction.default,
|
||||||
join: {
|
join: {
|
||||||
from: 'sales_invoices.id',
|
from: 'sales_invoices.id',
|
||||||
to: 'accounts_transactions.referenceId'
|
to: 'accounts_transactions.referenceId',
|
||||||
},
|
},
|
||||||
filter(builder) {
|
filter(builder) {
|
||||||
builder.where('reference_type', 'SaleInvoice');
|
builder.where('reference_type', 'SaleInvoice');
|
||||||
@@ -267,7 +287,7 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
modelClass: InventoryCostLotTracker.default,
|
modelClass: InventoryCostLotTracker.default,
|
||||||
join: {
|
join: {
|
||||||
from: 'sales_invoices.id',
|
from: 'sales_invoices.id',
|
||||||
to: 'inventory_cost_lot_tracker.transactionId'
|
to: 'inventory_cost_lot_tracker.transactionId',
|
||||||
},
|
},
|
||||||
filter(builder) {
|
filter(builder) {
|
||||||
builder.where('transaction_type', 'SaleInvoice');
|
builder.where('transaction_type', 'SaleInvoice');
|
||||||
@@ -287,15 +307,15 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Change payment amount.
|
* Change payment amount.
|
||||||
* @param {Integer} invoiceId
|
* @param {Integer} invoiceId
|
||||||
* @param {Numeric} amount
|
* @param {Numeric} amount
|
||||||
*/
|
*/
|
||||||
static async changePaymentAmount(invoiceId, amount) {
|
static async changePaymentAmount(invoiceId, amount) {
|
||||||
const changeMethod = amount > 0 ? 'increment' : 'decrement';
|
const changeMethod = amount > 0 ? 'increment' : 'decrement';
|
||||||
|
|
||||||
await this.query()
|
await this.query()
|
||||||
.where('id', invoiceId)
|
.where('id', invoiceId)
|
||||||
[changeMethod]('payment_amount', Math.abs(amount));
|
[changeMethod]('payment_amount', Math.abs(amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -369,7 +389,7 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
fieldType: 'number',
|
fieldType: 'number',
|
||||||
sortQuery(query, role) {
|
sortQuery(query, role) {
|
||||||
query.modify('sortByDueAmount', role.order);
|
query.modify('sortByDueAmount', role.order);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
created_at: {
|
created_at: {
|
||||||
label: 'Created at',
|
label: 'Created at',
|
||||||
@@ -379,7 +399,7 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
status: {
|
status: {
|
||||||
label: 'Status',
|
label: 'Status',
|
||||||
options: [
|
options: [
|
||||||
{ key: 'draft', label: 'Draft', },
|
{ key: 'draft', label: 'Draft' },
|
||||||
{ key: 'delivered', label: 'Delivered' },
|
{ key: 'delivered', label: 'Delivered' },
|
||||||
{ key: 'unpaid', label: 'Unpaid' },
|
{ key: 'unpaid', label: 'Unpaid' },
|
||||||
{ key: 'overdue', label: 'Overdue' },
|
{ key: 'overdue', label: 'Overdue' },
|
||||||
@@ -387,7 +407,7 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
{ key: 'paid', label: 'Paid' },
|
{ key: 'paid', label: 'Paid' },
|
||||||
],
|
],
|
||||||
query: (query, role) => {
|
query: (query, role) => {
|
||||||
switch(role.value) {
|
switch (role.value) {
|
||||||
case 'draft':
|
case 'draft':
|
||||||
query.modify('draft');
|
query.modify('draft');
|
||||||
break;
|
break;
|
||||||
@@ -410,8 +430,8 @@ export default class SaleInvoice extends TenantModel {
|
|||||||
},
|
},
|
||||||
sortQuery(query, role) {
|
sortQuery(query, role) {
|
||||||
query.modify('sortByStatus', role.order);
|
query.modify('sortByStatus', role.order);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
71
server/src/services/Sales/AutoIncrementOrdersService.ts
Normal file
71
server/src/services/Sales/AutoIncrementOrdersService.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import { Service, Inject } from 'typedi';
|
||||||
|
import TenancyService from 'services/Tenancy/TenancyService';
|
||||||
|
import { transactionIncrement } from 'utils';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto increment orders service.
|
||||||
|
*/
|
||||||
|
@Service()
|
||||||
|
export default class AutoIncrementOrdersService {
|
||||||
|
@Inject()
|
||||||
|
tenancy: TenancyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the next service transaction number.
|
||||||
|
* @param {number} tenantId
|
||||||
|
* @param {string} settingsGroup
|
||||||
|
* @param {Function} getMaxTransactionNo
|
||||||
|
* @return {Promise<[string, string]>}
|
||||||
|
*/
|
||||||
|
async getNextTransactionNumber(
|
||||||
|
tenantId: number,
|
||||||
|
settingsGroup: string,
|
||||||
|
getOrderTransaction: (prefix: string, number: string) => Promise<boolean>,
|
||||||
|
getMaxTransactionNumber: (prefix: string, number: string) => Promise<string>
|
||||||
|
): Promise<[string, string]> {
|
||||||
|
const settings = this.tenancy.settings(tenantId);
|
||||||
|
const group = settingsGroup;
|
||||||
|
|
||||||
|
// Settings service transaction number and prefix.
|
||||||
|
const settingNo = settings.get({ group, key: 'next_number' });
|
||||||
|
const settingPrefix = settings.get({ group, key: 'number_prefix' });
|
||||||
|
|
||||||
|
let nextInvoiceNumber = settingNo;
|
||||||
|
|
||||||
|
const orderTransaction = await getOrderTransaction(
|
||||||
|
settingPrefix,
|
||||||
|
settingNo
|
||||||
|
);
|
||||||
|
if (orderTransaction) {
|
||||||
|
// Retrieve the max invoice number in the given prefix.
|
||||||
|
const maxInvoiceNo = await getMaxTransactionNumber(
|
||||||
|
settingPrefix,
|
||||||
|
settingNo
|
||||||
|
);
|
||||||
|
if (maxInvoiceNo) {
|
||||||
|
nextInvoiceNumber = transactionIncrement(maxInvoiceNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [settingPrefix, nextInvoiceNumber];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increment setting next number.
|
||||||
|
* @param {number} tenantId -
|
||||||
|
* @param {string} orderGroup - Order group.
|
||||||
|
* @param {string} orderNumber -Order number.
|
||||||
|
*/
|
||||||
|
async incrementSettingsNextNumber(
|
||||||
|
tenantId,
|
||||||
|
orderGroup: string,
|
||||||
|
orderNumber: string
|
||||||
|
) {
|
||||||
|
const settings = this.tenancy.settings(tenantId);
|
||||||
|
|
||||||
|
settings.set(
|
||||||
|
{ group: orderGroup, key: 'next_number' },
|
||||||
|
transactionIncrement(orderNumber)
|
||||||
|
);
|
||||||
|
await settings.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Service, Inject } from 'typedi';
|
import { Service, Inject } from 'typedi';
|
||||||
import { omit, sumBy } from 'lodash';
|
import { omit, sumBy, join } from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {
|
import {
|
||||||
EventDispatcher,
|
EventDispatcher,
|
||||||
@@ -21,14 +21,15 @@ import JournalCommands from 'services/Accounting/JournalCommands';
|
|||||||
import events from 'subscribers/events';
|
import events from 'subscribers/events';
|
||||||
import InventoryService from 'services/Inventory/Inventory';
|
import InventoryService from 'services/Inventory/Inventory';
|
||||||
import TenancyService from 'services/Tenancy/TenancyService';
|
import TenancyService from 'services/Tenancy/TenancyService';
|
||||||
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
|
||||||
import { formatDateFields } from 'utils';
|
import { formatDateFields } from 'utils';
|
||||||
|
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
||||||
import { ServiceError } from 'exceptions';
|
import { ServiceError } from 'exceptions';
|
||||||
import ItemsService from 'services/Items/ItemsService';
|
import ItemsService from 'services/Items/ItemsService';
|
||||||
import ItemsEntriesService from 'services/Items/ItemsEntriesService';
|
import ItemsEntriesService from 'services/Items/ItemsEntriesService';
|
||||||
import CustomersService from 'services/Contacts/CustomersService';
|
import CustomersService from 'services/Contacts/CustomersService';
|
||||||
import SaleEstimateService from 'services/Sales/SalesEstimate';
|
import SaleEstimateService from 'services/Sales/SalesEstimate';
|
||||||
import JournalPosterService from './JournalPosterService';
|
import JournalPosterService from './JournalPosterService';
|
||||||
|
import AutoIncrementOrdersService from './AutoIncrementOrdersService';
|
||||||
import { ERRORS } from './constants';
|
import { ERRORS } from './constants';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,6 +68,9 @@ export default class SaleInvoicesService {
|
|||||||
@Inject()
|
@Inject()
|
||||||
journalService: JournalPosterService;
|
journalService: JournalPosterService;
|
||||||
|
|
||||||
|
@Inject()
|
||||||
|
autoIncrementOrdersService: AutoIncrementOrdersService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate whether sale invoice number unqiue on the storage.
|
* Validate whether sale invoice number unqiue on the storage.
|
||||||
*/
|
*/
|
||||||
@@ -153,6 +157,33 @@ export default class SaleInvoicesService {
|
|||||||
return saleInvoice;
|
return saleInvoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the next unique invoice number.
|
||||||
|
* @param {number} tenantId - Tenant id.
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
async getNextInvoiceNumber(tenantId: number): Promise<[string, string]> {
|
||||||
|
const { SaleInvoice } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
|
// Retrieve the max invoice number in the given prefix.
|
||||||
|
const getMaxInvoicesNo = (prefix, number) => {
|
||||||
|
return SaleInvoice.query()
|
||||||
|
.modify('maxInvoiceNo', prefix, number)
|
||||||
|
.then((res) => res?.invNumber);
|
||||||
|
};
|
||||||
|
// Retrieve the order transaction number by number.
|
||||||
|
const getTransactionNumber = (prefix, number) => {
|
||||||
|
return SaleInvoice.query().modify('byPrefixAndNumber', prefix, number);
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.autoIncrementOrdersService.getNextTransactionNumber(
|
||||||
|
tenantId,
|
||||||
|
'sales_invoices',
|
||||||
|
getTransactionNumber,
|
||||||
|
getMaxInvoicesNo
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform DTO object to model object.
|
* Transform DTO object to model object.
|
||||||
* @param {number} tenantId - Tenant id.
|
* @param {number} tenantId - Tenant id.
|
||||||
@@ -161,7 +192,8 @@ export default class SaleInvoicesService {
|
|||||||
transformDTOToModel(
|
transformDTOToModel(
|
||||||
tenantId: number,
|
tenantId: number,
|
||||||
saleInvoiceDTO: ISaleInvoiceCreateDTO | ISaleInvoiceEditDTO,
|
saleInvoiceDTO: ISaleInvoiceCreateDTO | ISaleInvoiceEditDTO,
|
||||||
oldSaleInvoice?: ISaleInvoice
|
oldSaleInvoice?: ISaleInvoice,
|
||||||
|
autoNextNumber?: [string, string] // prefix, number
|
||||||
): ISaleInvoice {
|
): ISaleInvoice {
|
||||||
const { ItemEntry } = this.tenancy.models(tenantId);
|
const { ItemEntry } = this.tenancy.models(tenantId);
|
||||||
const balance = sumBy(saleInvoiceDTO.entries, (e) =>
|
const balance = sumBy(saleInvoiceDTO.entries, (e) =>
|
||||||
@@ -180,6 +212,13 @@ export default class SaleInvoicesService {
|
|||||||
}),
|
}),
|
||||||
balance,
|
balance,
|
||||||
paymentAmount: 0,
|
paymentAmount: 0,
|
||||||
|
...(saleInvoiceDTO.invoiceNo || autoNextNumber
|
||||||
|
? {
|
||||||
|
invoiceNo: saleInvoiceDTO.invoiceNo
|
||||||
|
? saleInvoiceDTO.invoiceNo
|
||||||
|
: join(autoNextNumber, ''),
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
entries: saleInvoiceDTO.entries.map((entry) => ({
|
entries: saleInvoiceDTO.entries.map((entry) => ({
|
||||||
referenceType: 'SaleInvoice',
|
referenceType: 'SaleInvoice',
|
||||||
...omit(entry, ['amount', 'id']),
|
...omit(entry, ['amount', 'id']),
|
||||||
@@ -202,9 +241,18 @@ export default class SaleInvoicesService {
|
|||||||
): Promise<ISaleInvoice> {
|
): Promise<ISaleInvoice> {
|
||||||
const { saleInvoiceRepository } = this.tenancy.repositories(tenantId);
|
const { saleInvoiceRepository } = this.tenancy.repositories(tenantId);
|
||||||
|
|
||||||
// Transform DTO object to model object.
|
// The next invoice number automattically or manually.
|
||||||
const saleInvoiceObj = this.transformDTOToModel(tenantId, saleInvoiceDTO);
|
const autoNextNumber = !saleInvoiceDTO.invoiceNo
|
||||||
|
? await this.getNextInvoiceNumber(tenantId)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
// Transform DTO object to model object.
|
||||||
|
const saleInvoiceObj = this.transformDTOToModel(
|
||||||
|
tenantId,
|
||||||
|
saleInvoiceDTO,
|
||||||
|
null,
|
||||||
|
autoNextNumber
|
||||||
|
);
|
||||||
// Validate customer existance.
|
// Validate customer existance.
|
||||||
await this.customersService.getCustomerByIdOrThrowError(
|
await this.customersService.getCustomerByIdOrThrowError(
|
||||||
tenantId,
|
tenantId,
|
||||||
@@ -248,6 +296,7 @@ export default class SaleInvoicesService {
|
|||||||
saleInvoiceDTO,
|
saleInvoiceDTO,
|
||||||
saleInvoiceId: saleInvoice.id,
|
saleInvoiceId: saleInvoice.id,
|
||||||
authorizedUser,
|
authorizedUser,
|
||||||
|
autoNextNumber,
|
||||||
});
|
});
|
||||||
this.logger.info('[sale_invoice] successfully inserted.', {
|
this.logger.info('[sale_invoice] successfully inserted.', {
|
||||||
tenantId,
|
tenantId,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import events from 'subscribers/events';
|
|||||||
import TenancyService from 'services/Tenancy/TenancyService';
|
import TenancyService from 'services/Tenancy/TenancyService';
|
||||||
import SettingsService from 'services/Settings/SettingsService';
|
import SettingsService from 'services/Settings/SettingsService';
|
||||||
import SaleEstimateService from 'services/Sales/SalesEstimate';
|
import SaleEstimateService from 'services/Sales/SalesEstimate';
|
||||||
|
import SaleInvoicesService from 'services/Sales/SalesInvoices';
|
||||||
|
|
||||||
@EventSubscriber()
|
@EventSubscriber()
|
||||||
export default class SaleInvoiceSubscriber {
|
export default class SaleInvoiceSubscriber {
|
||||||
@@ -11,6 +12,7 @@ export default class SaleInvoiceSubscriber {
|
|||||||
tenancy: TenancyService;
|
tenancy: TenancyService;
|
||||||
settingsService: SettingsService;
|
settingsService: SettingsService;
|
||||||
saleEstimatesService: SaleEstimateService;
|
saleEstimatesService: SaleEstimateService;
|
||||||
|
saleInvoicesService: SaleInvoicesService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor method.
|
* Constructor method.
|
||||||
@@ -20,6 +22,7 @@ export default class SaleInvoiceSubscriber {
|
|||||||
this.tenancy = Container.get(TenancyService);
|
this.tenancy = Container.get(TenancyService);
|
||||||
this.settingsService = Container.get(SettingsService);
|
this.settingsService = Container.get(SettingsService);
|
||||||
this.saleEstimatesService = Container.get(SaleEstimateService);
|
this.saleEstimatesService = Container.get(SaleEstimateService);
|
||||||
|
this.saleInvoicesService = Container.get(SaleInvoicesService);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,10 +52,15 @@ export default class SaleInvoiceSubscriber {
|
|||||||
tenantId,
|
tenantId,
|
||||||
saleInvoiceId,
|
saleInvoiceId,
|
||||||
saleInvoice,
|
saleInvoice,
|
||||||
|
saleInvoiceDTO,
|
||||||
|
autoNextNumber,
|
||||||
}) {
|
}) {
|
||||||
await this.settingsService.incrementNextNumber(tenantId, {
|
if (saleInvoiceDTO.invoiceNo || !autoNextNumber) return;
|
||||||
key: 'next_number',
|
|
||||||
group: 'sales_invoices',
|
await this.saleInvoicesService.autoIncrementOrdersService.incrementSettingsNextNumber(
|
||||||
});
|
tenantId,
|
||||||
|
'sales_invoices',
|
||||||
|
autoNextNumber[1]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -281,11 +281,13 @@ function defaultToTransform(value, defaultOrTransformedValue, defaultValue) {
|
|||||||
const transformToMap = (objects, key) => {
|
const transformToMap = (objects, key) => {
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
|
|
||||||
objects.forEach(object => {
|
objects.forEach((object) => {
|
||||||
map.set(object[key], object);
|
map.set(object[key], object);
|
||||||
});
|
});
|
||||||
return map;
|
return map;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const transactionIncrement = (s) => s.replace(/([0-8]|\d?9+)?$/, (e) => ++e);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
hashPassword,
|
hashPassword,
|
||||||
@@ -308,5 +310,6 @@ export {
|
|||||||
formatNumber,
|
formatNumber,
|
||||||
isBlank,
|
isBlank,
|
||||||
defaultToTransform,
|
defaultToTransform,
|
||||||
transformToMap
|
transformToMap,
|
||||||
|
transactionIncrement,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user