Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/83335-problems-on-invoice-page/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.