Model manager queryset doubles the sum for sets of amounts

I want to return the sums of items and payments for an invoice using a model manager.
It works correctly if there is only one record in the payment and item models, if I add more I can no longer chain the results.
In the shell I tried the following

>>> Invoixe.objects.with_aggregates().last().tot
Decimal('60')
>>> Invoixe.objects.with_totals().last().tot
Decimal('30')

with_aggregates returns the wrong total(tot) value (The correct total is 30)

The SQL looks like this

SELECT
  "task_invoixe"."id",
  "task_invoixe"."name",
  (CAST(SUM("task_ixem"."amount") AS NUMERIC)) AS "tot",
  (CAST(SUM("task_paxment"."amount") AS NUMERIC)) AS "pay",
  (CAST(((CAST(SUM("task_ixem"."amount") AS NUMERIC)) - (CAST(SUM("task_paxment"."amount") AS NUMERIC))) AS NUMERIC)) AS "bal"
FROM "task_invoixe"
LEFT OUTER JOIN "task_ixem" ON ("task_invoixe"."id" = "task_ixem"."invoixe_id")
LEFT OUTER JOIN "task_paxment" ON ("task_invoixe"."id" = "task_paxment"."invoixe_id")
GROUP BY "task_invoixe"."id", "task_invoixe"."name"
ORDER BY "task_invoixe"."id" ASC
LIMIT 1

Here is the code
ChatGPT believes this code should work
I can create the same error by chaining managers like so

>>> Invoixe.objects.with_totals().with_payments().last().tot
Decimal('60')
>>> Invoixe.objects.with_totals().last().tot
Decimal('30')

Which also give the wrong amount

from django.db import models
from django.db.models import Sum, F

class InvoixeQueryset(models.QuerySet):

    def with_totals(self):
        return self.annotate(tot=Sum(F('ixem__amount')))

    def with_payments(self):
        return self.annotate(pay=Sum(F('paxment__amount')))

    def with_aggregates(self):
        return self.annotate(
            tot=Sum('ixem__amount'),
            pay=Sum('paxment__amount'),
        ).annotate(bal=F('tot') - F('pay'))

class InvoixeManager(models.Manager):
    def get_queryset(self):
        return InvoixeQueryset(self.model, using=self._db)
   
    def with_aggregates(self):
        return self.get_queryset().with_aggregates()

    def with_totals(self):
        return self.get_queryset().with_totals()
    
    def with_payments(self):
        return self.get_queryset().with_payments()
    
    def with_balance(self):
        return self.get_queryset().with_balance()


class Invoixe(models.Model):
     name = models.CharField(max_length=80, unique=True)
     objects = InvoixeManager()
     def __str__(self):
        return self.name

class Paxment(models.Model):
        amount = models.DecimalField(
            max_digits=20, decimal_places=2, default=0,
        )
        invoixe = models.ForeignKey('Invoixe', on_delete=models.CASCADE)
        def __str__(self):
            return str(self.amount)

class Ixem(models.Model):
        amount = models.DecimalField(
            max_digits=20, decimal_places=2, default=0,
        )
        invoixe = models.ForeignKey('Invoixe', on_delete=models.CASCADE)
        def __str__(self):
            return str(self.amount)

I would really appreciate if someone could guide me in finding the correct implementation.
Thanks.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật