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:
commit
c544de3012
@ -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;
|
||||
|
@ -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++;
|
||||
|
@ -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.",
|
||||
|
@ -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');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user