                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  VERSION =   3.00      dataenvironment      dataenvironment      Dataenvironment      KLeft = 104
Top = 35
Width = 314
Height = 483
Name = "Dataenvironment"
      cursor      cursor      Cursor1      Dataenvironment      Left = 10
Top = 20
Width = 90
Height = 261
Alias = "inv_head"
BufferModeOverride = 2
Order = "h_bname"
Database = ..\data\trackerdb.dbc
CursorSource = "inv_head"
Name = "Cursor1"
      cursor      cursor      Cursor2      Dataenvironment      Left = 150
Top = 20
Width = 90
Height = 237
Alias = "v_lineitemsforinvoice"
Database = ..\data\trackerdb.dbc
CursorSource = "v_lineitemsforinvoice"
NoDataOnLoad = .T.
Name = "Cursor2"
      3      1      t_form      ..\libs\t_base.vcx      form      frmInvoiceHeader      Height = 511
Width = 700
DoCreate = .T.
AutoCenter = .T.
Caption = "Invoicing"
WindowType = 1
ccurrentinvoice = 
cinvoicenumber = 
cprevioustable = 
Name = "frmInvoiceHeader"
     VPROCEDURE recalculateinvoicetotals
PRIVATE nTotalInvoiceAmount, nTotalConvertAmount


nTotalInvoiceAmount =  ThisForm.pgfInvoice.Page1.txtH_ttlinv.value + ;
						ThisForm.pgfInvoice.Page1.txtH_taxamount.value + ;
						ThisForm.pgfInvoice.Page1.txtH_serchg.value + ;
						ThisForm.pgfInvoice.Page1.txtH_shipchg.value

nTotalConvertAmount = ROUND((nTotalInvoiceAmount * ThisForm.pgfInvoice.Page1.txtH_convrat.value), 2)

ThisForm.pgfInvoice.Page1.txtH_totalextended.value = nTotalInvoiceAmount
ThisForm.pgfInvoice.Page1.txtH_ttlconvertamount.value = nTotalConvertAmount
														
*!*	REPLACE ALL inv_head.h_TotalExtended WITH nTotalInvoiceAmount FOR Inv_head.h_invnum = ThisForm.cInvoiceNumber
*!*	REPLACE ALL inv_head.h_TTLConvertAmount WITH nTotalConvertAmount FOR Inv_head.h_invnum = ThisForm.cInvoiceNumber
	

ENDPROC
PROCEDURE getnewheadertotals
PRIVATE nCurrentRecordNumber, nTotalLineAmount, cIndex, nCurrentRec

nTotalLineAmount = 0

*SUM Inv_data.d_linettl FOR ALLTRIM(Inv_data.d_invnum) == ALLTRIM(Thisform.cInvoiceNumber) TO nTotalLineAmount
SUM v_LineItemsForInvoice.d_linettl FOR ALLTRIM(Inv_data.d_invnum) = "A00AA0054S" TO nTotalLineAmount
SUM v_LineItemsForInvoice.d_linettl TO nTotalLineAmount


REPLACE ALL inv_head.h_ttlinv WITH nTotalLineAmount FOR Inv_head.h_invnum = ThisForm.cInvoiceNumber

thisform.RecalculateLineItems(nTotalLineAmount)

ENDPROC
PROCEDURE recalculatelineitems
PARAMETER nLineTotal
PRIVATE nTotalInvoiceAmount, nTotalConvertAmount

*!*	nTotalInvoiceAmount = ThisForm.pgfInvoice.Page1.txtH_ttlinv.value + ;
*!*							ThisForm.pgfInvoice.Page1.txtH_taxamount.value + ;
*!*							ThisForm.pgfInvoice.Page1.txtH_serchg.value + ;
*!*							ThisForm.pgfInvoice.Page1.txtH_shipchg.value
nTotalInvoiceAmount = nLineTotal + ;
						ThisForm.pgfInvoice.Page1.txtH_taxamount.value + ;
						ThisForm.pgfInvoice.Page1.txtH_serchg.value + ;
						ThisForm.pgfInvoice.Page1.txtH_shipchg.value

nTotalConvertAmount = ROUND((nTotalInvoiceAmount * ThisForm.pgfInvoice.Page1.txtH_convrat.value), 4)

*!*	ThisForm.pgfInvoice.Page1.txtH_totalextended.value = nTotalInvoiceAmount
*!*	ThisForm.pgfInvoice.Page1.txtH_ttlconvertamount.value = nTotalConvertAmount
														
REPLACE ALL inv_head.h_TotalExtended WITH nTotalInvoiceAmount FOR Inv_head.h_invnum = ThisForm.cInvoiceNumber
REPLACE ALL inv_head.h_TTLConvertAmount WITH nTotalConvertAmount FOR Inv_head.h_invnum = ThisForm.cInvoiceNumber
	
thisform.refresh
ENDPROC
PROCEDURE Resize
thisform.sizer.frmresize()
ENDPROC
PROCEDURE Init
DODEFAULT()

thisform.cCurrentTable = 'Inv_head'
Select (thisform.cCurrentTable)

thisform.cInvoiceNumber = Inv_head.h_invnum

IF TYPE("oUser.cName") = 'C'
	IF ALLTRIM(oUser.cUserLevel) = "Read Only"
		thisform.lIsReadOnly = .T.
		ThisForm.cmdButtons.cmdPrint.visible 	= .F.
		ThisForm.cmdButtons.CMDADD.visible 		= .F.
		ThisForm.cmdButtons.cmdEdit.visible 	= .F.
		ThisForm.cmdButtons.cmdDelete.visible 	= .F.
		ThisForm.pgfInvoice.Page1.cmdCopy.visible = .F.		
	ELSE
		thisform.lIsReadOnly = .F.
	ENDIF
ELSE
	thisform.lIsReadOnly = .F.
ENDIF


ENDPROC
     1                              -k   %                          U    T       U  THIS	 UOLDVALUE VALUE  %        %      k : T                       T         , T                 U	  THIS	 UOLDVALUE VALUE PARENT	 TXTD_DISC TXTD_NETPRICE	 TXTD_LIST TXTD_LINETTL TXTD_QTY GotFocus,     	 LostFocus^     1 12 q A A 1                       /         O         )                                                        S   %   k                       U    T       U  THIS	 UOLDVALUE VALUE  %        %      _ . T                   T         , T                 U  THIS	 UOLDVALUE VALUE PARENT	 TXTD_DISC TXTD_NETPRICE TXTD_LINETTL TXTD_QTY GotFocus,     	 LostFocus^     1 12 q A A 1                       /         O         )                              o  o                        _   %                           U  D  %      = & T               U  THIS	 UOLDVALUE VALUE PARENT TXTD_LINETTL TXTD_NETPRICE  T       U  THIS	 UOLDVALUE VALUE	 LostFocus,      GotFocus     1 qaA 2 11                                          )   o                        label      Alignment = 1
Caption = "Start date"
Height = 17
Left = 115
Top = 271
Width = 115
TabIndex = 21
Name = "lblD_subdate2"
      !frmInvoiceHeader.pgfInvoice.Page4      ..\libs\t_base.vcx      t_label      Alignment = 1
Caption = "Invoice Number"
Height = 17
Left = 115
Top = 239
Width = 115
TabIndex = 19
Name = "lblD_linvnum"
      cArial, 0, 9, 5, 15, 12, 32, 3, 0
Arial, 0, 8, 5, 14, 11, 30, 3, 0
Arial, 1, 8, 5, 14, 11, 29, 3, 0
      kTop = 497
Left = 686
Name = "SIZER"
lblhighlight.Name = "lblhighlight"
lblshading.Name = "lblshading"
      ccurrentinvoice
cinvoicenumber
lrequerysales
noldlinetotal
cprevioustable
*getinvoicetotals 
*recalculateinvoicetotals 
*getnewheadertotals 
*recalculatelineitems 
      t_pageframe      ..\libs\t_base.vcx      	pageframe      
pgfInvoice      frmInvoiceHeader     QErasePage = .T.
PageCount = 4
Top = 0
Left = 0
Width = 700
Height = 480
TabIndex = 1
Name = "pgfInvoice"
Page1.Caption = "Invoice Header"
Page1.Name = "Page1"
Page2.Caption = "Invoice List"
Page2.Name = "Page2"
Page3.Caption = "Line Item List"
Page3.Name = "Page3"
Page4.Caption = "Line Item Detail"
Page4.Name = "Page4"
     
PROCEDURE Page1.Activate
DODEFAULT()

thisform.cCurrentTable = "Inv_head"
IF thisform.cPreviousTable <> thisform.cCurrentTable
	select (thisform.cCurrentTable)
	* This tells the command buttons what work area is selected
	ThisForm.cmdButtons.nWorkarea = SELECT()
	*Refresh the navigation buttons
	thisform.cmdButtons.TopFile = .F.
	thisform.cmdButtons.EndFile = .F.
	ThisForm.cmdButtons.NavRefresh()
ENDIF

Thisform.cInvoiceNumber = inv_head.h_invnum

* We only allow editing on pages without a grid
IF !thisform.lIsReadOnly
	ThisForm.cmdButtons.cmdEdit.visible = .T.
ENDIF

thisform.lRequerySales = .T.

thisform.refresh
ENDPROC
PROCEDURE Page1.Init
thisform.cInvoiceNumber = Inv_head.h_invnum

ENDPROC
PROCEDURE Page2.Deactivate
dodefault()
thisform.cInvoiceNumber = inv_head.h_invnum

ENDPROC
PROCEDURE Page2.Activate
DODEFAULT()

thisform.cCurrentTable = "Inv_head"
IF thisform.cPreviousTable <> thisform.cCurrentTable
	select (thisform.cCurrentTable)
	* This tells the command buttons what work area is selected
	ThisForm.cmdButtons.nWorkarea = SELECT()
	*Refresh the navigation buttons
	thisform.cmdButtons.TopFile = .F.
	thisform.cmdButtons.EndFile = .F.
	ThisForm.cmdButtons.NavRefresh()
ENDIF

* We only allow editing on pages without a grid
ThisForm.cmdButtons.cmdEdit.visible = .F.

thisform.lRequerySales = .T.

thisform.refresh
ENDPROC
PROCEDURE Page3.Activate
DODEFAULT()

thisform.cCurrentTable = 'v_LineItemsForInvoice'
IF thisform.cPreviousTable <> thisform.cCurrentTable
	select (thisform.cCurrentTable)
	* This tells the command buttons what work area is selected
	ThisForm.cmdButtons.nWorkarea = SELECT()
	*Refresh the navigation buttons
	thisform.cmdButtons.TopFile = .F.
	thisform.cmdButtons.EndFile = .F.
	ThisForm.cmdButtons.NavRefresh()
ENDIF

REQUERY(thisform.cCurrentTable)
thisform.lRequerySales = .F.

This.refresh()

* We only allow editing on pages without a grid
ThisForm.cmdButtons.cmdEdit.visible = .F.
ENDPROC
PROCEDURE Page4.Activate
DODEFAULT()
thisform.cCurrentTable = 'v_LineItemsForInvoice'
IF thisform.cPreviousTable <> thisform.cCurrentTable
	select (thisform.cCurrentTable)
	* This tells the command buttons what work area is selected
	ThisForm.cmdButtons.nWorkarea = SELECT()
	*Refresh the navigation buttons
	thisform.cmdButtons.TopFile = .F.
	thisform.cmdButtons.EndFile = .F.
	ThisForm.cmdButtons.NavRefresh()
ENDIF

IF thisform.lRequerySales
	REQUERY(thisform.cCurrentTable)
	thisform.lRequerySales = .F.
ENDIF
This.refresh()

* We only allow editing on pages without a grid
IF !thisform.lIsReadOnly
	ThisForm.cmdButtons.cmdEdit.visible = .T.
ENDIF
ENDPROC
                                   L   %   A           P            U   %C     7  T            %C     r  T            %C       T            %C   	    T   	     
    %C     # T            %C     ^ T            %C      T            %C      T            %C      T            U  THIS PARENT
 TXTH_BNAME VALUE
 TXTH_SNAME TXTH_BCONTAC TXTH_SCONTAC TXTH_BADDR1 TXTH_SADDR1 TXTH_BADDR2 TXTH_SADDR2 TXTH_BADDR3 TXTH_SADDR3
 TXTH_BCITY
 TXTH_SCITY TXTH_BSTATE TXTH_SSTATE	 TXTH_BZIP	 TXTH_SZIP TXTH_BCOUNTY TXTH_SCOUNTY Click,     1 A A A A A A A A A 2                       L      )                          k    R  R                        H   %                             U    T       U  THIS	 UOLDVALUE VALUE(  %      ! 
     U  THIS	 UOLDVALUE VALUE THISFORM RECALCULATEINVOICETOTALS GotFocus,     	 LostFocus^     1 12 q A 1                       /         O          )   R                                                     r   %         J     <            U    T       U  THIS	 UOLDVALUE VALUEM  %      F / T     C        T  U	  THIS	 UOLDVALUE VALUE THISFORM
 PGFINVOICE PAGE1 TXTH_TTLCONVERTAMOUNT PARENT TXTH_TOTALEXTENDED GotFocus,     	 LostFocus^     1 12 qA 1                       /         O          )                           !frmInvoiceHeader.pgfInvoice.Page4      lblD_linvnum      label      ..\libs\t_base.vcx      frmInvoiceHeader      SIZER      control      ..\libs\resize.vcx      sizer      frmInvoiceHeader      
cmdButtons      	container      ..\libs\t_basicbtns.vcx      t_basictxtbtns      !frmInvoiceHeader.pgfInvoice.Page4      	t_textbox      ..\libs\t_base.vcx      textbox      	txtH_note      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_note"
Height = 48
Left = 467
MaxLength = 150
TabIndex = 39
Top = 390
Width = 200
Name = "txtH_note"
      t_shape      ..\libs\t_base.vcx      shape      T_shape1      !frmInvoiceHeader.pgfInvoice.Page1      kTop = 9
Left = 455
Height = 146
Width = 221
BackStyle = 1
BackColor = 128,255,255
Name = "T_shape1"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_invnum      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_invnum"
Enabled = .T.
Height = 19
Left = 565
MaxLength = 20
TabIndex = 27
Top = 16
Width = 98
Name = "txtH_invnum"
      t_label      ..\libs\t_base.vcx      label      lblH_invnum      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Invoice Number"
Height = 19
Left = 466
Top = 16
Width = 90
TabIndex = 41
Name = "lblH_invnum"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_acctno      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_acctno"
Height = 19
Left = 565
MaxLength = 7
TabIndex = 28
Top = 35
Width = 58
Name = "txtH_acctno"
      t_label      ..\libs\t_base.vcx      label      lblH_acctno      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Account number"
Height = 19
Left = 466
Top = 35
Width = 90
TabIndex = 44
Name = "lblH_acctno"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_taxrate      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_taxrate"
Height = 19
Left = 538
TabIndex = 36
Top = 213
Width = 41
Name = "txtH_taxrate"
     PROCEDURE GotFocus
this.uoldvalue = this.value
ENDPROC
PROCEDURE LostFocus
IF this.uOldValue <> this.value
	This.Parent.txtH_taxamount.value = ROUND((This.value / 100) * this.parent.txtH_ttlinv.value, 2)
	thisform.RecalculateInvoiceTotals
ENDIF
ENDPROC
                                   W   %         P     @            U    T       U  THIS	 UOLDVALUE VALUEX  %      Q 0 T     C   d     T
     U  THIS	 UOLDVALUE VALUE PARENT TXTH_TAXAMOUNT TXTH_TTLINV THISFORM RECALCULATEINVOICETOTALS GotFocus,     	 LostFocus^     1 12 q A 1                       /         O          )                           t_label      ..\libs\t_base.vcx      label      lblH_taxrate      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Tax rate"
Height = 19
Left = 451
Top = 216
Width = 80
TabIndex = 45
Name = "lblH_taxrate"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_shipchg      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_shipchg"
Height = 19
Left = 586
TabIndex = 35
Top = 193
Width = 90
Name = "txtH_shipchg"
     PROCEDURE GotFocus
this.uoldvalue = this.value
ENDPROC
PROCEDURE LostFocus
IF this.uOldValue <> this.value
	This.Parent.txtH_taxamount.value = ROUND((This.Parent.txtH_taxrate.value / 100) * this.parent.txtH_ttlinv.value, 2)
	thisform.RecalculateInvoiceTotals
ENDIF
ENDPROC
     xTop = 484
Left = 75
Height = 24
TabIndex = 2
Name = "cmdButtons"
cmdTop.Name = "cmdTop"
cmdPrev.Name = "cmdPrev"
cmdNext.Name = "cmdNext"
cmdEnd.Name = "cmdEnd"
cmdFind.Name = "cmdFind"
cmdPrint.Visible = .F.
cmdPrint.Name = "cmdPrint"
cmdAdd.Visible = .F.
cmdAdd.Name = "cmdAdd"
cmdEdit.Name = "cmdEdit"
cmdDelete.Name = "cmdDelete"
cmdExit.Name = "cmdExit"
      txtD_salesid      textbox      ..\libs\t_base.vcx      	t_textbox      textbox      t_label      ..\libs\t_base.vcx      label      lblH_shipchg      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Shipping charge"
Height = 19
Left = 450
Top = 196
Width = 80
TabIndex = 47
Name = "lblH_shipchg"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_convrat      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_convrat"
Height = 19
Left = 586
TabIndex = 38
Top = 293
Width = 90
Name = "txtH_convrat"
      PROCEDURE GotFocus
this.uoldvalue = this.value
ENDPROC
PROCEDURE LostFocus
IF this.uOldValue <> this.value
	ThisForm.pgfInvoice.Page1.txtH_ttlconvertamount.value = ROUND((This.Parent.txtH_totalextended.value * This.value), 2)
ENDIF
ENDPROC
      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_salesid"
Enabled = .F.
Height = 23
Left = 235
MaxLength = 8
TabIndex = 38
Top = 370
Width = 68
Name = "txtD_salesid"
      Comment = ""
FontBold = .F.
ControlSource = "v_lineitemsforinvoice.d_invnum"
Enabled = .T.
Height = 23
Left = 235
MaxLength = 20
TabIndex = 36
Top = 236
Width = 148
Name = "txtD_invnum"
      !frmInvoiceHeader.pgfInvoice.Page4      t_label      ..\libs\t_base.vcx      label      lblH_convrat      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
BackStyle = 0
Caption = "Conversion rate"
Height = 19
Left = 450
Top = 296
Width = 80
TabIndex = 49
Name = "lblH_convrat"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_convcty      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_convcty"
Height = 19
Left = 565
MaxLength = 3
TabIndex = 30
Top = 54
Width = 33
Name = "txtH_convcty"
      t_label      ..\libs\t_base.vcx      label      lblH_convcty      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Conversion country"
Height = 19
Left = 462
Top = 54
Width = 95
TabIndex = 50
Name = "lblH_convcty"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_serchg      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_serchg"
Height = 19
Left = 586
TabIndex = 37
Top = 233
Width = 90
Name = "txtH_serchg"
      PROCEDURE GotFocus
this.uoldvalue = this.value
ENDPROC
PROCEDURE LostFocus
IF this.uOldValue <> this.value
	thisform.RecalculateInvoiceTotals
ENDIF
ENDPROC
      txtD_invnum      ..\libs\t_base.vcx      	t_textbox      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_startdt"
Enabled = .F.
Height = 23
Left = 235
TabIndex = 34
Top = 268
Width = 71
Name = "txtD_startdt"
      !frmInvoiceHeader.pgfInvoice.Page4      txtD_startdt      textbox      ..\libs\t_base.vcx      	t_textbox      t_label      ..\libs\t_base.vcx      label      lblH_serchg      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Service charge"
Height = 19
Left = 450
Top = 236
Width = 80
TabIndex = 53
Name = "lblH_serchg"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_remitto      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_remitto"
Height = 19
Left = 565
MaxLength = 3
TabIndex = 31
Top = 73
Width = 33
Name = "txtH_remitto"
      t_label      ..\libs\t_base.vcx      label      lblH_remitto      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Remit to"
Height = 19
Left = 466
Top = 73
Width = 90
TabIndex = 54
Name = "lblH_remitto"
      	t_textbox      ..\libs\t_base.vcx      textbox      
txtH_ponum      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_ponum"
Height = 19
Left = 565
MaxLength = 13
TabIndex = 32
Top = 92
Width = 100
Name = "txtH_ponum"
      t_label      ..\libs\t_base.vcx      label      
lblH_ponum      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "PO Number"
Height = 19
Left = 466
Top = 92
Width = 90
TabIndex = 56
Name = "lblH_ponum"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_invcode      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_invcode"
Height = 19
Left = 565
MaxLength = 2
TabIndex = 33
Top = 111
Width = 28
Name = "txtH_invcode"
      t_label      ..\libs\t_base.vcx      label      lblH_invcode      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Invoice code"
Height = 19
Left = 466
Top = 111
Width = 90
TabIndex = 58
Name = "lblH_invcode"
      	t_textbox      ..\libs\t_base.vcx      textbox      
txtH_cu_id      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_cu_id"
Height = 19
Left = 565
MaxLength = 10
TabIndex = 34
Top = 130
Width = 79
Name = "txtH_cu_id"
      t_label      ..\libs\t_base.vcx      label      
lblH_cu_id      !frmInvoiceHeader.pgfInvoice.Page1      FontSize = 8
Alignment = 1
Caption = "Customer ID"
Height = 19
Left = 466
Top = 130
Width = 90
TabIndex = 60
BackColor = 192,192,192
Name = "lblH_cu_id"
      t_commandbutton      ..\libs\t_base.vcx      commandbutton      cmdCopy      !frmInvoiceHeader.pgfInvoice.Page1      xTop = 347
Left = 467
Height = 22
Width = 204
Caption = "Copy Shipping to Billing"
TabIndex = 40
Name = "cmdCopy"
     WPROCEDURE Click
* Copy the Shipping address to billing if billing line is empty
IF EMPTY(This.Parent.txth_bname.value)
	This.Parent.txth_bname.value = This.Parent.txth_sname.value
ENDIF

IF EMPTY(This.Parent.txth_bcontac.value)
	This.Parent.txth_bcontac.value = This.Parent.txth_scontac.value
ENDIF

IF EMPTY(This.Parent.txth_baddr1.value)
	This.Parent.txth_baddr1.value = This.Parent.txth_saddr1.value
ENDIF

IF EMPTY(This.Parent.txth_baddr2.value)
	This.Parent.txth_baddr2.value = This.Parent.txth_saddr2.value
ENDIF

IF EMPTY(This.Parent.txth_baddr3.value)
	This.Parent.txth_baddr3.value = This.Parent.txth_saddr3.value
ENDIF

IF EMPTY(This.Parent.txth_bCity.value)
	This.Parent.txth_bCity.value = This.Parent.txth_sCity.value
ENDIF

IF EMPTY(This.Parent.txth_bState.value)
	This.Parent.txth_bState.value = This.Parent.txth_sState.value
ENDIF

IF EMPTY(This.Parent.txth_bZip.value)
	This.Parent.txth_bZip.value = This.Parent.txth_sZip.value
ENDIF

IF EMPTY(This.Parent.txth_bCounty.value)
	This.Parent.txth_bCounty.value = This.Parent.txth_sCounty.value
ENDIF

ENDPROC
      Alignment = 1
Caption = "Last Invoice date"
Height = 17
Left = 405
Top = 305
Width = 100
TabIndex = 31
Name = "lblD_linvdt"
      !frmInvoiceHeader.pgfInvoice.Page4      lblD_linvdt      label      ..\libs\t_base.vcx      t_label      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_linvdt"
Enabled = .F.
Height = 23
Left = 510
TabIndex = 32
Top = 302
Width = 71
Name = "txtD_linvdt"
      !frmInvoiceHeader.pgfInvoice.Page4      txtD_linvdt      textbox      ..\libs\t_base.vcx      	t_textbox      zAlignment = 1
Caption = "End date"
Height = 17
Left = 405
Top = 271
Width = 100
TabIndex = 29
Name = "lblD_enddt"
      !frmInvoiceHeader.pgfInvoice.Page4      
lblD_enddt      label      ..\libs\t_base.vcx      t_label      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_enddt"
Enabled = .F.
Height = 23
Left = 510
TabIndex = 30
Top = 268
Width = 71
Name = "txtD_enddt"
      
txtD_enddt      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_region      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_region"
Height = 19
Left = 642
MaxLength = 1
TabIndex = 29
Top = 35
Width = 21
Name = "txtH_region"
      t_shape      ..\libs\t_base.vcx      shape      T_shape2      !frmInvoiceHeader.pgfInvoice.Page1      [Top = 9
Left = 24
Height = 146
Width = 404
BackColor = 128,255,255
Name = "T_shape2"
      t_shape      ..\libs\t_base.vcx      shape      T_shape3      !frmInvoiceHeader.pgfInvoice.Page1      ]Top = 162
Left = 24
Height = 146
Width = 404
BackColor = 128,255,255
Name = "T_shape3"
      t_shape      ..\libs\t_base.vcx      shape      T_shape4      !frmInvoiceHeader.pgfInvoice.Page1      ]Top = 316
Left = 24
Height = 126
Width = 404
BackColor = 128,255,255
Name = "T_shape4"
      	t_textbox      ..\libs\t_base.vcx      textbox      
txtH_sname      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
BackStyle = 1
ControlSource = "inv_head.h_sname"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 1
Top = 16
Width = 288
BackColor = 255,255,255
IntegralHeight = .F.
Name = "txtH_sname"
      t_label      ..\libs\t_base.vcx      label      
lblH_sname      !frmInvoiceHeader.pgfInvoice.Page1      rFontSize = 8
Caption = "Name"
Height = 19
Left = 38
Top = 18
Width = 36
TabIndex = 42
Name = "lblH_sname"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_saddr1      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_saddr1"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 2
Top = 35
Width = 288
Name = "txtH_saddr1"
      t_label      ..\libs\t_base.vcx      label      lblH_saddr1      !frmInvoiceHeader.pgfInvoice.Page1      vFontSize = 8
Caption = "Address"
Height = 19
Left = 37
Top = 36
Width = 48
TabIndex = 43
Name = "lblH_saddr1"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_saddr2      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_saddr2"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 3
Top = 54
Width = 288
Name = "txtH_saddr2"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_saddr3      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_saddr3"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 4
Top = 73
Width = 288
Name = "txtH_saddr3"
      	t_textbox      ..\libs\t_base.vcx      textbox      
txtH_scity      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_scity"
Height = 19
Left = 86
MaxLength = 20
TabIndex = 5
Top = 92
Width = 148
Name = "txtH_scity"
      t_label      ..\libs\t_base.vcx      label      
lblH_scity      !frmInvoiceHeader.pgfInvoice.Page1      rFontSize = 8
Caption = "City"
Height = 19
Left = 37
Top = 92
Width = 22
TabIndex = 46
Name = "lblH_scity"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_sstate      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_sstate"
Format = "!"
Height = 19
Left = 275
MaxLength = 3
TabIndex = 6
Top = 92
Width = 33
Name = "txtH_sstate"
      t_label      ..\libs\t_base.vcx      label      lblH_sstate      !frmInvoiceHeader.pgfInvoice.Page1      uFontSize = 8
Caption = "State"
Height = 19
Left = 237
Top = 93
Width = 30
TabIndex = 48
Name = "lblH_sstate"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_scounty      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_scounty"
Height = 19
Left = 86
MaxLength = 20
TabIndex = 8
Top = 111
Width = 148
Name = "txtH_scounty"
      t_label      ..\libs\t_base.vcx      label      lblH_scounty      !frmInvoiceHeader.pgfInvoice.Page1      xFontSize = 8
Caption = "Country"
Height = 19
Left = 37
Top = 112
Width = 44
TabIndex = 51
Name = "lblH_scounty"
      	t_textbox      ..\libs\t_base.vcx      textbox      	txtH_szip      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_szip"
Format = "!"
Height = 19
Left = 338
MaxLength = 10
TabIndex = 7
Top = 92
Width = 79
Name = "txtH_szip"
      t_label      ..\libs\t_base.vcx      label      	lblH_szip      !frmInvoiceHeader.pgfInvoice.Page1      qFontSize = 8
Caption = "Zip"
Height = 19
Left = 311
Top = 93
Width = 19
TabIndex = 52
Name = "lblH_szip"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_scontac      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_scontac"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 9
Top = 130
Width = 288
Name = "txtH_scontac"
      t_label      ..\libs\t_base.vcx      label      lblH_scontac      !frmInvoiceHeader.pgfInvoice.Page1      xFontSize = 8
Caption = "Contact"
Height = 19
Left = 37
Top = 131
Width = 44
TabIndex = 55
Name = "lblH_scontac"
      	t_textbox      ..\libs\t_base.vcx      textbox      
txtH_bname      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_bname"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 10
Top = 169
Width = 288
Name = "txtH_bname"
      t_label      ..\libs\t_base.vcx      label      
lblH_bname      !frmInvoiceHeader.pgfInvoice.Page1      sFontSize = 8
Caption = "Name"
Height = 19
Left = 37
Top = 168
Width = 36
TabIndex = 57
Name = "lblH_bname"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_baddr1      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_baddr1"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 11
Top = 188
Width = 288
Name = "txtH_baddr1"
      t_label      ..\libs\t_base.vcx      label      lblH_baddr1      !frmInvoiceHeader.pgfInvoice.Page1      wFontSize = 8
Caption = "Address"
Height = 19
Left = 37
Top = 190
Width = 48
TabIndex = 59
Name = "lblH_baddr1"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_baddr2      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_baddr2"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 12
Top = 207
Width = 288
Name = "txtH_baddr2"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_baddr3      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_baddr3"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 13
Top = 226
Width = 288
Name = "txtH_baddr3"
      	t_textbox      ..\libs\t_base.vcx      textbox      
txtH_bcity      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_bcity"
Height = 19
Left = 86
MaxLength = 20
TabIndex = 14
Top = 245
Width = 148
Name = "txtH_bcity"
      t_label      ..\libs\t_base.vcx      label      
lblH_bcity      !frmInvoiceHeader.pgfInvoice.Page1      sFontSize = 8
Caption = "City"
Height = 19
Left = 37
Top = 245
Width = 22
TabIndex = 61
Name = "lblH_bcity"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_bstate      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_bstate"
Format = "!"
Height = 19
Left = 275
MaxLength = 3
TabIndex = 15
Top = 245
Width = 33
Name = "txtH_bstate"
      t_label      ..\libs\t_base.vcx      label      lblH_bstate      !frmInvoiceHeader.pgfInvoice.Page1      vFontSize = 8
Caption = "State"
Height = 19
Left = 237
Top = 248
Width = 30
TabIndex = 62
Name = "lblH_bstate"
      	t_textbox      ..\libs\t_base.vcx      textbox      	txtH_bzip      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_bzip"
Format = "!"
Height = 19
Left = 338
MaxLength = 10
TabIndex = 16
Top = 245
Width = 79
Name = "txtH_bzip"
      t_label      ..\libs\t_base.vcx      label      	lblH_bzip      !frmInvoiceHeader.pgfInvoice.Page1      rFontSize = 8
Caption = "Zip"
Height = 19
Left = 311
Top = 248
Width = 19
TabIndex = 63
Name = "lblH_bzip"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_bcontac      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_bcontac"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 18
Top = 283
Width = 288
Name = "txtH_bcontac"
      t_label      ..\libs\t_base.vcx      label      lblH_bcontac      !frmInvoiceHeader.pgfInvoice.Page1      xFontSize = 8
Caption = "Contact"
Height = 19
Left = 37
Top = 287
Width = 44
TabIndex = 64
Name = "lblH_bcontac"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_bcounty      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_bcounty"
Height = 19
Left = 86
MaxLength = 20
TabIndex = 17
Top = 264
Width = 148
Name = "txtH_bcounty"
      t_label      ..\libs\t_base.vcx      label      lblH_bcounty      !frmInvoiceHeader.pgfInvoice.Page1      xFontSize = 8
Caption = "Country"
Height = 19
Left = 34
Top = 264
Width = 44
TabIndex = 65
Name = "lblH_bcounty"
      	t_textbox      ..\libs\t_base.vcx      textbox      
txtH_rname      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_rname"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 19
Top = 323
Width = 288
Name = "txtH_rname"
      t_label      ..\libs\t_base.vcx      label      
lblH_rname      !frmInvoiceHeader.pgfInvoice.Page1      sFontSize = 8
Caption = "Name"
Height = 19
Left = 37
Top = 325
Width = 36
TabIndex = 66
Name = "lblH_rname"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_raddr1      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_raddr1"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 20
Top = 342
Width = 288
Name = "txtH_raddr1"
      t_label      ..\libs\t_base.vcx      label      lblH_raddr1      !frmInvoiceHeader.pgfInvoice.Page1      wFontSize = 8
Caption = "Address"
Height = 19
Left = 37
Top = 344
Width = 48
TabIndex = 67
Name = "lblH_raddr1"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_raddr2      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_raddr2"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 21
Top = 361
Width = 288
Name = "txtH_raddr2"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_raddr3      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_raddr3"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 22
Top = 380
Width = 288
Name = "txtH_raddr3"
      	t_textbox      ..\libs\t_base.vcx      textbox      
txtH_rcity      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_rcity"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 23
Top = 399
Width = 144
Name = "txtH_rcity"
      t_label      ..\libs\t_base.vcx      label      
lblH_rcity      !frmInvoiceHeader.pgfInvoice.Page1      sFontSize = 8
Caption = "City"
Height = 19
Left = 37
Top = 402
Width = 22
TabIndex = 71
Name = "lblH_rcity"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_rstate      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_rstate"
Format = "!"
Height = 19
Left = 275
MaxLength = 3
TabIndex = 24
Top = 399
Width = 33
Name = "txtH_rstate"
      t_label      ..\libs\t_base.vcx      label      lblH_rstate      !frmInvoiceHeader.pgfInvoice.Page1      vFontSize = 8
Caption = "State"
Height = 19
Left = 237
Top = 402
Width = 30
TabIndex = 75
Name = "lblH_rstate"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtH_rcounty      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_rcounty"
Height = 19
Left = 86
MaxLength = 40
TabIndex = 26
Top = 418
Width = 144
Name = "txtH_rcounty"
      t_label      ..\libs\t_base.vcx      label      lblH_rcounty      !frmInvoiceHeader.pgfInvoice.Page1      xFontSize = 8
Caption = "Country"
Height = 19
Left = 33
Top = 421
Width = 44
TabIndex = 77
Name = "lblH_rcounty"
      	t_textbox      ..\libs\t_base.vcx      textbox      	txtH_rzip      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_rzip"
Height = 19
Left = 338
MaxLength = 10
TabIndex = 25
Top = 399
Width = 79
Name = "txtH_rzip"
      t_label      ..\libs\t_base.vcx      label      	lblH_rzip      !frmInvoiceHeader.pgfInvoice.Page1      rFontSize = 8
Caption = "Zip"
Height = 19
Left = 311
Top = 402
Width = 19
TabIndex = 79
Name = "lblH_rzip"
      t_label      ..\libs\t_base.vcx      label      T_label1      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "S"
Left = 10
Top = 18
Width = 10
TabIndex = 68
Name = "T_label1"
      t_label      ..\libs\t_base.vcx      label      T_label2      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "h"
Left = 10
Top = 33
Width = 10
TabIndex = 69
Name = "T_label2"
      t_label      ..\libs\t_base.vcx      label      T_label3      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "i"
Left = 10
Top = 49
Width = 10
TabIndex = 70
Name = "T_label3"
      t_label      ..\libs\t_base.vcx      label      T_label4      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "p"
Left = 10
Top = 67
Width = 10
TabIndex = 72
Name = "T_label4"
      t_label      ..\libs\t_base.vcx      label      T_label5      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "p"
Left = 10
Top = 84
Width = 10
TabIndex = 73
Name = "T_label5"
      t_label      ..\libs\t_base.vcx      label      T_label6      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "i"
Left = 10
Top = 101
Width = 10
TabIndex = 74
Name = "T_label6"
      t_label      ..\libs\t_base.vcx      label      T_label7      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "n"
Left = 10
Top = 116
Width = 10
TabIndex = 76
Name = "T_label7"
      t_label      ..\libs\t_base.vcx      label      T_label8      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "g"
Left = 10
Top = 132
Width = 10
TabIndex = 78
Name = "T_label8"
      t_line      ..\libs\t_base.vcx      line      T_line9      !frmInvoiceHeader.pgfInvoice.Page1      mBorderStyle = 1
Height = 0
Left = 25
Top = 154
Width = 403
BorderColor = 255,255,255
Name = "T_line9"
      t_line      ..\libs\t_base.vcx      line      T_line11      !frmInvoiceHeader.pgfInvoice.Page1      ]Height = 145
Left = 427
Top = 10
Width = 0
BorderColor = 255,255,255
Name = "T_line11"
      t_label      ..\libs\t_base.vcx      label      T_label9      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "B"
Left = 10
Top = 176
Width = 10
TabIndex = 80
Name = "T_label9"
      t_label      ..\libs\t_base.vcx      label      	T_label10      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "i"
Left = 10
Top = 191
Width = 10
TabIndex = 81
Name = "T_label10"
      t_label      ..\libs\t_base.vcx      label      	T_label11      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "l"
Left = 10
Top = 207
Width = 10
TabIndex = 82
Name = "T_label11"
      t_label      ..\libs\t_base.vcx      label      	T_label12      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "l"
Left = 10
Top = 223
Width = 10
TabIndex = 83
Name = "T_label12"
      t_label      ..\libs\t_base.vcx      label      	T_label13      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "i"
Left = 10
Top = 239
Width = 10
TabIndex = 84
Name = "T_label13"
      t_label      ..\libs\t_base.vcx      label      	T_label14      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "n"
Left = 10
Top = 255
Width = 10
TabIndex = 85
Name = "T_label14"
      t_label      ..\libs\t_base.vcx      label      	T_label15      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "g"
Left = 10
Top = 270
Width = 10
TabIndex = 86
BackColor = 0,0,0
Name = "T_label15"
      t_label      ..\libs\t_base.vcx      label      	T_label16      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "R"
Left = 10
Top = 322
Width = 10
TabIndex = 87
Name = "T_label16"
      t_label      ..\libs\t_base.vcx      label      	T_label17      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "e"
Left = 10
Top = 337
Width = 10
TabIndex = 88
Name = "T_label17"
      t_label      ..\libs\t_base.vcx      label      	T_label18      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "m"
Left = 10
Top = 352
Width = 11
TabIndex = 89
Name = "T_label18"
      t_label      ..\libs\t_base.vcx      label      	T_label19      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "i"
Left = 10
Top = 367
Width = 10
TabIndex = 90
Name = "T_label19"
      t_label      ..\libs\t_base.vcx      label      	T_label20      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "t"
Left = 10
Top = 382
Width = 10
TabIndex = 91
Name = "T_label20"
      t_label      ..\libs\t_base.vcx      label      	T_label21      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "t"
Left = 10
Top = 401
Width = 10
TabIndex = 92
Name = "T_label21"
      t_label      ..\libs\t_base.vcx      label      	T_label22      !frmInvoiceHeader.pgfInvoice.Page1      FontBold = .T.
FontSize = 8
Alignment = 2
Caption = "o"
Left = 10
Top = 416
Width = 10
TabIndex = 93
Name = "T_label22"
      t_line      ..\libs\t_base.vcx      line      T_line1      !frmInvoiceHeader.pgfInvoice.Page1      mBorderStyle = 1
Height = 0
Left = 25
Top = 307
Width = 403
BorderColor = 255,255,255
Name = "T_line1"
      t_line      ..\libs\t_base.vcx      line      T_line2      !frmInvoiceHeader.pgfInvoice.Page1      ]Height = 145
Left = 427
Top = 163
Width = 0
BorderColor = 255,255,255
Name = "T_line2"
      t_line      ..\libs\t_base.vcx      line      T_line3      !frmInvoiceHeader.pgfInvoice.Page1      mBorderStyle = 1
Height = 0
Left = 25
Top = 441
Width = 403
BorderColor = 255,255,255
Name = "T_line3"
      t_line      ..\libs\t_base.vcx      line      T_line4      !frmInvoiceHeader.pgfInvoice.Page1      ]Height = 124
Left = 427
Top = 317
Width = 0
BorderColor = 255,255,255
Name = "T_line4"
      t_label      ..\libs\t_base.vcx      label      	T_label23      !frmInvoiceHeader.pgfInvoice.Page1      sFontBold = .T.
Alignment = 2
Caption = "-"
Left = 627
Top = 36
Width = 10
TabIndex = 94
Name = "T_label23"
      t_label      ..\libs\t_base.vcx      label      	T_label24      !frmInvoiceHeader.pgfInvoice.Page1      MCaption = "Note:"
Left = 467
Top = 374
TabIndex = 95
Name = "T_label24"
      t_label      ..\libs\t_base.vcx      label      	T_label25      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
Alignment = 1
Caption = "Extended"
Left = 450
Top = 276
Width = 80
TabIndex = 96
Name = "T_label25"
      t_label      ..\libs\t_base.vcx      label      	T_label26      !frmInvoiceHeader.pgfInvoice.Page1      zFontSize = 8
Alignment = 1
Caption = "Converted"
Left = 450
Top = 316
Width = 80
TabIndex = 97
Name = "T_label26"
      textbox      textbox      txtH_totalextended      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontBold = .T.
FontSize = 8
ControlSource = "inv_head.h_totalextended"
Enabled = .F.
Height = 19
Left = 586
TabIndex = 98
Top = 273
Width = 90
Name = "txtH_totalextended"
      textbox      textbox      txtH_ttlconvertamount      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontBold = .T.
FontSize = 8
ControlSource = "inv_head.h_ttlconvertamount"
Enabled = .F.
Height = 19
Left = 586
TabIndex = 99
Top = 313
Width = 90
Name = "txtH_ttlconvertamount"
      t_label      ..\libs\t_base.vcx      label      	T_label27      !frmInvoiceHeader.pgfInvoice.Page1      wFontSize = 8
Alignment = 1
Caption = "Total"
Left = 450
Top = 176
Width = 80
TabIndex = 100
Name = "T_label27"
      textbox      textbox      txtH_ttlinv      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontBold = .T.
FontSize = 8
ControlSource = "inv_head.h_ttlinv"
Enabled = .F.
Height = 19
Left = 586
TabIndex = 101
Top = 173
Width = 90
Name = "txtH_ttlinv"
      textbox      textbox      txtH_taxamount      !frmInvoiceHeader.pgfInvoice.Page1      Comment = ""
FontSize = 8
ControlSource = "inv_head.h_taxamount"
Enabled = .F.
Height = 19
Left = 586
TabIndex = 102
Top = 213
Width = 90
Name = "txtH_taxamount"
      t_grid      ..\libs\t_base.vcx      grid      grdInvoiceHeader      !frmInvoiceHeader.pgfInvoice.Page2     ColumnCount = 5
Height = 452
Left = 0
Panel = 1
ReadOnly = .T.
ScrollBars = 2
Top = 0
Width = 695
Name = "grdInvoiceHeader"
Column1.ControlSource = "inv_head.h_invnum"
Column1.Width = 82
Column1.ReadOnly = .T.
Column1.Name = "Column1"
Column2.ControlSource = "inv_head.h_bname"
Column2.Width = 345
Column2.ReadOnly = .T.
Column2.Name = "Column2"
Column3.ControlSource = "inv_head.h_acctno"
Column3.ReadOnly = .T.
Column3.Name = "Column3"
Column4.ControlSource = "inv_head.h_ponum"
Column4.ReadOnly = .T.
Column4.Name = "Column4"
Column5.ControlSource = "inv_head.h_totalextended"
Column5.ReadOnly = .T.
Column5.Name = "Column5"
      header      header      Header1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column1      6Alignment = 2
Caption = "Invoice"
Name = "Header1"
      textbox      textbox      Text1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column1      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column2      ;Alignment = 2
Caption = "Billing Name"
Name = "Header1"
      textbox      textbox      Text1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column2      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column3      6Alignment = 2
Caption = "Account"
Name = "Header1"
      textbox      textbox      Text1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column3      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column4      8Alignment = 2
Caption = "PO Number"
Name = "Header1"
      textbox      textbox      Text1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column4      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column5      5Alignment = 2
Caption = "Amount"
Name = "Header1"
      textbox      textbox      Text1      :frmInvoiceHeader.pgfInvoice.Page2.grdInvoiceHeader.Column5      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      t_grid      ..\libs\t_base.vcx      grid      grdLineItems      !frmInvoiceHeader.pgfInvoice.Page3     WColumnCount = 6
Height = 452
Left = 0
Panel = 1
ReadOnly = .T.
RecordSource = "v_lineitemsforinvoice"
ScrollBars = 2
Top = 0
Width = 695
Name = "grdLineItems"
Column1.ControlSource = "v_lineitemsforinvoice.d_qty"
Column1.Width = 36
Column1.ReadOnly = .T.
Column1.Name = "Column1"
Column2.ControlSource = "v_lineitemsforinvoice.d_descrip"
Column2.Width = 320
Column2.ReadOnly = .T.
Column2.Name = "Column2"
Column3.ControlSource = "v_lineitemsforinvoice.d_list"
Column3.ReadOnly = .T.
Column3.Name = "Column3"
Column4.ControlSource = "v_lineitemsforinvoice.d_disc"
Column4.ReadOnly = .T.
Column4.Name = "Column4"
Column5.ControlSource = "v_lineitemsforinvoice.d_netprice"
Column5.ReadOnly = .T.
Column5.Name = "Column5"
Column6.ControlSource = "v_lineitemsforinvoice.d_linettl"
Column6.ReadOnly = .T.
Column6.Name = "Column6"
      header      header      Header1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column1      2Alignment = 2
Caption = "Qty"
Name = "Header1"
      textbox      textbox      Text1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column1      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column2      :Alignment = 2
Caption = "Description"
Name = "Header1"
      textbox      textbox      Text1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column2      BorderStyle = 0
ControlSource = "v_lineitemsforinvoice.d_netprice"
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column3      3Alignment = 2
Caption = "List"
Name = "Header1"
      textbox      textbox      Text1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column3      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column4      3Alignment = 2
Caption = "Disc"
Name = "Header1"
      textbox      textbox      Text1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column4      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column5      2Alignment = 2
Caption = "Net"
Name = "Header1"
      textbox      textbox      Text1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column5      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      header      header      Header1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column6      9Alignment = 2
Caption = "Line Total"
Name = "Header1"
      textbox      textbox      Text1      6frmInvoiceHeader.pgfInvoice.Page3.grdLineItems.Column6      iBorderStyle = 0
Margin = 0
ReadOnly = .T.
ForeColor = 0,0,0
BackColor = 255,255,255
Name = "Text1"
      	t_textbox      ..\libs\t_base.vcx      textbox      	txtD_prid      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_prid"
Enabled = .F.
Height = 23
Left = 100
MaxLength = 10
TabIndex = 2
Top = 32
Width = 91
Name = "txtD_prid"
      t_label      ..\libs\t_base.vcx      label      	lblD_prid      !frmInvoiceHeader.pgfInvoice.Page4      hCaption = "Product ID"
Height = 17
Left = 23
Top = 34
Width = 75
TabIndex = 1
Name = "lblD_prid"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtD_qty      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
ControlSource = "v_lineitemsforinvoice.d_qty"
Height = 23
Left = 359
MaxLength = 7
TabIndex = 4
Top = 32
Width = 60
Name = "txtD_qty"
      PROCEDURE LostFocus
IF This.uOldValue <> This.Value
	This.Parent.txtD_linettl.value = this.value * this.parent.txtD_netprice.value
ENDIF 
ENDPROC
PROCEDURE GotFocus
this.uOldValue = this.value
ENDPROC
      !frmInvoiceHeader.pgfInvoice.Page4      textbox      ..\libs\t_base.vcx      	t_textbox      {Alignment = 1
Caption = "Record ID"
Height = 17
Left = 115
Top = 375
Width = 115
TabIndex = 27
Name = "lblD_recid"
      !frmInvoiceHeader.pgfInvoice.Page4      
lblD_recid      label      ..\libs\t_base.vcx      t_label      !frmInvoiceHeader.pgfInvoice.Page4      lblD_linvnum2      t_label      ..\libs\t_base.vcx      label      lblD_qty      !frmInvoiceHeader.pgfInvoice.Page4      fCaption = "Quantity"
Height = 17
Left = 284
Top = 34
Width = 63
TabIndex = 3
Name = "lblD_qty"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtD_descrip      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
ControlSource = "v_lineitemsforinvoice.d_descrip"
Height = 23
Left = 100
MaxLength = 50
TabIndex = 6
Top = 68
Width = 358
Name = "txtD_descrip"
      t_label      ..\libs\t_base.vcx      label      lblD_descrip      !frmInvoiceHeader.pgfInvoice.Page4      lCaption = "Description"
Height = 17
Left = 25
Top = 70
Width = 75
TabIndex = 5
Name = "lblD_descrip"
      	t_textbox      ..\libs\t_base.vcx      textbox      	txtD_list      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
ControlSource = "v_lineitemsforinvoice.d_list"
Height = 23
Left = 100
TabIndex = 8
Top = 106
Width = 75
Name = "txtD_list"
     PROCEDURE GotFocus
this.uOldValue = this.value
ENDPROC
PROCEDURE LostFocus
IF This.uOldValue <> This.Value
	IF this.parent.txtD_disc.value > 0
		this.parent.txtD_netprice.value = This.value - (this.value * this.parent.txtD_disc.value)
	ELSE
		this.parent.txtD_netprice.value = this.value
	ENDIF
		This.Parent.txtD_linettl.value = this.parent.txtD_qty.value * this.parent.txtD_netprice.value
ENDIF 
ENDPROC
      Alignment = 1
Caption = "Last invoice number"
Height = 17
Left = 115
Top = 340
Width = 115
TabIndex = 25
Name = "lblD_linvnum2"
      label      ..\libs\t_base.vcx      t_label      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_linvnum"
Enabled = .F.
Height = 23
Left = 235
MaxLength = 20
TabIndex = 26
Top = 337
Width = 148
Name = "txtD_linvnum"
      !frmInvoiceHeader.pgfInvoice.Page4      txtD_linvnum      textbox      ..\libs\t_base.vcx      	t_textbox      lblD_finvdt      t_label      ..\libs\t_base.vcx      label      	lblD_list      !frmInvoiceHeader.pgfInvoice.Page4      cCaption = "List"
Height = 17
Left = 25
Top = 108
Width = 75
TabIndex = 7
Name = "lblD_list"
      	t_textbox      ..\libs\t_base.vcx      textbox      	txtD_disc      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
ControlSource = "v_lineitemsforinvoice.d_disc"
Height = 23
InputMask = ".99"
Left = 265
TabIndex = 10
Top = 106
Width = 48
Name = "txtD_disc"
     PROCEDURE GotFocus
this.uOldValue = this.value
ENDPROC
PROCEDURE LostFocus
IF This.uOldValue <> This.Value
	IF this.parent.txtD_disc.value > 0
		this.parent.txtD_netprice.value = This.Parent.txtD_list.value - (This.Parent.txtD_list.value * this.parent.txtD_disc.value)
	ELSE
		this.parent.txtD_netprice.value = this.value
	ENDIF
		This.Parent.txtD_linettl.value = this.parent.txtD_qty.value * this.parent.txtD_netprice.value
ENDIF 
ENDPROC
      Alignment = 1
Caption = "First Invoice"
Height = 17
Left = 115
Top = 304
Width = 115
TabIndex = 23
Name = "lblD_finvdt"
      !frmInvoiceHeader.pgfInvoice.Page4      label      ..\libs\t_base.vcx      t_label      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_finvdt"
Enabled = .F.
Height = 23
Left = 235
TabIndex = 24
Top = 302
Width = 71
Name = "txtD_finvdt"
      !frmInvoiceHeader.pgfInvoice.Page4      txtD_finvdt      textbox      ..\libs\t_base.vcx      	t_textbox      lblD_subdate2      label      t_label      ..\libs\t_base.vcx      label      	lblD_disc      !frmInvoiceHeader.pgfInvoice.Page4      hCaption = "Discount"
Height = 17
Left = 208
Top = 109
Width = 60
TabIndex = 9
Name = "lblD_disc"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtD_netprice      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_netprice"
Enabled = .F.
Height = 23
InputMask = "99,999.99"
Left = 400
TabIndex = 12
Top = 106
Width = 75
Name = "txtD_netprice"
      t_label      ..\libs\t_base.vcx      label      lblD_netprice      !frmInvoiceHeader.pgfInvoice.Page4      nCaption = "Net price"
Height = 17
Left = 341
Top = 109
Width = 62
TabIndex = 11
Name = "lblD_netprice"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtD_linettl      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
FontBold = .T.
ControlSource = "v_lineitemsforinvoice.d_linettl"
Enabled = .F.
Height = 23
InputMask = "9,999,999.99"
Left = 578
TabIndex = 14
Top = 106
Width = 86
Name = "txtD_linettl"
      t_label      ..\libs\t_base.vcx      label      lblD_linettl      !frmInvoiceHeader.pgfInvoice.Page4      nCaption = "Line Total"
Height = 17
Left = 510
Top = 109
Width = 72
TabIndex = 13
Name = "lblD_linettl"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtD_renewal      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
ControlSource = "v_lineitemsforinvoice.d_renewal"
Height = 23
Left = 100
MaxLength = 15
TabIndex = 16
Top = 164
Width = 113
Name = "txtD_renewal"
      t_label      ..\libs\t_base.vcx      label      lblD_renewal      !frmInvoiceHeader.pgfInvoice.Page4      jCaption = "Renewal"
Height = 17
Left = 25
Top = 166
Width = 62
TabIndex = 15
Name = "lblD_renewal"
      	t_textbox      ..\libs\t_base.vcx      textbox      txtD_subdate      !frmInvoiceHeader.pgfInvoice.Page4      Comment = ""
ControlSource = "v_lineitemsforinvoice.d_subdate"
Height = 23
Left = 445
MaxLength = 30
TabIndex = 18
Top = 164
Width = 218
Name = "txtD_subdate"
      t_label      ..\libs\t_base.vcx      lblD_subdate      !frmInvoiceHeader.pgfInvoice.Page4      wCaption = "Subscription dates"
Height = 17
Left = 335
Top = 166
Width = 108
TabIndex = 17
Name = "lblD_subdate"
      t_label                                   Z   %   /      d     T            U    T       U  THIS	 UOLDVALUE VALUE^  %      W 6 T     C     d     T
     U	  THIS	 UOLDVALUE VALUE PARENT TXTH_TAXAMOUNT TXTH_TAXRATE TXTH_TTLINV THISFORM RECALCULATEINVOICETOTALS GotFocus,     	 LostFocus^     1 12 qa A 1                       /         O         )                          
:PROCEDURE cmdTop.Click
DODEFAULT()
thisform.cInvoiceNumber = Inv_head.h_invnum
ENDPROC
PROCEDURE cmdPrev.Click
DODEFAULT()
thisform.cInvoiceNumber = Inv_head.h_invnum
ENDPROC
PROCEDURE cmdNext.Click
DODEFAULT()
thisform.cInvoiceNumber = Inv_head.h_invnum
ENDPROC
PROCEDURE cmdEnd.Click
DODEFAULT()
thisform.cInvoiceNumber = Inv_head.h_invnum
ENDPROC
PROCEDURE cmdFind.Click
PRIVATE cSearchWhat

cSearchWhat = ''

* Call window to query user to type of search to use
DO FORM SearchOptions TO cSearchWhat

DO CASE
	CASE cSearchWhat = 'IndexSearch'
		Private recnum
		#DEFINE InvoiceBrowse	'h_bname		:20	:H = "Company", ;
									h_bcity	:20	:H = "City", ;
									h_bstate	: 5	:H = "State"'

							
			recnum = m_browse('',InvoiceBrowse, '', 'RECNO()')
			IF !EMPTY(recnum)
				ThisForm.pgfInvoice.refresh()
				thisform.cInvoiceNumber = Inv_Head.h_InvNum
*				ThisForm.lDoRequery = .T.
			ELSE
				WAIT WINDOW 'Find Aborted'
			ENDIF
	CASE cSearchWhat = 'PowerSearch'
		DODEFAULT()
		
	OTHERWISE
		MESSAGEBOX("No search selected",16," ")
		
ENDCASE

ENDPROC
PROCEDURE cmdAdd.Click
This.visible = .F.
ThisForm.pgfInvoice.page1.enabled = .T.
ThisForm.pgfInvoice.Page2.enabled = .T.
ThisForm.pgfInvoice.Page3.enabled = .T.
ThisForm.pgfInvoice.Page4.enabled = .T.

DODEFAULT()

IF ThisForm.pgfInvoice.activepage = 4
	IF thisform.nOldLineTotal <> ThisForm.pgfInvoice.Page4.txtD_linettl.value
		thisform.GetNewHeaderTotals
	ENDIF
ENDIF

ThisForm.cmdButtons.navrefresh
ENDPROC
PROCEDURE cmdEdit.Click
IF This.Parent.cmdAdd.visible = .T.
	This.Parent.cmdAdd.visible = .F.
	ThisForm.pgfInvoice.page1.enabled = .T.
	ThisForm.pgfInvoice.Page2.enabled = .T.
	ThisForm.pgfInvoice.Page3.enabled = .T.
	ThisForm.pgfInvoice.Page4.enabled = .T.

ELSE
	This.Parent.cmdAdd.visible = .T.
	IF thisform.pgfInvoice.activepage < 3
		thisform.pgfInvoice.activepage = 1
		ThisForm.pgfInvoice.Page2.enabled = .F.
		ThisForm.pgfInvoice.Page3.enabled = .F.
		ThisForm.pgfInvoice.Page4.enabled = .F.
	ELSE
		thisform.pgfInvoice.activepage = 4
		thisform.nOldLineTotal = ThisForm.pgfInvoice.Page4.txtD_linettl.value
		ThisForm.pgfInvoice.Page1.enabled = .F.
		ThisForm.pgfInvoice.Page2.enabled = .F.
		ThisForm.pgfInvoice.Page3.enabled = .F.
	ENDIF
ENDIF


DODEFAULT()
ENDPROC
PROCEDURE cmdDelete.Click
DODEFAULT()

** If we are on a page displaying header data and do a delete we need to 
** delete the line items as well
IF ThisForm.pgfInvoice.ActivePage < 3
	DELETE FOR Inv_data.d_Invnum = thisform.cInvoiceNumber IN inv_data
ENDIF

ENDPROC
     	    	  	                           %   }        I   4            U   	 C T      U  THISFORM CINVOICENUMBER INV_HEAD H_INVNUM 	 C T      U  THISFORM CINVOICENUMBER INV_HEAD H_INVNUM 	 C T      U  THISFORM CINVOICENUMBER INV_HEAD H_INVNUM 	 C T      U  THISFORM CINVOICENUMBER INV_HEAD H_INVNUM 5   T      SearchOptions(   H:     IndexSearch4 5  T C  a h_bname		:20	:H = "Company", 									h_bcity	:20	:H = "City", 									h_bstate	: 5	:H = "State"   RECNO()  %C 
 C    T   	  0 R, Find Aborted     PowerSearchY	 C 2% C No search selected  x  U
  CSEARCHWHAT SEARCHOPTIONS RECNUM M_BROWSE THISFORM
 PGFINVOICE REFRESH CINVOICENUMBER INV_HEAD H_INVNUM  T   - T    a T    a T    a T    a	 C %  	    % 
       
          U  THIS VISIBLE THISFORM
 PGFINVOICE PAGE1 ENABLED PAGE2 PAGE3 PAGE4
 ACTIVEPAGE NOLDLINETOTAL TXTD_LINETTL VALUE GETNEWHEADERTOTALS
 CMDBUTTONS
 NAVREFRESH %     a|  T     - T    a T    a T  	  a T  
  a u T     a %     T    T    - T  	  - T  
  - q T    T    
    T    - T    - T  	  -  	 C U  THIS PARENT CMDADD VISIBLE THISFORM
 PGFINVOICE PAGE1 ENABLED PAGE2 PAGE3 PAGE4
 ACTIVEPAGE NOLDLINETOTAL TXTD_LINETTL VALUE? 	 C %    8          U  THISFORM
 PGFINVOICE
 ACTIVEPAGE FOR INV_DATA D_INVNUM CINVOICENUMBER cmdTop.Click,      cmdPrev.Click}      cmdNext.Click      cmdEnd.Click     cmdFind.Clickp     cmdAdd.Clickr     cmdEdit.Click     cmdDelete.Click    1  12  12  12  12 q   q &1 aA   QB 3  AAAA r A A  2 AAAAA Aq1AAA 1AAAA A  2  tA 2                       P         t                 	   
   +  c          J         m    2   -     	  C   D   @	  /
  ^    )   	                           k  k                           %           C   L            U   	 C T    Inv_head %        F    T    CW T    - T    - C      T   	 
  %   
  T     a  T   a
     U  THISFORM CCURRENTTABLE CPREVIOUSTABLE
 CMDBUTTONS	 NWORKAREA TOPFILE ENDFILE
 NAVREFRESH CINVOICENUMBER INV_HEAD H_INVNUM LISREADONLY CMDEDIT VISIBLE LREQUERYSALES REFRESH  T      U  THISFORM CINVOICENUMBER INV_HEAD H_INVNUM 	 C T      U  THISFORM CINVOICENUMBER INV_HEAD H_INVNUM 	 C T    Inv_head %        F    T    CW T    - T    - C      T    	 - T  
 a
     U  THISFORM CCURRENTTABLE CPREVIOUSTABLE
 CMDBUTTONS	 NWORKAREA TOPFILE ENDFILE
 NAVREFRESH CMDEDIT VISIBLE LREQUERYSALES REFRESH 	 C% T    v_LineItemsForInvoice %        F    T    CW T    - T    - C      C    T   - C	 
  T     - U  THISFORM CCURRENTTABLE CPREVIOUSTABLE
 CMDBUTTONS	 NWORKAREA TOPFILE ENDFILE
 NAVREFRESH LREQUERYSALES THIS REFRESH CMDEDIT VISIBLE	 C% T    v_LineItemsForInvoice %        F    T    CW T    - T    - C      %     C    T   -  C	 
  %   
  T     a  U  THISFORM CCURRENTTABLE CPREVIOUSTABLE
 CMDBUTTONS	 NWORKAREA TOPFILE ENDFILE
 NAVREFRESH LREQUERYSALES THIS REFRESH LISREADONLY CMDEDIT VISIBLE Page1.Activate,     
 Page1.Init     Page2.Deactivate     Page2.Activatef     Page3.Activate     Page4.Activate    1  q "A 2AA   2 13  13  q "A C  2  Rq "A    C2  Qq "A   A  AA 1                                           3        X  q  #   #       8   1      
  N    )   k                       4                              E   %           +   <            U    5   I T                    	  # T C     
  T T        T       U  NTOTALINVOICEAMOUNT NTOTALCONVERTAMOUNT THISFORM
 PGFINVOICE PAGE1 TXTH_TTLINV VALUE TXTH_TAXAMOUNT TXTH_SERCHG TXTH_SHIPCHG TXTH_CONVRAT TXTH_TOTALEXTENDED TXTH_TTLCONVERTAMOUNT  5      T  ) KC  
 A00AA0054S(    K(   ! >	 
  	     C     U  NCURRENTRECORDNUMBER NTOTALLINEAMOUNT CINDEX NCURRENTREC V_LINEITEMSFORINVOICE	 D_LINETTL INV_DATA D_INVNUM ALL INV_HEAD H_TTLINV FOR H_INVNUM THISFORM CINVOICENUMBER RECALCULATELINEITEMS  4   5  = T                	  # T C    
  T! >       ! >       
    U 
 NLINETOTAL NTOTALINVOICEAMOUNT NTOTALCONVERTAMOUNT THISFORM
 PGFINVOICE PAGE1 TXTH_TAXAMOUNT VALUE TXTH_SERCHG TXTH_SHIPCHG TXTH_CONVRAT ALL INV_HEAD H_TOTALEXTENDED FOR H_INVNUM CINVOICENUMBER H_TTLCONVERTAMOUNT REFRESH  C     U  THISFORM SIZER	 FRMRESIZE+	 C T    Inv_head F    T      %C oUser.cNameb C %C  	 Read Only  T   a T   	 
 - T    
 - T    
 - T    
 - T     
 - 
 T   -  $ T   -  U  THISFORM CCURRENTTABLE CINVOICENUMBER INV_HEAD H_INVNUM OUSER
 CUSERLEVEL LISREADONLY
 CMDBUTTONS CMDPRINT VISIBLE CMDADD CMDEDIT	 CMDDELETE
 PGFINVOICE PAGE1 CMDCOPY recalculateinvoicetotals,      getnewheadertotals     recalculatelineitems     Resize     Init    1  27 1 3 q  2 2 2   2 AAAAq  A   A 3                    $   D        m  x          	  #      	  	  :      
  K  =    )                     
