Well, the script you use to calculate the number is quite complex, but in general only have to wrap the entrie script it into an if expression.
if (this.isNull) {
// place your calculation script here …
}
Btw: Your expression
this.value = …
is wrong and should be
this.rawValue = …
instead.
Note: When you want to Reader-enable the form with Acrobat once it got finished, you have to clear the field manually otherwise the field will always hold the calculated value before it was Reader-enabled. To do this, open the the JavaScript console (Ctrl + J) and execute this code line:
this.xfa.form.Form0008.PgContent.SetReqNo.rawValue = null;