***** Header Part (Define PrintOCD=.t. for F6=Credit Notes, Define PrintDuplicate=.t. to print duplictae massage) ****** SortedItems:=.t. for sorted printing,SortedBy=>"G" for Group Wise Sorting and SortedBy="T" for Tax Wise Sorting ****** SortedBy:="GP" for Group Code & Product Name Wise Sorting and SortedBy="TP" for Tax & Product Name Wise Sorting ****** SortedBy:="P" for Product Name Wise Sorting and SortedBy:="PDSH" for Product ShelfId Wise & SortedBy:="GEN" for generic Product Wise ****** PrintICD:=.t. for Incidental Charges & Discount Detail (IcArr)) ****** PrintICD:=.t. for I.c. & Disc. Detail (IcArr[i]:Add/Less Rate OnRs. Amt.) ****** CmReturn Block will be used for CmRepl Block in Case MultiCrNote:=.t. ****** You Can Use Following function,you have to pass a Perticular Taxtype ****** SI_SaleAmt(Taxtype);SI_ProdDiscAmt(Taxtype);SI_CrNoteAmt(Taxtype);SI_InvDiscAmt(Taxtype) ****** SI_TaxAmt(Taxtype);SI_ScAmt(Taxtype);SI_AdScAmt(Taxtype);SI_NetAmt(Taxtype);SI_TaxableAmt(Taxtype) ****** SI_FTaxableAmt(Taxtype),SI_FTaxAmt(Taxtype) ****** SI_MrpValue(Taxtype),SI_FMrpValue(Taxtype) ****** VTaxString,RTaxString,CTaxString,ETaxString ****** Variables in detail part : mDSaleAmt,mamt,mDGrossAmt,mDTaxAmt,mdScAmt,mdAdScAmt,mabtamt,mDDiscount,mdSDiscount,mpromoamt,mMrpValue,mFMrpValue,mDBLRate,ChkDblMrp:=.f.,mDtChLnNo ****** Variables in detail part : mShelfId,mShdDesc,mshdcode for Schedule Information ****** PrintOSStr :=.f. For Calculate Outstanding Array And OSArray Return in this String {"InvDate BillNo DueDate DueDays Amount"} ****** OSString Return in this String 0-30 Days,31-60 Days, 61-90 Days, > 90 ****** Sales Person Commission use mSPComm , Print for ShortItem Qty =>ShortPdQty ****** Variable avaiable for Input Tax Credit mITCTaxable,mITCAmt,mITCTaxPay,mITCDTaxable,mITCDTaxAmt ****** CnArray as array details of adjusted entries and string variable mAdjStr for Adjusted Credit Note which is posting in A/c & Adjust in Invoice ****** five elements are exist in CnArray is tdate:=x[i][1],tvhno:=x[i][2],tremark:=x[i][3],tamt:=x[i][4],trefno:=x[i][5] ****** set cargo10 to .t. for printing qty. disc.,Cargo9 to .t. for Tax Invoice {||lines:=14,CMFooter:=14,Printed:=.t.,MultiCrNote:=.t.,CmReturn:=5,CmRetDtl:=2,PrnShdCode:=.f.,ChkDblMrp:=.T.,SortedItems:=.t.,SortedBy:="GP",cargo10:=.f., Cargo9:=.T.} {||Qout(iif(Cargo9,Padc("TAX INVOICE",Pagewidth),Padc("BILLS OF SUPPLY",Pagewidth)))} {||QOUT(_EXP+PADC(ALLTRIM(MNAME),(PAGEWIDTH)/2)+_EXP_OFF),iif(start,cargo1:=0,nil)} {||qout("GSTIN : "+padr(mgstno,15)+" "+padc(alltrim(maddress),pagewidth-49)+" "+padr("Phone : ",7)+padR(alltrim(mphone1),15))} {||qout("FL No. : "+padr(alltrim(mfoodlic),15)+" "+padc(alltrim(maddress1)+","+alltrim(maddress2),pagewidth-49)+" "+_elite+padr("Mobile :",7)+padR(alltrim(mmobile),17)+_elite_off)} {||qout("DL.No:"+padr(ALLTRIM(mlicno)+","+ALLTRIM(mlicno2),18)+" "+padc(alltrim(mstation)+" "+Alltrim(mpin),pagewidth-49)+" "+padr("Email:",6)+padR(alltrim(memail),16))} {||qout(TLCBAR+repl(HZBAR,pagewidth-33)+TBAR+repl(HZBAR,12)+TBAR+iif(start,repl(HZBAR,16),"Continued From "+str(invpg-1,1))+repl(HZBAR,1)+TRCBAR)} {||qout(BAR+"M/s "+padr(alltrim(&CUSTTBL->CUNAME),pagewidth-54)+padr(alltrim(DRUGLICNO)+":",7)+iif(len(alltrim(&CUSTTBL->CUDLNO))>10,_COMPRESS+padr(&CUSTTBL->CUDLNO,17)+_COMP_OFF,padr(&CUSTTBL->CUDLNO,10))+BAR+mpaymode+BAR+"Inv.No:"+PrnInvSSR+Tran(PrnInvNo,"999999")+space(3)+BAR)} {||qout(BAR+space(4)+padr(alltrim(&CUSTTBL->CUADDRESS1)+" "+alltrim(&CUSTTBL->CUADDRESS2),pagewidth-37)+BAR+padc("("+alltrim(INVCUCODE)+")",12)+BAR+"Date : "+dtoc4(INVDATE)+BAR)} {||qout(BAR+space(4)+padr(alltrim(&CUSTTBL->CUSTATION),pagewidth-66)+iif(empty(alltrim(&CUSTTBL->CUGSTNO)),"State Code:"+padr(mcustatecd,2)+" PAN:"+_Compress+Padr(alltrim(&CUSTTBL->CUPANNO),17)+_comp_off,space(6)+padr("GSTIN:-",12)+iif(len(alltrim(&CUSTTBL->CUGSTNO))>10,_COMPRESS+padr(&CUSTTBL->CUGSTNO,17)+_COMP_OFF,padr(&CUSTTBL->CUGSTNO,10)))+space(1)+BAR+space(12)+BAR+space(17)+BAR)} {||qout(BLCBAR+repl(HZBAR,pagewidth-33)+INVTBAR+repl(HZBAR,12)+INVTBAR+repl(HZBAR,17)+BRCBAR)} *{||qout(_compress+Padr(" Qty "+" Packing "+"Description",43+iif(cargo10,0,8))+"Mfg. HSN "+padr(" Batch ",12)+" Exp. "+" MRP "+" Rate "+" Total "+" Disc "+iif(cargo10,"QtyDisc.","")+" Taxable "+"CGST "+"SGST"+_comp_off)} {||qout(_compress+Padr(" Qty "+" Packing "+"Description",iif(cargo10,((pagewidth-54)*1.7),(pagewidth-50)*1.7))+" Mfg. HSN "+padr(" Batch ",12)+" Exp. "+" MRP "+" Rate "+" Total "+" Disc "+iif(cargo10,"QtyDisc.","")+" Taxable "+"CGST"+"SGST"+_comp_off)} {||qout(repl(HZBAR,pagewidth))} {||iif(!start,qout(space(pagewidth-26)+padr("Total b/f",17)+tran(totamt,"999999.99")),.t.)} {||iif(!start,linecount:=13,linecount:=12)} ****** CMFooter 13 (Total Variables:TotItems,TotQty,TotFqty, Expiry Date:mdt, ChallanNo:mChallanNo) {||qout(repl(HZBAR,pagewidth))} {||qout(PADR("No. of Items :-"+tran(totitems,"999"),pagewidth-48)+"Total : "+space(16)+_compress+TRAN(TOTAMT,"999999.99")+TRAN(MDISCOUNT,"9999.99")+" "+TRAN(CARGO1,"99999.99")+""+TRAN(MSCAMT,"99999.99")+TRAN(TAX,"99999.99")+_comp_off)} {||qout(repl(HZBAR,pagewidth))} {||qout(iif(finished,iif(len(&NTTBL->NTNOTE)<=pagewidth-26,PADR(&NTTBL->NTNOTE,pagewidth-26),_COMPRESS+padr(&NTTBL->NTNOTE,round((pagewidth-26)*1.7,0))+_COMP_OFF)+padr("GROSS AMOUNT",17),space(pagewidth-26)+padr("Total c/f ",17))+tran(totamt,"999999.99"))} {||iif(Finished,qout(PADR("Challan No.,"+Alltrim(mchallanno),pagewidth-26)+"LESS DISCOUNT "+tran(mdiscount+mCDISCAMT,"99999.99")),qout())} *{||iif(Finished,qout(space(pagewidth-26)+PADR("ADD CGST",17)+TRAN(MSCAMT,"999999.99")),qout())} {||iif(Finished,qout(iif(len(alltrim(MamtWords))<=(pagewidth-26),PADR(alltrim(mamtwords),pagewidth-26),_compress+PADR(alltrim(mamtwords),(pagewidth-26)*1.7)+_comp_off)+PADR("ADD CGST",17)+TRAN(MSCAMT,"999999.99")),qout())} {||iif(Finished,qout(iif(len(SurTaxString)<=pagewidth-26,PADR(Alltrim(SURTAXSTRING),pagewidth-26),_COMPRESS+padr(Alltrim(SURTAXSTRING),round((pagewidth-26)*1.7,0))+_COMP_OFF)+PADR("ADD SGST ",17)+TRAN(TAX,"999999.99")),qout())} {||iif(Finished,qout(iif(len(VTaxString )<=pagewidth-26,PADR("SGST"+substr(alltrim(VTAXSTRING),14),pagewidth-26),_COMPRESS+padr("SGST"+substr(alltrim(VTAXSTRING),14),round((pagewidth-26)*1.7,0))+_COMP_OFF)+iif((totcdamt-INVFreight-INVOctroi)<=0,"LESS ","ADD ")+"RET./Cr NOTE "+tran(abs(totcdamt-INVFreight-INVOctroi),"99999.99")),qout(space(pagewidth-28)+_EXP+"Continued on "+str(invpg,1)+_EXP_OFF))} {||iif(Finished,qout(space(pagewidth-26)+PADR("Round Off ",17)+TRAN(mrnddiff,"999999.99")),qout())} {||iif(Finished,qout(padr("For :-"+alltrim(mname),pagewidth-26)+_DS+"NET AMT."+_EXP+tran(PRNNETAMT+INVOTHADJ,"999999.99")+_EXP_OFF+_DS_OFF),qout())} {||qout(repl(HZBAR,pagewidth))} {||qout(padr("All Subject to "+alltrim(mstation)+" Jurisdiction Only.",pagewidth-11)+" E. & O. E.")} {||qout()} {||linecount:=linecount+13} ****** CmReturn 5 * 2 Lines for Header, Line for Detail depend on CmRetdtl (Default 2 (1 for credit/debit and 1 for others) ), 1 Line for Total,mRemark {||qout(_COMPRESS+PADR(" Sales Return Slip Detail",74)+_COMP_OFF),Linecount:=LineCount+1} {||.T.} *{||qout(_compress+iif(!empty(&STOCKTBL->stchseqno),_UL,"")+PADC(&DTBL->CDTYPE,3)+" "+iif(pagewidth>80,Padc(mMfgDt,Pagewidth-74),"")+iif(Alltrim(&STOCKTBL->STPART)="Fr.Product",chr(159)," ")+padr(&PRODTBL->PDname,23)+" "+Padr(&PRODTBL->PDHSN,4)+" "+tran(&dtbl->cdqty,"99999")+" "+padr(mpack,7)+" "+padr(&dTBL->cdBHno,14)+" "+padr(&dtbl->cdexpiry,5)+" "+tran(&dtbl->cdmrp,"9999.99")+" "+tran(mcdprice,"9999.99")+" "+tran(&cdtbl->cddiscOUNT,"99.99")+" "+tran(ABS(&DTBL->CDAMOUNT),"@z 99999.99")+""+tran(mamt,"99999.99")+" "+tran(&taxtbl->txschrg,"99%")+" "+tran(&taxtbl->txrstrate,"99%")+_comp_OFF),linecount:=linecount+1} {||qout(_compress+PADr(&DTBL->CDTYPE,1)+""+tran(&dtbl->cdqty,"99999")+" "+padr(mpack,7)+" "+padr(&PRODTBL->PDname,29)+" "+Padr(&GROUPTBL->GPNAME,6)+" "+Padr(&PRODTBL->PDHSN,4)+" "+padr(&dTBL->cdBHno,12)+" "+padr(&dtbl->cdexpiry,5)+" "+tran(&dtbl->cdmrp,"9999.99")+" "+tran(mcdprice,"9999.99")+" "+tran(ABS(&DTBL->CDAMOUNT),"@z 99999.99")+" "+tran(&cdtbl->cddiscOUNT,"99.99")+" "+tran(mamt,"99999.99")+" "+tran(&taxtbl->txschrg,"99%")+" "+tran(&taxtbl->txrstrate,"99%")+_comp_OFF),linecount:=linecount+1} *{||qout(_compress+padr(" "+mqty+" "+padr(mpack,7)+" "+mtx+&PRODTBL->PDname,iif(cargo10,((pagewidth-54)*1.7),(pagewidth-50)*1.7))+" "+Padr(&GroupTbl->GpName,6)+" "+Padr(&PRODTBL->PDHSN,4)+" "+iif(!empty(&STOCKTBL->stchseqno),"$"," ")+padr(&STOCKTBL->STBHno,12)+" "+mdt+" "+MDblRate+mrp+" "+vrate+""+tran(mvalue,"999999.99")+" "+tran(&STOCKTBL->STDISCOUNT,"99.99")+" "+iif(cargo10,TRAN((&STOCKTBL->STRATE/&STOCKTBL->STBOXSIZE)*VAL(MQTY2),"99999.99"),"")+" "+tran(mamt,"999999.99")+" "+tran(&taxtbl->txschrg,"99%")+" "+tran(&taxtbl->txrstrate,"99%")+iif(!empty(mShdCode),mShdCode,"")+_comp_OFF),cargo1:=cargo1+mamt,linecount:=linecount+1} {||.T.} {||.T.} ****** CMDetail 1 * Use mrate to print discounted rates, mdt to print expiry, mmfgcode,mmfgname to print group code and name {||qout(_compress+padr(" "+mqty+" "+padr(mpack,7)+" "+mtx+&PRODTBL->PDname,iif(cargo10,((pagewidth-54)*1.7),(pagewidth-50)*1.7))+" "+Padr(&GroupTbl->GpName,6)+" "+Padr(&PRODTBL->PDHSN,4)+" "+iif(!empty(&STOCKTBL->stchseqno),"$"," ")+padr(&STOCKTBL->STBHno,12)+" "+mdt+" "+MDblRate+mrp+" "+vrate+""+tran(mvalue,"999999.99")+" "+tran(&STOCKTBL->STDISCOUNT,"99.99")+" "+iif(cargo10,TRAN((&STOCKTBL->STRATE/&STOCKTBL->STBOXSIZE)*VAL(MQTY2),"99999.99"),"")+" "+tran(mamt,"999999.99")+" "+tran(&taxtbl->txschrg,"99%")+" "+tran(&taxtbl->txrstrate,"99%")+iif(!empty(mShdCode),mShdCode,"")+_comp_OFF),cargo1:=cargo1+mamt,linecount:=linecount+1} ****** End of File