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
  • 0

    Kyle,

    Can you clarify what you mean by manually assigning SIH.NUM?   Is "Some Invoice Number" coming from a generated value based on data in the invoice, or from a manually entered pop-up?

    If you really want to do an entry point, you might be looking for AUTINVDFIL of FUNAUTINVD (http://online-help.sageerpx3.com/erp/12/wp-static-content/static-pages/en_US/OBJ/ADC_5.htm)   Or your might have to create your own entry point in FUNAUTINVD, but that means modifying standard code, which I generally would NOT recommend.  

    the FUNAUTs don't really use the object creation logic.  They call it for various functionalities, but this is a different beast.  

    That all said, if you are trying to manually type in values during automated invoice creation, i think you might want to review your customer's User Story about why they are trying to interrupt an automated process with manual entry. 

    This is all more of a starting point than a fix probably, but the better you can tell us what and why the user's needs are, the more creative of a fix that can probably be devised.

    and alternatively...   could you maybe just make a new sequence number structure.. include formula elements, and replace the sequence number that is currently assigned to the Sales Invoice or SIH INVTYP?   That would remove the need to do any of the coding


Reply
  • 0

    Kyle,

    Can you clarify what you mean by manually assigning SIH.NUM?   Is "Some Invoice Number" coming from a generated value based on data in the invoice, or from a manually entered pop-up?

    If you really want to do an entry point, you might be looking for AUTINVDFIL of FUNAUTINVD (http://online-help.sageerpx3.com/erp/12/wp-static-content/static-pages/en_US/OBJ/ADC_5.htm)   Or your might have to create your own entry point in FUNAUTINVD, but that means modifying standard code, which I generally would NOT recommend.  

    the FUNAUTs don't really use the object creation logic.  They call it for various functionalities, but this is a different beast.  

    That all said, if you are trying to manually type in values during automated invoice creation, i think you might want to review your customer's User Story about why they are trying to interrupt an automated process with manual entry. 

    This is all more of a starting point than a fix probably, but the better you can tell us what and why the user's needs are, the more creative of a fix that can probably be devised.

    and alternatively...   could you maybe just make a new sequence number structure.. include formula elements, and replace the sequence number that is currently assigned to the Sales Invoice or SIH INVTYP?   That would remove the need to do any of the coding


Children
  • 0 in reply to bmyerspgh

    The client wants the invoice number to be calculated off of the delivery number, it would not be entered manually via pop-up.  The "Some invoice number" is generated from SDH.SDHNUM, for example if the delivery were SD0001 the invoice number would be IN0001.  Because there is a direct relationship between the two and there is no new sequence, I cannot use a sequence number. 

     

    AUTINVDFIL will not work as it is just the selection criteria and does not allow me to set the invoice number upon creation. 

     

    As for your alternate suggestion, that is actually the first route I took, but it requires appending a new sequence to the code i.e. IN0001-001 etc.