y] s~E,e>aπe`ׂkA({MSn9C¿>%8z0tt.R (1ܯ ^%HLq\.gMσQfIIL4Y3 oprCא׎ o] A:|ݪƌTokuͭxYN3\uΗy,t9BF}IXx *gV|pJfu> ^LBv pbtXDs7^ ޴+ިvȴ9HaoP@c6Ötz2n{?m|a1˻. 3T/ڻWU3Ey8?K~1\;fʋvxM~~=iK"0ѳ7=_w!h6gt(F.tE׌bFuc*$TJCa:X!6IjdşLD?Y1*yRʺxM&`i:떺@-UEߺ'BaThJ%mژe.v<P8n[?3J@/`@+œdPbUf)"S$3?zU"GfBTVzWly6#ˤ7+ѩj}y ܘ ϕSgjG!Vҁw9I@_ 2J2+X, NO4bTjod5HQ =-{O˻g B&Nz_⣨gCl5ǥfєGrj( }YMڻ+qN-7g,NGIR;DN1c{:X費SʕX v&3^3=iDgVTPĚd3^+nHe01 t++U(c#f:@)"r:辑^+^f.R2yv[28Eܿ0CL11MӳH?KGtZ(BOS p3zV%& N,t9h;} #- Ep"Gft\ \F5;c& AV3" ZxЗ1ֺ"oB* (+BX>X clNy,\0eRk,Nʽ.Z[`Ek<( TUgxeOW>vQ= ?s \4D;a~:YQ(.Z*SN;Xv(ٍ?' qгl#G{:S@]f^ɪP_/~hsK|)r^Li4\?H?KGtZ(BOAi~[5f&X6:.86)I$1R{OB__){9&&12I\ vNS^ԓcK۬a;cᏖjY.F?՞O9)k1ƠD1~Aô;Z] U/S*O6$c쀶SY]70/RbBԆQ*Ҥ<:щDdXVܾp6h ;4E,Ketsrݛˮ ͒&+)k݌}` Wš#™_1&i7?FC;EY^b]N,4HڟBڸȴs[.cjY|Otaw\h{ǡI)o-%)+Ճ2P*}Fp|ǕIyFsء,fJY풫X+Ru'ۃŰ+={| wctyle='width:70;' tabindex='1'> "; echo "$cnt$name"; //$sprice$qty".$row['uprice'].""; echo "$sprice".$row['qty']."".$row['percentage']."$uprice$amt"; echo ""; $cnt+=1; } if($cnt>1)echo "Summary$qty$total"; ?>
Paid From
Inv No. Date: Total Amount Discount
NetAmount Extra Charges Paid "; ?>
Name Cell No.
0){ $uprice=$sprice-($sprice*$percentage/100); }elseif($uprice>0){ $percentage=(100*(($sprice*$qty)-($qty*$uprice)))/($sprice*$qty); $uprice=$sprice-($sprice*$percentage/100); }else{ $uprice=$sprice; } $discount=($sprice*$qty)-($uprice*$qty); /* $sno=getName($con,"select sno from sale where actid='$actid' and itemid='$itemid' and invno='$invno'"); if ($sno>0) { $qry="update sale set uprice='$uprice',percentage='$percentage',discount='$discount',qty=$qty,pprice=$pprice,sprice=$sprice where actid=$actid and itemid=$itemid and invno='$invno'"; }else{ $qry=getName($con,"select ifnull(max(sno),0)+1 from sale where invno='$invno' and LabID='$LabID' "); $qry="insert into sale (sno,uprice,percentage,discount,date_,invno,actid,itemid,qty,pprice,sprice,LabID) values('$qry','$uprice',$percentage,$discount,'$date_',$invno,$actid,$itemid,$qty,$pprice,$sprice,$LabID)"; } $run = mysqli_query($con,$qry); */ $qry=getName($con,"select ifnull(max(sno),0)+1 from sale where invno='$invno' and LabID='$LabID' "); $qry="insert into sale (sno,uprice,percentage,discount,date_,invno,actid,itemid,qty,pprice,sprice,LabID) values('$qry','$uprice',$percentage,$discount,'$date_',$invno,$actid,$itemid,$qty,$pprice,$sprice,$LabID)"; $run = mysqli_query($con,$qry); $pur = getName($con,"select ifnull(sum(qty*uprice),0) from sale where invno=$invno and LabID='$LabID'"); if (getName($con,"select 1 from sale2 where invno='$invno' and actid='$actid'")=="") $qry="insert into sale2 (time_,date_,invno,actid,amount,LabID) values('$time_','$date_',$invno,$actid,$pur,$LabID)"; else $qry="update sale2 set amount=$pur where actid=$actid and invno=$invno "; $run = mysqli_query($con,$qry); if (getName($con,"select 1 from ledger where LabID='$LabID' and saleno='$invno'")==""){ $autoid = getName($con,"select IFNULL(max(autoid),0)+1 from ledger "); mysqli_query($con,"insert into ledger (autoid,remarks,date_,saleno,actid,debit,credit,LabID) select '$autoid','Sale #:$invno',date_,invno,actid,amount,paid,LabID from sale2 where invno='$invno' and LabID='".$_SESSION['LabID']."'"); }else{ mysqli_query($con,"update ledger set debit=(select sum(qty*uprice) from sale where invno='$invno' and LabID='".$_SESSION['LabID']."') where saleno='$invno' and LabID='".$_SESSION['LabID']."'"); } calculateBalance($actid); updateQty($itemid); echo "
#NamePriceQty%ageNetPriceAmountDelete"; ?>
"; echo fillList($con,"select concat(itemid,' | ',itemname,' | ',model,' | ',size,' | ',itemcolor,' | ',company,' | ',qty,' | ',sprice) as itemname from item where LabID='$LabID' order by itemname"); echo ""; ?> "; echo "
$cnt$name"; //$sprice$qty".$row['uprice'].""; echo "$sprice".$row['qty']."".$row['percentage']."$uprice$amt"; echo ""; $cnt+=1; } if($cnt>1)echo "
Summary$qty$total"; ?>

Paid From
Inv No. Date: Total Amount Discount
NetAmount Extra Charges Paid "; ?>
Name Cell No.
#CodeNameAddressContactsBalanceEditPurchaseSalesReturnReceiptLedgerLedger2pReturnDel"; if ($anyAccount=="") $query = "select id,name,address,contacts,balance,date_,actcode from accounts where LabID='$LabID' and status=0 order by date_ desc, id asc "; else $query = "select id,name,address,contacts,balance,date_,actcode from accounts where LabID='$LabID' and status=0 and (name like '%$anyAccount%' or address like '%$anyAccount%' or contacts like '%$anyAccount%') order by name asc"; $cnt=1; $debAmt=0; $crdAmt=0; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ $id = $row['id']; $name = $row['name']; $address = $row['address']; $balance = $row['balance']; if ($balance>0) $debAmt+=$balance; else $crdAmt+=$balance; //$date_ = date('Y-m-d',strtotime($row['date_'])); echo "$cnt".$row['actcode']; echo "$name$address"; echo "".$row['contacts']; echo "$balance"; echo ""; if($_SESSION['LabID']==30){ //Mahmood Steel echo ""; //}elseif($_SESSION['LabID']>=31 ){ //Al-Makkah Mobile Ferdous // echo ""; }else{ echo ""; } echo ""; echo ""; echo " 1"; echo " 2"; echo ""; echo ""; $cnt+=1; } echo "SummaryDebit
Credit$debAmt
$crdAmt"; }elseif (isset($_GET['anyvalue'])){ $anyvalue=$_GET['anyvalue']; $invno=232;//$_GET['invno']; echo "
SerialNameStockDatePriceQty%ageuPriceAdd"; if ($anyvalue=="") $query = "select itemid,itemname,qty,pprice,uprice,sprice,model from item where LabID='$LabID' and status=0 order by itemname asc"; else $query = "select itemid,itemname,qty,pprice,uprice,sprice,model from item where LabID='$LabID' and status=0 and (itemname like '%$anyvalue%' or model like '%$anyvalue%' or size like '%$anyvalue%') order by itemname asc"; //echo "
QRY=".$query; $cnt=1; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ //$name = $row['itemname']; $stock = $row['qty']; $pprice = $row['pprice']; $uprice = $row['uprice']; $sprice = $row['sprice']; echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
$cnt".$row['itemname']."$stock"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $cnt+=1; } echo "
"; }elseif(isset($_GET['anyItem'])){ $anyItem=$_GET['anyItem']; if($anyItem==""){ $query = "select itemid,itemname,size,model,pprice,sprice,itemcolor,company,qty,itemtype,limit_,uprice from item where LabID='$LabID' order by itemname"; }elseif(is_numeric($anyItem)){ $query = "select itemid,itemname,size,model,pprice,sprice,itemcolor,company,qty,itemtype,limit_,uprice from item where LabID='$LabID' and(itemname like'%$anyItem%' or size like'%$anyItem%' or model like'%$anyItem%') order by itemid desc"; }else{ $query = "select itemid,itemname,size,model,pprice,sprice,itemcolor,company,qty,itemtype,limit_,uprice from item where LabID='$LabID' and(itemname like'%$anyItem%' or size like'%$anyItem%' or model like'%$anyItem%') order by itemid desc"; } echo "
SerialNameSizeModelTypeColorCompanypriceP_PriceS_PriceQtyEditbar#Delete"; $cnt=1;$totalQty=$pAmt=$sAmt=$uAmt=0; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ $itemid = $row['itemid']; $itemname = $row['itemname']; $size = $row['size']; $model = $row['model']; $pprice = $row['pprice']; $sprice = $row['sprice']; $itemtype = $row['itemtype']; $itemcolor = $row['itemcolor']; $company = $row['company']; $qty= $row['qty']; $totalQty+=$qty; //$pAmt+=$qty*$row['uprice']; $uAmt+=$qty*$row['uprice']; $pAmt+=$qty*$row['pprice']; $sAmt+=$qty*$sprice; echo "
$cnt"; if($row['qty']<$row['limit_']) echo "$itemname"; else echo "$itemname"; echo "$size$model$itemtype$itemcolor$company".round($row['uprice'],0)."$pprice$sprice$qtyEdit"; echo ""; echo "del"; $cnt+=1; } $qty=$sAmt-$pAmt; echo "
Summary".round($uAmt)."$pAmt$sAmt$totalQty"; }elseif(isset($_GET['anyItemHafiz'])){ $anyItem=$_GET['anyItemHafiz']; if($anyItem==""){ $query = "select itemid,itemname,size,model,pprice,sprice,itemcolor,company,qty,itemtype,limit_,uprice from item where LabID='$LabID' order by itemname"; }elseif(is_numeric($anyItem)){ $query = "select itemid,itemname,size,model,pprice,sprice,itemcolor,company,qty,itemtype,limit_,uprice from item where LabID='$LabID' and(itemname like'%$anyItem%' or size like'%$anyItem%' or model like'%$anyItem%') order by itemid desc"; }else{ $query = "select itemid,itemname,size,model,pprice,sprice,itemcolor,company,qty,itemtype,limit_,uprice from item where LabID='$LabID' and(itemname like'%$anyItem%' or size like'%$anyItem%' or model like'%$anyItem%') order by itemid desc"; } //echo "
SerialNameSizeModelTypeColorCompanypriceP_PriceS_PriceQtyEditbar#Delete"; echo "
#NameTypepriceP_PriceS_PriceMeterQtyEditbar#Delete"; $cnt=1;$totalQty=$pAmt=$sAmt=$uAmt=0; $run = mysqli_query($con,$query); while ($row=mysqli_fetch_array($run)){ $itemid = $row['itemid']; $pprice = $row['pprice']; $sprice = $row['sprice']; $qty= round($row['qty'],2); $totalQty+=$qty; $uAmt+=$qty*$row['uprice']; $pAmt+=$qty*$row['pprice']; $sAmt+=$qty*$sprice; //$meter+=$qty*$sprice; echo "
$cnt"; if($row['limit_']>0 and $row['qty']<$row['limit_']) echo "".$row['itemname'].""; else echo "".$row['itemname'].""; echo "".$row['itemtype']."".round($row['uprice'],2)."$pprice$sprice"; echo "".round(getName($con,"select sum(meter*qty) from itemlink where itemid='$itemid' "),2); echo "$qty"; echo ""; echo ""; echo ""; $cnt+=1; } //$qty=$sAmt-$pAmt; echo "
Summary".round($totalQty,0).""; //echo "
Summary".round($uAmt)."$pAmt$sAmt$totalQty"; } mysqli_close($con); ?>