How to write accounting entries when exchanging goods to make up the difference

Accounting entries for replacement of goods to make up the difference:

Buyer input:

Debit: The amount of inventory goods and raw materials is the difference excluding VAT.

Borrow: tax payable-value-added tax payable-input tax,

Loans: accounts payable, bank deposits, etc.

Seller entry:

Debit: accounts receivable, bank deposits, etc. Collect the difference,

Loan: income from main business,

Credit: tax payable-VAT payable-output tax.