IBWS PAYMENT PLAN
$grandtotal=0;
$sqlstr ="SELECT * FROM Ref_IBWSPayment_Plan WHERE $where ";
//echo $sqlstr;
$result = mysqli_query($conn,$sqlstr);
while($record = mysqli_fetch_array( $result ))
{
$Invno=$record['Inv_No'];
$ETD=$record['Etd'];
$FTy=$record['NickName'];
$invoicedt=$record['Inv_Date'];
$Intrenal=$record['Internal'];
///////due date
//echo $FTy;
$sql22=mysqli_query($conn,"Select * from Factory Where NickName='$FTy'");
$record22=mysqli_fetch_array($sql22);
$crediteddays=$record22['Dept1'];
if($crediteddays != "")
{
$newdate = strtotime ( $crediteddays.'days' , strtotime ( $invoicedt ) ) ;
$newdate = date ( 'Y-m-j' , $newdate );
}
?>
| Invoice No |
|
FTY |
|
| Invoice Date |
|
ETD |
|
| Due Date |
|
|
|
|
| Parts |
Sc No |
Amt |
|
$ttlparts=0;
$ttlamountfull=0;
$sqlstr5 ="SELECT * FROM Payment_IBWS_P_SC WHERE Inv_No='$Invno' order by Sc_No ASC ";
//echo $sqlstr;
$result5 = mysqli_query($conn,$sqlstr5);
while($record5 = mysqli_fetch_array( $result5 ))
{
$scno=$record5['Sc_No'];
$invamt=$record5['sumvalsc'];
//$seqno
$ttlparts=$ttlparts+$invamt;
$selctship=mysqli_query($conn,"Select Max(Ship_No) as maxship From Ibws_Data_shp_qty Where Inv_No='$Invno' AND Sc_No='$scno'");
$record66=mysqli_fetch_array($selctship);
$maxshipno=$record66['maxship'];
$scnoship=$scno."-".$maxshipno;
?>
| |
|
0.00 |
|
}
?>
| |
Parts Total |
0.00 |
|
| |
|
|
|
|
$sqlstr7 ="SELECT * FROM Ref_Ibws_SPvalue WHERE Inv_No='$Invno' ";
//echo $sqlstr;
$result7= mysqli_query($conn,$sqlstr7);
$sumspfull=$result7['sumspfull'];
if($sumspfull > '0')
{
?>
| Spares |
Sc No |
Amt |
|
$ttlspares=0;
$sqlstr6 ="SELECT * FROM Payment_IBWS_SP_SC WHERE Inv_No='$Invno' order by Sc_No ASC ";
//echo $sqlstr;
$result6 = mysqli_query($conn,$sqlstr6);
while($record6 = mysqli_fetch_array( $result6 ))
{
$scno=$record6['Sc_No'];
$invamt=$record6['spval'];
$ttlspares=$ttlspares+$invamt;
if($invamt > '0')
{
?>
| |
|
0.00 |
|
}
// }
}
?>
| |
Spares Total |
0.00 |
|
}
?>
| |
|
|
|
|
| Total Amt |
Parts Total |
0.00 |
if($sumspfull > '0')
{
?>
| |
Spares Total |
0.00 |
}
$pmttl=0;
$sqlstr7 ="SELECT * FROM Ibws_Inv_Plus_Minus WHERE internal='$Intrenal' ";
//echo $sqlstr;
$result7 = mysqli_query($conn,$sqlstr7);
while($record7 = mysqli_fetch_array( $result7 ))
{
$des=$record7['plus_minus_des'];
$pmvalue=$record7['plus_minus'];
$pmttl=$pmttl+$pmvalue;
?>
| |
|
0.00 |
}
$ttlamountfull=$pmttl+$ttlparts+$ttlspares;
$grandtotal=$grandtotal+$ttlamountfull;
?>
| |
|
|
|
0.00 |
| |
|
|
|
|
}
?>
| |
Grand Total |
0.00 |