Jump to content

bozeman

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bozeman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Sunfighter, I have your code up on tour site : www.msits.co.za/manage/test_java.php. It does generate decimals if you unselect randomly. Not sure how to work around this issue.
  2. The code for the display of the table is in the function ShowOpenInv(). This runs through the database and displays the table. It displays the values correctly from the php code but when working on it from the java bit it gives the multiple decimal value in the ipay_amount text box. All the code is in my previous post. I can give you access to the script, but i dont want to post the link here though.
  3. function ShowOpenInv($CUST) { global $db; $sql = "SELECT * FROM Orders WHERE Order_Status = '1' AND Company_ID = '$CUST' AND Invoice_Total <> '0' AND (Invoice_Total - Payment_Total) <> '0' "; $q = $db->query($sql); if (PEAR::isError($q)) { showError ($q); exit; } $numRows = $q->numRows(); print "<table width='100%' border='0' cellspacing='0' cellpadding='2'><tr> <td class='tdTabColumns' width='50'>Invoice No</td> <td class='tdTabColumns' width='100'>Date</td> <td class='tdTabColumns'>Header</td> <td class='tdTabColumns' width='120' align='right'>Total Invoiced</td> <td class='tdTabColumns' width='120' align='right'>Total Payments</td> <td class='tdTabColumns' width='120' align='right'>Shortfall</td> <td class='tdTabColumns' width='32' align='right'>Pay now</td> </tr>"; while ($row = $q->fetchRow()) { if ($_class == "trLine1") { $_class = "trLine2"; } else { $_class = "trLine1"; }; $inv_no = $row['Invoice_No']; $inv_date = $row['Order_Date']; $inv_head = $row['Order_Header']; $inv_total = $row['Invoice_Total']; $inv_payment = $row['Payment_Total']; $shortfall = $inv_total - $inv_payment; $shortfall = number_format ($shortfall, 2, '.','') ; print "<tr class='$_class' ONMOUSEOVER=\"this.className='mOver'\" ONMOUSEOUT=\"this.className='$_class'\" >\n"; print "<td class='tdTabDetail'>$inv_no</td>"; print "<td class='tdTabDetail'>$inv_date</td>"; print "<td class='tdTabDetail'>$inv_head</td>"; print "<td class='tdTabDetail' align='right'>$inv_total</td>"; print "<td class='tdTabDetail' align='right'>$inv_payment</td>"; print "<td class='tdTabDetail' align='right' id='ivalue$inv_no'>$shortfall</td>"; print "<td class='tdTabDetail'><input name='icb$inv_no' id='icb$inv_no' type='checkbox' value='1' onclick=\"alter('$inv_no')\"></td>"; print "</tr>"; } print "</table>"; } <script type="text/javascript"> function alter(colo){ if (document.getElementById('icb'+colo).checked) { document.getElementById('ipay_amount').value = ((document.getElementById('ipay_amount').value)*1 + (document.getElementById('ivalue'+colo).innerHTML)*1); } else { document.getElementById('ipay_amount').value = ((document.getElementById('ipay_amount').value)*1 - (document.getElementById('ivalue'+colo).innerHTML)*1); } } </script> print "<input name='ipay_amount' id='ipay_amount' size='11.2' maxlength='11.2' $InputStyle value='0.00' >"; Hi, I got it all working with the checkboxes. I only have 2 problems with the system at the moment : 1. The numbers for some reason pick up numerous decimal values when adding and subtracting (eg : 54827.01000000001). But my numbers which are being worked with are all 2 decimals ? 2. How do I get the value in the ipay_total text box on post (when I view the source html it still shows 0.00 but in the browser it shows the amount)? PS : I have included only the code parts which are effected. Thanks for your help.
  4. This is a good start for me. I'm going to start working on the implementation and let you know how it goes. Thank you very much. The code was rather easy to understand.
  5. Hi All, i have the following problem which i need some help with: I have a payment screen where it shows a list of outstanding invoices with a corresponding checkbox - see attached image. What i would like to do is the following : When the user clicks the checkboxes it must update the total of the payment. I'm new to jquery, any help would be appreciated. [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.