Your first error was to use a purchase invoice. A purchase invoice records an incoming sales invoice from a supplier. Customers never appear on purchase invoices. They get sales invoices. This matters greatly, because the effects of all accounting transactions are reversed for purchase invoices versus sales invoices.
The second error was to apply the VAT 7% tax code to both the receipt for the deposit and the invoice. Even if you had correctly used a sales invoice, this would be incorrect. In effect, you have charged the customer twice for the same VAT. The tax code should only be applied to one or the other.
In most jurisdictions, the deposit is not a taxable sale. So tax is applied on the sales invoice only. The receipt only records your receipt of money held on your customer’s account for application to a future sales invoice.
In the few jurisdictions where a deposit is considered a taxable sale, the tax is not applied to the portion of the sale covered by the deposit, but only the remainder. This requires splitting one or more line items into two parts, one taxed and the other not.
A similar situation applies when you pay a deposit to a supplier and a purchase invoice is involved.
I did not check all your math because of your other errors, but it looks like you may also be misunderstanding tax-inclusive pricing.
Read the Guides: