0
I am making a system for controlling expenses/revenues, and I want to know how to make the amounts of revenue or expenditure if they add to the balance only after confirmation of payment. Ex: register a light bill to pay in the amount of R $ 100,00 in for a week from now. My current balance is R$ 200,00, but I just want the amount of the electricity bill to be deducted from the balance only when I mark the electricity bill as paid. How can I do this using PHP only?
I think you have a specification problem. It doesn’t make sense for you to save the balance in the bank. You already have the income and expenses, the balance should always be a calculated amount by adding the revenues and subtracting the expenses.
– Júlio Neto
agree with the problem of specification... an account to pay, is only a record, a document, and not a financial movement, in motion yes, you can record the balance.
– Rovann Linhalis
I think you should enter as expenses in the act of effective payment, before that is Bills to Pay
– user60252
ps. I write the balance in my drive table, since it does not suffer updates or delete, only Inserts, so I have the columns,
valor
,saldo_anterior
,saldo_atual
which are populated by subselect within the Insert or Trigger– Rovann Linhalis