This commit is contained in:
behruz-dev
2025-11-01 16:12:26 +05:00
parent a2f23fb601
commit 3f8bf3c391
2 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
from django.core.management.base import BaseCommand
from core.apps.finance.models import Counterparty
from core.apps.counterparty.utils.counterparty import update_counterparty_balance
class Command(BaseCommand):
help = 'Barcha counterpartylardagi debit va kredit balanslarini yangilash'
def handle(self, *args, **options):
counterparties = Counterparty.objects.all()
for counterparty in counterparties:
update_counterparty_balance(counterparty)
self.stdout.write(
self.style.SUCCESS(
f'{counterparties.count()} ta counterparty yangilandi'
)
)