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^3/8"ψ;8igZN?=ƕRD谙kk\jwqҜJN~=`L *%(6\RτevBpdM^ٛ=Bo^L^C(Z狱2w\08fv}"ȱp*4]!28>cif' ";c_a(5ҳz)~&`2Vݟ(/M|r.\ifֿwey`lEVaI6ob;lĐ̰|zW3N'%Ey\"R{S(A5Wwo^eؤ0ؘ̞*Y#3V`]5KٺE8e@ =_.Az smfdZQ =Nr__6ecb+ڬS?xE7flϋf Gn+  &1}ϴUnCḮ*ET =N=/e r,Os 2*YSiwg~Q(Mx1=^'ӕ^ظ9x Q |,|=JSI6ĄvGl|-dh# Ue@p^.G*rIymPIj݄ ©f s<˃ V"F\M(vҸzo?m|#zpn:i{EB'Aj^ .`1T}`P߇ݵ U̷-cGJAvh\iEt2fdLOw)Lw9< JCz;|x'!+9Sl OuԦur= odbc_exec($conn,$query); $cur=calculateBalance($conn,$fID); //$cur=calculateBalance($conn,$paymentType); //echo"
".$query; } if($percentage>0 and $qty2>0){ $remarks2="Stock Purchased to Supplier "; $fCharges= ($percentage*$qty2); $query="insert into ledger (recordType,date_,accountID,invno,debit,userID,labid,remarks) values('$recordType','$date_','$companyID','$invno','$fCharges','".$_SESSION['empID']."','".$_SESSION['labid']."','$remarks2')"; $cur= odbc_exec($conn,$query); $cur=calculateBalance($conn,$companyID); //$cur=calculateBalance($conn,$paymentType); } } } } if(isset($_POST['btnSave'])){ $paymentType=0;// $_POST['paymentType']; $pPrice= $_POST['pPrice']; $date_ = date('Y-m-d',strtotime($_POST['date_'])); $accountID= $_POST['accountID']; $qty= $_POST['qty']; $invno= $_POST['invno']; $remarks= $_POST['remarks']; $tPrice= $_POST['tPrice']; //freight Charges $discount= $_POST['discount']; //expenes $batchNo= $_POST['batchNo']; //Vehicle Mo. $companyID= $_POST['companyID']; //Vehicle Mo. $qty2= $_POST['qty2']; //factory Waight $poNo= $_POST['poNo']; //factory Waight $percentage= $_POST['saleRate']; //Sale Rate $rPrice=$fID= $_POST['fID']; if($fID=="")$fID=0; $isUpdated=false; if ($invno=="") { $invno= getName( $conn, "select isnull(max(invno),0)+1 from itemInOut where labid='".$_SESSION['labid']."' and recordType='$recordType' " ); $query="insert into itemInOut(percentage,poNo,sPrice,uPrice,rPrice,batchNo,tPrice,discount,recordType, remarks,date_,accountID,invno,qty,pPrice,userID,labid) values('$percentage','$poNo','$qty2','$companyID','$fID','$batchNo','$tPrice','$discount','$recordType','$remarks','$date_','$accountID','$invno','$qty','$pPrice','".$_SESSION['empID']."','".$_SESSION['labid']."')"; if(canSave($conn,"stockInDirect")=="0"){ $cur= odbc_exec($conn,$query); $isUpdated=true; } }else{ $oldImg=getName($conn,"select img from itemInOut where invno='$invno' and labid='".$_SESSION['labid']."' and recordType='$recordType'"); //$cur=odbc_exec($conn,"delete from itemInOut where invno='$invno' and labid='".$_SESSION['labid']."' and recordType='$recordType'"); $query="update itemInOut set percentage='$percentage',poNo='$poNo',sPrice='$qty2',uPrice='$companyID',rPrice='$fID',batchNo='$batchNo',tPrice='$tPrice',discount='$discount',remarks='$remarks',date_='$date_',accountID='$accountID',qty='$qty',pPrice='$pPrice',userID='".$_SESSION['empID']."' "; $query.=" where invno='$invno' and recordType='$recordType' and labid='".$_SESSION['labid']."' "; if(canUpdate($conn,"stockInDirect")=="0"){ $cur= odbc_exec($conn,$query); $isUpdated=true; } } if($isUpdated==true){ $records=getNAme($conn,"select count(*) from itemInOut where qty='$qty' and date_='$date_' and batchNo='$batchNo' and labid='".$_SESSION['labid']."' and recordType='siteInvoice'"); if($records>1){ echo ""; }else{ $cur=odbc_exec($conn,"update itemInOut set sPrice='$qty2',poNo='$poNo' where qty='$qty' and date_='$date_' and batchNo='$batchNo' and labid='".$_SESSION['labid']."' and recordType='siteInvoice'"); } $amount=$qty*$pPrice; $cur=odbc_exec($conn,"delete from ledger where invno='$invno' and labid='".$_SESSION['labid']."' and recordType='$recordType'"); if($amount>0){ $remarks2="Stock Purchased $remarks $qty ton with price $pPrice"; $query="insert into ledger (recordType,date_,accountID,invno,credit,userID,labid,remarks) values('$recordType','$date_','$accountID','$invno','$amount','".$_SESSION['empID']."','".$_SESSION['labid']."','$remarks2')"; $cur= odbc_exec($conn,$query); $cur=calculateBalance($conn,$accountID); //$cur=calculateBalance($conn,$paymentType); } //echo $query; if($tPrice>0 and $fID>0 ){ $remarks2="Stock Purchased $remarks wt:$qty2 @ $tPrice truck:$batchNo expenses:$discount"; $fCharges= ($tPrice*$qty2)+$discount; $query="insert into ledger (recordType,date_,accountID,invno,credit,userID,labid,remarks) values('$recordType','$date_','$fID','$invno','$fCharges','".$_SESSION['empID']."','".$_SESSION['labid']."','$remarks2')"; $cur= odbc_exec($conn,$query); $cur=calculateBalance($conn,$fID); //$cur=calculateBalance($conn,$paymentType); } if($percentage>0 and $qty2>0){ $remarks2="Stock Purchased to Supplier "; $fCharges= ($percentage*$qty2); $query="insert into ledger (recordType,date_,accountID,invno,debit,userID,labid,remarks) values('$recordType','$date_','$companyID','$invno','$fCharges','".$_SESSION['empID']."','".$_SESSION['labid']."','$remarks2')"; $cur= odbc_exec($conn,$query); $cur=calculateBalance($conn,$companyID); //$cur=calculateBalance($conn,$paymentType); } } //exit(); } $poNo=$remarks= "";$discount= ""; $pPrice= "";$batchNo= ""; $accountName= ""; $medicineCompany=""; $Status=0;$tPrice="";$Salary=0; $invno= "";$qty2=$qty= ""; if(isset($_REQUEST['from'])) $from = date('Y-m-d',strtotime($_REQUEST['from'])); if(isset($_REQUEST['to'])) $to = date('Y-m-d',strtotime($_REQUEST['to'])); if (isset($_GET['accountID'])) $accountID = $_GET['accountID']; if (isset($_GET['ID'])) $accountID = $_GET['ID']; if (isset($_GET['delinvno'])){ if(canDelete($conn,"stockInDirect")=="0"){ $query=getName($conn,"select accountID from ledger where invno='".$_GET['delinvno']."' and labid='".$_SESSION['labid']."' and recordType='$recordType' "); $cur=odbc_exec($conn,"delete from ledger where invno='".$_GET['delinvno']."' and labid='".$_SESSION['labid']."' and recordType='$recordType' "); if(is_array($query)){ for($i=0;$iwindow.open('stockInDirect,'_self')"; } } if (isset($_GET['editinvno'])){ //$accountID = $_GET['accountID']; $query="select * from itemInOut where invno='".$_GET['editinvno']."' and labid='".$_SESSION['labid']."' and recordType='$recordType' "; $cur=odbc_exec($conn,$query); while( odbc_fetch_row( $cur ) ) { $from=$date_= date("Y-m-d", strtotime(odbc_result( $cur, 'date_' ))); $accountID=odbc_result($cur,'accountID'); $invno=odbc_result($cur,'invno'); $batchNo=odbc_result($cur,'batchNo'); $qty=odbc_result($cur,'qty'); $pPrice=round(odbc_result($cur,'pPrice')); $tPrice=round(odbc_result($cur,'tPrice')); $discount=round(odbc_result($cur,'discount')); $remarks=odbc_result($cur,'remarks'); $companyID=odbc_result($cur,'uPrice'); $qty2=odbc_result($cur,'sPrice'); $fID=odbc_result($cur,'rPrice'); $poNo=odbc_result($cur,'poNo'); $saleRate=odbc_result($cur,'percentage'); } } if (isset($_GET['siteInvoiceNo'])){ //$accountID = $_GET['accountID']; $query="select * from itemInOut where invno='".$_GET['siteInvoiceNo']."' and labid='".$_SESSION['labid']."' and recordType='siteInvoice' "; $cur=odbc_exec($conn,$query); while( odbc_fetch_row( $cur ) ) { $from=$date_= date("Y-m-d", strtotime(odbc_result( $cur, 'date_' ))); $accountID= odbc_result($cur,'taxAct'); // odbc_result($cur,'accountID'); //Supplier //$invno=odbc_result($cur,'invno'); $batchNo=odbc_result($cur,'batchNo'); $qty=odbc_result($cur,'qty'); //$pPrice=round(odbc_result($cur,'pPrice')); $tPrice=round(odbc_result($cur,'pPrice')); $discount=round(odbc_result($cur,'discount')); $remarks=odbc_result($cur,'remarks'); $companyID=odbc_result($cur,'accountID'); //customer $qty2=odbc_result($cur,'sPrice'); $fID=odbc_result($cur,'rPrice'); $poNo=odbc_result($cur,'poNo'); $saleRate=odbc_result($cur,'percentage'); } } ?> HOME
Date
Supplier
Truck No.
Mine
Weigth (ton)
Rate/ton
Freight/ton
Expenes
Customer/Supplier
PO No.
Sale Rate
Weigth (Factory)
Fraight Account
.
"; echo "
"; ?> "; echo ""; echo ""; ?> "; // $query= "select * from itemInOut where (date_ between '$from' and '$to') and invno>0 and labid='".$_SESSION['labid']."' and recordType='$recordType' "; if($accountID!="") $query.=" and accountID='$accountID' "; if($anyvalue!=""){ if(is_numeric($anyvalue)){ $query.= " and poNo='$anyvalue' "; }else{ $company="select ID from student where stdName like'%$anyvalue%' and labid='".$_SESSION['labid']."' "; $query.= " and (remarks like '%$anyvalue%' or batchNo='$anyvalue' or uprice in($company) )"; } } if (isset($_GET['siteInvoiceNo'])){ $query.= " and poNo='$poNo' and date_='$date_' and batchNo='$batchNo' "; } echo "
"; $query.=" order by date_ asc,invno asc"; //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1;$total=$tqty=$amt=$totalFactoryWeight=$gross=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
#DateTruckSupplierCompanyPO_No.MineWeightF:WeightRateAmountFreight(Rate)ExpenesTotal"; $date2= date("d.m.y", strtotime(odbc_result( $cur, 'date_' ))); $invno=odbc_result($cur,'invno'); echo "
".$cnt."$date2"; echo "".odbc_result( $cur, 'batchNo' ); $accountName=getName($conn,"select stdName from student where ID='".odbc_result($cur, 'accountID')."' and recordType='Account'"); echo "".$accountName; $companyName=getName($conn,"select stdName from student where ID='".odbc_result($cur, 'uPrice')."' and recordType='Account'"); echo "".$companyName; echo "".odbc_result( $cur, 'poNo' ); if(odbc_result($cur,"img")!="") echo "".odbc_result( $cur, 'remarks' ).""; else echo "".odbc_result($cur,'remarks'); //echo "".$accountName; $tqty+=odbc_result( $cur, 'qty' ); $totalFactoryWeight+=odbc_result( $cur, 'sPrice' ); $amt=odbc_result( $cur, 'qty' )*odbc_result($cur,'pPrice'); $amt+=odbc_result( $cur, 'sPrice' )*odbc_result($cur,'tPrice'); //freight $amt+=odbc_result( $cur, 'discount' ); //Expenes //echo "".round(odbc_result( $cur, 'qty' ),2); echo ""; echo ""; echo ""; echo ""; //echo ""; echo ""; echo ""; echo ""; //echo "".round(odbc_result( $cur, 'sPrice' ),2); echo ""; //echo "".round(odbc_result($cur,'pPrice')); echo ""; echo "".round(odbc_result( $cur, 'qty' )*odbc_result($cur,'pPrice')); $gross+=(odbc_result( $cur, 'qty' )*odbc_result($cur,'pPrice')); echo "".round(odbc_result( $cur, 'sPrice' )*odbc_result($cur,'tPrice')); echo "
"; //echo "
".round(odbc_result($cur,'discount')); //exp echo ""; echo "".$amt; $total+=$amt; echo "" ; echo "" ; $cnt++; } $out=getName($conn,"select sum(qty) from itemInOut where (date_ between '$from' and '$to') and invno>0 and labid='".$_SESSION['labid']."' and recordType='Sale' "); //$out=getName($conn,"select sum(qty) from itemInOut where (date_ between '$from' and '$to') and labid='".$_SESSION['labid']."' and recordType='Sale' "); //echo "
IN
OUT
$tqty
".round($out,2)."
".$total; echo "
Total".round($tqty,2)."".round($totalFactoryWeight,2); echo ""; echo "".round($gross); echo ""; echo "".$total; //$in=getName($conn,"select sum(qty) from itemInOut where invno>0 and labid='".$_SESSION['labid']."' and recordType='Purchase' "); //$out=getName($conn,"select sum(qty) from itemInOut where invno>0 and labid='".$_SESSION['labid']."' and recordType='Sale' "); //echo "
Total IN
Total OUT
".round($in,2)."
".round($out,2)."
Balance".round(($in-$out),2); echo ""; echo ""; echo ""; echo "
"; echo "
"; echo "
"; ?>