Resets the invoice number counter
Product line
Standard
|Expert
Operating mode
CLOUD ABO
|ON-PREMISES
Modules
Services & CRM
Budget & Phases
Purchases
Resource Planning
Business Intelligence
The invoice number is reset. This script is used, for example, when an invoice needs to be deleted and re-created, so that the invoice number is not “wasted”.
There are 2 scripts:
For both scripts, they reset the last used invoice number with the current prefix.
If you want to increase the invoice number instead, you do not need this script, but can specify the next invoice number in the system settings > invoice / invoice.
Somewhere in Vertec
Resets the invoice number by one counter.
# coding: windows-1252
#
#---Description: Reset invoice number
# Class: BusinessclassesRoot
# Condexpression:
# Objectscript: N
# Containerscript: N
# Eventtype: None
# Eventclass:
# Eventmembers:
# Extendedrights: N
#---Resets invoice number by one counter.
#---12.02.2004, Vertec AG: created
#---02.06.2008, sr: Updatedatabase added.
#---19.06.2017, sr: Script created in Python.
def main():
prop = vtcapp.evalocl(“property->select(propertyname='PraefixInvoice Number’)->first”)
if prop:
prefix = vtcapp.evalocl(“usedprefix->select(prefix='” + prop.propertyvalue + “')->first”)
if
prefix: mer has
been reset’)
main()
Sets the invoice number to the value requested by the user.
# coding: windows-1252
#
#---Description: Reset invoice number with input
# Class: BusinessclassesRoot
# CondExpression:
# Objectscript: N
# Containerscript: N
# Eventtype: None
# Eventclass:
# Eventmembers:
# Extendedrights: N
#---Resets invoice number. The next
# invoice number to be used can be specified in a query.
#---15.02.2007, sc: created. created #---31.12.2012, sr: Prefix added to msgbox.
#---19.06.2017, sr: Script created in Python.
def main():
prop = vtcapp.evalocl(“property->select(propertyname='PraefixInvoice Number’)->first”)
if prop:
prefix =
vtcapp.evalocl(“usedprefix->select(prefix='” + prop.propertyvalue + “')->first”)
if prefix: lastusednumber =
prefix.lastusednumber
userinput = vtcapp.inputbox(“Vertec,””The last invoice number is: %s \r\r The associated prefix is: %s \r\r Enter a new invoice number (without prefix):” % (lastusednumber, prop.propertyvalue), ““)
if userinput:
try:
return
prefix.lastusednumber = int(newnumber) -1 vtcapp.updatedatabase() vtcapp.updatedatabase()
except ValueError:
vtcapp.msgbox('The value you entered is not a number. Please enter a number.', 0, 'Vertec’)
main()