Skip to content
Snippets Groups Projects
Commit 21438bc2 authored by S.Listl's avatar S.Listl
Browse files

1055629 recalculate offer code when saving

parent b8da7f63
No related branches found
No related tags found
No related merge requests found
import("system.vars");
import("system.result");
import("system.neon");
import("Contract_lib");
import("Entity_lib");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW
&& !ContractUtils.validateContractNumber(vars.get("local.value")))
{
vars.set("$field.CONTRACTCODE", ContractUtils.getNextContractNumber().toString());
}
\ No newline at end of file
//reload the field on save to make sure the contractcode is really unique, otherwise the contractcode could be the same for two contracts created at
//the same time
neon.refresh(["$field.CONTRACTCODE"]);
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
import("Offer_lib");
import("Salesproject_lib");
import("Util_lib");
import("Entity_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW
&& !vars.exists("$param.OfferCode_param")
&& !OfferUtils.validateOfferNumber(vars.get("local.value")) )
{
vars.set( "$field.OFFERCODE", OfferUtils.getNextOfferNumber().toString() );
}
\ No newline at end of file
//reload the field on save to make sure the offercode is really unique, otherwise the offercode could be the same for two offers created at
//the same time
neon.refresh(["$field.OFFERCODE"]);
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
import("Order_lib");
import("Salesproject_lib");
import("Util_lib");
import("Entity_lib");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW
&& !vars.exists("$param.OrderCode_param")
&& !OrderUtils.validateOrderNumber(vars.get("local.value")) )
{
vars.set( "$field.SALESORDERCODE", OrderUtils.getNextOrderNumber().toString() );
}
//reload the field on save to make sure the salesordercode is really unique, otherwise the salesordercode could be the same for two salesorders
//created at the same time
neon.refresh(["$field.SALESORDERCODE"]);
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
import("Salesproject_lib");
import("Util_lib");
import("Entity_lib");
if( vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW
&& !Salesproject.validateProjectNumber(vars.get("local.value")) )
{
vars.set( "$field.PROJECTCODE", Salesproject.getNextProjectNumber().toString("1 = 1") );
}
\ No newline at end of file
//reload the field on save to make sure the projectcode is really unique, otherwise the projectcode could be the same for two projects created at
//the same time
neon.refresh(["$field.PROJECTCODE"]);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment