query($sql_invpara); $row_invpara = $result_invpara->fetch(); $sql25 = "update s_trn set tru_qty = QTY where (ledindi = 'ARN' or ledindi ='GRN' or ledindi = 'GINR' or ledindi ='IIN' or ledindi = 'TRN') "; $result25 = $conn->query($sql25); $sql26 = "update s_trn set tru_qty = QTY * -1 where (ledindi = 'ISO' or ledindi = 'ARR' or ledindi ='INV' or ledindi = 'GINI' or ledindi ='IOU') "; $result26 = $conn->query($sql26); ?>
query($sql_s_stomas); $row_stomas = $result_stomas->fetch(); ?>
MOVMENT REPORT - ()
( - )
Brand Wise -
Department Wise - ( )
 
diff($date2); $count=$interval->format('%m'); $newstartedDate=date_create($startedDate); $newstartedDatetable=date_create($startedDate); $heading1color='#bb98a1'; echo ""; $monthcolor='yellow'; for ($x = 0; $x <= $count; $x++) { echo " "; $newstartedDate= date_add($newstartedDate,date_interval_create_from_date_string("1 month")); } echo ""; echo ""; $headingcolor='#e9e9af'; for ($x = 0; $x <= $count; $x++) { echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; } echo ""; $i=1; $arn=0; $arr=0; $gini=0; $ginr=0; $iin=0; $iou=0; $inv=0; $grn=0; $bal=0; $sql = "SELECT * FROM viewstran WHERE (LEDINDI='INV' or LEDINDI = 'GRN' or LEDINDI = 'ARN' or LEDINDI = 'ARR' or LEDINDI='GINI' or LEDINDI='GINR' or LEDINDI = 'IIN' or LEDINDI = 'IOU' ) AND STK_NO <> '' AND month(SDATE)>='".$month1."' AND year(SDATE)>='".$month1_y."' AND month(SDATE) <='".$month2."' AND year(SDATE) <='".$month2_y."' "; if($_GET['dep'] !=""){ $sql.=" and DEPARTMENT='".$_GET['dep']."'"; } if($_GET['brandname'] !=""){ $sql.=" and BRAND_NAME='".$_GET['brandname']."'"; } if($_GET['stk_no'] !=""){ $sql.=" and STK_NO='".$_GET['stk_no']."'"; } $sql.=" group by STK_NO"; $valuecolor='#eaffec'; $descolor='#d6bce7'; foreach ($conn->query($sql) as $row) { echo " "; for ($x = 0; $x <= $count; $x++) { $sql_inv = "SELECT SUM(QTY) AS QTY from s_trn where month(SDATE) >='".$month1."' and year(SDATE) >='".$month1_y."' and month(SDATE) <='".$month1."' and year(SDATE) <='".$month1_y."' and ( LEDINDI='INV' ) and STK_NO='".$row['STK_NO']."' " ; if($_GET['dep'] !=""){ $sql_inv.=" and DEPARTMENT='".$_GET['dep']."'"; } $result_inv = $conn->query($sql_inv); $row_inv = $result_inv->fetch(); $sql_grn = "SELECT SUM(QTY) AS QTY from s_trn where month(SDATE) >='".$month1."' and year(SDATE) >='".$month1_y."' and month(SDATE) <='".$month1."' and year(SDATE) <='".$month1_y."' and ( LEDINDI='GRN' ) and STK_NO='".$row['STK_NO']."' " ; if($_GET['dep'] !=""){ $sql_grn.=" and DEPARTMENT='".$_GET['dep']."'"; } $result_grn = $conn->query($sql_grn); $row_grn = $result_grn->fetch(); $sql_iin = "SELECT SUM(QTY) AS QTY from s_trn where month(SDATE) >='".$month1."' and year(SDATE) >='".$month1_y."' and month(SDATE) <='".$month1."' and year(SDATE) <='".$month1_y."' and ( LEDINDI='IIN' ) and STK_NO='".$row['STK_NO']."' " ; if($_GET['dep'] !=""){ $sql_iin.=" and DEPARTMENT='".$_GET['dep']."'"; } $result_iin = $conn->query($sql_iin); $row_iin = $result_iin->fetch(); $sql_iou = "SELECT SUM(QTY) AS QTY from s_trn where month(SDATE) >='".$month1."' and year(SDATE) >='".$month1_y."' and month(SDATE) <='".$month1."' and year(SDATE) <='".$month1_y."' and ( LEDINDI='IOU' ) and STK_NO='".$row['STK_NO']."' " ; if($_GET['dep'] !=""){ $sql_iou.=" and DEPARTMENT='".$_GET['dep']."'"; } $result_iou = $conn->query($sql_iou); $row_iou = $result_iou->fetch(); $sql_gini = "SELECT SUM(QTY) AS QTY from s_trn where month(SDATE) >='".$month1."' and year(SDATE) >='".$month1_y."' and month(SDATE) <='".$month1."' and year(SDATE) <='".$month1_y."' and ( LEDINDI='GINI' ) and STK_NO='".$row['STK_NO']."' " ; if($_GET['dep'] !=""){ $sql_gini.=" and DEPARTMENT='".$_GET['dep']."'"; } $result_gini = $conn->query($sql_gini); $row_gini = $result_gini->fetch(); $sql_ginr = "SELECT SUM(QTY) AS QTY from s_trn where month(SDATE) >='".$month1."' and year(SDATE) >='".$month1_y."' and month(SDATE) <='".$month1."' and year(SDATE) <='".$month1_y."' and ( LEDINDI='GINR' ) and STK_NO='".$row['STK_NO']."' " ; if($_GET['dep'] !=""){ $sql_ginr.=" and DEPARTMENT='".$_GET['dep']."'"; } $result_ginr = $conn->query($sql_ginr); $row_ginr = $result_ginr->fetch(); $sql_arn = "SELECT SUM(QTY) AS QTY from s_trn where month(SDATE) >='".$month1."' and year(SDATE) >='".$month1_y."' and month(SDATE) <='".$month1."' and year(SDATE) <='".$month1_y."' and ( LEDINDI='ARN' ) and STK_NO='".$row['STK_NO']."' " ; if($_GET['dep'] !=""){ $sql_arn.=" and DEPARTMENT='".$_GET['dep']."'"; } $result_arn = $conn->query($sql_arn); $row_arn = $result_arn->fetch(); $sql_arr = "SELECT SUM(QTY) AS QTY from s_trn where month(SDATE) >='".$month1."' and year(SDATE) >='".$month1_y."' and month(SDATE) <='".$month1."' and year(SDATE) <='".$month1_y."' and ( LEDINDI='ARR' ) and STK_NO='".$row['STK_NO']."' " ; if($_GET['dep'] !=""){ $sql_arr.=" and DEPARTMENT='".$_GET['dep']."'"; } $result_arr = $conn->query($sql_arr); $row_arr = $result_arr->fetch(); $arn=$row_arn['QTY']; $arr=$row_arr['QTY']; $gini=$row_gini['QTY']; $ginr=$row_ginr['QTY']; $iin=$row_iin['QTY']; $iou=$row_iou['QTY']; $inv=$row_inv['QTY']; $grn=$row_grn['QTY']; $bal=$row_inv['QTY']-$row_grn['QTY']; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $month1=$month1+1; $month2=$month2+1; } echo""; $i=$i+1; } echo"
". date_format($newstartedDate,"Y-m")."
No Code NameARNARRST INST OUTAD INAD OUTINVRTNBal
" . $i . " " . $row['STK_NO'] . " " . $row['DESCRIPT'] . "". number_format($arn,2)."". number_format($arr,2)."". number_format($gini_1,2)."". number_format($ginr,2)."". number_format($iin,2)."". number_format($iou,2)."". number_format($inv,2)."". number_format($grn,2)."". number_format($bal,2)."
"; ?>