How to deal with two No. Series?

Hi, The client has two no. series for their Sales Invoices. The first one is called ‘TC’, and the other one is called ‘LF’. The ‘TC’ one is just a regular no. series. But for the ‘LF’ one, the no. has a month suffix. I tried to connect these two no. series as 2 relationships, but I couldn’t get the correct number as I switched the no. series. Here is the situation: Say the client uses the ‘TC’ no. series, and he gets the followings: TC-1001, and creates another invoices, TC-1002 … etc. Then, he wants to use the ‘LF’ no. series. What happen is he could get the invoice no. without the month suffix (as the first record after the switch): LF-1001, then for the second record, he would be able to get the complete invoice no., LF-1002-02, and the following records would be just fine. So, how do I fix this issue? I have these codes on the OnInsert trigger in the Sales Header table: // new code by SST Month := DATE2DMY(WORKDATE,2); Zero := 0; // end SalesSetup.GET; IF “No.” = ‘’ THEN BEGIN TestNoSeries; NoSeriesMgt.InitSeries(GetNoSeriesCode,xRec.“No. Series”,“Posting Date”,“No.”,“No. Series”); // new code by SST IF (“Document Type” = “Document Type”::Invoice) THEN BEGIN NoSeriesLine.SETFILTER(“Order of Month”,’%1’,NoSeriesLine.“Order of Month”::Prefix); IF NoSeriesLine.FIND(’-’) THEN IF NoSeriesLine.“Series Code” = “No. Series” THEN “No.” := “No.”; NoSeriesLine.SETFILTER(“Order of Month”,’%1’,NoSeriesLine.“Order of Month”::Suffix); IF NoSeriesLine.FIND(’-’) THEN IF NoSeriesLine.“Series Code” = “No. Series” THEN //NewNo := NoSeriesMgt.GetNextNo(“No. Series”,WORKDATE,TRUE); IF Month <10 THEN “No.” := “No.” + ‘-’ + FORMAT(Zero) + FORMAT(Month) ELSE “No.” := “No.” + ‘-’ + FORMAT(Month); END; IF (“Document Type” = “Document Type”::Quote) OR (“Document Type” = “Document Type”::Order) OR (“Document Type” = “Document Type”::“Credit Memo”) OR (“Document Type” = “Document Type”::“Blanket Order”) THEN “No.” := “No.”; // end END; InitRecord; IF GETFILTER(“Sell-to Customer No.”) <> ‘’ THEN IF GETRANGEMIN(“Sell-to Customer No.”) = GETRANGEMAX(“Sell-to Customer No.”) THEN VALIDATE(“Sell-to Customer No.”,GETRANGEMIN(“Sell-to Customer No.”)); Thanks in advance. Sincerely, Sylvia Tsang Management Software Solutions, In Edited by - yummi on 2002 Feb 22 22:41:23

does your second no. series (the one with the month suffix) needs to reset its running number for each new month, or it is a running no. which does not reset itself?

Jordan, No, the second no. series doesn’t need to reset its running number for each month. Basically, it will keep running until they are done. Sylvia Sincerely, Sylvia Tsang Management Software Solutions, Inc. stsang@mgmtsoftware.com

Add new field in Serial No. Table (AddMonth, Boolean) In on insert trigger, add: //added if NoSeries.get( “No. Series”) then begin if NoSeries.AddMonth then “No.” := “No.” + CONVERTSTR(format( workdate, 2), 2), ’ ', ‘0’) end; In Serie ‘TC’ check AddMonth true. Best regards from BCN.

Hi, I got the program working already. Thank you for all the inputs. Sincerely, Sylvia Tsang Management Software Solutions, Inc. stsang@mgmtsoftware.com