u
This commit is contained in:
@@ -63,8 +63,10 @@ export function getNextDocumentNumber(kind) {
|
||||
const prefixStyle = refSeq?.prefix ?? '';
|
||||
|
||||
if (kind === 'retoure') {
|
||||
prefix = 'RET-';
|
||||
pad = 5;
|
||||
prefix = prefixStyle.endsWith('-') || !prefixStyle ? 'RET-' : 'RET';
|
||||
startNum = 1;
|
||||
} else if (kind === 'return') {
|
||||
prefix = prefixStyle.endsWith('-') || !prefixStyle ? 'RTN-' : 'RTN';
|
||||
startNum = 1;
|
||||
} else if (kind === 'delivery') {
|
||||
prefix = prefixStyle.startsWith('DEL-') ? 'DEL-' : (prefixStyle.startsWith('L-') ? 'L-' : 'LS-');
|
||||
@@ -160,7 +162,16 @@ export async function ensureDocumentNumber(kind) {
|
||||
const seq = numbers.find((r) => r.type === kind);
|
||||
let prefix = seq?.prefix;
|
||||
if (prefix == null) {
|
||||
prefix = kind === 'quote' ? 'ANG-' : (kind === 'order' ? 'AUF-' : (kind === 'retoure' ? 'RET-' : 'LS-'));
|
||||
prefix =
|
||||
kind === 'quote'
|
||||
? 'ANG-'
|
||||
: kind === 'order'
|
||||
? 'AUF-'
|
||||
: kind === 'retoure'
|
||||
? 'RET-'
|
||||
: kind === 'return'
|
||||
? 'RTN-'
|
||||
: 'LS-';
|
||||
}
|
||||
|
||||
let maxFound = maxKnownNumberByKind.get(kind) ?? 0;
|
||||
@@ -215,7 +226,9 @@ export function getMaxDocumentNumber(kind = 'quote') {
|
||||
|
||||
let prefix = '';
|
||||
if (kind === 'retoure') {
|
||||
return `RET-${'9'.repeat(5)}`;
|
||||
prefix = prefixStyle.endsWith('-') || !prefixStyle ? 'RET-' : 'RET';
|
||||
} else if (kind === 'return') {
|
||||
prefix = prefixStyle.endsWith('-') || !prefixStyle ? 'RTN-' : 'RTN';
|
||||
} else if (kind === 'delivery') {
|
||||
prefix = prefixStyle.startsWith('DEL-') ? 'DEL-' : (prefixStyle.startsWith('L-') ? 'L-' : 'LS-');
|
||||
} else if (
|
||||
|
||||
Reference in New Issue
Block a user