How To Calculate Monthly Net Income [closed]


I have an expenses table that receives expenses and display data using date-picker. I also have a sales details table with profit margin column which is calculated by multiplying the profit margin by the quantity of the product purchased. The sum of the profit margin column produces the total profit from sales. I want to know how I can subtract the expenses from the total profit?

Sales Details table

Expenses table

Source: Ask PHP