Set Invoice number using code when running FUNAUTINVD

SOLVED

I am trying to set the invoice number manually using code, because of the clients requirements I cannot use sequence numbers. 

I have successfully accomplished this within SPESIH $VERIF_CRE.  However, when running FUNAUTINVD, this is ignored.  I have tried using the entry point but this will not retain the assigned invoice number.  Is there another entry point that needs to be used in order to manually assign SIH.NUM when running FUNAUTINVD?

####################################################################
$VERIF_CRE
Local Char YINVNUM(30)
If [M:SIH0]SIVTYP = "INV"
  YINVNUM = "some invoice number"
  [M:SIH0]NUM=YINVNUM : Affzo [M:SIH0]NUM
Endif
Return

####################################################################

$ALISIH
Local Char YINVNUM(30)
If [M:SIH0]SIVTYP = "INV"
  YINVNUM = "Some invoice number"
  [M:SIH0]NUM=YINVNUM
  [F:SIH]NUM=YINVNUM
Endif
Return

#####################################################################################

Parents Reply
  • 0 in reply to Kyle Klinger
    SUGGESTED

    ...I can not undertand complete what you exactclly need, but you can setting up other counter to an invoice type / financials docuemnt type fange and this invoices has other counter. 

    If you want don't want to increase the SEQUENCE, but this will stop the invoice process you can do in this entry point STAT=1. I'm not suer but maybe ig GOK=1 and GERR=0 maybe the FUNAUTINVxx will works.

    Other option is create a counter with out sequence and assign the counter with a formula: in the formula you can use that evalue(func TRT.fucntion). I used this for LOT counter in cosmetic and pharma.

    I hope this helps you!

Children