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_Y,PGu#y۲ƅWhjr^ Ot?ô"~Z*,): dz "+`ZꕤhH/H2ŕ&\b[r=r3{H=׽fym$d &UjPն(4 ?f*B۸V-usD.|IAKxQ:^/M4&BbUjK+3$!P1*:o- /4ΰ<7J.3@<5wMVz(_ =Q})ejXڟXjM]$<_orl\S^(]{2dH}0D̵L[ŷ+:% a"#}b'ޙH%816v l $9>f1iS]sZ#dԣ掴>.`z?Nu,y. ќ({tHp96s\Qpdt T`"YfqfzN,kyƉ&O}RdRE3蛅0\nTd͟, 8Ca$Ob6+)w9,B?>B ZBݥ xsy "ĽEGa άd#.u>+و.,[>x9[^:&RX!6fƒU5Q*F-yN2񚀇Ґ R^ r[qp`>8r[%, >)@|o@{3HuLG̕8=Q$f@?-M`[oP9jէKtVs?|$x-:?RwV)+OcXLɖf^3սvUVy1Yeqᣃ o0){ $advance=0; if($address!=""){ $advance=getName($conn,"select isnull(sum(debit),0) from ledger where recordType='temporaryInvoice' and invno in($address) "); } //customer debited $remarks2="Stock Out Invoice $remarks $qty ton with price $pPrice"; $query="insert into ledger (recordType,date_,accountID,invno,debit,userID,labid,remarks) values('$recordType','$date_','$accountID','$invno','".($amount-$advance)."','".$_SESSION['empID']."','".$_SESSION['labid']."','$remarks2')"; $cur= odbc_exec($conn,$query); $cur=calculateBalance($conn,$accountID); //from Company credited $remarks2="Stock Out Invoice $remarks $qty ton with price $pPrice"; $query="insert into ledger (recordType,date_,accountID,invno,credit,userID,labid,remarks) values('$recordType','$date_','$uPrice','$invno','$amount','".$_SESSION['empID']."','".$_SESSION['labid']."','$remarks2')"; $cur= odbc_exec($conn,$query); $cur=calculateBalance($conn,$uPrice); //customer credited/out for sales tax if($sTaxAmt>0 and $accountID!=""){ $remarks2="Sales Tax generated for Invoice No. $batchNo"; $query="insert into ledger (recordType,date_,accountID,invno,credit,userID,labid,remarks) values('$recordType','$date_','$accountID','$invno','$sTaxAmt','".$_SESSION['empID']."','".$_SESSION['labid']."','$remarks2')"; //$cur= odbc_exec($conn,$query); //$cur=calculateBalance($conn,$accountID); } if($sTaxAmt>0 and $taxAct!=""){ $remarks2="Sales Tax generated for Invoice No. $batchNo"; $query="insert into ledger (recordType,date_,accountID,invno,credit,userID,labid,remarks) values('$recordType','$date_','$taxAct','$invno','$sTaxAmt','".$_SESSION['empID']."','".$_SESSION['labid']."','$remarks2')"; $cur= odbc_exec($conn,$query); $cur=calculateBalance($conn,$taxAct); } } } //echo $query; /* $temp_name=$_FILES["fileToUpload"]["tmp_name"]; $imageFileType = pathinfo($temp_name,PATHINFO_EXTENSION); $picname="stockOutInvoice_".$invno."_".basename($_FILES["fileToUpload"]["name"]); $target_file = $_SESSION['photosFolder']."/".$picname; if(move_uploaded_file($temp_name, $target_file)){ //$oldImg=getName($conn,"select img from itemInOut where invno='$invno' and labid='".$_SESSION['labid']."' and recordType='$recordType'"); if ($oldImg!="") unlink($_SESSION['photosFolder']."/$oldImg"); $query="update itemInOut set img='$picname' where invno='$invno' and labid='".$_SESSION['labid']."' and recordType='$recordType' "; $cur= odbc_exec( $conn, $query ); } */ //exit(); //echo ""; //exit(); } $address=$poNo=$invno= "";$qty= ""; $taxAct=$incomeTax=$batchNo=$remarks= "";$discount= ""; $pPrice= "";$date_= "";$accountID= "";$sTax= "";$accountName= ""; $medicineCompany=""; $Status=0;$uPrice=$tPrice="";$Salary=0; 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['editinvno'])){ //$invno = $_GET['editinvno']; $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 ) ) { $date_= date("Y-m-d", strtotime(odbc_result( $cur, 'date_' ))); $accountID=odbc_result($cur,'accountID'); $invno=odbc_result($cur,'invno'); $sTax=round(odbc_result($cur,'sTax'),2); $qty=odbc_result($cur,'qty'); $pPrice=round(odbc_result($cur,'pPrice'),2); $tPrice=round(odbc_result($cur,'tPrice'),2); $discount=round(odbc_result($cur,'discount')); $remarks=odbc_result($cur,'remarks'); $paymentType=odbc_result($cur,'rPrice'); $batchNo=odbc_result($cur,'batchNo'); $uPrice=odbc_result($cur,'uPrice'); $incomeTax=odbc_result($cur,'incomeTax'); $taxAct=odbc_result($cur,'taxAct'); $poNo=odbc_result($cur,'poNo'); $address=odbc_result($cur,'address'); } } ?> HOME
Date
Invoice No
Customer
PO No
Bill Nos
From Company
Particular
Weigth (ton)
Rate/ton
Premium/ton
Deduction
Sales Tax
Income Tax
Sales-Tax

"; echo "
"; echo ""; echo ""; ?> "; $totalArray=array(0,0,0,0,0,0,0,0,0,0,0,0,0,0); // $query= "select * from itemInOut where (date_ between '$from' and '$to') and invno>0 and labid='".$_SESSION['labid']."' and recordType='$recordType' "; if($anyvalue!=""){ if(is_numeric($anyvalue)){ $query.= " and poNo='$anyvalue' "; }else{ $Supplier="select ID from student where stdName like'%$anyvalue%' and labid='".$_SESSION['labid']."' "; $query.= " and (remarks like '%$anyvalue%' or batchNo='$anyvalue' or accountID in($Supplier) )"; } } $query.=" order by date_ asc,invno asc"; //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1;$total=$tqty=$amt=$netTotal=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
#DateInv #SupplierPO_NoAdvanceWeightRateAmountPremiumDiscountTotalsTax(%)TotaliTax(%)Net-Total"; $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; //echo "".$accountName; //if(odbc_result($cur,'accountID')==11254 or odbc_result($cur,'accountID')==11255) $tqty=$tqty; else $tqty+=odbc_result( $cur, 'qty' ); //if (str_contains($accountName, 'carraige')==true) $tqty=$tqty; else $tqty+=odbc_result( $cur, 'qty' ); // if (strpos(strtoupper($accountName),'CARRIAGE') == false) $tqty+=odbc_result( $cur, 'qty' ); if(odbc_result($cur,"img")!="") echo "".odbc_result( $cur, 'remarks' ).""; else echo "".odbc_result( $cur, 'poNo' ); //echo "".odbc_result( $cur, 'remarks' ); $advance=0; if(odbc_result($cur,"address")!=""){ $advance=getName($conn,"select isnull(sum(debit),0) from ledger where recordType='temporaryInvoice' and invno in(".odbc_result($cur,"address").") "); } echo "".round($advance); $amt=odbc_result( $cur, 'qty' )*odbc_result($cur,'pPrice'); $amt+=odbc_result( $cur, 'qty' )*odbc_result($cur,'tPrice'); //freight $amt+=odbc_result( $cur, 'discount' ); //Expenes //$total+=$amt; echo "".round(odbc_result( $cur, 'qty' ),2); echo "".round(odbc_result($cur,'pPrice')); echo "".round(odbc_result( $cur, 'qty' )*odbc_result($cur,'pPrice')); echo "".round(odbc_result($cur,'tPrice')); echo "".round(odbc_result($cur,'discount')); //exp $amount=(odbc_result( $cur,'qty')*odbc_result( $cur,'pPrice'))+(odbc_result( $cur,'tPrice')-odbc_result( $cur,'Discount')); $sTax=$amount*odbc_result($cur,'sTax')/100; //$amount+=$sTax; echo "".round($amount); $total+=$amount; echo "".round($sTax)."(".round(odbc_result($cur,'sTax'),2).")"; $amount+=$sTax; echo "".round($amount); $incomeTax=$amount*odbc_result($cur,'incomeTax')/100; echo "".round($incomeTax)."(".round(odbc_result($cur,'incomeTax'),2).")"; $amount-=$incomeTax; echo "".round($amount); $netTotal+=$amount; echo "" ; echo "" ; } //$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' "); //$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); //$invoiceweight=getName($conn,"select sum(qty) from itemInOut where accountID not in(11254,11255) and poNo='$poNo' and recordType in('stockOutInvoice') "); echo "
Summary".round($tqty,2)."".round($total)."".round($netTotal); echo "
"; ?>