First personal project after Ethereum SCP 101 - No Invoice delays

Hello everyone! As Filip suggested at the end of the course, I decided to write my own project. I will forward the draft and I would like to hear what do you think about it and if there is anything I can edit/improve.

Name is No Invoice Delays
General idea:
In todays world bussineses mostly works on invoices with some payment delays. (Could be 7,10,30 or 60 days typically). The issue I often encounter is that even if there is agreed time of payment, people often don´t pay in time. They often blame it on “bank taking their time”, “they are sending payments only once a week” and all other kind of excuses. Sometimes they don´t pay, because they do not have enough funds but you can not figure out that in advance. So my idea is to create a smart contract, that acts as sort of controller and enforcer of payments

Main features
1)Deposit funds - this way, people join this accountant smart contract. By joining they are obliged to pay exactly in time, but also can expect the same from all others members of the SC.

2)Create invoice members can create invoice between each other. Before the service/goods are delivered, recipient must approve an invoice. The SC will check if he will have enough funds to pay after maturity period is over, and if everything checks, Invoice is created. Invoice will belong into “expected income” for the provider of service/goods and into “expected expenses” for the recipient.
-this will include functions “approve invoice”

3)Check Solvency - before invoice with delayed payment is created and added into the system, SC will check if recipient will have enough funds to pay with after maturity period is over. The formula is as follows:

Funds available at certain date = current funds + Expected income by date - expected expenses by date + function Checkfuturebalance

function Checkfuturebalance - It will check if owner would go to the negative balance at any point in the future, if they would add proposed invoice in their "epxected expenses".

If there are no enough funds available with currently set maturity of the invoice, SC will propose nearest time, at which their account would have enough funds. If that would never happen, SC will tell them such thing aswell.

  1. Withdraw funds
    before withdrawing, SC will essentially check solvency.

Let me know guys what do you think, I am eager to hear your opinions! :slight_smile: