The workflow is used to pull transaction numbers from a number range for the appropriate event. Number templates can be used for this. These differ, e.g. Offers, delivery notes, invoices and any other operations. In addition, the number key can start again from 1 per calendar week, month and year as desired.
If a lead number is assigned to a business transaction (offer to invoice), this number can no longer be overridden (in other transaction categories, this must also be intercepted in the workflow). The deletion of a transaction with transaction number is only possible via a cancellation.
A template is generated in the system and this corresponds to a number range name. The system then searches for the number range "String" and creates it automatically if it does not exist. From this point on, the place is always increased by 1. This technique can be used to generate arbitrary number ranges.
With assignment via "#nof", one number is counted per transaction type.
(1,2,...) ->1 number from 1 ff
work$itemNumber = "#nof"
If you still want a prefix, the line looks like this: (returns -> L1)
work$itemNumber = "L"+"#nof"
With assignment via "#no", a number is counted per transaction type, year, calendar week and day of the week.
Year+ calendar week + day of week + counter (1,2,...) -> 9031.1 "20019 + calendar week 03 +Monday 1+ first operation on this day"
work$itemNumber = "#no"
If you still want a prefix, the line looks like this: (returns -> A9031.1)
work$itemNumber = "A"+"#no"
The counter can start from a defined number, e.g. always with 8000
#s[8000]
var startCounter =8000;
work$itemNumber = "#no#s["+startCounter+"]"
The counter is then always increased by 8000 and gives-> A9031.8001
The counters generate a number range per transaction type. This can be overwritten and you can create your own number range.
#f[myNumberRange]
var numberRange = "myNumberRange"
work$itemNumber = "#no#f["+numberRange"+"]"
The counter is then always increased by 8000 and gives -> 1
We want a number range that counts per client and calendar weekday. First, we define the required variables.
var tenant = "2";
var date = new Date();
var year = date.getFullYear()+"";
year =year.substring(year.length - 1, year.length);
var day = date.getDay();
if (day ==0){
day = 7;
}
var currentThursday = new Date(date.getTime() +(3-((date.getDay()+6) % 7)) * 86400000);
var yearOfThursday = currentThursday.getFullYear();
var firstThursday = new Date(new Date(yearOfThursday,0,4).getTime() +(3-((new Date(yearOfThursday,0,4).getDay()+6) % 7)) * 86400000);
var kalenderwoche =""+ Math.floor(1 + 0.5 + (currentThursday.getTime() - firstThursday.getTime()) / 86400000/7);
if (kalenderwoche.length ==1){
kalenderwoche = "0"+kalenderwoche;
}
Den Zähler definieren wir zusammengesetzt aus den Variablen.
var numberRange = "myNumberRange"+mandant+jahr+kalenderwoche+tag;
Dann wird die Nummer wie folgt zugewiesen:
work$itemNumber = "R"+tenant+"."+year+kalenderwoche+day+".#nof#f["+numberRange+"]"
The counter returns -> R2.9031.1
In order not to repeatedly assign a number to a procedure, the following IF query is necessary (not for commercial procedures, because this is already checked automatically).
if (work$itemNumber == "0" || work$itemNumber == ""){
work$itemNumber = ...;
}
Avoid a commercial transaction without assigning a list of positions. Check if the position number is not smaller than 1
if (parseFloat(work$SIZE_ACitems) < 1){
// keine Nummer vergeben
} else if (1==1){
// Nummer vergeben
}
ATTENTION: remove, we overwrite the assigned number, so there are number gaps in the number range, because then there is no process with the appropriate number. Remedy only creates a new Nummenkreis here. Therefore always use these commands with caution:
The operation number is removed with the command:
work$itemNumber = "REMOVENO"
Override the operation number, even if one has already been assigned:
work$itemNumber = "#nof"+"FORCE"
In the Administration settings for the company, there is a section ++ for additional parameters. Under 'A' (for order processing), the following can be configured:
Prefix for number assignment is determined by the alias of the transaction types. For invoices, the alias is 'r.' In the default setting, it is listed as R|r. This means all invoices will have the prefix 'R.' You can replace the 'R' with a sequence of letters of your choice, for example, 'RG' or 'R.', 'R-', etc., to customize it according to your preferences.
2. 2. Counting Concept... Similar to the prefix, the alias is used to assign the corresponding variants. For invoices, the default is 'tenant week.' This means the number is incremented weekly, following the calendar week.
Concepts when the Transaction Alias = r for Invoice with Prefix = R. and Tenant = 9:
We distinguish the following concepts:
count = R.1
week = R....
year = R....
tenant week = R.9.1054.4 -> 1 = 2021 (Year), 05 = Week 5, .4 = Number in this week...
tenant month = R.9.21.1.4 -> 21 = Year, 1 = Month, 4 = Sequential number per Tenant/Year/Month
tenant year = R.9-21-
tenant year long = R.9-2021
3. The starting number is a value that initiates numbering from 1 but adds n days and thus changes the start. Starting number.
Example: The old system assigned the number R22-2341 to the last invoice of Tenant 3. Now, we want to ensure that the next invoice number counts as R-2342.
In the Prefix, it is R-|r
In the Concept, it is year|r
In the Starting Number, it is 2341|r2
In the Starting Number, we enter the value 2341|r (if only one tenant is defined) or 2341|r2 for tenant 2. This way, the number 2341 is identified through the alias r and consistently incremented in the numbering. CAUTION: For resetting, such as after a new year, set the number back to 0|r to start from 1 again.