2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +00:00

Merge branch 'frappe:master' into ar_translation

This commit is contained in:
taha2002 2022-03-12 08:09:36 +01:00 committed by GitHub
commit c544de3012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 10 deletions

View File

@ -35,8 +35,6 @@ module.exports = {
return;
}
// if(doc.meta)
// Legacy, using doc settings for number series
if (doc.meta.settings) {
const numberSeries = (await doc.getSettings()).numberSeries;

View File

@ -14,7 +14,7 @@ module.exports = class NumberSeries extends BaseDocument {
const exists = await this.checkIfCurrentExists(doctype);
if (!exists) {
return this.current;
return this.getPaddedName(this.current);
}
this.current++;

View File

@ -1,6 +1,6 @@
{
"name": "frappe-books",
"version": "0.3.2-beta.0",
"version": "0.4.0-beta.0",
"description": "Simple book-keeping app for everyone",
"author": {
"name": "Frappe Technologies Pvt. Ltd.",

View File

@ -549,10 +549,5 @@ export function invertMap(map) {
}
export function getPaddedName(prefix, next, padZeros) {
const padding = padZeros ?? 4;
const l = next.toString().length;
const z = '0'.repeat(Math.max(0, padding - l));
return prefix + z + next;
return prefix + next.toString().padStart(padZeros ?? 4, '0');
}