|
|
|
ตรงราคารวม VAT ครับช่วยคิดภาษี 7 % ให้หน่อยครับคำนวณยังไงครับ |
|
|
|
|
|
|
|
<table width="652" height="78" border="1" align="center" bordercolor="#808080">
<tr bgcolor="#3D6297">
<td width="43" height="19" align="center" bgcolor="#B7B7FF"><b>เลขที่</b></td>
<td width="227" align="center" bgcolor="#B7B7FF"><b>รายการสั่งซื้อ</b></td>
<td width="73" align="center" bgcolor="#B7B7FF"><b>ราคารวม VAT </b></td>
<td width="103" align="center" bgcolor="#B7B7FF"><b>วันที่สั่งซื้อ</b></td>
<td width="101" align="center" bgcolor="#B7B7FF"><b>วันที่สิ้นสุด</b></td>
<td width="32" align="center" bgcolor="#B7B7FF"><b>พิมพ์</b></td>
<td width="27" align="center" bgcolor="#B7B7FF"><b>ลบ</b></td>
</tr>
<?
$cmd_s = "select * from sale where cus_id = '$c_id' and sale_status = 'presale' ";
$result_s = mysql_query($cmd_s,$link);
while($row_s=mysql_fetch_array($result_s))
{
?>
<tr bgcolor="#B2DFFF">
<td align="center" bgcolor="#E8E8FF">
<span class="style7">
<? if($row_s[sale_due] == $fullday) {echo"<b><font size='2' color = 'blue'>$row_s[sale_id]</font></b>"; }else {echo"<font size='2'>$row_s[sale_id]";}?>
</span> </td>
<td align="deafult" bgcolor="#E8E8FF">
<span class="style7">
<?
$n=0;
$cmd_st= "select * from saletemp where sale_id = '$row_s[sale_id]'";$result_st = mysql_query($cmd_st,$link);
while($row_st=mysql_fetch_array($result_st))
{
$cmd_pros = "select * from productstock where pros_id = '$row_st[pros_id]'"; $result_pros = mysql_query($cmd_pros,$link); $row_pros = mysql_fetch_array($result_pros);
$cmd_num = "select * from saletemp where pro_auto = '$row_pros[pro_auto]' and sale_id='$row_s[sale_id]' "; $result_num = mysql_query($cmd_num,$link);
$num = mysql_num_rows($result_num);
$cmd_pro = "select * from product where pro_auto = '$row_pros[pro_auto]'"; $result_pro = mysql_query($cmd_pro,$link); $row_pro = mysql_fetch_array($result_pro);
if($test != $row_st[pro_auto])
{
$n++;
$cost=$row_pro[pro_pricesale]*$num;
if($row_s[sale_due] == $fullday)
{echo"<b><font size='2' color = 'blue'> $n : $row_pro[pro_name] <font size='1' color = 'green'>[ $num ชิ้น $cost bath ]</font><BR>";}
else {echo"<font size='2'> $n : $row_pro[pro_name] <font size='1' color = 'green'>[ $num ชิ้น $cost bath ]</font><BR>";}
}
$test = $row_st[pro_auto];
}
?>
</span> </td>
<td align="center" bgcolor="#E8E8FF">
<span class="style7">
<? if($row_s[sale_due] == $fullday) {echo"<b><font size='2' color = 'blue'>$row_s[sale_cost]</font></b>"; }else {echo"<font size='2'>$row_s[sale_cost]";}?>
</span> </td>
<td align="center" bgcolor="#E8E8FF">
<span class="style7">
<? if($row_s[sale_due] == $fullday) {echo"<b><font size='2' color = 'blue'>$row_s[sale_date]</font></b>"; }else {echo"<font size='1'>$row_s[sale_date]";}?>
</span> </td>
<td align="center" bgcolor="#E8E8FF">
<span class="style7">
<? if($row_s[sale_due] == $fullday) {echo"<b><font size='4' color = 'blue'>$row_s[sale_due]</font></b>"; }else {echo"<font size='1'>$row_s[sale_due]";}?>
</span> </td>
<td align="center" bgcolor="#E8E8FF">
<a href="#" class="style7" onclick="Orderz=window.open('salez.php?<? echo"sale_id=$row_s[sale_id]"?>','Orderz','toolbar=no, status=no,width=550,height=600'); "?>','Orderz','toolbar=no, status=no,width=550,height=600'); "><? echo "<input type='image' src='admin/pic/print.gif'>"; ?></a></td>
<td align="center" bgcolor="#E8E8FF"><span class="style7"><? echo "<a href = 'profile.php?sale_id=$row_s[sale_id]&action=delsale' onclick='Javascript : return confirm(\"คุณแน่ใจที่จะลบข้อมูล ?\")'><img src='admin/pic/delete.gif' border = '0'></a>"; ?></span></td>
</tr>
<?
$sale_id=$row_s[sale_id];
}
?>
</table>
Tag : - - - -
|
|
|
|
|
|
Date :
2009-03-11 11:52:17 |
By :
aukkadet |
View :
3328 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ถ้าผมดูไม่ผิด
$row_s[sale_cost] คือราคาที่ไม่รวม vat ใช่ไหมครับ
ถ้าอยากให้เป็นราคาที่รวม vat แล้วก็คูณด้วย 1.07 เข้าไปครับ
ในที่นี้ Vat เป็น 7% นะครับ
Code (PHP)
<?
$sale_cost_vat = $row_s[sale_cost] *1.07 // ราคารวม Vat
?>
|
|
|
|
|
Date :
2009-03-11 12:57:34 |
By :
zepherus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ERROR ครับ
|
|
|
|
|
Date :
2009-03-11 16:26:19 |
By :
aukkadet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php
<table width="652" height="78" border="1" align="center" bordercolor="#808080">
<tr bgcolor="#3D6297">
<td width="43" height="19" align="center" bgcolor="#B7B7FF"><b>เลขที่</b></td>
<td width="227" align="center" bgcolor="#B7B7FF"><b>รายการสั่งซื้อ</b></td>
<td width="73" align="center" bgcolor="#B7B7FF"><b>ราคารวม VAT </b></td>
<td width="103" align="center" bgcolor="#B7B7FF"><b>วันที่สั่งซื้อ</b></td>
<td width="101" align="center" bgcolor="#B7B7FF"><b>วันที่สิ้นสุด</b></td>
<td width="32" align="center" bgcolor="#B7B7FF"><b>พิมพ์</b></td>
<td width="27" align="center" bgcolor="#B7B7FF"><b>ลบ</b></td>
</tr>
<?
$cmd_s = "select * from sale where cus_id = '$c_id' and sale_status = 'presale' ";
$result_s = mysql_query($cmd_s,$link);
while($row_s=mysql_fetch_array($result_s))
{
?>
<tr bgcolor="#B2DFFF">
<td align="center" bgcolor="#E8E8FF">
<span class="style7">
<? if($row_s[sale_due] == $fullday) {echo"<b><font size='2' color = 'blue'>$row_s[sale_id]</font></b>"; }else {echo"<font size='2'>$row_s[sale_id]";}?>
</span> </td>
<td align="deafult" bgcolor="#E8E8FF">
<span class="style7">
<?
$n=0;
$cmd_st= "select * from saletemp where sale_id = '$row_s[sale_id]'";$result_st = mysql_query($cmd_st,$link);
while($row_st=mysql_fetch_array($result_st))
{
$cmd_pros = "select * from productstock where pros_id = '$row_st[pros_id]'"; $result_pros = mysql_query($cmd_pros,$link); $row_pros = mysql_fetch_array($result_pros);
$cmd_num = "select * from saletemp where pro_auto = '$row_pros[pro_auto]' and sale_id='$row_s[sale_id]' "; $result_num = mysql_query($cmd_num,$link);
$num = mysql_num_rows($result_num);
$cmd_pro = "select * from product where pro_auto = '$row_pros[pro_auto]'"; $result_pro = mysql_query($cmd_pro,$link); $row_pro = mysql_fetch_array($result_pro);
if($test != $row_st[pro_auto])
{
$n++;
$cost=$row_pro[pro_pricesale]*$num;
if($row_s[sale_due] == $fullday)
{echo"<b><font size='2' color = 'blue'> $n : $row_pro[pro_name] <font size='1' color = 'green'>[ $num ชิ้น $cost bath ]</font><BR>";}
else {echo"<font size='2'> $n : $row_pro[pro_name] <font size='1' color = 'green'>[ $num ชิ้น $cost bath ]</font><BR>";}
}
$test = $row_st[pro_auto];
}
?>
</span> </td>
<td align="center" bgcolor="#E8E8FF">
<span class="style7">
<?
if($row_s[sale_due] == $fullday)
{
$sale_cost_vat = $row_s[sale_cost] *1.07; // เพิ่มภาษี 7%
echo"<b><font size='2' color = 'blue'>$sale_cost_vat</font></b>";
}
else
{
echo"<font size='2'>$sale_cost_vat";
}
?>
</span> </td>
<td align="center" bgcolor="#E8E8FF">
<span class="style7">
<? if($row_s[sale_due] == $fullday) {echo"<b><font size='2' color = 'blue'>$row_s[sale_date]</font></b>"; }else {echo"<font size='1'>$row_s[sale_date]";}?>
</span> </td>
<td align="center" bgcolor="#E8E8FF">
<span class="style7">
<? if($row_s[sale_due] == $fullday) {echo"<b><font size='4' color = 'blue'>$row_s[sale_due]</font></b>"; }else {echo"<font size='1'>$row_s[sale_due]";}?>
</span> </td>
<td align="center" bgcolor="#E8E8FF">
<a href="#" class="style7" onclick="Orderz=window.open('salez.php?<? echo"sale_id=$row_s[sale_id]"?>','Orderz','toolbar=no,status=no,width=550,height=600'); "?>','Orderz','toolbar=no,status=no,width=550,height=600'); "><? echo "<input type='image' src='admin/pic/print.gif'>"; ?></a></td>
<td align="center" bgcolor="#E8E8FF"><span class="style7"><? echo "<a href = 'profile.php?sale_id=$row_s[sale_id]&action=delsale' onclick='Javascript : return confirm(\"คุณแน่ใจที่จะลบข้อมูล ?\")'><img src='admin/pic/delete.gif' border = '0'></a>"; ?></span></td>
</tr>
<?
$sale_id=$row_s[sale_id];
}
?>
</table>
?>
ลองดูอีกรอบนะครับ
|
|
|
|
|
Date :
2009-03-11 17:18:16 |
By :
zepherus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับ
|
|
|
|
|
Date :
2009-03-12 09:09:26 |
By :
aukkadet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|