mirror of
https://github.com/frappe/books.git
synced 2024-12-23 11:29:03 +00:00
Merge branch 'frappe:master' into ar_translation
This commit is contained in:
commit
c544de3012
@ -35,8 +35,6 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(doc.meta)
|
|
||||||
|
|
||||||
// Legacy, using doc settings for number series
|
// Legacy, using doc settings for number series
|
||||||
if (doc.meta.settings) {
|
if (doc.meta.settings) {
|
||||||
const numberSeries = (await doc.getSettings()).numberSeries;
|
const numberSeries = (await doc.getSettings()).numberSeries;
|
||||||
|
@ -14,7 +14,7 @@ module.exports = class NumberSeries extends BaseDocument {
|
|||||||
|
|
||||||
const exists = await this.checkIfCurrentExists(doctype);
|
const exists = await this.checkIfCurrentExists(doctype);
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
return this.current;
|
return this.getPaddedName(this.current);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.current++;
|
this.current++;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "frappe-books",
|
"name": "frappe-books",
|
||||||
"version": "0.3.2-beta.0",
|
"version": "0.4.0-beta.0",
|
||||||
"description": "Simple book-keeping app for everyone",
|
"description": "Simple book-keeping app for everyone",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Frappe Technologies Pvt. Ltd.",
|
"name": "Frappe Technologies Pvt. Ltd.",
|
||||||
|
@ -549,10 +549,5 @@ export function invertMap(map) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getPaddedName(prefix, next, padZeros) {
|
export function getPaddedName(prefix, next, padZeros) {
|
||||||
const padding = padZeros ?? 4;
|
return prefix + next.toString().padStart(padZeros ?? 4, '0');
|
||||||
|
|
||||||
const l = next.toString().length;
|
|
||||||
const z = '0'.repeat(Math.max(0, padding - l));
|
|
||||||
|
|
||||||
return prefix + z + next;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user