OposPosPrinter

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: OposPosPrinter

Post by danielmaximiliano »

Hola a todos :
funcionando a medias pude imprimir 2 mensajes mediante OPOS (OLE Point of Sale) en una impresora LDN (logical device names) con este codigo

Code: Select all

*----------------------------------------------------------------------------*
procedure CreaRPT005()
*----------------------------------------------------------------------------*
/* Technically, 
it's Open() / ClaimDevice() / DeviceEnabled = TRUE / DeviceEnabled = FALSE / ReleaseDevice() / Close(). 
Open() requests a handle to the named device, and should work if the device exists. 
Close() is the matching pair function, and it should be called when the device is no longer needed by the application. 
ClaimDevice() (previously known as ... */
    
    IF ( oOposPrinter := CreateObject( RPT005 ) ) != NIL
	        lOposSuccess := oOposPrinter:open("RPT005")
		     If lOposSuccess := .T.
			msgdebug( oOposPrinter , lOposSuccess )
			oOposPrinter:ClaimDevice(1000)
			oOposPrinter:DeviceEnabled := .T.
			oOposPrinter:PrintNormal(2,  "Test")
			oOposPrinter:PrintNormal(2, "LDN RPT005")
			oOposPrinter:CutPaper(100)
			oOposPrinter:ReleaseDevice()
			oOposPrinter:Close()
no funciona oOposPrinter:CutPaper(100) pero al usar la aplicacion que viene con los drivers y hacer un test de impesion sale en el papel las 2 lineas mencionadas
2021-01-14 21_11_36-C__Perez_fuentes_ventas.prg - Notepad++.png
2021-01-14 21_11_36-C__Perez_fuentes_ventas.prg - Notepad++.png (54.1 KiB) Viewed 1467 times
ticket.jpg
ticket.jpg (61.2 KiB) Viewed 1467 times
los ejemplos en la web no indican otros metodos para que el buffer fuera impreso antes de desconetar la impresora y cerrar la conexion :roll:
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
franco
Posts: 816
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: OposPosPrinter

Post by franco »

Hi Danial, What windows are you using. Are you using this printer with hmg. If windows and hmg do you have the windows drivers ?, if so try to install
it as a windows printer and usb port. I see the printer has a cutter, does it have a cash drawer outlet and do you have a cash drawer.
Are you trying to print the receipt as in above post.
I will check with my printer supplier tomorrow if your cutter code is the same as mine.
Franco
All The Best,
Franco
Canada
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: OposPosPrinter

Post by edk »

Here is the Programmer manual for this device: https://3nstar.com/wp-content/uploads/2 ... Manual.pdf
Paper cut command (page #29):
GS V m
where:
GS is CHR(29)
V is CHR(86)
m is cut mode: m=0,48 (one point left uncut) or m=1,49 (Partial cut) or m=66 (Feeds paper and cut)

I found information on the net that the CutPaper(int: Percent) method indicates the percentage of paper cut, but according to the Programmer manual, this device does not have such a mode.

So, maybe try to :?:

Code: Select all

oOposPrinter:CutPaper(1.49)
- or -
oOposPrinter:CutPaper(0.48)
- or -
oOposPrinter:CutPaper(66, 0)
Or build your own communication with the device in RAW mode according to the Programmer manual.
Last edited by edk on Fri Jan 15, 2021 11:53 am, edited 1 time in total.
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: OposPosPrinter

Post by danielmaximiliano »

franco wrote: Fri Jan 15, 2021 6:34 am Hi Danial, What windows are you using. Are you using this printer with hmg. If windows and hmg do you have the windows drivers ?, if so try to install
it as a windows printer and usb port. I see the printer has a cutter, does it have a cash drawer outlet and do you have a cash drawer.
Are you trying to print the receipt as in above post.
I will check with my printer supplier tomorrow if your cutter code is the same as mine.
Franco
Hola Franco: estas impresoras funcionan en 2 modos, OposPrinter y OposDrawer.
la segunda opcion maneja el cajon de efectivo en caso de contar con el mismo, como no se utiliza el cajon utiizo la primera.
gracias por preguntar a su vendedor

Hi Franco: these printers work in 2 modes, OposPrinter and OposDrawer.
The second option manages the cash drawer in case of having it, as the drawer is not used, I use the first.
thanks for asking your seller
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: OposPosPrinter

Post by danielmaximiliano »

edk wrote: Fri Jan 15, 2021 9:53 am Paper cut command (page #29):
GS V m
where:
GS is CHR(29)
V is CHR(86)
m is cut mode: m=0,48 (one point left uncut) or m=1,49 (Partial cut) or m=66 (Feeds paper and cut)
So, maybe try to :?:

Code: Select all

oOposPrinter:CutPaper(1.49)
- or -
oOposPrinter:CutPaper(0.48)
- or -
oOposPrinter:CutPaper(66, 0)
Hola EDK : la impresora imprime correctamente el estado CheckHealt y corta el papel los demas metodos quedan en el buffer ya que si uso la aplicacion de testeo de la impresora sale impreso el contenido previamente enviado a la impresora :?
te comento que el CheckHealt no hace falta usar metodo CutPaper(1.49) ya que lo hace automaticamente.

Hello EDK: the printer correctly prints the CheckHealt status and cuts the paper, the other methods remain in the buffer since if I use the printer's testing application, the content previously sent to the printer is printed :?

I tell you that the CheckHealt does not need to use the CutPaper method (1.49) since it does it automatically.

Code: Select all

	        If ( oOposPrinter:open("RPT005")) != NIL
	         oOposPrinter:ClaimDevice ( 2000 )
			 if oOposPrinter:ResultCode != OPOS_SUCCESS
			 msgbox ( "Cannot use a POS Printer.", "Attention" )
			 return
			 Else
			  oOposPrinter:DeviceEnabled := .T.
			  // Work 
			  //oOposPrinter:CheckHealth   ( OPOS_CH_INTERNAL )
			  
			  //does not work
			  oOposPrinter:TransactionPrint( PTR_S_RECEIPT, PTR_TP_TRANSACTION )
	                  oOposPrinter:PrintNormal     ( PTR_S_RECEIPT , 'Normal'              )
                          oOposPrinter:PrintImmediate  ( PTR_S_RECEIPT , 'Immediate'           )
			  oOposPrinter:PrintBarCode    ( PTR_S_RECEIPT ,"7798113302076" ;
			                                               ,PTR_BCS_EAN13   ;
			                                               ,100                    ;
								       , 640                   ;
									, PTR_BC_CENTER  ;
									, PTR_BC_TEXT_BELOW ) 
			oOposPrinter:TransactionPrint( PTR_S_RECEIPT , PTR_TP_NORMAL     )
			oOposPrinter:CutPaper(1.49)
			
			//I disable and close the printer
			oOposPrinter:DeviceEnabled := .F.
	               oOposPrinter:ReleaseDevice()
			oOposPrinter:Close()
			endif
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: OposPosPrinter

Post by danielmaximiliano »

Hola a todos:
agregando #define CRLF Chr(13)+Chr(10)
la impresora no hace los metodos :PrintNormal , :PrintImmediate ..... pero :CutPaper(1.49) si corta el papel :roll:

Code: Select all

			  // does not work
			  oOposPrinter:TransactionPrint( PTR_S_RECEIPT, PTR_TP_TRANSACTION )
			 oOposPrinter:PrintNormal     ( PTR_S_RECEIPT , 'Normal'     + CRLF         )
			 msgdebug( oOposPrinter:ResultCode )
                         oOposPrinter:PrintImmediate  ( PTR_S_RECEIPT , 'Immediate'  + CRLF         )
			oOposPrinter:PrintBarCode    ( PTR_S_RECEIPT ,"7798113302076" ;
			                                             ,PTR_BCS_EAN13   ;
								    ,100             ;
								    , 640            ;
								   , PTR_BC_CENTER  ;
								  , PTR_BC_TEXT_BELOW ) 
			oOposPrinter:TransactionPrint( PTR_S_RECEIPT , PTR_TP_NORMAL     )
			
			oOposPrinter:CutPaper(1.49) 
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: OposPosPrinter

Post by danielmaximiliano »

Hola a todos / Hello everyone
voy a necesitar trasladar este codigo VBA / I'm going to need to transfer this VBA code :ugeek:

Code: Select all

	Private Sub cmdAsync_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdAsync.Click
		
		Dim bExit As Boolean
		Dim lValue As Integer
		Dim i As Short
		Dim idBuf(5) As ITEMDATA
		Dim ESC As New VB6.FixedLengthString(1)
		Dim fDate As String
		Dim BcData As String
		Dim sBuf As String
		Dim sPrice As String
		Dim sValue As String
		
		If OPOSPOSPrinter1.CapRecPresent = False Then
			MsgBox("This Printer doesn't have Receipt Station.", MsgBoxStyle.Exclamation)
			Exit Sub
		End If
		
		' Initialization
		Cursor = System.Windows.Forms.Cursors.WaitCursor
		ESC.Value = Chr(&H1Bs)
		fDate = VB6.Format(Now, "mmmm dd, yyyy  AM/PM h:mm")
		BcData = "4902720005074"
		bExit = False
		
		' Make a data of the buying goods
		idBuf(0).Name_Renamed = "apples" : idBuf(0).Price = 10
		idBuf(1).Name_Renamed = "grapes" : idBuf(1).Price = 20
		idBuf(2).Name_Renamed = "bananas" : idBuf(2).Price = 30
		idBuf(3).Name_Renamed = "lemons" : idBuf(3).Price = 40
		idBuf(4).Name_Renamed = "oranges" : idBuf(4).Price = 50
		
		With OPOSPOSPrinter1
			.AsyncMode = True
			.TransactionPrint(PTR_S_RECEIPT, PTR_TP_TRANSACTION)
			If .ResultCode <> OPOS_SUCCESS Then
				MsgBox("Cannot use a POS Printer.", MsgBoxStyle.Exclamation)
				.AsyncMode = False
				Cursor = System.Windows.Forms.Cursors.Default
				Exit Sub
			End If
			
			'Loop
			Do 
				If .CapRecBitmap = True Then
					.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|1B")
				End If
				
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|N" & "123xxstreet,xxxcity,xxxxstate " & vbLf)
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|rA" & "TEL 9999-99-9999   C#2" & vbLf)
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|200uF")
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|cA" & fDate & vbLf)
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|500uF")
				'Print buying goods
				lValue = 0
				For i = LBound(idBuf) To UBound(idBuf) - 1
					If .ResultCode <> OPOS_SUCCESS Then Exit For
					sBuf = idBuf(i).Name_Renamed
					lValue = lValue + idBuf(i).Price
					sPrice = VB6.Format(idBuf(i).Price, "$#.00")
					sValue = MakePrintString(.RecLineChars, sBuf, sPrice)
					.PrintNormal(PTR_S_RECEIPT, sValue & vbLf)
				Next 
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|200uF")
				'Print the total cost
				sBuf = "Tax excluded."
				sPrice = VB6.Format(lValue, "$#.00")
				sValue = MakePrintString(.RecLineChars, sBuf, sPrice)
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|bC" & sValue & vbLf)
				sBuf = "Tax  5.0%"
				sPrice = VB6.Format(lValue * 0.05, "$#.00")
				sValue = MakePrintString(.RecLineChars, sBuf, sPrice)
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|N" & ESC.Value & "|uC" & sValue & vbLf)
				sBuf = "Total"
				sPrice = VB6.Format(lValue * 1.05, "$#.00")
				sValue = MakePrintString(.RecLineChars \ 2, sBuf, sPrice) 'Because the width of characters of total is doubled, take this into consideration when computing.
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|N" & ESC.Value & "|bC" & ESC.Value & "|2C" & sValue & vbLf)
				sBuf = "Customer's payment"
				sPrice = VB6.Format(200, "$#.00")
				sValue = MakePrintString(.RecLineChars, sBuf, sPrice)
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|N" & sValue & vbLf)
				sBuf = "Change"
				sPrice = VB6.Format(200 - lValue * 1.05, "$#.00")
				sValue = MakePrintString(.RecLineChars, sBuf, sPrice)
				.PrintNormal(PTR_S_RECEIPT, sValue & vbLf)
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|500uF")
				
				If .CapRecBarCode = True Then
					.PrintBarCode(PTR_S_RECEIPT, BcData, PTR_BCS_JAN13, 1000, .RecLineWidth, PTR_BC_CENTER, PTR_BC_TEXT_BELOW)
				End If
				
				.PrintNormal(PTR_S_RECEIPT, ESC.Value & "|" & CStr(.RecLinesToPaperCut) & "lF")
				If .CapRecPapercut = True Then
					.CutPaper(100)
				End If
				
				If .ResultCode = OPOS_SUCCESS Then Exit Do
				
				'When error occurs, display a message to ask the user whether retry or not.
				Select Case MsgBox("Fails to output to a printer" & vbCrLf & vbCrLf & "Retry?", MsgBoxStyle.AbortRetryIgnore + MsgBoxStyle.Question)
					Case MsgBoxResult.Abort ' "Cancel"has been selected
						.ClearOutput()
						bExit = True
						Exit Do
					Case MsgBoxResult.Retry ' "Retry" has been selected
						.ClearOutput()
					Case MsgBoxResult.Ignore ' "Ignore" has been selected
						Exit Do
				End Select
			Loop 
			
			If bExit = False Then 'Has it been canceled?
				.TransactionPrint(PTR_S_RECEIPT, PTR_TP_NORMAL)
				If .ResultCode <> OPOS_SUCCESS Then
					MsgBox("Cannot use a POS Printer.", MsgBoxStyle.Exclamation)
					.AsyncMode = False
					' Clear the buffered data since the buffer retains print data
					' when an error occurs during printing.
					.ClearOutput()
					Cursor = System.Windows.Forms.Cursors.Default
					Exit Sub
				End If
			End If
			.AsyncMode = False
		End With
		
		Cursor = System.Windows.Forms.Cursors.Default
		
	End Sub
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: OposPosPrinter

Post by edk »

Do this test:

Code: Select all

nLinesToPaperCut := 3

oOposPrinter:ClaimDevice(1000)
oOposPrinter:DeviceEnabled := .T.
oOposPrinter:PrintNormal(2,  "Test")
oOposPrinter:PrintNormal(2, "LDN RPT005")

//new nLinesToPaperCut
oOposPrinter:PrintNormal(2, CHR(27) + "|" + AllTrim(Str( nLinesToPaperCut) ) + "lF" )

//This command is effective only processed at the beginning of a line.
oOposPrinter:CutPaper(100)

oOposPrinter:ReleaseDevice()

OR

Code: Select all

#include <hmg.ch>
Function Main()

 Local cCutPaperCmd :=  Chr(29) + Chr(86)

 IF !File ("Cut048.raw")
	 StrFile ( cCutPaperCmd + "0.48", "Cut048.raw")
 ENDIF

 IF !File ("Cut149.raw")
	 StrFile ( cCutPaperCmd + "1.49", "Cut149.raw")
 ENDIF

 IF !File ("Cut660.raw")
	 StrFile ( cCutPaperCmd + "66" + CHR(0), "Cut660.raw")
 ENDIF
 
 DEFINE WINDOW form_main AT 0 ,0 WIDTH 200 HEIGHT 200 TITLE "" ICON NIL MAIN
	
    DEFINE MAIN MENU
        DEFINE POPUP "Cut Test"
            MENUITEM "Cut 0.48" ACTION CutTest ("Cut048.raw")
            MENUITEM "Cut 1.49" ACTION CutTest ("Cut149.raw")
            MENUITEM "Cut 66 0" ACTION CutTest ("Cut660.raw")
        END POPUP
    END MENU

 END WINDOW

form_main.Center
form_main.Activate
Return NIL


function CutTest (cRAWCmd)
Local cPrinter := GetPrinter()

IF cPrinter = "RPT005"
	win_PrintFileRaw(cPrinter, cRAWCmd) 	
ELSE
	MsgStop ( "No RPT005 Selected")
ENDIF
RETURN 

User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: OposPosPrinter

Post by danielmaximiliano »

Hi Franco :
it´s work it´s
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
franco
Posts: 816
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: OposPosPrinter

Post by franco »

Daniel,
This seem to be a lot to print an ticket invoice. I do not understand any of what you are doing. I have many customers using starpos and I just install
star as a windows printer, port usb, set the security, give it a share name, drivers star drivers for the printer. Then I just use:

Code: Select all


	Procedure Printsmall
	*------------------------------------------------------------------------------*
	Local i ,lSuccess, pl:= 0, Page := 1, PR := ALLTRIM(Controls->prn1)    // prn1 = star share name or name
	Parameter DI
	DI:= .T.              //normanly sent from preceding program

	go top
		if  upper(di) = 'DIRECT'
			SELECT PRINTER PR TO LSUCCESS ;  //PREVIEW ;
			ORIENTATION	PRINTER_ORIENT_PORTRAIT ;  
			QUALITY	PRINTER_RES_MEDIUM 
		else
			SELECT PRINTER PR TO LSUCCESS PREVIEW;
			ORIENTATION	PRINTER_ORIENT_PORTRAIT ;  
			QUALITY	PRINTER_RES_MEDIUM
		endif
			If lSuccess <> .T.   //== .T.
				MsgInfo('Print Not Available')
				return
			EndIf
		
	// Measure Units Are Millimeters

	START PRINTDOC
	pl:=pl+5
	
	START PRINTPAGE
	pl:=pl+5
			@ pl,27-(len(alltrim(mco))/2)   print mco  ;                             // COMPANY INFORMATION
				 FONT "Arial" ;
				 SIZE 8 
			@ pl+4,27-(len(alltrim(mcoaddress))/2)  Print Mcoaddress SIZE 8 
			@ pl+8,27-(len(alltrim(mcomailing))/2)  Print Mcomailing SIZE 8
			@ pl+12,27-(len(alltrim(mcocity))/2) -(len(alltrim(mcoprovince))/2) ;
						Print trim(mcocity)+ '  '+ mcoprovince SIZE 8
			@ pl+16,27-(len(alltrim(mcopocode))/2)  Print Mcopocode + ;
			            space(18)+mcophone SIZE 8
			pl:=pl+24
		@ pl+4,5  Print 'Sold To: ' + customer->name FONT "Arial" SIZE 7                            // CUSTOMER INFORMATION

		if upper(type) = 'REPRINT'                                                                            // REPRINT POSTED INVOICE
			@ pl+8,5 Print  type + ':# ' + p_inv->inv  FONT "Arial" SIZE 7      //'Invoice #: '+invoice->inv
			@ pl+12,5 Print dtoc(p_inv->sal_dat)  FONT "Arial" SIZE 7
			@ pl+12,57 Print SUBSTR(TIME(),1,5)  FONT "Arial" SIZE 7
			@ pl+16,5 Print "Sales Per:  "  +  p_inv->sal_per  FONT "Arial" SIZE 7
			if len(alltrim(customer->ssno)) > 0
				@ pl+16, 52 print 'Pst#: '+customer->ssno FONT "Arial" SIZE 7 
			endif
			@ pl+20,5 print 'Pd.by: '+p_inv->payment  FONT "Arial" SIZE 7
			@ pl+24,5 print substr(p_inv->po_num,1,48)  FONT "Arial" SIZE 7
			pl:=pl+24
		else
			@ pl+8,5 Print  type + ':# ' + invoice->inv  FONT "Arial" SIZE 7          //  POST SALES INVOICE
			@ pl+12,5 Print dtoc(date())  FONT "Arial" SIZE 7
			@ pl+12,57 Print SUBSTR(TIME(),1,5)  FONT "Arial" SIZE 7 //82
			@ pl+16,5 Print "Sales Per:  "  +  pcode   FONT "Arial" SIZE 7
			if len(alltrim(customer->ssno)) > 0
				@ pl+16, 52 print 'Pst#: '+customer->ssno FONT "Arial" SIZE 7 
			endif
			if upper(type) = 'INVOICE'
				if mpay8 == ''
					mpay8:=mpay1
				endif
				@ pl+20,5 print 'Pd.by: ' +p_inv->payment  FONT "Arial" SIZE 7 //+mpay8
				@ pl+24,5 print substr(invoice->po_num,1,48)  FONT "Arial" SIZE 7
				pl:=pl+24
			else
				@ pl+20,5 print substr(invoice->po_num,1,48)  FONT "Arial" SIZE 7
				pl:=pl+20
			endif 
		endif
		@ pl+4,2 print 'Item                         Description    '+;  
				'                             Amount'  FONT "Arial" SIZE 7
		@ pl+8,1  Print Line TO pl+8,80 penwidth 0.1		//110	
		pl:=pl+6           //8
		go top
		do while ! eof()
			if eof()
				exit
			endif
			@ pl+4,1 print item FONT "Arial" SIZE 6 bold  //10
			@ pl+4,22 print desc FONT "Arial" SIZE 6 BOLD  //45
				@ pl+4,70 print val(str(qty*unit_price,10,2)) right  FONT "Arial" SIZE 7 //110
				pl:=pl+4

			if pl >= controls->invlines*4
				END PRINTPAGE
				START PRINTPAGE
				PL := -4
			endif
			skip
			loop
		enddo
			@ pl+4,1  Print Line TO pl+4,80 penwidth 0.1
			pl :=pl+2
			@ pl+4,38 Print 'Sub-Total:'  FONT "Arial" SIZE 7
			@ pl+4,70 Print Form_Grid_IN2.TEXT_1.VALUE right  FONT "Arial" SIZE 7
			@ pl+8,2 Print 'Gst#: '+controls->gst SIZE 7
			@ pl+8,40 Print 'Gst-Tax:'  FONT "Arial" SIZE 7
			@ pl+8,70 Print Form_Grid_IN2.TEXT_3.VALUE right  FONT "Arial" SIZE 7
		*	@ pl+16,10 Print controls->comment1  FONT "Arial" SIZE 7
			@ pl+12,40 Print 'Pst-Tax:'  FONT "Arial" SIZE 7
			@ pl+12,70 Print Form_Grid_IN2.TEXT_2.VALUE right  FONT "Arial" SIZE 7
		*	@ pl+16,10 Print controls->comment2
			@ pl+16,43 Print 'Total:'  FONT "Arial" SIZE 7
			if upper(type) = 'INVOICE'  
				@ pl+16,70 Print Ptotal right  FONT "Arial" SIZE 7
			else
				@ pl+16,70 Print Form_Grid_IN2.TEXT_4.VALUE right  FONT "Arial" SIZE 7
			endif
*memo
			pl := pl +24
			if file('mem\tape.mem')                                                         // I HAVE A MEMORY FILE TO PRINT AT BOTTOM OF INVOICE
				memfil=alltrim('mem\tape.mem')                                   // SPECIALS COMING UP.. MERRY CHRISTMAS AND SO ON
				mem_var = MEMOREAD(memfil)
				PL1 = MLCOUNT(mem_var,60)       //120
				IF PL1 > 3 //10 
					PL1 = 3 //10
				ENDIF
				FOR PL2 = 1 TO PL1
				PL3 = MEMOLINE(mem_var,60,PL2)     //120
				@ pl ,2 print PL3  FONT "Arial" SIZE 7
				pl:=pl+4
				NEXT 
				pl:=pl+4
			endif
			PL:=PL+20
			IF CONTROLS->CUTTER = 'S'
				@ PL,-5 PRINT CHR(27)+CHR(100)+CHR(01)
			ENDIF
			IF CONTROLS->CASHDRAWER = 'S'
				@ PL,-5 PRINT CHR(7)
			ENDIF

			
	END PRINTPAGE
			
	END PRINTDOC
return		
i LIKE TO HAVE A CONTROLS CUMPANY FILE WITH 1 RECORD TO SET VALUES TO BE PICKED THROUGHOUT THE PROGRAM.

I do not know if this makes sense but may help someone.
Franco
All The Best,
Franco
Canada
Post Reply