P.O. Number
| Terms
| Due Date
| Project #
|
| | | |
|
Item Code
| Description
| Quantity
| Price
| Amount
|
mysql_select_db('ecosmar_inv', $dbcnx);
$prod_inv = @mysql_query("SELECT ID,prod_name,prod_desc,prod_qty,prod_price,dtup,dtnum,status FROM inv_prod WHERE invnum='$invnum'");
if (!$prod_inv) {
echo('Error retrieving Product Data. ' . 'Error: '. mysql_error(). ' ');
}
while($rowp = mysql_fetch_array($prod_inv)){
$PID = $rowp['ID'];
$prod_name = $rowp['prod_name'];
$prod_name_arr[] = $prod_name;
$prod_desc = $rowp['prod_desc'];
$prod_qty = $rowp['prod_qty'];
$prod_price = $rowp['prod_price'];
$status = $rowp['status'];
$amount = $prod_qty * $prod_price;
echo("$prod_name | $prod_desc" .
" | $prod_qty" .
" | $prod_price | $amount" .
" | ");
$full_amount[] = $amount;
}
?>
|
|
|
|
|
Eco-$mart Invoice Payments
|
Subtotal
$am_count = count($full_amount);
$i = 0;
$subtotal = 0;
while($i < $am_count){
$subtotal = $subtotal + $full_amount[$i];
$i++;
}
echo (" " . $subtotal . " ");
?>
|
Payments to Date |
Date
|
Payment Type
|
Amount
|
mysql_select_db('ecosmar_inv', $dbcnx);
$payem = @mysql_query("SELECT ID,amount,type,dtnum FROM inv_pay WHERE invnum='$invnum'");
if (!$payem) {
echo("Error retrieving Payment Data. Error: ". mysql_error(). " | ");
}else{
$pcount = mysql_num_rows($payem);
if($pcount < 1){
echo("No Payments Made | ");
$ptotal = '0.00';
}else{
while($rowp = mysql_fetch_array($payem)){
$IP = $rowp['ID'];
$pamount = $rowp['amount'];
$type = $rowp['type'];
$pdtnum = $rowp['dtnum'];
$chunk_pdtnum = chunk_split($pdtnum, 2, ':');
$chunk_arrp = explode(":", $chunk_pdtnum);
$paydus = $chunk_arrp[2].'-'.$chunk_arrp[3].'-'.$chunk_arrp[0].$chunk_arrp[1];
$payments[] = $pamount;
echo("$paydus | $type | $pamount | ");
}
$ptot = array_sum($payments);
$ptotal = printf('%.2f', $ptot);
}
}
echo("Total: | $ptotal | ");
?>
| Sales Tax
if($State == 'FL'){
$tax1 = .07;
}else{
$tax1 = 0;
}
$tax = $subtotal * $tax1;
echo (" " . $tax . " ");
?>
|
Total
$total = $subtotal + $tax;
echo (" " . $total . " ");
?>
|
Payments/Credits
|
Balance Due
|
|