swanside Posted December 27, 2007 Share Posted December 27, 2007 Hi all, I have setup a few php pages to access my database, but on my invoice page, It starts to go wrong. This is the way it works. I send an engineer to a job he is there for 1 hour at £25. He uses some materials which total £10, I put on an additional cost on the materials of 10%. The invoice will now total £36. A second engineer goes to the same job to help the first engineer, he does not use anythingso its only another £25 for him, the invoice should now total £61, but it wont. It shows up as £72 because it has aded the materials to the second engineer aswell. Has anybody got any ideas please? Here is the code that does the work. select job.Job_No, job.Order_Date, job.File_No, job.Order_Site_Address, job.Job_Description, customer.Customer_Name, customer.Billing_Address, labour.Working_Hrs * Paying_Rate, labour.Working_Hrs * Paying_Rate * 0.175, (material.Quantity * Unit_Price * Additional_Cost / 100 + Quantity * Unit_Price)*0.175, material.Quantity * Unit_Price + (Quantity * Unit_Price * Additional_Cost / 100), (labour.Working_Hrs * Paying_Rate + material.Quantity * Unit_Price + Quantity * Unit_Price * Additional_Cost / 100) * 0.175, labour.Working_Hrs * Paying_Rate + material.Quantity * Unit_Price + (Quantity * Unit_Price * Additional_Cost / 100), (labour.Working_Hrs * Paying_Rate + material.Quantity * Unit_Price + Quantity * Unit_Price * Additional_Cost / 100) * 0.175 + labour.Working_Hrs * Paying_Rate + material.Quantity * Unit_Price + (Quantity * Unit_Price * Additional_Cost / 100) from job inner join labour on (job.Job_No=labour.Job_No) inner join material on (job.Job_No=material.Job_No) inner join customer on (job.Customer_Name=customer.Customer_Name) Thanks Paul. Quote Link to comment https://forums.phpfreaks.com/topic/83335-problems-on-invoice-page/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.