PARA mMODE
** Nث~ƶq[i`ƶq
DO INIT_04 WITH "BEGIN"
LOCAL REG,MODES
REG="SHP_BAT"+ALLTRIM(SHP_BAT.NBR)+ALLTRIM(SHP_BAT.IOSEQ)
SELECT SHP_BAT
GO TOP
LOCAL RECVAR
SEEK (SHP_BAH.NBR)
IF FOUND()
	DO WHILE NBR=SHP_BAH.NBR .AND. !EOF()
		RECVAR=RECNO()
		SELECT INV_TRA
		REG="SHP_BAT"+ALLTRIM(SHP_BAT.NBR)+ALLTRIM(SHP_BAT.IOSEQ)
		SEEK(REG)
		IF FOUND()
			IF !(DATE=SHP_BAT.DATE .AND. ITEM_NBR=SHP_BAT.ITEM_NBR .AND. WARE_NBR=SHP_BAT.WARE_NBR .AND. UNIT=SHP_BAT.UNIT .AND. QTY=SHP_BAT.QTY .AND. PRICE=SHP_BAT.PRICE)
				IF mMODE=2 .AND.  shp_bah.io_p="hf"
					mMODES=(-1)
				ELSE
					mMODES=1
				ENDIF
				** xs(ª)CXJwJ`
				DO REP_ACR WITH INV_TRA.acr_mon,INV_TRA.ware_nbr,INV_TRA.item_nbr,INV_TRA.pro_nbr,INV_TRA.unit,INV_TRA.qty*mMODES,shp_bah.io_p
				** xs(ª)wslB
				DO REP_BAL WITH INV_TRA.ware_nbr,INV_TRA.item_nbr,INV_TRA.pro_nbr,INV_TRA.unit,INV_TRA.qty*mMODES,shp_bah.date,shp_bah.io_p,INV_TRA.PRICE

				** xs(s)CXJwJ`
				DO REP_ACR WITH shp_bah.acr_mon,shp_bat.ware_nbr,shp_bat.item_nbr,shp_bat.pro_nbr,shp_bat.unit,shp_bat.qty,shp_bah.io_p
				** xs(s)wslB
				DO REP_BAL WITH shp_bat.ware_nbr,shp_bat.item_nbr,shp_bat.pro_nbr,shp_bat.unit,shp_bat.qty,shp_bah.date,shp_bah.io_p,SHP_BAT.PRICE

				** xswsӪ
				DO REP_TRA WITH "SHP_BAT",shp_bah.date,shp_bah.nbr,SHP_BAT.IOSEQ,SHP_BAT.ITEM_NBR,shp_bat.ware_nbr,SHP_BAT.PRO_NBR,SHP_BAT.UNIT,SHP_BAT.QTY*(-1),SHP_BAT.PRICE,SHP_BAH.ACR_MON,shp_bah.io_p,"ק"
			ENDIF
		ELSE
			** sv
			DO REF_AMT WITH shp_bah.cus_nbr,shp_bat.item_nbr,shp_bat.pro_nbr,shp_bat.unit,shp_bah.coin_nbr,shp_bah.date,shp_bat.price,shp_bat.qty,shp_bat.cus_item,shp_bat.in_box,shp_bat.qty_pbox,shp_bat.cuft,shp_bat.n_wight,shp_bat.g_wight,"Xf"
			** xswsӪ
			DO REP_TRA WITH "SHP_BAT",shp_bah.date,shp_bah.nbr,SHP_BAT.IOSEQ,SHP_BAT.ITEM_NBR,shp_bat.ware_nbr,SHP_BAT.PRO_NBR,SHP_BAT.UNIT,(SHP_BAT.QTY)*(-1),SHP_BAT.PRICE,SHP_BAH.ACR_MON,shp_bah.io_p,"sW"
			** xsCXJwJ`
			DO REP_ACR WITH shp_bah.acr_mon,shp_bat.ware_nbr,shp_bat.item_nbr,shp_bat.pro_nbr,shp_bat.unit,shp_bat.qty,shp_bah.io_p
			** xswslB
			DO REP_BAL WITH shp_bat.ware_nbr,shp_bat.item_nbr,shp_bat.pro_nbr,shp_bat.unit,shp_bat.qty,shp_bah.date,shp_bah.io_p,SHP_BAT.PRICE
		ENDIF
		SELECT SHP_BAT
		GO RECVAR
		SKIP
	ENDDO
ENDIF
** Nث~ƶq[i`ƶq
DO INIT_04 WITH "END"