**** Sales Invoice Header , 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 & Product Name Sorting and SortedBy="TP" for Tax & Product Name Wise Sorting **** SortedBy=>"P" for Product Name and SortedBy:="PDSH" for Product ShelfId Wise & SortedBy:="GEN" for Generic Product Wise **** SiReturn Block will be used for SiRepl 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) **** Provide the array for printing pending order mPendOrdArr,mPendOrdArrBillWise **** Variables in detail part : mDSaleAmt,mamt,mDGrossAmt,mDTaxAmt,mdScAmt,mdAdScAmt,mabtamt,mDDiscount,mdSDiscount,mpromoamt,mMrpValue,mFMrpValue,mDBLRate,ChkDblMrp:=.f.,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 , For ShortItem Qty => ShortPdQty, Mfg Date=> mMfgDt **** Variable avaiable for Input Tax Credit mITCTaxable,mITCAmt,mITCTaxPay,mITCDTaxable,mITCDTaxAmt {||topline:=17,itemline:=2,CFline:=3,BFLine:=2,sireturn:=5,siretdtl:=2,sirepl:=0,cnline:=0,discline:=0,taxline:=0,frtline:=0,; replline:=0,crline:=0,netline:=0,POrderLine:=0,bottomline:=20,msgline:=0,SortedItems:=.f.,MultiCrNote:=.t.} **** Print Header {||QOUT(SPACE(20)+_EXP+PADC(ALLTRIM(MNAME),(PAGEWIDTH-25)/2)+_EXP_OFF),iif(MTOTVALUE=0,cargo1:=0,nil)} {||qout(SPACE(20)+padc(ALLTRIM(MADDRESS1),pagewidth-40))} {||qout("GSTIN :"+padr(MGSTNO,15)+padc(Alltrim(maddress2)+" "+alltrim(mSTATION)+" "+alltrim(mpin),pagewidth-48)+" "+"TIN No."+padr(mrstno,15))} {||qout("DL.No:"+padr(ALLTRIM(mlicno)+","+ALLTRIM(mlicno2),16)+padc("Phone.No. :- "+mphone1,pagewidth-48)+" "+padr("F.L.No:",7)+padl(alltrim(mFOODLIC),15))} {||qout(TLCBAR+repl(HZBAR,pagewidth-33)+repl(HZBAR,14)+Repl(HZBAR,16)+repl(HZBAR,1)+TRCBAR)} {||QOUT(PADR(alltrim("Name & Address of Consginee : "),pagewidth-37)+bar+padr("Inv. No. : ",8)+PrnInvSSR+Tran(PrnInvNo,"999999")+" "+"Date : "+dtoc4(INVDATE))} {||qout(padr(alltrim(&custtbl->cuname),pagewidth-37)+bar+padr("Order No. :",10)+padr(&hdrtbl->&hdrs.orderno,5)+" "+"Date : "+dtoc4(&hdrtbl->&hdrs.ordate))} {||qout(padr(alltrim(&custtbl->cuaddress1),pagewidth-37)+bar+padr("G.R.No.:",10)+padr(&hdrtbl->&hdrs.mtrno,5)+" "+"Date : "+dtoc4(&hdrtbl->&hdrs.mtrdate))} {||qout(padr(alltrim(&custtbl->custation),pagewidth-37)+bar+padr("Cases.:",10)+padr(&hdrtbl->&hdrs.cases,5)+" "+"Weight : ")} {||qout("Phone. "+padr(alltrim(&custtbl->cuphone),pagewidth-44)+bar+padr("Delivery.",10)+padr(&hdrtbl->&hdrs.spcode,10))} {||qout(padr("State Code:"+mcustatecd,pagewidth-37)+bar+padr("Transport.",10)+padr(&hdrtbl->&hdrs.trans,10))} {||qout(padr("DL.No. "+ALLTRIM(&CUSTTBL->CUDLNO)+" "+ALLTRIM(&CUSTTBL->CUDLNO1),pagewidth-37)+bar+padr("Document.",10)+padr(&hdrtbl->&hdrs.bank,10))} {||qout(padr("GSTIN : "+ALLTRIM(&CUSTTBL->CUGSTNO),pagewidth-37)+bar+padr("Du Date.",10)+padr(&hdrtbl->&hdrs.duedate,10))} {||qout(BLCBAR+repl(HZBAR,pagewidth-33)+INVTBAR+repl(HZBAR,12)+INVTBAR+repl(HZBAR,17)+BRCBAR)} {||qout(_compress+"Sr. "+iif(pagewidth>80,Padr("MFG Dt",Pagewidth-74),"")+Padr(" Description",23)+" HSN "+" Qty "+" Unit "+padr(" Batch ",14)+" Exp Dt. "+" MRP "+" Rate "+" Disc "+" Total "+" Taxable "+" CGST "+" SGST "+_comp_off)} {||qout(repl(HZBAR,pagewidth))} {||linecount:=linecount+16} **** Sales Invoice : Print Detail *Use mdt for exp.dt. mrate for discounted rate mmfgcode,mmfgname for group code and name {||qout(_compress+iif(!empty(&STOCKTBL->stchseqno),_UL,"")+tran(totitems+1,"999")+" "+iif(pagewidth>80,Padc(mMfgDt,Pagewidth-74),"")+iif(Alltrim(&STOCKTBL->STPART)="Fr.Product",chr(159)," ")+padr(&PRODTBL->PDname,23)+" "+padr(&PRODTBL->PDhsn,4)+" "+mqty+" "+padr(mpack,7)+""+iif(!empty(&STOCKTBL->stchseqno),"$"," ")+padr(&STOCKTBL->STBHno,14)+" "+mdt+" "+mrp+" "+vrate+" "+tran(&STOCKTBL->STDISCOUNT,"9999.99")+" "+tran(mvalue,"99999.99")+" "+tran(mamt,"99999.99")+" "+tran(&taxtbl->txschrg,"99%")+" "+tran(&taxtbl->txrstrate,"99%")+_comp_OFF),cargo1:=cargo1+mamt} {||linecount:=linecount+1} **** Sals Invoice : Print C/f Amount and Continued on next page. {||qout(space(pagewidth-12)+"-----------")} {||Qout(_EXP+"Continued On "+padr(invpg,2)+_EXP_OFF+spac(Pagewidth-43)+tran(iif(!Finished,mtotvalue,total),"999999999.99"))} {||linecount:=linecount+2} **** Sals Invoice : Print b/f Amount on next page. {||qout("Continued from "+padr(invpg-1,2)+Padl("Total b/f ",pagewidth-30)+tran(iif(!finished,mtotvalue,total),"999999999.99"))} {||Linecount:=Linecount+1} **** SiReturn 5 * 2 Lines for Header, Line for Detail Depend on SiRetDtl (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,"9999.99")+" "+tran(ABS(&DTBL->CDAMOUNT),"@z 99999.99")+" "+tran(mamt,"99999.99")+" "+tran(&taxtbl->txschrg,"99.99")+" "+tran(&taxtbl->txrstrate,"99.99")+_comp_OFF),linecount:=linecount+1} {||.T.} {||.T.} **** Sales Invoice : Print Total Amount **** Sales Invoice : Print Discount in Header **** Sales Invoice : Print Tax **** Sales Invoice : Print Bank Instructions (bottomline) (Use mChallanNo to print Challan Nos) {||qout(repl(HZBAR,pagewidth))} {||qout(space(30)+"Total : "+space(16)+_compress+TRAN(MDISCOUNT,"9999.99")+" "+TRAN(MTOTVALUE,"999999.99")+TRAN(CARGO1,"99999.99")+""+TRAN(MSCAMT,"99999.99")+TRAN(TAX,"999999.99")+_comp_off)} {||qout(repl(HZBAR,pagewidth))} {||QOUT(PADR(&NTTBL->NTNOTE,pagewidth-26)+PADR("TOTAL",16)+tran(MTOTVALUE,"9999999.99"))} {||qout(repl(HZBAR,pagewidth))} {||iif(Finished,qout(PADR("",pagewidth-26)+"LESS DISCOUNT "+tran(mdiscount+mCDISCAMT,"99999.99")),qout())} {||iif(Finished,qout(PADR("Freight "+padr(&hdrtbl->&hdrs.freight,6),pagewidth-26)+PADR("ADD CGST",17)+TRAN(MSCAMT,"999999.99")),qout())} {||iif(Finished,qout(PADR("",pagewidth-26)+PADR("ADD SGST ",17)+TRAN(TAX,"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)+iif((totcdamt-INVFreight-INVOctroi)<=0,"CR ","DR ")+"Note. "+tran(abs(totcdamt-INVFreight-INVOctroi),"99999.99")),qout())} {||iif(Finished,qout(PADR("SGST"+SubStr(VTAXSTRING,14),pagewidth-26)+PADR("Round Off ",17)+TRAN(mrnddiff,"999999.99")),qout())} {||iif(Finished,qout(padr("",pagewidth-32)+_DS+"G. Total(Rs.)."+_EXP+tran(TOTAL,"999999.99")+_EXP_OFF+_DS_OFF),qout())} {||iif(finished,qout(repl(HZBAR,pagewidth)),qout())} {||iif(finished,qout(padr("Declaration ",pagewidth-15)+" Signature"),qout())} {||iif(finished,qout(),qout())} {||iif(finished,qout(padr("Signatory ",pagewidth-27)+" Name of designation/Station"),qout())} {||iif(finished,qout(),qout())} {||iif(finished,qout(padr("Electronic Reference Number ",pagewidth-15)+"Date"),qout())} {||qout(repl(HZBAR,pagewidth))} {||iif(finished,qout(),qout())} {||linecount:=linecount+19} **** Sales Invoice : Note/message (msgline) ****end of file