Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 10 JUL 2021 02:23:39AM cmeyer wrote:

Just started editing a stored procedure in OI10.0.8.1 and get lost of warnings and Compilation Failed! error.

many warnings as follows:

Equate "TCVERTICAL (TABLECELL_EQUATES   ) on line "22" does not end with "$"

This is an equate from SYSPROG supplied by Rev. Does that imply that all inserts have to end in a "$" sign.

Then a:

Compilation Failed! 

REP300 - Entity PBC*STPOCSINS**TABLECELL_EQUATES  does not exist.

Yet I can edit the insert, compile the insert etc.

This is not a problem in OI9.4.6

Restarted my laptop, performed another migration etc.

Not sure what is going on.

Any advice would allow me to proceed with testing OI10

Chris


At 10 JUL 2021 02:36AM cmeyer wrote:

Here is the procedure trying to compile:


Compile Subroutine OE_Invoice_Format1(Parms)



*19th August 2004, Added invoice message from division record to form

*rOUTINE TO PRINT Sales Order Invoice, only prints one invoice at a time. 

*26-5-06	Modified for relayfax

*7-3-07		Modified for ReadReceipt

* 110817	MAB	Modified to check the total order amount and change text to 'Credit Note' if amount is less than zero



Declare Function Msg, Get_printer, Set_Printer, NameCap

Declare Function Invoice_Due_Date



Declare Subroutine Init_Printer_Reports, Email_Reports, Print_Fax, Format_Shipping_Address



$Insert OiPrint_Equates	

$Insert Logical	

$Insert Invoice_Ins

$Insert PBC_Users_Ins

$Insert PBC_Common_Ins

$Insert Report_Fonts_Ins

$Insert Debtors_Ins

$Insert Division_Ins

$Insert TableCell_EQUATES	

	

	Gosub OpenFiles

	StartRow = 1

	LinesPerPage = 25

	LinesPerPage = 24

	ReadReceipt = False$

	If Not(Error) then

		Gosub SetVars

		Begin Case

			Case Output = 5 ; Gosub GetFaxInfo

			Case Output = 3 ; Gosub GetEmailInfo

		End Case



		Gosub PrintSetup	

		Gosub FormatItems

		CopyType = PrintType		

		Gosub PrintCoyInfo

		If PrintType = 3 then

			For abc = 1 to 2

				PrintType = abc

				*Gosub PrintCopyType

				Gosub PrintSummary

				Gosub PrintCustInfo

				Gosub PrintTable

				Gosub PrintRemittance

				Gosub PrintTotals

				If Abc = 1 then

					Void = Set_Printer("PAGEBREAK")

				End

			Next abc

		End Else

			If NoOfPages > 1 then

				ItemTable = Itable

				For def = 1 to NoOfPages

					PageNo = def

					Gosub PrintSummary

					Gosub PrintCustInfo

					Itable = Field(ItemTable, @fm, startRow, LinesPerPage)

					StartRow = StartRow + LinesPerPage

					Gosub PrintTable

					If def # NoOfPages then

						Gosub PrintContinued

						Void = Set_Printer("PAGEBREAK")

					End

				Next abc

				Gosub PrintRemittance

				Gosub PrintTotals

					

			End Else

				Gosub PrintSummary

				Gosub PrintCustInfo

				Gosub PrintTable

				Gosub PrintRemittance

*				Gosub PrintMessage	;* This has been implemented in OE_INVOICE_BFE

				Gosub PrintTotals

			End	

		End			

		

		IF AGE.FLAG = 'C' THEN

  			WRITEV INVOICE.DATE ON INVOICE, INV.NO, 4 Else

  			end

  			If Output # 2 then

				WRITEV 'Y' ON INVOICE,INV.NO, 38 Else

				end

			End	

		END



		Void = Set_printer("TERM", 1)

		If EmailParms and Output = 3 then

			EmailParms<4> = "INV"

			EmailParms<5> = Debtor.No

			EmailParms<6> = Inv.No

			EmailParms<16> = ReadReceipt

*			Email_Reports(Emailparms, 1)

			Email_Reports(Emailparms, 1, 'OLE')

		End

	End Else

		Void = Msg('', Error)

	End

	

Return



********

SetVars:

********





	CREDIT.TYPE			= DEBTORS.DATA<Dbt_Credit_Type>

	DEBTORS.NAME		= DEBTORS.DATA<Dbt_Name>

	DEBTORS.ADDRESS		= DEBTORS.DATA<Dbt_Address>

	DEBTORS.FAX			= DEBTORS.DATA<Dbt_Fax>

	CUST.TYPE			= DEBTORS.DATA<Dbt_Type>

	TaxCode  			= DEBTORS.DATA<Dbt_Tax_Code>

	GstStatus  			= Xlate('TAX_CODE',TaxCode,'GST_STATUS','X')

	DEBTORS.SUBURB		= DEBTORS.DATA<Dbt_Suburb>

	DEBTORS.COUNTRY		= DEBTORS.DATA<Dbt_Country>

	DEBTORS.STATE		= DEBTORS.DATA<Dbt_State>

	DEBTORS.POST.CODE		= DEBTORS.DATA<Dbt_Postcode>

	STATEMENT.FLAG		= DEBTORS.DATA<Dbt_Statement_Flag>

	

	COUNTRY			= DEBTORS.DATA<Dbt_Country>

	Debtors.Phone     	= Debtors.Data<Dbt_Ho_Phone_No>



	Currency_Code = Inv.Data<Invc_Currency_Code>



	Type		= Inv.Data<Invc_Type>

	EXT.AMT	= INV.DATA<Invc_Ext_Amt>

	TAX.AMT	= INV.DATA<Invc_Tax_Amt>

	NET.AMT	= INV.DATA<Invc_Net_Amt>

	T.CODE	= INV.DATA<Invc_T_Code>

	MISC		= INV.DATA<Invc_Miscellaneous>

	FREIGHT	= INV.DATA<Invc_Freight>

	GST.AMT	= INV.DATA<Invc_GST_AMT>

	ROUNDING	= INV.DATA<Invc_Rounding_Amount>	

	R.PRICE	= INV.DATA<Invc_R_PRICE>

	DISC		= INV.DATA<Invc_Discount>

	INet.Amt    = Sum(Net.Amt) + Misc + Freight + rounding

	IF INV.DATA<Invc_Printed> = 'Y' THEN

  		INVOICE_DATE = INV.DATA<Invc_Invoice_Date>	;*INVOICE REPRINTED

	END ELSE

  		IF INV.DATE THEN

    			INVOICE_DATE = INV.DATE

		END ELSE

    			INVOICE_DATE = DATE()

  		END

	END



	Invoice.Date    = Invoice_Date

	Inv.Data<Invc_Invoice_Date> = invoice_Date

	Invoice_Date	= Oconv(Invoice_Date, "DL")	

	

	

*	IF CUST.TYPE = 'E' THEN

	IF GstStatus = False$ THEN

		GST.PERCENT = 0

	END ELSE

  		GST.PERCENT = XLATE('GROUP_MASTER',0,41,'X')

	END

	

	GST.MISC 	= OCONV(MISC*GST.PERCENT/10000,'MD0')

  	GST.FREIGHT	= OCONV(FREIGHT*GST.PERCENT/10000,'MD0')



	If Currency_Code # "AUD" then

		*InvTotal    = SUM(NET.AMT) + FREIGHT + MISC + GST.AMT + ROUNDING

		InvGst      = 0

		Freight = Inv.Data<Invc_F_Freight>

		Misc = inv.Data<invc_F_Miscellaneous>

		InvTotal = Sum(Inv.Data<Invc_F_Ext_Prices>) + Freight + Misc



	End Else

		InvTotal    = SUM(NET.AMT) + FREIGHT + MISC + GST.AMT + ROUNDING

		InvGst      = Gst.Amt

	End	



Return







************

FormatItems:

************



	Void = Set_Printer("TEXT", '')

	

	ITEM.NOS	  = Inv.Data<Invc_Item_no>

	ITEM.DESC	  = inv.Data<Invc_Item_Desc>



	** format table before printing as it may need to go over a page

	AllItem.Nos = DCount(Item.Nos, @vm)

	ITable = ''

	For a = 1 to AllItem.Nos

		ThisItem = Item.Nos<1,a>

		NextLine = ''

		NextLine<1,1> = ThisItem

		NextLine<1,2> = NameCap(Item.Desc<1,a>)

		NextLine<1,3> = Inv.Data<Invc_Qty_Shipped, a>

		If Currency_Code # "AUD" then

			Sell.Price = Inv.Data<Invc_F_Unit_prices,a>

			NextLine<1,4> = OCONV(SELL.PRICE,'MD2,')			

			Net.amt = Inv.Data<Invc_F_Ext_prices,a>



			NextLine<1,6> = OCONV(NET.AMT,'MD2,')			



		End Else

			SELL.PRICE	  = OCONV(R.PRICE<1,a>*(1-DISC<1,a>/10000),'MD0')

			NextLine<1,4> = OCONV(SELL.PRICE,'MD2,$')			

			NextLine<1,6> = OCONV(NET.AMT<1,a>,'MD2,$')			

		End	

		

		

		UOFM		  = XLATE('INVENTORY', ThisItem,'UOFM','X')		

		NextLine<1,5> = UOFM	

		

		ITable<-1> = NextLine

		

	Next a

	

	** now add on other stuff,freight misc. etc.

	IF MISC THEN

		Itable<-1>  = ' '

		NextLine = ''

		NextLine<1,2> = "Miscellaneous Item"

		If Currency_Code # "AUD" then

			NextLine<1,6> = OCONV(MISC,'MD2,')

		End Else

			NextLine<1,6> = OCONV(MISC,'MD2,$')

		End	

		Itable<-1> = NextLine

	End

	

	IF FREIGHT THEN

		Itable<-1> = ' '

		NextLine = ''

		NextLine<1,2> = "Delivery"

		If Currency_Code # "AUD" then

			NextLine<1,6> = OCONV(FREIGHT,'MD2,')

		End Else

			NextLine<1,6> = OCONV(FREIGHT,'MD2,$')

		End	

		ITable<-1> = NextLine

	End	



	NoOfLines = DCount(ITable, @fm)



	NoOfPages = 1

	If NoOfLines > FirstPageLines then

		** more than one page

		ExtraLines 	= NoOfLines-FirstPageLines

		Leftover 	= Mod(ExtraLines, SecondPageLines)

		NoOfPages  	= Int(ExtraLines/SecondPageLines)

		If Leftover then

			NoOfPages += 1

		End

		** need to add first page

		NoOfPages += 1

	End

	

Return





***********

PrintTable:

***********

	If Terms = 0 then

		TablePos = Get_Printer('POS')

		CodPos = 5

		CodPos<2> = 2

		void = Set_Printer('POS',CODPos)

		Void  = Set_Printer("FONT", Font36)

		CODTable = 'C.O.D'

		Void = Set_Printer("ADDTABLE", '^10940', '', CODTable, Gray, "", Append, Tb_None:@FM:"C")

	

	

		Void  = Set_Printer("FONT", Font10)

		Void = Set_Printer('POS',TablePos)

	end

	TableHdr = ''

	TableHdr<1,1> = 'Code'

	TableHdr<1,2> = 'Description'

	TableHdr<1,3> = 'Qty'

	If Currency_Code # 'AUD' then

		TableHdr<1,4> = 'Price ':Currency_Code

		TableHdr<1,5> = 'UOFM'

		TableHdr<1,6> = 'Amount ':Currency_Code

	End Else

		TableHdr<1,4> = 'Price'

		TableHdr<1,5> = 'UOFM'

		TableHdr<1,6> = 'Amount'

	End	

	

	TableFmt 	 = ''

	TableFmt<1,1> = '<~1500'

	TableFmt<1,2> = '<~8200'

	TableFmt<1,3> = '>1000'

	TableFmt<1,4> = '>1500'

	TableFmt<1,5> = '^1500'

	TableFmt<1,6> = '>2000'



	** depending on number of lines print other stuff here.

	

	AllRows = DCount(ITable, @fm)

	If AllRows < FirstPageLines then

		For a = AllRows to FirstPageLines

			Itable<-1> = ' '

		Next a

	End

		

	Void  = Set_Printer("FONT", Font10)

	Void  = Set_Printer("ADDTABLE", TableFmt, TableHdr, ITable, Gray, "", Append, Tb_Box_Columns:@FM:"C")	





Return





*************

PrintSummary:

**************





	** print order number in box same size as the summary info

		

	StartY = 0-.5

	EndY   = 0-.1

	

	Void = Set_Printer("RECT", 8.3:@fm:StartY:@fm:Pagewidth-.9:@fm:EndY, 0)		

	Void = Set_Printer("TEXTXY", "Invoice No", 8.4:@fm:StartY+.05, Font10Bold, 1)

	Void = Set_Printer("TEXTXY", Inv.No, 9.5:@fm:StartY+.05, Font10, 1)



	Void = Set_Printer("TEXTXY", "Invoice Date", 8.4:@fm:StartY+.2, Font10Bold, 1)

	Void = Set_Printer("TEXTXY", Oconv(Invoice.date, "DL"), 9.5:@fm:StartY+.2, Font10, 1)





	Void = set_Printer("POS", 0:@fm:0)

	

	HdrTableFmt 	 = ''

	HdrTableFmt<1,1> = '<1500'

	HdrTableFmt<1,2> = '<4500'

	HdrTableFmt<1,3> = '<1200'

	HdrTableFmt<1,4> = '~<4550'

	HdrTableFmt<1,5> = '<250'

	HdrTableFmt<1,6> = '<1650'

	HdrTableFmt<1,7> = '<2000'

	

	ReturnPos = Get_printer("POS")



	Table = ''

	

	Table<1,3> = 'Delivered'

	Table<2,3> = 'To'



	Table<1,6> = "Amount Due"

	Table<2,6> = "Terms"

	Table<3,6> = "Due Date"	

	Void  = Set_Printer("FONT", Font10Bold)

	Void  = Set_Printer("ADDTABLE", HdrTableFmt, '', Table, '', "", 0, Tb_None:@FM:"C")	



	Void = Set_Printer("POS", ReturnPos)

	Void  = Set_Printer("FONT", Font10)

	

	Gosub ShippingAddress



	Void  = Set_printer("POS", ReturnPos)

	Void  = Set_Printer("FONT", Font10)

	

	Table = ''



	Table<1,4> = Shipto.Address<1,1>

	Table<2,4> = Shipto.Address<1,2>

	Table<3,4> = Shipto.Address<1,3>

*	Table<4,4> = Shipto.Address<1,4>



	Invoice_Date = Inv.Data<Invc_Invoice_Date>

	Terms        = Debtors.Data<Dbt_Terms>

	

	TermsInfo = Invoice_Due_Date(Invoice_Date, Credit.Type, Terms)

	

	Termstext = TermsInfo<2>

	Due.Date  = Oconv(Termsinfo<1>, 'DL')



	If Currency_Code # "AUD" then

		Table<1,7> = Oconv(InvTotal, "MD2,"):" ":Currency_Code

	End Else

		Table<1,7> = Oconv(InvTotal, "MD2,$")

	End	

	Table<2,7> = TermsText

	Table<3,7> = Due.Date	

	

	Void  = Set_Printer("ADDTABLE", HdrTableFmt, '', Table, '', "", 0, Tb_None:@FM:"C")	

	

	EndPos = Get_printer("POS")

	EndY   = EndPos<2>

	

	Void = Set_Printer("TEXT", '')

	

	StartX = 8.3

	EndX   = PageWidth-.9

	StartY = 0

	EndY   = EndY

	

	Void = Set_Printer("RECT", 8.3:@fm:StartY:@fm:Pagewidth-.9:@fm:EndY, 0)	

	Void = Set_Printer("RECT", 4.1:@fm:StartY:@fm:8.2:@fm:EndY, 0)	



Return





**************

PrintCustInfo:

**************

	



	ReturnPos = Get_Printer("POS")

	StartY = ReturnPos<2>



	PRINT.FLAG				= Inv.data<Invc_Printed>

	CUST.ORD.NO				= NameCap(Field(Inv.Data<Invc_CUST_ORD_NO>, "*", 2))



	Void = Set_Printer("FONT", Font10Bold)		

	

	Table = ''

		

	Table<1,1> = "Sold To"

	

	Table<1,3> = "Special"

	Table<2,3> = "Instructions"

	

	Table<1,6> = "Delivery No"	

	Table<2,6> = 'Your Order No'

	Table<3,6> = "Page"



	HdrTableFmt 	 = ''

	HdrTableFmt<1,1> = '<1500'

	HdrTableFmt<1,2> = '~<4500'

	HdrTableFmt<1,3> = '<1200'

	HdrTableFmt<1,4> = '<4550'

	HdrTableFmt<1,5> = '<250'

	HdrTableFmt<1,6> = '<1650'

	HdrTableFmt<1,7> = '<2000'

			

	Append     = False$

		

	Void  = Set_Printer("ADDTABLE", HdrTableFmt, '', Table, "", "", Append, Tb_None:@FM:"C")

		

	Void  = Set_printer("POS", ReturnPos)

	Void  = Set_Printer("FONT", Font10)

	

	Table = ''





	Table<1,2> = NameCap(Debtors.Name)

	Table<2,2> = Debtors.Address<1,1>

	If Index(Debtors.Address, @vm, 1) then

		Table<3,2> = Debtors.Address<1,2>

		Table<4,2> = Debtors.Suburb:' ':Debtors.State:' ':Debtors.Post.code

*		If Cust.Type = "E" then

		If TaxCode = "E" then

			Table<4,2> = Debtors.Suburb:' ':Debtors.State:' ':Debtors.Post.code:" ":Debtors.Country

		End	

	End Else

		Table<3,2> = Debtors.Suburb:' ':Debtors.State:' ':Debtors.Post.code

*		If Cust.Type = "E" then

		If TaxCode = "E" then

			Table<4,2> = Debtors.Country

		End	

	

	End

	

	

	Table<2,1> = Debtor.No

	CurrPage = Get_Printer("PAGE")

	

	Table<1,7> = Inv.Data<Invc_OUR_ORDER>	

	Table<2,7> = cust.ord.No	

	Table<3,7> = CurrPage:' of ':NoOfPages



	

	Void = Set_Printer("ADDTABLE", HdrTableFmt, '', Table, "", "", Append, Tb_None:@fm:"C")	

	

	EndPos1 = Get_Printer("POS")

	Void = Set_Printer("POS", ReturnPos)

	

	Table = ''

	

	Instructions = Inv.Data<Invc_Instructions>



	Swap @tm with @vm in Instructions

	AllInstructions = DCount(Instructions, @vm)

	

	For a = 1 to AllInstructions

		If Instructions<1,a> then

			Table<a,4> = Instructions<1,a>

		end

	Next a	

	

	Append     = False$

	Void = Set_Printer("STARTTABLE")

	Void = Set_Printer("ADDTABLE", HdrTableFmt, '', Table, "", "", Append, Tb_None:@fm:"C")

	Void = Set_Printer("TABLECELL",TcFontSize:@fm:1:@fm:4:@fm:4:@fm:4:@fm:8)

	Void = Set_Printer("ENDTABLE")

	EndPos2 = Get_Printer("POS")



	EndY2 = EndPos2<2>

	EndY1 = EndPos1<2>

	

	If EndY2 > EndY1 then

		** this means that there was more than 3 lines to special instructions

		EndY = EndY2

		PText = ' '

	End Else

		** only 3 lines printed, we want to print another

		EndY = EndY1

		PText = @fm

	End

	

	Void = Set_Printer("RECT", 8.3:@fm:StartY:@fm:Pagewidth-.9:@fm:EndY, 0)	

	Void = Set_Printer("RECT", 4.1:@fm:StartY:@fm:8.2:@fm:EndY, 0)	



	Void = Set_printer("POS", 0:@fm:EndY)	



	If Imessage then

		Void = Set_printer("POS", 0:@fm:EndY+.05)	

*		Void = Set_Printer("FONT", Font10CentreBold)

		Void = Set_Printer("FONT", Font10RightBold)

	End

	Void = Set_Printer("TEXT", Imessage:PText)

	If IMessage Then

		Void = Set_Printer("FONT", Font10)

	End	

				

				

Return			



**************

PrintCopyType:

**************





	IF Inv.Data<Invc_Printed> = "Y" THEN

		If PrintType = 2 then

			Void = Set_Printer("TEXTXY", "CUSTOMER COPY REPRINT", 0:@fm:CBmpHeight-bmpadj, Font12Bold, 0)

		End Else

			If PrintType = 1 then

				Void = Set_Printer("TEXTXY", "FILE COPY REPRINT", 0:@fm:CBmpHeight-bmpadj, Font12Bold, 0)

			End

		End	

	End Else

		If PrintType = 2 then

			Void = Set_Printer("TEXTXY", "CUSTOMER COPY", 0:@fm:CBmpHeight-bmpadj, Font12Bold, 0)

		End Else

			If PrintType = 1 then

				Void = Set_Printer("TEXTXY", "FILE COPY", 0:@fm:CBmpHeight-bmpadj, Font12Bold, 0)

			End

		End	

	End



Return



*************

PrintCoyInfo:

*************



	** this will print on every page, so we need to use text xy

	

	void 	  = Set_Printer("CALCBMP", Bitmap)

	size 	  = Get_Printer("CALCBMP")	;* get the size

	bmpWidth  = size<1>	;* width

	bmpHeight = size<2>	;* height

	

	bmpadj    = 1.6	

	Diff = ((PageWidth - BmpWidth) / 2) - .5    ;*   

	

	stat = Set_Printer("BMP", Bitmap, Diff:@fm:-bmpAdj, 1, 1)

	

	Void = Set_Printer("FONT", Font16Bold)

	

	** print vertical line for folding

	Void = Set_Printer("LINE", 8.0:@fm:-bmpadj:@fm:8.0:@fm:-bmpadj+.2, 0)	



	Coytext = Address:", AUSTRALIA  ":Telephone

	

	Void = Set_Printer("FONT", Font10)

	Void = Set_Printer("CALCTEXT", CoyText)

	Dimensions = Get_Printer("CALCTEXT")

	Diff = ((PageWidth - Dimensions<1>) / 2) - .5  

	

	Void = Set_Printer("TEXTXY", Coytext, Diff:@fm:BmpHeight-bmpadj, Font10, 1)

	

	BmpHeight = BmpHeight + Dimensions<2>

		  

	CoyName 	= Division_data<2>

	

	Void = Set_Printer("FONT", Font16Bold)

	Void = Set_Printer("CALCTEXT", CoyName)

	Dimensions = Get_Printer("CALCTEXT")

	Diff = ((PageWidth - Dimensions<1>) / 2) - .5  

	

	Void = Set_Printer("TEXTXY", CoyName, Diff:@fm:BmpHeight-bmpadj, Font16Bold, 1)	

	BmpHeight = BmpHeight + Dimensions<2>

	

		

	CBmpHeight = BmpHeight

	

	IF AGE.FLAG = 'C' then

	*Inv.data<Invc_Printed> # "Y" THEN

  		IF (TYPE = 'C') OR (Tot.Ord.Amt LT 0) THEN

    		TypeText = 'CREDIT NOTE'

  		END ELSE

    		BEGIN CASE

      			CASE PrintType = 1	; TypeText = 'FILE COPY INVOICE'

			    CASE 1

*        			IF CUST.TYPE = 'E' THEN

        			IF TaxCode = 'E' THEN

          				TypeText = 'EXPORT INVOICE'

 			       	END ELSE

          				TypeText = 'TAX INVOICE'

		        	END

    		END CASE

	  	END

	END ELSE

	  	IF (TYPE = 'C') OR (Tot.Ord.Amt LT 0) THEN

    		TypeText = 'REPRINTED CREDIT NOTE'

  		END ELSE

    		BEGIN CASE

      			CASE PrintType = 1	; TypeText = 'FILE COPY INVOICE - Reprint'

			    CASE 1

*        			IF CUST.TYPE = 'E' THEN

        			IF TaxCode = 'E' THEN

          				TypeText = 'REPRINTED EXPORT INVOICE'

 			       	END ELSE

          				TypeText = 'REPRINTED TAX INVOICE'

		        	END

    		END CASE

	  	END	  	

	End

	

	Void = Set_Printer("TEXTXY", TypeText, 0:@fm:BmpHeight-bmpadj, Font14Bold, 1)		

	

	ABN  = "ABN ":CoyABN

	

	Void 		= Set_Printer("FONT", Font10Right)

	Void 		= Set_Printer("CALCTEXT", ABN)

	Dimensions  = Get_Printer("CALCTEXT")

	Diff = ((PageWidth - Dimensions<1>) / 2) - .5  	



	Void = Set_Printer("TEXTXY", ABN, Diff:@fm:BmpHeight-bmpadj, Font10, 1)

		

	BmpHeight = BmpHeight + Dimensions<2>	



Return



****************

PrintRemittance:

****************



	currpos = get_printer("POS")

	

	Void = Set_Printer("POS", 0:@fm:RemittanceStart)

	

	Void = Set_Printer("FONT", Font10)

	Void  = Set_Printer("ADDTABLE", '^15700', 'Please Return This Portion With Payment', '', Gray, "", 0, Tb_Box:@FM:"C")		

	ReturnPos = Get_printer("POS")

		

	Void = Set_Printer("FONT", Font10Bold)

	Table = ''

		



	

	Table<1,1> = "Return To"

	Table<1,2> = CoyName



	Table<1,3> = "Sold To"

	

	Table<1,5> = "Invoice No"

	Table<2,5> = 'Invoice Date'

	Table<3,5> = "Due Date"

	Table<4,5> = "Amount Due"



	HdrTableFmt 	 = ''

	HdrTableFmt<1,1> = '<1500'

	HdrTableFmt<1,2> = '~<4700'

	HdrTableFmt<1,3> = '<1500'

	HdrTableFmt<1,4> = '~<4500'

	HdrTableFmt<1,5> = '>1500'

	HdrTableFmt<1,6> = '>2000'

			

	Append     = False$

	

	

	Void  = Set_Printer("ADDTABLE", HdrTableFmt, '', Table, "", "", Append, Tb_Box:@FM:"C")

		

	Void  = Set_printer("POS", ReturnPos)

	Void  = Set_Printer("FONT", Font10)

	

	Table = ''





	Table<1,4> = NameCap(Debtors.Name)

	Table<2,4> = Debtors.Address<1,1>

	If Index(Debtors.Address, @vm, 1) then

		Table<3,4> = Debtors.Address<1,2>

		Table<4,4> = Debtors.Suburb:' ':Debtors.State:' ':Debtors.Post.code

*		If Cust.Type = "E" then

		If TaxCode = "E" then

			Table<4,4> = Debtors.Suburb:' ':Debtors.State:' ':Debtors.Post.code:' ':Debtors.Country

		End	

	End Else

		Table<3,4> = Debtors.Suburb:' ':Debtors.State:' ':Debtors.Post.code

*		If Cust.Type = "E" then

		If TaxCode = "E" then

			Table<4,4> = Debtors.Country

		End	

	

	End



	Void = Set_Printer("ADDTABLE", HdrTableFmt, '', Table, "", "", Append, Tb_None:@fm:"C")	

	Void = Set_printer("POS", ReturnPos)

	Table<2,3> = Debtor.No

	PoBox           = Division_Data<6>

	IF POBOX THEN

		Table<2,2> 	= 'PO Box ':PoBox

		Table<3,2>  = DIVISION_DATA<DIV_Po_Box_Suburb>:' ':DIVISION_DATA<DIV_Po_Box_State>:' ':DIVISION_DATA<DIV_Po_Box_Post_Code>

	END ELSE

		Table<2,2>  = Division_Data<4>

		Table<3,2>  = DIVISION_DATA<5>:' ':DIVISION_DATA<8>:' ':DIVISION_DATA<7>

	

	END	

		

	Table<1,6> = Inv.No

	Table<2,6> = Oconv(Invoice.date, "DL")

	Table<3,6> = Due.date

	If Currency_Code # "AUD" then

		Table<4,6> = Oconv(InvTotal, 'MD2,')



	End Else

		Table<4,6> = Oconv(InvTotal, 'MD2,$')

	End	

	

	

	

	Append     = False$

	

	Void = Set_Printer("ADDTABLE", HdrTableFmt, '', Table, "", "", Append, Tb_None:@fm:"C")	

	

	EndPos = Get_Printer("POS")

	EndY = EndPos<2>

	

	Void = Set_Printer("TEXT", " ")

				

				

Return



*************

PrintMessage:

*************



	If Imessage then

*		Void = Set_printer("POS", 0:@fm:TotalsStart - .3)

		Void = Set_printer("POS", 0:@fm:RemittanceStart - .2)	

*		Void = Set_Printer("FONT", Font10CentreBold)

		Void = Set_Printer("FONT", Font10Bold)

		Imess	= Imessage:PText

		Swap @tm with ' ' in Imess

		Swap @vm with ' ' in Imess

		Void = Set_Printer("TEXT", Imess)

		Void = Set_Printer("FONT", Font10)

	End





Return			



************

PrintTotals:

************



	Void = Set_Printer("POS", 0:@fm:TotalsStart)

	

	Table      = ''

		

	Void = set_Printer("FONT", Font10Bold)

	

	If Currency_Code # "AUD" then

		Table<1,2> = 'Sub Total ':Currency_Code

*		Table<2,2> = "GST Amount"

		Table<3,2> = 'Invoice Total ':Currency_Code

			

		Table<1,3> = Oconv(InvTotal, 'MD2,')

*		Table<2,3> = Oconv(Gst.Amt, "MD2,$")

		Table<3,3> = Oconv(InvTotal, 'MD2,')

	

	End Else

		Table<1,2> = 'Sub Total Ex GST'

		Table<2,2> = "GST Amount"

		Table<3,2> = 'Invoice Total'

			

		Table<1,3> = Oconv(Inet.amt, 'MD2,$')

		Table<2,3> = Oconv(Gst.Amt, "MD2,$")

		Table<3,3> = Oconv(InvTotal, 'MD2,$')

	End	

	

	TableFmt 	 = ''

	TableFmt<1,1> = '<10700'

	TableFmt<1,2> = '>3000'

	TableFmt<1,3> = '>2000'

	stat = Set_Printer("CALCTABLE", TableFmt:@fm:table)

	size = Get_Printer("CALCTABLE") ;* get the size

	TotalWidth = size<1> ;* width

	TotalHeight = size<2> ;* height



	Void = Set_Printer("ADDTABLE", TableFmt, '', Table, "", "", Append, Tb_None:@fm:"C")	

	

	Void = Set_printer("POS", 0:@fm:TotalsStart)

	Void = Set_printer("FONT", Font10)

	

	Table = Terms.Data

	Void = Set_Printer("CALCTEXT", CoyText)

	Dimensions = Get_Printer("CALCTEXT")

	TableFmt 	 = ''

	TableFmt<1,1> = '<10700'

	TableFmt<1,2> = '<5000'

*	TableFmt<1,3> = '>2000'

	stat = Set_Printer("CALCTABLE", TableFmt:@fm:table)

	size = Get_Printer("CALCTABLE") ;* get the size

	TermsWidth = size<1> ;* width

	termsHeight = size<2> ;* height

	If TermsHeight < TotalHeight then

		Table<3> = ' '

	end

	Void = Set_Printer("ADDTABLE", TableFmt, '', Table, "", "", Append, Tb_Box_Columns:@fm:"C")	

	

Return





Return





***********

PrintSetup:

***********



	Filename 	= "Sales Tax Invoice"

	PrintTitle 	= "Sales Tax Invoice"

	PageInfo   	= .5:@fm:2:@fm:.5:@fm:0

	PageSetup   = 1

	

	Dflt_name 	= 'PS':inv.No

	EmailParms 	= 'NOPROMPT'

	

	Init_Printer_Reports(Filename, PrintTitle, PageInfo, PageSetup, Output, Format, Dflt_Name, EmailParms)	

	If OutputOrg = 5 then

		Print_Fax("PRINT", FaxParms, Error, EmailParms)

	End

	

	

	Void 	= Set_Printer("FONTHEADFOOT", Font10)

	Append 	= False$

	Void   	= Set_Printer("FONT", Font10)





	Printedby = Xlate("PBC_USERS", Curr_User%, 16, "X")

	



	Void = Set_Printer("FONT", Font10)



	

	PageSize  = Get_Printer("PAGESIZE")

	PageWidth = PageSize<1>

	PageHeight= PageSize<2>



	RemittanceStart = PageHeight - 2 - 1.25	

	TotalsStart     = RemittanceStart - .75

	

	FirstPageLines    = 14

	ExtraPageOneLines = 10

	SecondPageLines   = 25



Return





**********

OpenFiles:

**********



	Error = ''

	

	Output	= Parms<1>

	OutputOrg	= Parms<1>

	Format	= Parms<2>

	Inv.No	= Parms<3>

	PrintType	= Parms<4>

	Inv.Date	= Parms<6>

				

	OPEN 'INVOICE' TO Invoice ELSE 

		Error = 'Cant find Invoice file'

	End

		

	OPEN 'INVOICE_HIST' TO Invoice.Hist ELSE 

		Error = 'Cant find Invoice Hist file'

	End



	OPEN 'DEBTORS_MASTER' TO DEBTORS.MASTER ELSE 

		Error = 'Cant find DEBTORS_MASTER file'

	End

		

	OPEN 'INVENTORY' TO INVENTORY ELSE 

		Error = 'Cant find INVENTORY file'

	End

		

	OPEN 'COMPANY' TO COMPANY ELSE 

		Error = 'Cant find COMPANY file'

	End

		

	OPEN 'DIVISION' TO DIVISION ELSE 

		Error = 'Cant find DIVISION file'

	End

		

	OPEN 'DEPARTMENT_RATES' TO DEPARTMENT.RATES ELSE 

		Error = 'Cant find DEPARTMENT_RATES file'

	End

		

	AGE.FLAG = 'C'

	INV.DATA = ''

	READ INV.DATA FROM INVOICE,INV.NO ELSE

		AGE.FLAG = 'H'

		READ INV.DATA FROM INVOICE.HIST,INV.NO ELSE

			Error = 'Error reading ':INV.NO:' from INVOICE file'

		End

	End	

		

	CUST.ORD.NO = NameCap(FIELD(INV.DATA<Invc_CUST_ORD_NO>,'*',2))

	Tot.Ord.Amt	= INV.DATA<Invc_Tot_Ord_Gst>

	

	Bitmap		= Xlate("CONTROLS", "IMAGES2", 3, "X")

			

	DEPT		= Inv.Data<Invc_Dept_No>

	

	READ DEPARTMENT.RATES.DATA FROM DEPARTMENT.RATES, DEPT ELSE 

		Error = 'Cant find DEPARTMENT.RATES ':DEPT

	End

		

	DIVISION 		= XLATE('DEPARTMENT',DEPT,33,'X')

	DIVISION_DATA	= XLATE('DIVISION',DIVISION,'','X')

	COMP.NO			= DIVISION_DATA<1>

	CoyNo			= Division_Data<1>

	CoyName 		= Division_data<2>

	CoyABN			= Xlate("COMPANY", CoyNo, 20, "X")

	

	PoBox           = Division_Data<6>

	IF POBOX THEN

		Address    	= 'PO Box ':PoBox:'  ':DIVISION_DATA<DIV_Po_Box_Suburb>:' ':DIVISION_DATA<DIV_Po_Box_State>:' ':DIVISION_DATA<DIV_Po_Box_Post_Code>

	END ELSE

		Address    	= Division_Data<4>:'  ':DIVISION_DATA<5>:' ':DIVISION_DATA<8>:' ':DIVISION_DATA<7>

	

	END	

	

	Telephone	= 'Phone:':DIVISION_DATA<9>:'  Fax:':DIVISION_DATA<10>		

	IMessage	= Division_Data<DIV_INVOICE_MESSAGE>

	Append		= False$

	Table		= ''

	

	TYPE		= INV.DATA<Invc_Type>

	DEBTOR.NO	= INV.DATA<Invc_Debtor_No>

	

	READ DEBTORS.DATA FROM DEBTORS.MASTER,DEBTOR.NO ELSE

  		Error = 'Cannot find ':DEBTOR.NO:' in DEBTORS.MASTER file'



	END

	

	If Debtors.Data<Dbt_Invoice_Terms> then

		TERMS.DATA	= Debtors.Data<Dbt_Invoice_Terms>

	end else

		TERMS.DATA	= DEPARTMENT.RATES.DATA<21>

	end

	CONVERT @TM TO ' ' IN TERMS.DATA

	TERMS.DATA		= TRIM(TERMS.DATA)

	

	TERMS.DATA		= TERMS.DATA





Return



***************

PrintContinued:

***************



*	Void = set_Printer("POS", 0:@fm:6.5)

		

	Void	= Set_printer("TEXT", '')	

	Table	= '... continued Page ':PageNo+1

	Void	= Set_Printer("ADDTABLE", '>15700' , '', Table, '', "", '', TB_Box:@fm:"C")

	Table	= ''

	

Return



****************

ShippingAddress:

****************



	SHIPTO.ADDRESS	= ''

	Shipto.Phone	= ''

	Shipto.Contact  = ''

	Shipto			= Inv.data<Invc_SHIPTO>

	Skey			= Debtor.No:"*":Shipto

	

	Format_Shipping_Address(Skey, Shipto.Address, Shipto.Phone, Shipto.Contact)

	

Return





***********

GetFaxInfo:

***********



	FaxParms 	= ''

	FaxParms<1>	= Debtors.Data<Dbt_FAX>

	FaxParms<2> = Debtors.Data<Dbt_NAME>

	FaxParms<3> = 'Tax Invoice ':Inv.No

	FaxParms<4> = "Your Order No ":Inv.Data<Invc_CUST_ORD_NO>

	FaxParms<5> = Inv.Data<Invc_Given_By>

	FaxParms<7> = Inv.Data<Invc_DEPT_NO>

	 

	Error = ''

	Print_Fax('CHECK', FaxParms, Error)

	If Error then

		Void = Msg("", Error)

		Output = 1

	End

	 

Return



*************

GetEmailInfo:

*************



	** check debtor record for email address with email code = "INV"

	** if none found change output to 1

	

	ReadReceipt = False$

	ECode = Debtors.Data<Dbt_Email_Code>

	AllCodes = DCount(Ecode, @vm)

	Found = False$

	For a = 1 To AllCodes Until Found

		ThisCode = Ecode<1,a>

		If ThisCode = "INV" then

			If Debtors.Data<Dbt_Email_Address, a> then

				Found = True$

				ReadReceipt = Debtors.Data<Dbt_Read_Receipt, a>

			End

		End

	Next a

	

	If Not(Found) then

		Output = 1

	End

	 

Return




At 10 JUL 2021 02:44AM Donald Bakke wrote:

Just started editing a stored procedure in OI10.0.8.1 and get lost of warnings and Compilation Failed! error.

many warnings as follows:

Equate "TCVERTICAL (TABLECELL_EQUATES   ) on line "22" does not end with "$"

This is an equate from SYSPROG supplied by Rev. Does that imply that all inserts have to end in a "$" sign.

Then a:

Compilation Failed! 

REP300 - Entity PBC*STPOCSINS**TABLECELL_EQUATES  does not exist.

Yet I can edit the insert, compile the insert etc.

This is not a problem in OI9.4.6

Restarted my laptop, performed another migration etc.

Not sure what is going on.

Any advice would allow me to proceed with testing OI10

Chris

Go to the Settings > IDE Settings menu. Then click on the Source Code Editor > Editor Interface option. Look for the Compiler Warnings > Ignore Missing Equate Suffixes and change the value to True.

Don Bakke

SRP Computer Solutions, Inc.


At 10 JUL 2021 03:08AM cmeyer wrote:

Thanks Don,

Your a legend.

Compilation warnings and errors gone.

Chris

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/1fe862c5f66a784e8015419a9a34c202.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1