********************* 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 ********************* PrintAllPendingOrder:=.t. will be used for Showing all pending order of a customer ********************* MrpValue,FMrpValue,SI_AdScAmt,SI_CrNoteAmt,SI_FMrpValue,SI_FTaxableAmt,SI_FTaxAmt,SI_InvDiscAmt,SI_MrpValue,SI_NetAmt,SI_ProdDiscAmt,SI_SaleAmt,SI_ScAmt,SI_TaxableAmt,SI_TaxAmt {||lines:=24,CMFooter:=20,Printed:=.t.,MultiCrNote:=.t.,CmReturn:=5,CmRetDtl:=2,PrnShdCode:=.f.,PAGEWIDTH:=79,PAGELENGTH:=72} {||QOUT(_EXP+PADC("Goverment of India/ ",PAGEWIDTH/2)+_EXP_OFF)} {||QOUT(PADC("Department of "+ALLTRIM(""),PAGEWIDTH-2)),IIF(TOTAMT=0,CARGO1:=CARGO2:=0,NIL)} {||QOUT(PADC("Form GST INV -1",PAGEWIDTH-2))} {||QOUT(PADC("(See Rule......................)",PAGEWIDTH-2))} {||QOUT(_EXP+_COMPRESS+PADC("Application for Electronic Reference Number of an invoice",PAGEWIDTH-2)+_COMP_OFF+_EXP_OFF)} {||QOUT(PADR("1.GSTIN",18)+PADR(ALLTRIM(MGSTNO),50))} {||QOUT(PADR("2.Name",18)+PADR(ALLTRIM(Mname),50))} {||QOUT(PADR("3.Address",18)+PADR(ALLTRIM(MADDRESS1)+" "+Alltrim(maddress2)+","+AllTrim(MSTATION)+" "+ALLTRIM(MPIN),pagewidth-18))} {||QOUT(PADR("4.Sr.No.of Invoice",18)+PADR(tran(prninvno,"9999999"),50))} {||QOUT(PADR("5.Date of Invoice",18)+PADR(Dtoc(InvDate),50))} {||QOUT("")} {||QOUT(PADR("Detail of Receiver (Billed to)",pagewidth-45)+PADR("Detail of Consignee (Shipped to)",pagewidth-45))} {||QOUT(PADR("Name "+alltrim(&custtbl->cuname),pagewidth-45)+PADR("Name "+alltrim(&custtbl->cuname),pagewidth-45))} {||QOUT(PADR("Address "+alltrim(&custtbl->cuaddress1),pagewidth-45)+PADR("Address "+alltrim(&custtbl->cuaddress1),pagewidth-45))} {||QOUT(PADR("State:"+mcustate,pagewidth-45)+PADR("State:"+mcustate,pagewidth-45))} {||QOUT(PADR("State Code:"+mcustatecd,pagewidth-45)+PADR("State Code:"+mcustatecd,pagewidth-45))} {||QOUT(PADR("GSTIN/Unique ID "+alltrim(&custtbl->cugstno),pagewidth-45)+PADR("GSTIN/Unique ID "+alltrim(&custtbl->cugstno),pagewidth-45))} {||QOUT(repl(HZBAR,pagewidth-2))} {||QOut(_COMPRESS+PADC("Sr.",4)+PADC("Description",14)+PADC("HS",5)+PADC("Qty ",7)+PADC("Unit ",7)+PADL("Rate",7)+PADL("Total ",8)+PADL("Disc",8)+PADC("Taxable",10)+PADC("CGST",17)+PADC("SGST",17)+PADC("IGST",17))} {||QOut(_COMPRESS+PADC("No.",4)+PADC("of Goods",14)+PADC("N",5)+PADC(" ",7)+PADC(" ",7)+PADL("(Per",7)+PADL(" ",8)+PADL("ount",8)+PADC("Value",10)+REPL(HZBAR,41))} {||QOut(_COMPRESS+PADR("",4)+PADC("",14)+PADC("",5)+PADC(" ",7)+PADC(" ",7)+PADL("Item)",7)+PADR(" ",8)+PADR("",8)+PADR(" ",10)+PADC("Rate",7.3)+PADC("Amt.",8)+PADC("Rate",7.3)+PADC("Amt.",8)+PADC("Rate",7.3)+PADC("Amt.",8))} {||qout(repl(HZBAR,pagewidth-2))} {||iif(!START,QOUT(space(PAGEWIDTH-26)+padr("Total b/f",17)+tran(totamt," ")),.t.)} {||iif(!start,linecount:=23,linecount:=22)} ***** CMFooter 12 (Total Variables:TotItems,TotQty,TotFqty, Expiry Date:mdt, ChallanNo:mChallanNo) {||QOUT(repl(HZBAR,pagewidth-2))} {||QOut(_COMPRESS+PADR("",26.5)+PADR("TOTAL",24.3)+PADL(TRAN(TOTAMT,"99999.99"),8.2)+PADR(TRAN(MDISCOUNT,"9999.99"),7.7)+PADL(TRAN(CARGO1,"999999.99"),10.2)+PADR("",7.3)+PADR(TRAN(TAX/2,"999999.99"),9.7)+PADC(TRAN(TAX/2,"999999.99"),17)+PADR("",7)+_COMP_OFF)} {||QOUT(repl(HZBAR,pagewidth-2))} {||QOUT(PADR("Freight "+tran(ABS(invfreight),"99999.99"),pagewidth-2))} {||QOUT(PADR("Insurance ",pagewidth-2))} {||QOUT(PADR("Packing and Forwarding Charges ",pagewidth-2))} {||QOUT(repl(HZBAR,pagewidth-2))} {||QOUT(PADR("Total Invoice Value (In Figure)",30)+PADL(TRAN(TOTAMT,"999999.99"),PAGEWIDTH-32))} {||QOUT(PADR("Total Invoice Value (In Words) ",30)+_COMPRESS+PADR(alltrim(mamtwords),PAGEWIDTH-32)+_COMP_OFF)} {||QOUT(PADR("Amount of Tax Subject to Reverse charge 0.00 ",Pagewidth-2))} {||QOUT(PADR("Declaration",pagewidth-42)+PADR("Signature ",pagewidth-45))} {||QOUT(repl(HZBAR,pagewidth-2))} {||QOUT("")} {||QOUT("")} {||QOUT(PADR("Signatory",pagewidth-42)+PADR("Name of the Designation / Status ",pagewidth-45))} {||QOUT("")} {||QOUT("")} {||QOUT(PADR("Electronic Reference Number",pagewidth-42)+PADR("Date :- ",pagewidth-45))} {||QOUT("")} {||linecount:=linecount+19} ***** 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(_UL+" Breakage/Expiry & Returns"+_UL_OFF),Linecount:=Linecount+1 } {||.t.} {||QOut(_COMPRESS+PADC(&DTBL->CDTYPE,4)+PADC(ALLTRIM(&PRODTBL->PDNAME),14)+PADR(&PRODTBL->PDHSN,4)+" "+PADC(TRAN(&DTBL->CDQTY,"9999"),7)+PADC(ALLTRIM(MPACK),7)+PADL(TRAN(&DTBL->CDPRICE,"999.99"),7)+PADL(TRAN(&DTBL->CDAMOUNT,"99999.99"),8)+" "+tran(&cdtbl->cddiscOUNT,"99.99")+" "+tran(ABS(&DTBL->CDAMOUNT),"@z 99999.99")+PADL(iif(left(alltrim(&taxtbl->txseqno),1)="I","",TRAN(&TAXTBL->TXSCHRG,"99%")),7.3)+iif(left(alltrim(&taxtbl->txseqno),1)="I","",TRAN(MDSCAMT,"99999.99"))+PADR(iif(left(alltrim(&taxtbl->txseqno),1)="I","",TRAN(&TAXTBL->TXrstrate,"99%")),7.3)+padr(iif(left(alltrim(&taxtbl->txseqno),1)="I","",TRAN(MDtaxAMT,"99999.99")),8)+" "+PADl(iif(left(alltrim(&taxtbl->txseqno),1)="I",TRAN(&TAXTBL->TXrstrate,"99%"),""),7.3)+padl(iif(left(alltrim(&taxtbl->txseqno),1)="I",TRAN(MDtaxAMT,"99999.99"),""),8)+_COMP_OFF),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+PADC(TRAN(TOTITEMS,"999"),4)+PADC(ALLTRIM(&PRODTBL->PDNAME),14)+PADR(&PRODTBL->PDHSN,4)+" "+PADC(ALLTRIM(MQTY),7)+PADC(ALLTRIM(MPACK),7)+PADL(TRAN(&STOCKTBL->STRATE,"999.99"),7)+PADL(TRAN(MVALUE,"99999.99"),8)+PADL(TRAN(&STOCKTBL->STDISCOUNT,"99.99"),8)+PADL(TRAN(MAMT,"99999.99"),10)+PADL(iif(left(alltrim(&taxtbl->txseqno),1)="I","",TRAN(&TAXTBL->TXSCHRG,"99%")),7.3)+iif(left(alltrim(&taxtbl->txseqno),1)="I","",TRAN(MDSCAMT,"99999.99"))+PADR(iif(left(alltrim(&taxtbl->txseqno),1)="I","",TRAN(&TAXTBL->TXrstrate,"99%")),7.3)+padr(iif(left(alltrim(&taxtbl->txseqno),1)="I","",TRAN(MDtaxAMT,"99999.99")),8)+" "+PADl(iif(left(alltrim(&taxtbl->txseqno),1)="I",TRAN(&TAXTBL->TXrstrate,"99%"),""),7.3)+padl(iif(left(alltrim(&taxtbl->txseqno),1)="I",TRAN(MDtaxAMT,"99999.99"),""),8)+_COMP_OFF),linecount:=linecount+1} {||CARGO1:=CARGO1+MAMT} ***** End of File