bugmenot 25 Posting Whiz in Training
public static boolean INSERT(Payment argPayment, Connection con) {
        boolean result = false;
        Connection mastercon = MyConnection.getMasterConnection();

        try {
//            String selectStatement = "SELECT SUM(AMOUNT) AS TOTALAMOUNT, SUM(PAID) AS TOTALPAID,OUTSTANDING FROM PAYMENT WHERE SUBID=? AND OFFICEID=? GROUP BY SUBID";
            String selectStatement = "SELECT PAID AS TOTALPAID,OUTSTANDING FROM PAYMENT WHERE SUBID=? AND OFFICEID=? AND ID = (SELECT MAX(ID) FROM PAYMENT WHERE SUBID=? AND OFFICEID=?) GROUP BY SUBID";
            PreparedStatement stmt = con.prepareStatement(selectStatement);
            stmt.setInt(1, argPayment.getSubid());
            stmt.setInt(2, argPayment.getOfficeID());
            stmt.setInt(3, argPayment.getSubid());
            stmt.setInt(4, argPayment.getOfficeID());
            ResultSet rs = stmt.executeQuery();
            if (rs.next()) {
                argPayment.setSumPaid(rs.getFloat("TOTALPAID"));
                argPayment.setOutstanding(rs.getFloat("OUTSTANDING"));
//                argPayment.setSumAmount(rs.getFloat("TOTALAMOUNT"));
            }

            String insertStatement = "INSERT INTO PAYMENT(SUBID,AMOUNT,PAID,OUTSTANDING,ENTRYDATE,REMARK,COURIERCHARGE,LESSPAYMENT,OFFICEID) VALUES (?,?,?,?,?,?,?,?,?)";
            PreparedStatement stat = con.prepareStatement(insertStatement);
            stat.setInt(1, argPayment.getSubid());
            stat.setFloat(2, argPayment.getAmount());
            stat.setFloat(3, argPayment.getAmount() + argPayment.getSumPaid());
            stat.setFloat(4, argPayment.getOutstanding() - argPayment.getAmount());

            stat.setDate(5, argPayment.getEntryDate());
            stat.setString(6, argPayment.getRemark());
            stat.setFloat(7, argPayment.getCourierCharge());
            stat.setFloat(8, argPayment.getLessPayment());
            stat.setInt(9, argPayment.getOfficeID());

            con.setAutoCommit(false);
            if (stat.executeUpdate() > 0) {
                int subid = argPayment.getSubid();
                Purchase purchase = DBPurchase.retrive(subid, argPayment.getOfficeID(), con);
                int partyid = purchase.getParty().getPartyID();
                Account partyAccount = DBAccount.retrieveAccountByIDandType(partyid, "PARTY", mastercon);
                Account officeAccount = DBAccount.retrieveAccountByIDandType(argPayment.getOfficeID(), "OFFICE", mastercon);
                AccountTrack partyAccountTrack = new AccountTrack();
                partyAccountTrack.setId(partyAccount.getId());
                partyAccountTrack.setCredit(true);
                partyAccountTrack.setDate(argPayment.getEntryDate());
                partyAccountTrack.setAmount(argPayment.getAmount());
                partyAccountTrack.setDescription("Payment for payment id-" + argPayment.getId());
                if (DBAccountTrack.insert(partyAccountTrack)) {
                    AccountTrack officeAccountTrack = new AccountTrack();
                    officeAccountTrack.setId(officeAccount.getId());
                    officeAccountTrack.setCredit(false);
                    officeAccountTrack.setDate(argPayment.getEntryDate());
                    officeAccountTrack.setAmount(argPayment.getAmount());
                    officeAccountTrack.setDescription("Payment for payment id-" + argPayment.getId());

                    if (DBAccountTrack.insert(officeAccountTrack)) {
                        AccountTrack pAccountTrack = new AccountTrack();
                        pAccountTrack.setId(partyAccount.getId());
                        pAccountTrack.setCredit(false);
                        pAccountTrack.setDate(argPayment.getEntryDate());
                        float amount = argPayment.getLessPayment() + argPayment.getCourierCharge();
                        pAccountTrack.setAmount(amount);
                        pAccountTrack.setDescription("Less Payment and Courier Charge-" + argPayment.getId());

                        if (DBAccountTrack.insert(pAccountTrack)) {
                            AccountTrack oAccountTrack = new AccountTrack();
                            oAccountTrack.setId(officeAccount.getId());
                            oAccountTrack.setCredit(true);
                            oAccountTrack.setDate(argPayment.getEntryDate());
                            float officeAmount = argPayment.getLessPayment() + argPayment.getCourierCharge();
                            oAccountTrack.setAmount(amount);
                            oAccountTrack.setDescription("Less Payment and Courier Charge-" + argPayment.getId());

                            result = DBAccountTrack.insert(oAccountTrack);
                            con.commit();                            
                        }

                    }
                }
            }

        } catch (Exception …
stephen84s commented: 194 Posts and still no code tags -1
Ezzaral commented: This code is absolutely useless as a response to the question. -3
bugmenot 25 Posting Whiz in Training

Yeah, I'm having a similar problem with an ASUS mobo with a Pentium III processor. The power supply is working, HD is spinning, CD-ROM's are working, fan on CPU is running, etc. The power button on the front of the computer isn't working. I tried taking out the RAM and CPU and re-inserting them, no luck. I guess my next step is completely taking out all the hardware and reinserting it. A friend suggested it could be a bad video card or CPU but that seems weird, especially with a Pentium III, I've never had to replace a P3. Anyone have any similar experiences or input? Thanks in advance.

I'm having the same exact problem. I was opening my case for some reason put it back together and nothing displays on my monitor but all my fans and drives spin but my power LED does not come on. My email address is jayman1233@gmail.com

bugmenot 25 Posting Whiz in Training

how about you just store it as an integer which when divided by 20 yields your number?

iamthwee commented: nope -2
bugmenot 25 Posting Whiz in Training

Hi I am a newbie to this kind of thing as well as to this site and I need some help!!! I have come very close to making the new PS Eye (SLEH-00201) camera work on my laptop, but I really have no idea what I'm doing.

This guy has done some work on fishing out the details for the camera's USB data. Try posting your message there.