From d7f2a9a1c886ee164a1f5a1be9892f470dbaa4b6 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Tue, 28 Oct 2025 16:19:34 +0500 Subject: [PATCH 01/17] fi --- core/apps/notifications/views/notification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/apps/notifications/views/notification.py b/core/apps/notifications/views/notification.py index 2f00ec9..b752003 100644 --- a/core/apps/notifications/views/notification.py +++ b/core/apps/notifications/views/notification.py @@ -12,7 +12,7 @@ class RegisterExpoPushToken(generics.GenericAPIView): def post(self, request): serializer = self.serializer_class(data=request.data) if serializer.is_valid(): - Notification.objects.update_or_create( + Notification.objects.get_or_create( user=request.user, token=serializer.validated_data['token'] ) From 3b465c5aa48becc293f75b6d4fd516c9c854bedc Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Tue, 28 Oct 2025 16:20:04 +0500 Subject: [PATCH 02/17] fix --- requirements.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fe31089..a97daeb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,8 @@ amqp==5.3.1 asgiref==3.9.1 billiard==4.2.1 celery==5.5.3 +certifi==2025.10.5 +charset-normalizer==3.4.4 click==8.2.1 click-didyoumean==0.3.1 click-plugins==1.1.1.2 @@ -18,10 +20,12 @@ django-silk==5.4.0 djangorestframework==3.16.0 djangorestframework_simplejwt==5.5.1 drf-yasg==1.21.10 +exponent_server_sdk==2.2.0 funcy==2.0 gprof2dot==2025.4.14 gunicorn==23.0.0 h11==0.16.0 +idna==3.11 inflection==0.5.1 kombu==5.5.4 packaging==25.0 @@ -33,11 +37,12 @@ python-dateutil==2.9.0.post0 pytz==2025.2 PyYAML==6.0.2 redis==6.2.0 +requests==2.32.5 six==1.17.0 sqlparse==0.5.3 tzdata==2025.2 uritemplate==4.2.0 +urllib3==2.5.0 uvicorn==0.35.0 vine==5.1.0 wcwidth==0.2.13 -requests From f11aca5c10fb8d046729a794a368df24c9e16f26 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Tue, 28 Oct 2025 16:24:48 +0500 Subject: [PATCH 03/17] fi --- core/apps/notifications/views/notification.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/apps/notifications/views/notification.py b/core/apps/notifications/views/notification.py index b752003..68ef8c9 100644 --- a/core/apps/notifications/views/notification.py +++ b/core/apps/notifications/views/notification.py @@ -3,11 +3,13 @@ from rest_framework.response import Response from core.apps.notifications.serializers import notification as serializers from core.apps.notifications.models import Notification +from core.apps.accounts.permissions.permissions import HasRolePermission class RegisterExpoPushToken(generics.GenericAPIView): serializer_class = serializers.NotificationSerializer queryset = Notification.objects.all() + permission_classes = [HasRolePermission] def post(self, request): serializer = self.serializer_class(data=request.data) From 0899595781b09250fc9df764bfa5358b399be2ee Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Tue, 28 Oct 2025 16:30:08 +0500 Subject: [PATCH 04/17] fix --- core/apps/orders/serializers/order.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/apps/orders/serializers/order.py b/core/apps/orders/serializers/order.py index eb63664..3ebc7f4 100644 --- a/core/apps/orders/serializers/order.py +++ b/core/apps/orders/serializers/order.py @@ -71,6 +71,7 @@ class MultipleOrderCreateSerializer(serializers.Serializer): resources = validated_data.pop('resources') common_date = validated_data.get('date') orders = [] + user = self.context.get('user') for resource in resources: order = Order( @@ -88,10 +89,9 @@ class MultipleOrderCreateSerializer(serializers.Serializer): {user.full_name} {order.project_folder.name} uchun {order.wherehouse.name} ombor ga {order.quantity} {order.unity.value} {order.product.name} ga buyurtma berdi. Buyurtma yetkazish sanasi {common_date} """ - notify_user(user=self.context.get("user"), title="Ta'minot",body=body) - + notify_user(user=user, title="Ta'minot",body=body) + created_orders = Order.objects.bulk_create(orders) - user = self.context.get('user') return created_orders From a5426138416c504cea6e43cf127f98580de07462 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Tue, 28 Oct 2025 16:44:29 +0500 Subject: [PATCH 05/17] fix --- core/apps/finance/serializers/expence.py | 8 ++++++-- core/apps/finance/urls.py | 2 +- core/apps/orders/serializers/order.py | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/apps/finance/serializers/expence.py b/core/apps/finance/serializers/expence.py index 8aa4bd4..4055fda 100644 --- a/core/apps/finance/serializers/expence.py +++ b/core/apps/finance/serializers/expence.py @@ -3,6 +3,7 @@ from django.db import transaction from rest_framework import serializers from core.apps.finance.models import Expence +from core.apps.notifications.utils.notify_user import notify_user class ExpenceCreateSerializer(serializers.ModelSerializer): @@ -33,7 +34,7 @@ class ExpenceCreateSerializer(serializers.ModelSerializer): ) cash_transaction = expence.cash_transaction payment_type = expence.payment_type - + user = self.context.get('user') if validated_data.get('currency') == 'uzs': cash_transaction.expence_balance_uzs += expence.price cash_transaction.total_balance_uzs = cash_transaction.income_balance_uzs - cash_transaction.expence_balance_uzs @@ -69,7 +70,10 @@ class ExpenceCreateSerializer(serializers.ModelSerializer): expence.counterparty.debit_usd += validated_data.get('price') expence.counterparty.total_debit += expence.price expence.counterparty.save() - + body = f""" + {user.full_name} {expence.price} {expence.currency.upper()}... \n screen: /monitoring + """ + notify_user(user=user, title="Tasdiqlang yoki rad eting", body=body) cash_transaction.save() payment_type.save() return expence diff --git a/core/apps/finance/urls.py b/core/apps/finance/urls.py index 705ec1b..c8ecdbb 100644 --- a/core/apps/finance/urls.py +++ b/core/apps/finance/urls.py @@ -91,7 +91,7 @@ urlpatterns = [ ] )), path('expence_chat/', include( - [ + [ path('/messages/', ex_chat_views.ExpenceMessageListApiView.as_view()), path('message/', include( [ diff --git a/core/apps/orders/serializers/order.py b/core/apps/orders/serializers/order.py index 3ebc7f4..ae9f852 100644 --- a/core/apps/orders/serializers/order.py +++ b/core/apps/orders/serializers/order.py @@ -85,9 +85,7 @@ class MultipleOrderCreateSerializer(serializers.Serializer): employee=self.context.get('user'), ) orders.append(order) - body = f""" - {user.full_name} {order.project_folder.name} uchun {order.wherehouse.name} ombor ga {order.quantity} {order.unity.value} {order.product.name} ga buyurtma berdi. Buyurtma - yetkazish sanasi {common_date} + body = f"""{user.full_name} {order.project_folder.name} uchun {order.wherehouse.name} ombor ga {order.quantity} {order.unity.value} {order.product.name} ga buyurtma berdi. Buyurtma yetkazish sanasi {common_date} \n screen: /supply """ notify_user(user=user, title="Ta'minot",body=body) From fe543fad5a39909712f3aed3aeb516052dfb48fd Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Tue, 28 Oct 2025 16:53:01 +0500 Subject: [PATCH 06/17] add notification for expence create api --- core/apps/finance/serializers/expence.py | 4 +--- core/apps/notifications/admin/__init__.py | 1 + core/apps/notifications/admin/notification.py | 5 +++++ core/apps/notifications/apps.py | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 core/apps/notifications/admin/__init__.py create mode 100644 core/apps/notifications/admin/notification.py diff --git a/core/apps/finance/serializers/expence.py b/core/apps/finance/serializers/expence.py index 4055fda..be1ab8d 100644 --- a/core/apps/finance/serializers/expence.py +++ b/core/apps/finance/serializers/expence.py @@ -70,9 +70,7 @@ class ExpenceCreateSerializer(serializers.ModelSerializer): expence.counterparty.debit_usd += validated_data.get('price') expence.counterparty.total_debit += expence.price expence.counterparty.save() - body = f""" - {user.full_name} {expence.price} {expence.currency.upper()}... \n screen: /monitoring - """ + body = f"""{user.full_name} {expence.price} {expence.currency.upper()}... \n screen: /monitoring""" notify_user(user=user, title="Tasdiqlang yoki rad eting", body=body) cash_transaction.save() payment_type.save() diff --git a/core/apps/notifications/admin/__init__.py b/core/apps/notifications/admin/__init__.py new file mode 100644 index 0000000..b70bf7e --- /dev/null +++ b/core/apps/notifications/admin/__init__.py @@ -0,0 +1 @@ +from .notification import * \ No newline at end of file diff --git a/core/apps/notifications/admin/notification.py b/core/apps/notifications/admin/notification.py new file mode 100644 index 0000000..2174051 --- /dev/null +++ b/core/apps/notifications/admin/notification.py @@ -0,0 +1,5 @@ +from django.contrib import admin + +from core.apps.notifications.models import Notification + +admin.site.register(Notification) \ No newline at end of file diff --git a/core/apps/notifications/apps.py b/core/apps/notifications/apps.py index eb827b0..023ea83 100644 --- a/core/apps/notifications/apps.py +++ b/core/apps/notifications/apps.py @@ -4,3 +4,6 @@ from django.apps import AppConfig class NotificationsConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'core.apps.notifications' + + def ready(self): + import core.apps.notifications.admin \ No newline at end of file From 9efc8aef40a07174aaba71bee919a98d03f1ba6d Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Tue, 28 Oct 2025 17:03:04 +0500 Subject: [PATCH 07/17] fix --- core/apps/finance/serializers/expence.py | 5 ++++- core/apps/notifications/utils/notify_user.py | 4 ++-- core/apps/orders/serializers/order.py | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/apps/finance/serializers/expence.py b/core/apps/finance/serializers/expence.py index be1ab8d..54c0833 100644 --- a/core/apps/finance/serializers/expence.py +++ b/core/apps/finance/serializers/expence.py @@ -71,7 +71,10 @@ class ExpenceCreateSerializer(serializers.ModelSerializer): expence.counterparty.total_debit += expence.price expence.counterparty.save() body = f"""{user.full_name} {expence.price} {expence.currency.upper()}... \n screen: /monitoring""" - notify_user(user=user, title="Tasdiqlang yoki rad eting", body=body) + data = { + "screen": "/monitoring" + } + notify_user(user=user, title="Tasdiqlang yoki rad eting", body=body, data=data) cash_transaction.save() payment_type.save() return expence diff --git a/core/apps/notifications/utils/notify_user.py b/core/apps/notifications/utils/notify_user.py index 37f4381..83ef144 100644 --- a/core/apps/notifications/utils/notify_user.py +++ b/core/apps/notifications/utils/notify_user.py @@ -2,7 +2,7 @@ from core.apps.notifications.models import Notification from core.apps.notifications.utils.send_notification import send_notification -def notify_user(user, title, body): +def notify_user(user, title, body, data): tokens = Notification.objects.filter(user=user) for token in tokens: - send_notification(token.token, title, body) \ No newline at end of file + send_notification(token.token, title, body, data) \ No newline at end of file diff --git a/core/apps/orders/serializers/order.py b/core/apps/orders/serializers/order.py index ae9f852..6d3899c 100644 --- a/core/apps/orders/serializers/order.py +++ b/core/apps/orders/serializers/order.py @@ -85,9 +85,12 @@ class MultipleOrderCreateSerializer(serializers.Serializer): employee=self.context.get('user'), ) orders.append(order) - body = f"""{user.full_name} {order.project_folder.name} uchun {order.wherehouse.name} ombor ga {order.quantity} {order.unity.value} {order.product.name} ga buyurtma berdi. Buyurtma yetkazish sanasi {common_date} \n screen: /supply + body = f"""{user.full_name} {order.project_folder.name} uchun {order.wherehouse.name} ombor ga {order.quantity} {order.unity.value} {order.product.name} ga buyurtma berdi. Buyurtma yetkazish sanasi {common_date} """ - notify_user(user=user, title="Ta'minot",body=body) + data = { + "screen": "/supply" + } + notify_user(user=user, title="Ta'minot",body=body, data=data) created_orders = Order.objects.bulk_create(orders) return created_orders From 82d85f8152f52391a7d39f88d169910ede05f0bc Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Wed, 29 Oct 2025 16:24:58 +0500 Subject: [PATCH 08/17] change party command --- .../commands/import_counterparty.py | 36 +- core/apps/orders/admin/order.py | 12 +- core/apps/orders/admin/party.py | 21 +- .../management/commands/import_orders.py | 6 +- .../management/commands/import_party.py | 127 +- data/{ => counterparty}/counterparty.json | 0 data/counterparty/cp1.json | 5279 +++++++++++++++++ 7 files changed, 5407 insertions(+), 74 deletions(-) rename data/{ => counterparty}/counterparty.json (100%) create mode 100644 data/counterparty/cp1.json diff --git a/core/apps/counterparty/management/commands/import_counterparty.py b/core/apps/counterparty/management/commands/import_counterparty.py index b723604..0ad7351 100644 --- a/core/apps/counterparty/management/commands/import_counterparty.py +++ b/core/apps/counterparty/management/commands/import_counterparty.py @@ -1,4 +1,5 @@ import json + from django.core.management import BaseCommand from core.apps.counterparty.models import Counterparty @@ -7,26 +8,29 @@ from core.apps.counterparty.models import Counterparty class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument("file_path", type=str) - - def handle(self, *args, **options): - file_path = options['file_path'] - with open(file_path, 'r') as f: + def handle(self, *args, **options): + file_path = options["file_path"] + + with open(file_path, "r") as f: data = json.load(f) - - for item in data['data']['data']: + + for item in data["data"]["data"]: Counterparty.objects.get_or_create( - name=item['name'], + name=item["name"], defaults={ - 'phone': item['person']['phone'], - 'inn': item['person']['tin'], - 'balance_currency': item['balances'][0]['currency']['symbol'].lower() if item['balances'] else 'uzs', - 'is_archived': item['is_archived'], - 'balance': item['total_amount'], - 'total_debit': item['debt_amount'], - 'total_kredit': item['credit_amount'], + "phone": item["person"]["phone"], + "inn": item["person"]["tin"], + "balance_currency": ( + item["balances"][0]["currency"]["symbol"].lower() + if item["balances"] + else "uzs" + ), + "is_archived": item["is_archived"], + "balance": item["total_amount"], + "total_debit": item["debt_amount"], + "total_kredit": item["credit_amount"], }, ) - + self.stdout.write("Counterparties added") - \ No newline at end of file diff --git a/core/apps/orders/admin/order.py b/core/apps/orders/admin/order.py index f0f53de..4c6b52d 100644 --- a/core/apps/orders/admin/order.py +++ b/core/apps/orders/admin/order.py @@ -5,4 +5,14 @@ from core.apps.orders.models import Order @admin.register(Order) class OrderAdmin(admin.ModelAdmin): - list_display = ['id', 'product', 'wherehouse', 'currency'] + list_display = ['id', 'product', 'wherehouse', 'currency', 'counterparty'] + +# # Statuslar: {'ORDERED', 'PARTIALLY_RECIEVED', 'pending', "open", "buying", "rejected", "recieved", "passive"} +# open -> yangi == NEW +# ordered -> partiya qilingan == PARTY_IS_MADE +# pending -> kutilmoqda == EXPECTED +# passive -> qoralama == DRAFT +# recieved -> yopilgan == RECIEVED +# rejected -> bekor qilingan == CANCELLED +# buying -> sotib olinmoqda == PURCHASED +# partially_recieved -> jarayonda == PROCESS \ No newline at end of file diff --git a/core/apps/orders/admin/party.py b/core/apps/orders/admin/party.py index 4fcee87..0e43a65 100644 --- a/core/apps/orders/admin/party.py +++ b/core/apps/orders/admin/party.py @@ -1,6 +1,6 @@ from django.contrib import admin -from core.apps.orders.models import Party, PartyAmount, DeletedParty +from core.apps.orders.models import DeletedParty, Party, PartyAmount class PartyAmountInline(admin.StackedInline): @@ -11,17 +11,28 @@ class PartyAmountInline(admin.StackedInline): @admin.register(Party) class PartyAdmin(admin.ModelAdmin): - list_display = ['id','number','mediator', 'delivery_date', 'payment_date', 'is_deleted'] - inlines = [PartyAmountInline] + list_display = [ + "id", + "number", + "mediator", + "delivery_date", + "payment_date", + "is_deleted", + ] + inlines = [PartyAmountInline] + search_fields = [ + "number", + ] @admin.register(PartyAmount) class PartyAmountAdmin(admin.ModelAdmin): - list_display = ['id', 'total_price', 'cost_amount'] + list_display = ["id", "total_price", "cost_amount"] def has_module_permission(self, request): return False + @admin.register(DeletedParty) class DeletedPartyAdmin(admin.ModelAdmin): - list_display = ['id', 'deleted_date', 'party'] \ No newline at end of file + list_display = ["id", "deleted_date", "party"] diff --git a/core/apps/orders/management/commands/import_orders.py b/core/apps/orders/management/commands/import_orders.py index c8caf75..a22a2c3 100644 --- a/core/apps/orders/management/commands/import_orders.py +++ b/core/apps/orders/management/commands/import_orders.py @@ -20,6 +20,8 @@ class Command(BaseCommand): with open(file_path, 'r', encoding='utf-8') as f: data = json.load(f) + statuses = set() + for item in data['data']['data']: product_name = item['product']['name']['uz'] unit_name = item['unit']['name']['uz'] @@ -53,6 +55,8 @@ class Command(BaseCommand): created_at=created_at, date=delivery_date ) - break + statuses.add(item['status'].upper()) + # break self.stdout.write(self.style.SUCCESS("Orders imported successfully ✅")) + self.stdout.write(f"Statuslar: {statuses}") \ No newline at end of file diff --git a/core/apps/orders/management/commands/import_party.py b/core/apps/orders/management/commands/import_party.py index 2734cba..fecfc65 100644 --- a/core/apps/orders/management/commands/import_party.py +++ b/core/apps/orders/management/commands/import_party.py @@ -1,86 +1,110 @@ -import json, requests +import json +import requests from django.core.management import BaseCommand -from core.apps.orders.models import Order, Party, PartyAmount from core.apps.accounts.models import User -from core.apps.products.models import Product, Unity from core.apps.counterparty.models import Counterparty -from core.apps.wherehouse.models import WhereHouse -from core.apps.projects.models import Project, ProjectFolder +from core.apps.orders.models import Order, Party, PartyAmount from core.apps.orders.utils.parse_date import parse_date +from core.apps.products.models import Product, Unity +from core.apps.projects.models import Project, ProjectFolder +from core.apps.wherehouse.models import WhereHouse +token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2JhY2tlbmQuYXBwLnV5cXVyLnV6L21haW4vYXV0aC9sb2dpbiIsImlhdCI6MTc2MTczMTI4MSwiZXhwIjoxNzYxODE3NjgxLCJuYmYiOjE3NjE3MzEyODEsImp0aSI6ImszNVRQUDBiblpSU3ZFS24iLCJzdWIiOiIxMDQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.G5rjiIV-roIgEZzH9s8XgLYnS9tunnMgnCa2U6S3vd0" -token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2JhY2tlbmQuYXBwLnV5cXVyLnV6L21haW4vYXV0aC9sb2dpbiIsImlhdCI6MTc2MTI4NjcwMywiZXhwIjoxNzYxNjQ2NzAzLCJuYmYiOjE3NjEyODY3MDMsImp0aSI6IjRBNkh4aHI5WkRqOGxVMzUiLCJzdWIiOiIxMDQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.O4NGZL_a3WIrjko5W2sEOBAbM5lv0miVgVa9tfYuyhM' class Command(BaseCommand): def add_arguments(self, parser): - parser.add_argument('file_path', type=str) - - def handle(self, *args, **options): - file_path = options['file_path'] - headers = { - "Authorization": f"Bearer {token}" - } + parser.add_argument("file_path", type=str) - with open(file_path, 'r') as f: + def handle(self, *args, **options): + file_path = options["file_path"] + headers = {"Authorization": f"Bearer {token}"} + + with open(file_path, "r") as f: data = json.load(f) - for item in data['data']['data']: - url = f'https://backend.app.uyqur.uz/main/supply/order-view?id={item['id']}' + statuses = { + "open": "NEW", + "ordered": "PARTY_IS_MADE", + "pending": "EXPECTED", + "passive": "DRAFT", + "recieved": "RECIEVED", + "rejected": "CANCELLED", + "buying": "PURCHASED", + "partially_recieved": "PROCESS" + } + + for item in data["data"]["data"]: + url = f"https://backend.app.uyqur.uz/main/supply/order-view?id={item['id']}" res = requests.get(url, headers=headers) - data = res.json()['data'] + data = res.json()["data"] user = None - if data.get('agent'): - user = User.objects.filter(full_name=data['agent']['full_name']).first() + if data.get("agent"): + user = User.objects.filter(full_name=data["agent"]["full_name"]).first() if not user: continue - party, created = Party.objects.get_or_create( - number=data['id'], + + party, created = Party.objects.update_or_create( + number=data["id"], defaults={ - 'mediator': user, - 'delivery_date': parse_date(data['delivery_date']), - 'closed_date': parse_date(data['recieved_date']), - 'order_date': parse_date(data['ordered_date']), - 'payment_date': parse_date(data['payment_date']) if parse_date(data['payment_date']) else parse_date(data['ordered_date']), - 'status': data['status'].upper(), - 'payment_percentage': data['payment_percent'], - 'process': data['percent'], - } + "mediator": user, + "delivery_date": parse_date(data["delivery_date"]), + "closed_date": parse_date(data["recieved_date"]), + "order_date": parse_date(data["ordered_date"]), + "payment_date": ( + parse_date(data["payment_date"]) + if parse_date(data["payment_date"]) + else parse_date(data["ordered_date"]) + ), + "status": statuses.get(data["status"].lower()), + "payment_percentage": data["payment_percent"], + "process": data["percent"], + }, ) + statuses.add(data["status"].upper()) orders = [] total_price = 0 paid_amount = 0 calculated_amount = 0 must_pay_amount = 0 - for i in data['warehouse_products']: - product = Product.objects.filter(name__icontains=i['product']['name']['uz']).first() + for i in data["warehouse_products"]: + product = Product.objects.filter( + name__icontains=i["product"]["name"]["uz"] + ).first() if not product: continue - unit = Unity.objects.filter(value=i['unit']['name']['uz']).first() - counterparty = Counterparty.objects.filter(name=i['company_person']['name']).first() + unit = Unity.objects.filter(value=i["unit"]["name"]["uz"]).first() + counterparty = Counterparty.objects.filter( + name=i["company_person"]["name"] + ).first() wherehouse = None - if i.get('warehouse'): - wherehouse = WhereHouse.objects.filter(name=i.get('warehouse').get('name')).first() + if i.get("warehouse"): + wherehouse = WhereHouse.objects.filter( + name=i.get("warehouse").get("name") + ).first() project_folder = None - if i.get('project'): - project_folder = ProjectFolder.objects.filter(name=i['project']['name']).first() - - order, created = Order.objects.get_or_create( + if i.get("project"): + project_folder = ProjectFolder.objects.filter( + name=i["project"]["name"] + ).first() + + order = Order.objects.create( product=product, + amount=i["amount"], + total_price=i["total_amount"], + quantity=i["quantity"], unity=unit, - counterparty=counterparty, - currency=i['currency']['symbol'].lower(), - wherehouse=wherehouse, + currency=i["currency"]["symbol"].lower(), project_folder=project_folder, - amount=i['amount'], - total_price=i['total_amount'], - quantity=i['quantity'], + wherehouse=wherehouse, + counterparty=counterparty, ) - total_price += i['total_amount'] - paid_amount += i['paid_amount'] - calculated_amount += i['calculated_amount'] - must_pay_amount += i['must_pay_amount'] + total_price += i["total_amount"] + paid_amount += i["paid_amount"] + calculated_amount += i["calculated_amount"] + must_pay_amount += i["must_pay_amount"] orders.append(order) party.orders.set(orders) PartyAmount.objects.get_or_create( @@ -90,6 +114,7 @@ class Command(BaseCommand): "calculated_amount": calculated_amount, "paid_amount": paid_amount, "payment_amount": must_pay_amount, - } + }, ) self.stdout.write("Parties added") + self.stdout.write(f"Statuslar: {statuses}") \ No newline at end of file diff --git a/data/counterparty.json b/data/counterparty/counterparty.json similarity index 100% rename from data/counterparty.json rename to data/counterparty/counterparty.json diff --git a/data/counterparty/cp1.json b/data/counterparty/cp1.json new file mode 100644 index 0000000..d394af9 --- /dev/null +++ b/data/counterparty/cp1.json @@ -0,0 +1,5279 @@ +{ + "data": { + "current_page": 1, + "total": 103, + "data": [ + { + "id": 1373, + "description": null, + "type": "supplier", + "name": "\"LIGHT BOX AGENCY\" MCHJ", + "start_date": "22.10.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 1252, + "name": "\"LIGHT BOX AGENCY\" MCHJ", + "tin": "310744041", + "phone": "+998915555522", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 1331, + "start_amount": 0, + "amount": 0, + "start_date": "22.10.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1357, + "description": null, + "type": "supplier", + "name": "Nargiza - nanixanum", + "start_date": "21.10.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 1237, + "name": "Nargiza - nanixanum", + "tin": "4278310021126115", + "phone": "+998958671111", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 1314, + "start_amount": 0, + "amount": 0, + "start_date": "21.10.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 1332, + "start_amount": 0, + "amount": 0, + "start_date": "22.10.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1354, + "description": null, + "type": "supplier", + "name": "Kamoliddin Mamasodikov", + "start_date": "20.10.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 1236, + "name": "Kamoliddin Mamasodikov", + "tin": "9860350149612367", + "phone": "+998909969407", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 1313, + "start_amount": 0, + "amount": 0, + "start_date": "20.10.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1307, + "description": null, + "type": "supplier", + "name": "Fayzullaxon", + "start_date": "15.10.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 1192, + "name": "Fayzullaxon", + "tin": "8600330463548576", + "phone": "+998903503936", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 1265, + "start_amount": 0, + "amount": 0, + "start_date": "15.10.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1304, + "description": null, + "type": "supplier", + "name": "Abdulloh Jamilov", + "start_date": "15.10.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 1190, + "name": "Abdulloh Jamilov", + "tin": "5614681806539304", + "phone": "+998900236706", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 1264, + "start_amount": 0, + "amount": 0, + "start_date": "15.10.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1295, + "description": null, + "type": "supplier", + "name": "Umida Asrolova", + "start_date": "13.10.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 1181, + "name": "Umida Asrolova", + "tin": "9860260101500189", + "phone": "+998978720850", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 1257, + "start_amount": 0, + "amount": 0, + "start_date": "13.10.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1280, + "description": null, + "type": "supplier", + "name": "ООО «UYSOT TEAM»", + "start_date": "08.10.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 1166, + "name": "ООО «UYSOT TEAM»", + "tin": "20208000805609600001", + "phone": "+998906196888", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 1236, + "start_amount": 0, + "amount": 0, + "start_date": "08.10.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1259, + "description": null, + "type": "supplier", + "name": "ООО \"IZBA ADVERTISING COMPANY\"", + "start_date": "06.10.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 1150, + "name": "ООО \"IZBA ADVERTISING COMPANY\"", + "tin": "307817495", + "phone": "+998946403904", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 1212, + "start_amount": 0, + "amount": 0, + "start_date": "06.10.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1038, + "description": null, + "type": "supplier", + "name": "ИП ООО “OLX CLASSIFIEDS”", + "start_date": "26.09.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 940, + "name": "ИП ООО “OLX CLASSIFIEDS”", + "tin": "205707447", + "phone": "+998908306924", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 966, + "start_amount": 0, + "amount": 0, + "start_date": "26.09.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 1036, + "description": null, + "type": "supplier", + "name": "Камол", + "start_date": "26.09.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 938, + "name": "Камол", + "tin": "394429492", + "phone": "+998909969407", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 964, + "start_amount": 0, + "amount": 0, + "start_date": "26.09.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 970, + "start_amount": 0, + "amount": 0, + "start_date": "27.09.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 911, + "description": null, + "type": "supplier", + "name": "ООО LUMENAR AUDIT", + "start_date": "18.08.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 835, + "name": "ООО LUMENAR AUDIT", + "tin": "310478222", + "phone": "+998917883578", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 839, + "start_amount": 0, + "amount": 0, + "start_date": "18.08.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 910, + "description": null, + "type": "supplier", + "name": "Ibrohim Ismoilov", + "start_date": "18.08.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 834, + "name": "Ibrohim Ismoilov", + "tin": "5614682115409668", + "phone": "+998979020109", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 838, + "start_amount": 0, + "amount": 0, + "start_date": "18.08.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 876, + "description": null, + "type": "supplier", + "name": "НОУ \"ALPHA SOLUTIONS\"", + "start_date": "22.07.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 806, + "name": "НОУ \"ALPHA SOLUTIONS\"", + "tin": "304292394", + "phone": "+998998350525", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 784, + "start_amount": 0, + "amount": 0, + "start_date": "22.07.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 854, + "description": null, + "type": "supplier", + "name": "Suhaylo", + "start_date": "18.07.2025", + "status": "active", + "total_amount": 640000, + "credit_amount": 640000, + "debt_amount": 0, + "person": { + "id": 784, + "name": "Suhaylo", + "tin": "19492693298", + "phone": "+998900921209", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 774, + "start_amount": 0, + "amount": 640000, + "start_date": "18.07.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 847, + "description": null, + "type": "supplier", + "name": "ЧП Best Internet Solution", + "start_date": "16.07.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 777, + "name": "ЧП Best Internet Solution", + "tin": "305292385", + "phone": "+998900921209", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 760, + "start_amount": 0, + "amount": 0, + "start_date": "16.07.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 804, + "description": null, + "type": "supplier", + "name": "USOFT GROUP", + "start_date": "07.07.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 748, + "name": "USOFT GROUP", + "tin": "311177074", + "phone": "+998712001200", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 729, + "start_amount": 0, + "amount": 0, + "start_date": "07.07.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 782, + "description": null, + "type": "supplier", + "name": "Нодир Куздеков", + "start_date": "26.06.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 729, + "name": "Нодир Куздеков", + "tin": "200829053", + "phone": "+998933996062", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 704, + "start_amount": 0, + "amount": 0, + "start_date": "26.06.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 763, + "description": null, + "type": "supplier", + "name": "KIMPLE MCHJ", + "start_date": "20.06.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 713, + "name": "KIMPLE MCHJ", + "tin": "307974262", + "phone": "+998903575700", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 688, + "start_amount": 0, + "amount": 0, + "start_date": "20.06.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 710, + "description": null, + "type": "supplier", + "name": "\"TOSHKENT-PARFUM\" МЧЖ", + "start_date": "04.06.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 663, + "name": "\"TOSHKENT-PARFUM\" МЧЖ", + "tin": "309558968", + "phone": "+998993474600", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 652, + "start_amount": 0, + "amount": 0, + "start_date": "04.06.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 660, + "description": null, + "type": "supplier", + "name": "Шамшод", + "start_date": "15.05.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 614, + "name": "Шамшод", + "tin": "9860010107167800", + "phone": "+998900921209", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 606, + "start_amount": 0, + "amount": 0, + "start_date": "15.05.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 656, + "description": null, + "type": "supplier", + "name": "Nurmamatov Oybek", + "start_date": "13.05.2025", + "status": "active", + "total_amount": -165922.4, + "credit_amount": 0, + "debt_amount": 165922.4, + "person": { + "id": 610, + "name": "Nurmamatov Oybek", + "tin": "8600030400034124", + "phone": "+998333305378", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 601, + "start_amount": 0, + "amount": -2589922.4, + "start_date": "13.05.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 730, + "start_amount": 0, + "amount": 200, + "start_date": "07.07.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 653, + "description": null, + "type": "supplier", + "name": "Prime Continent", + "start_date": "12.05.2025", + "status": "active", + "total_amount": -19895680, + "credit_amount": 0, + "debt_amount": 19895680, + "person": { + "id": 608, + "name": "Prime Continent", + "tin": "304515494", + "phone": "+998998044206", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 598, + "start_amount": 0, + "amount": -19895680, + "start_date": "12.05.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 618, + "description": null, + "type": "supplier", + "name": "ИП «DADAMIRZAYEV JAVOHIR SHERZOD O'G'LI»", + "start_date": "01.05.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 575, + "name": "ИП «DADAMIRZAYEV JAVOHIR SHERZOD O'G'LI»", + "tin": "505866606", + "phone": "+998336020000", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 548, + "start_amount": 0, + "amount": 0, + "start_date": "01.05.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 606, + "description": null, + "type": "supplier", + "name": "ALIJ ONOV X ASANBOY K OMILJ ON O'G'L", + "start_date": "25.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 563, + "name": "ALIJ ONOV X ASANBOY K OMILJ ON O'G'L", + "tin": "207162990", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 540, + "start_amount": 0, + "amount": 0, + "start_date": "25.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 598, + "description": null, + "type": "supplier", + "name": "ООО «Smart Media Solutions»", + "start_date": "22.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 555, + "name": "ООО «Smart Media Solutions»", + "tin": "304060778", + "phone": "+998712317264", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 533, + "start_amount": 0, + "amount": 0, + "start_date": "22.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 595, + "description": null, + "type": "supplier", + "name": "OOO «KODIRI VIDEO PRODUCTION»", + "start_date": "22.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 553, + "name": "OOO «KODIRI VIDEO PRODUCTION»", + "tin": "312067843", + "phone": "+998917883578", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 531, + "start_amount": 0, + "amount": 0, + "start_date": "22.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 587, + "description": null, + "type": "supplier", + "name": "QO‘CHQOROV JAMSHID DAVRON O‘G‘LI", + "start_date": "17.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 545, + "name": "QO‘CHQOROV JAMSHID DAVRON O‘G‘LI", + "tin": "32207927170011", + "phone": "+998991515959", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 527, + "start_amount": 0, + "amount": 0, + "start_date": "17.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 575, + "description": null, + "type": "supplier", + "name": "ЧП “JK CORР”", + "start_date": "07.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 537, + "name": "ЧП “JK CORР”", + "tin": "305694383", + "phone": "+998999335333", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 515, + "start_amount": 0, + "amount": 0, + "start_date": "07.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 572, + "description": null, + "type": "supplier", + "name": "ИП «MANAPOVA SHAXNOZAXON RIXSITULLOYEVNA»", + "start_date": "07.04.2025", + "status": "active", + "total_amount": -2400000, + "credit_amount": 0, + "debt_amount": 2400000, + "person": { + "id": 534, + "name": "ИП «MANAPOVA SHAXNOZAXON RIXSITULLOYEVNA»", + "tin": "497065277", + "phone": "+998909452202", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 511, + "start_amount": 0, + "amount": -2400000, + "start_date": "07.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 562, + "description": null, + "type": "supplier", + "name": "YATT \"XOLIQOV RO'ZIBOY ABDUG'APPOR O'G'LI\"", + "start_date": "02.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 524, + "name": "YATT \"XOLIQOV RO'ZIBOY ABDUG'APPOR O'G'LI\"", + "tin": "528558034", + "phone": "+998909919639", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 505, + "start_amount": 0, + "amount": 0, + "start_date": "02.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 561, + "description": null, + "type": "supplier", + "name": "OOO “MIRROR TV GROUP”", + "start_date": "02.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 523, + "name": "OOO “MIRROR TV GROUP”", + "tin": "308510704", + "phone": "+998955157010", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 504, + "start_amount": 0, + "amount": 0, + "start_date": "02.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 559, + "description": null, + "type": "supplier", + "name": "ООО «FLASH MEDIA GROUP»", + "start_date": "01.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 521, + "name": "ООО «FLASH MEDIA GROUP»", + "tin": "301928274", + "phone": "+998781507545", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 502, + "start_amount": 0, + "amount": 0, + "start_date": "01.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 558, + "description": null, + "type": "supplier", + "name": "OOO “MEDIA LEDJ”", + "start_date": "01.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 520, + "name": "OOO “MEDIA LEDJ”", + "tin": "309771593", + "phone": "+998889241993", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 501, + "start_amount": 0, + "amount": 0, + "start_date": "01.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 557, + "description": null, + "type": "supplier", + "name": "“ALIBAZAR-MEDIA” МЧЖ", + "start_date": "01.04.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 519, + "name": "“ALIBAZAR-MEDIA” МЧЖ", + "tin": "306125622", + "phone": "+998946199919", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 500, + "start_amount": 0, + "amount": 0, + "start_date": "01.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 531, + "description": null, + "type": "supplier", + "name": "Asqar", + "start_date": "24.03.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 496, + "name": "Asqar", + "tin": "7149691", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 468, + "start_amount": 0, + "amount": 0, + "start_date": "24.03.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 469, + "start_amount": 0, + "amount": 0, + "start_date": "24.03.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 521, + "description": null, + "type": "supplier", + "name": "ООО «MEDIA POINT AGENCY»", + "start_date": "11.03.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 487, + "name": "ООО «MEDIA POINT AGENCY»", + "tin": "309557185", + "phone": "+998900240202", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 457, + "start_amount": 0, + "amount": 0, + "start_date": "11.03.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 519, + "description": null, + "type": "supplier", + "name": "ЯТТ \"Расулов А.А.\"", + "start_date": "07.03.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 485, + "name": "ЯТТ \"Расулов А.А.\"", + "tin": "30805986640018", + "phone": "+998881888585", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 456, + "start_amount": 0, + "amount": 0, + "start_date": "07.03.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 513, + "description": null, + "type": "supplier", + "name": "AKBAROV MUXAMMADAMIN BAXTIYOR O‘G‘LI", + "start_date": "27.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 480, + "name": "AKBAROV MUXAMMADAMIN BAXTIYOR O‘G‘LI", + "tin": "31304986540050", + "phone": "+998909794266", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 445, + "start_amount": 0, + "amount": 0, + "start_date": "27.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 512, + "description": null, + "type": "supplier", + "name": "Буронов Ю.У", + "start_date": "27.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 479, + "name": "Буронов Ю.У", + "tin": "200542776", + "phone": "+998909072359", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 444, + "start_amount": 0, + "amount": 0, + "start_date": "27.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 511, + "description": null, + "type": "supplier", + "name": "KUDRATOV OZODJON TOSHTEMIR-O‘G‘LI", + "start_date": "26.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 478, + "name": "KUDRATOV OZODJON TOSHTEMIR-O‘G‘LI", + "tin": "32901864070062", + "phone": "+998983083633", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 443, + "start_amount": 0, + "amount": 0, + "start_date": "26.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 466, + "description": null, + "type": "supplier", + "name": "show news", + "start_date": "17.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 433, + "name": "show news", + "tin": "84164161316516", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 428, + "start_amount": 0, + "amount": 0, + "start_date": "17.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 463, + "description": null, + "type": "supplier", + "name": "RAXMATULLAYEV RAVSHAN G‘AYRAT O‘G‘LI", + "start_date": "14.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 430, + "name": "RAXMATULLAYEV RAVSHAN G‘AYRAT O‘G‘LI", + "tin": "30410986500024", + "phone": "+998977150543", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 427, + "start_amount": 0, + "amount": 0, + "start_date": "14.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 461, + "description": null, + "type": "supplier", + "name": "OOO DT MEDIA CO", + "start_date": "12.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 428, + "name": "OOO DT MEDIA CO", + "tin": "305559637", + "phone": "+998901273330", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 424, + "start_amount": 0, + "amount": 0, + "start_date": "12.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 460, + "description": null, + "type": "supplier", + "name": "OOO UNITED INDUSTRIAL EQUIPMENT TECH SERVICE", + "start_date": "11.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 427, + "name": "OOO UNITED INDUSTRIAL EQUIPMENT TECH SERVICE", + "tin": "302406339", + "phone": "+998781400002", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 414, + "start_amount": 0, + "amount": 0, + "start_date": "11.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 457, + "description": null, + "type": "supplier", + "name": "ABDURAHMONOVA DURDONA KOMILJONOVNA9", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 424, + "name": "ABDURAHMONOVA DURDONA KOMILJONOVNA9", + "tin": "62903026350020", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 409, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 456, + "description": null, + "type": "supplier", + "name": "Davron Fayziyev", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 423, + "name": "Davron Fayziyev", + "tin": "4646416", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 408, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 418, + "start_amount": 0, + "amount": 0, + "start_date": "12.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 455, + "description": null, + "type": "supplier", + "name": "Shuhrat Achilov", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 422, + "name": "Shuhrat Achilov", + "tin": "1315165131", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 407, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 419, + "start_amount": 0, + "amount": 0, + "start_date": "12.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 454, + "description": null, + "type": "supplier", + "name": "Hasan Mamasaidov", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 421, + "name": "Hasan Mamasaidov", + "tin": "464634136", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 406, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 420, + "start_amount": 0, + "amount": 0, + "start_date": "12.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 453, + "description": null, + "type": "supplier", + "name": "Dilshod realty", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 622000, + "credit_amount": 622000, + "debt_amount": 0, + "person": { + "id": 420, + "name": "Dilshod realty", + "tin": "45846464641", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 405, + "start_amount": 0, + "amount": -590000, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 421, + "start_amount": 0, + "amount": 100, + "start_date": "12.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 452, + "description": null, + "type": "supplier", + "name": "Nafosat", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 419, + "name": "Nafosat", + "tin": "64646946", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 404, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 422, + "start_amount": 0, + "amount": 0, + "start_date": "12.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 451, + "description": null, + "type": "supplier", + "name": "Khusnorik", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 418, + "name": "Khusnorik", + "tin": "494636513", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 403, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 423, + "start_amount": 0, + "amount": 0, + "start_date": "12.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 450, + "description": null, + "type": "supplier", + "name": "Shahlohonim", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 417, + "name": "Shahlohonim", + "tin": "98859456", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 402, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 425, + "start_amount": 0, + "amount": 0, + "start_date": "12.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 449, + "description": null, + "type": "supplier", + "name": "\"GLOBAL SHOP\" XK", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 416, + "name": "\"GLOBAL SHOP\" XK", + "tin": "306242604", + "phone": "+998935799749", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 401, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 448, + "description": null, + "type": "supplier", + "name": "ИП «LATIPOV JAXONGIR ABDULNOSIROVIСH»", + "start_date": "10.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 415, + "name": "ИП «LATIPOV JAXONGIR ABDULNOSIROVIСH»", + "tin": "31401940270047", + "phone": "+998909698181", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 400, + "start_amount": 0, + "amount": 0, + "start_date": "10.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 445, + "description": null, + "type": "supplier", + "name": "ЧП \"SWEET HOME ALEX\"", + "start_date": "06.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 412, + "name": "ЧП \"SWEET HOME ALEX\"", + "tin": "308886878", + "phone": "+998933787305", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 397, + "start_amount": 0, + "amount": 0, + "start_date": "06.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 444, + "description": null, + "type": "supplier", + "name": "Yapon bog'i", + "start_date": "06.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 411, + "name": "Yapon bog'i", + "tin": "165484613", + "phone": "+998909919639", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 396, + "start_amount": 0, + "amount": 0, + "start_date": "06.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 443, + "description": null, + "type": "supplier", + "name": "Oloy bozor", + "start_date": "06.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 410, + "name": "Oloy bozor", + "tin": "848464651", + "phone": "+998909919639", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 395, + "start_amount": 0, + "amount": 0, + "start_date": "06.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 442, + "description": null, + "type": "supplier", + "name": "Yunusobod bozor", + "start_date": "06.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 409, + "name": "Yunusobod bozor", + "tin": "69456113", + "phone": "+998909919639", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 394, + "start_amount": 0, + "amount": 0, + "start_date": "06.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 398, + "start_amount": 0, + "amount": 0, + "start_date": "07.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 441, + "description": null, + "type": "supplier", + "name": "Megaplanet", + "start_date": "06.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 408, + "name": "Megaplanet", + "tin": "164165115", + "phone": "+998909919639", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 393, + "start_amount": 0, + "amount": 0, + "start_date": "06.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 399, + "start_amount": 0, + "amount": 0, + "start_date": "07.02.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 435, + "description": null, + "type": "supplier", + "name": "ИП \"ERKINOV BEKZOD ALISHER O'G'LI", + "start_date": "05.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 402, + "name": "ИП \"ERKINOV BEKZOD ALISHER O'G'LI", + "tin": "2021800607050157001", + "phone": "+998909615558", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 391, + "start_amount": 0, + "amount": 0, + "start_date": "05.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 433, + "description": null, + "type": "supplier", + "name": "Умид ака абу сахий", + "start_date": "05.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 400, + "name": "Умид ака абу сахий", + "tin": "16541685465", + "phone": "+998990007333", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 389, + "start_amount": 0, + "amount": 0, + "start_date": "05.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 431, + "description": null, + "type": "supplier", + "name": "Berezia", + "start_date": "03.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 398, + "name": "Berezia", + "tin": "498461351", + "phone": "+998951771661", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 377, + "start_amount": 0, + "amount": 0, + "start_date": "03.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 429, + "description": null, + "type": "supplier", + "name": "ЯТТ SATTAROVA MAVJUDAXON XUJANAFASOVNA", + "start_date": "03.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 396, + "name": "ЯТТ SATTAROVA MAVJUDAXON XUJANAFASOVNA", + "tin": "491009088", + "phone": "+998331100046", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 376, + "start_amount": 0, + "amount": 0, + "start_date": "03.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 425, + "description": null, + "type": "supplier", + "name": "\"PRINTUZ\" MCHJ", + "start_date": "28.01.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 392, + "name": "\"PRINTUZ\" MCHJ", + "tin": "04788646", + "phone": "+998711503636", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 372, + "start_amount": 0, + "amount": 0, + "start_date": "28.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 424, + "description": null, + "type": "supplier", + "name": "\"ROUND UMBRELLA\" MCHJ", + "start_date": "24.01.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 391, + "name": "\"ROUND UMBRELLA\" MCHJ", + "tin": "301243701", + "phone": "+998712001200", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 369, + "start_amount": 0, + "amount": 0, + "start_date": "24.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 419, + "description": null, + "type": "supplier", + "name": "Жавохир видеограф", + "start_date": "21.01.2025", + "status": "active", + "total_amount": -265200, + "credit_amount": 0, + "debt_amount": 265200, + "person": { + "id": 386, + "name": "Жавохир видеограф", + "tin": "9416318513", + "phone": "+998999335333", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 366, + "start_amount": 0, + "amount": -4264800, + "start_date": "21.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 371, + "start_amount": 0, + "amount": 330, + "start_date": "28.01.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 415, + "description": null, + "type": "supplier", + "name": "ООО “ADMIXER”", + "start_date": "17.01.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 382, + "name": "ООО “ADMIXER”", + "tin": "308310185", + "phone": "+998908309014", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 361, + "start_amount": 0, + "amount": 0, + "start_date": "17.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 406, + "description": null, + "type": "supplier", + "name": "Бахром", + "start_date": "23.12.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 373, + "name": "Бахром", + "tin": "16486461431", + "phone": "+998973606444", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 356, + "start_amount": 0, + "amount": 0, + "start_date": "23.12.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 405, + "description": null, + "type": "supplier", + "name": "ХК \"WHITE STAR DESIGN\"", + "start_date": "21.12.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 372, + "name": "ХК \"WHITE STAR DESIGN\"", + "tin": "301544310", + "phone": "+998980076024", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 354, + "start_amount": 0, + "amount": 0, + "start_date": "21.12.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 404, + "description": null, + "type": "supplier", + "name": "XOLMURADOVA LOBAR ABDUGANIYEVNA", + "start_date": "20.12.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 371, + "name": "XOLMURADOVA LOBAR ABDUGANIYEVNA", + "tin": "41410760040030", + "phone": "998935997999", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 353, + "start_amount": 0, + "amount": 0, + "start_date": "20.12.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 402, + "description": null, + "type": "supplier", + "name": "Like mebel", + "start_date": "17.12.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 369, + "name": "Like mebel", + "tin": "302855359", + "phone": "+998911712272", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 352, + "start_amount": 0, + "amount": 0, + "start_date": "17.12.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 401, + "description": null, + "type": "supplier", + "name": "MUZIKINA NADEJDA VASILEVNA", + "start_date": "17.12.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 368, + "name": "MUZIKINA NADEJDA VASILEVNA", + "tin": "42704526530013", + "phone": "998901685270", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 351, + "start_amount": 0, + "amount": 0, + "start_date": "17.12.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 389, + "description": null, + "type": "supplier", + "name": "Uznews", + "start_date": "29.11.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 357, + "name": "Uznews", + "tin": "303290667", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 337, + "start_amount": 0, + "amount": 0, + "start_date": "29.11.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 373, + "description": null, + "type": "supplier", + "name": "ЯТТ RYASNOVA ANASTASIYA DMITRIYEVNA", + "start_date": "22.11.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 347, + "name": "ЯТТ RYASNOVA ANASTASIYA DMITRIYEVNA", + "tin": "537705044", + "phone": "+998941407741", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 328, + "start_amount": 0, + "amount": 0, + "start_date": "22.11.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 372, + "description": null, + "type": "supplier", + "name": "YaTT «Pak V.L.»,", + "start_date": "21.11.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 346, + "name": "YaTT «Pak V.L.»,", + "tin": "417940154", + "phone": "+998901896109", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 327, + "start_amount": 0, + "amount": 0, + "start_date": "21.11.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 365, + "description": null, + "type": "supplier", + "name": "\"NEW AGE PAGE\" MCHJ", + "start_date": "06.11.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 339, + "name": "\"NEW AGE PAGE\" MCHJ", + "tin": "307902596", + "phone": "+998974759697", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 319, + "start_amount": 0, + "amount": 0, + "start_date": "06.11.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 361, + "description": null, + "type": "supplier", + "name": "Феруза карта", + "start_date": "30.10.2024", + "status": "active", + "total_amount": 32592599.7, + "credit_amount": 32592599.7, + "debt_amount": 0, + "person": { + "id": 335, + "name": "Феруза карта", + "tin": "8600490446233108", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 316, + "start_amount": 0, + "amount": 46166999.7, + "start_date": "30.10.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 355, + "start_amount": 0, + "amount": -1120, + "start_date": "21.12.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 352, + "description": null, + "type": "supplier", + "name": "\"RAQAMLI\" MCHJ", + "start_date": "21.10.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 326, + "name": "\"RAQAMLI\" MCHJ", + "tin": "311084490", + "phone": "+998909969402", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 302, + "start_amount": 0, + "amount": 0, + "start_date": "21.10.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 339, + "description": null, + "type": "supplier", + "name": "ИП «Санжарбек Хамидов Махмуджон ўғли»", + "start_date": "04.10.2024", + "status": "active", + "total_amount": -5000000, + "credit_amount": 0, + "debt_amount": 5000000, + "person": { + "id": 313, + "name": "uy joylar", + "tin": "213454", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 284, + "start_amount": 0, + "amount": -5000000, + "start_date": "04.10.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 338, + "description": null, + "type": "supplier", + "name": "ООО \"ROMI-AGENCY\"", + "start_date": "04.10.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 312, + "name": "ООО \"ROMI-AGENCY\"", + "tin": "309792686", + "phone": "+998901884580", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 283, + "start_amount": 0, + "amount": 0, + "start_date": "04.10.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 333, + "description": null, + "type": "supplier", + "name": "AZODA", + "start_date": "27.09.2024", + "status": "active", + "total_amount": 6060000, + "credit_amount": 6060000, + "debt_amount": 0, + "person": { + "id": 307, + "name": "AZODA", + "tin": "12345672", + "phone": "+998910898988", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 276, + "start_amount": 0, + "amount": 500, + "start_date": "27.09.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 283, + "description": null, + "type": "supplier", + "name": "Раъно Шодиева пост", + "start_date": "21.08.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 260, + "name": "Раъно Шодиева пост", + "tin": "74207502", + "phone": "+998900069888", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 228, + "start_amount": 0, + "amount": 0, + "start_date": "21.08.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 232, + "start_amount": 0, + "amount": 0, + "start_date": "25.08.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 282, + "description": null, + "type": "supplier", + "name": "Абдулазиз Абдукодирий", + "start_date": "21.08.2024", + "status": "active", + "total_amount": -366000, + "credit_amount": 0, + "debt_amount": 366000, + "person": { + "id": 259, + "name": "Абдулазиз Абдукодирий", + "tin": "9860176620990661", + "phone": "+998917883578", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 227, + "start_amount": 0, + "amount": -24606000, + "start_date": "21.08.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 238, + "start_amount": 0, + "amount": 2000, + "start_date": "28.08.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 279, + "description": null, + "type": "supplier", + "name": "ООО «VW MAGIC MEDIA»", + "start_date": "19.08.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 256, + "name": "ООО «VW MAGIC MEDIA»", + "tin": "309317784", + "phone": "+998900098070", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 225, + "start_amount": 0, + "amount": 0, + "start_date": "19.08.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 269, + "description": null, + "type": "supplier", + "name": "ЧП Mirzayev Doniyor Omonovich", + "start_date": "13.08.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 246, + "name": "ЧП Mirzayev Doniyor Omonovich", + "tin": "32106880050029", + "phone": "+998983666024", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 215, + "start_amount": 0, + "amount": 0, + "start_date": "13.08.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 240, + "description": null, + "type": "supplier", + "name": "Магазин", + "start_date": "31.07.2024", + "status": "active", + "total_amount": 112360, + "credit_amount": 112360, + "debt_amount": 0, + "person": { + "id": 217, + "name": "Магазин", + "tin": "654123654", + "phone": "+998909919639", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 189, + "start_amount": 0, + "amount": 2500000, + "start_date": "31.07.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 192, + "start_amount": 0, + "amount": -197, + "start_date": "02.08.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 237, + "description": null, + "type": "supplier", + "name": "«MFAKTOR» MCHJ", + "start_date": "27.07.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 214, + "name": "«MFAKTOR» MCHJ", + "tin": "306294248", + "phone": "+998953700088", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 183, + "start_amount": 0, + "amount": 0, + "start_date": "27.07.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 232, + "description": null, + "type": "supplier", + "name": "ООО «TCA-MEDIA»", + "start_date": "24.07.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 209, + "name": "ООО «TCA-MEDIA»", + "tin": "310991155", + "phone": "+998908109911", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 188, + "start_amount": 0, + "amount": 0, + "start_date": "29.07.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 230, + "description": null, + "type": "supplier", + "name": "ЯТТ MUSHTAYEVA ANNA MAKSIMOVNA", + "start_date": "23.07.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 207, + "name": "ЯТТ MUSHTAYEVA ANNA MAKSIMOVNA", + "tin": "503087643", + "phone": "+998941047741", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 175, + "start_amount": 0, + "amount": 0, + "start_date": "23.07.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 217, + "description": null, + "type": "supplier", + "name": "Боходир", + "start_date": "16.07.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 196, + "name": "Боходир", + "tin": "321654987", + "phone": "+998909622747", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 162, + "start_amount": 0, + "amount": 0, + "start_date": "16.07.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 166, + "start_amount": 0, + "amount": 0, + "start_date": "19.07.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 189, + "description": null, + "type": "supplier", + "name": "OOO \"THE ART COVER\"", + "start_date": "09.07.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 171, + "name": "OOO \"THE ART COVER\"", + "tin": "307961359", + "phone": "+998946497077", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 129, + "start_amount": 0, + "amount": 0, + "start_date": "09.07.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 188, + "description": null, + "type": "supplier", + "name": "ООО «IBRAHIM GULYAMOVS ACADEMY»", + "start_date": "09.07.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 170, + "name": "ООО «IBRAHIM GULYAMOVS ACADEMY»", + "tin": "310071438", + "phone": "+998993534911", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 128, + "start_amount": 0, + "amount": 0, + "start_date": "09.07.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 169, + "description": null, + "type": "supplier", + "name": "\"MEDIAHOME\" MCHJ", + "start_date": "02.07.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 151, + "name": "\"MEDIAHOME\" MCHJ", + "tin": "311070754", + "phone": "+998935988881", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 107, + "start_amount": 0, + "amount": 0, + "start_date": "02.07.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 158, + "description": null, + "type": "worker", + "name": "Дурдона", + "start_date": "27.06.2024", + "status": "active", + "total_amount": 42391840.68, + "credit_amount": 42391840.68, + "debt_amount": 0, + "person": { + "id": 140, + "name": "Дурдона", + "tin": "1234567891", + "phone": "+998909919639", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 92, + "start_amount": 0, + "amount": -167954637.72, + "start_date": "27.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 334, + "start_amount": 0, + "amount": 17355.32, + "start_date": "28.11.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 155, + "description": null, + "type": "worker", + "name": "Таргет", + "start_date": "27.06.2024", + "status": "active", + "total_amount": -155066.4, + "credit_amount": 0, + "debt_amount": 155066.4, + "person": { + "id": 137, + "name": "Таргет", + "tin": "22618840291585234002", + "phone": "+998909433907", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 86, + "start_amount": 0, + "amount": -12881066.4, + "start_date": "27.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 94, + "start_amount": 0, + "amount": 1050, + "start_date": "28.06.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 150, + "description": null, + "type": "supplier", + "name": "ООО \"Media Lux\"", + "start_date": "26.06.2024", + "status": "active", + "total_amount": 20159999.67, + "credit_amount": 20159999.67, + "debt_amount": 0, + "person": { + "id": 132, + "name": "ООО \"Media Lux\"", + "tin": "301055230", + "phone": "+998900089066", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 83, + "start_amount": 0, + "amount": 20159999.67, + "start_date": "26.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 149, + "description": null, + "type": "supplier", + "name": "ООО «APEX MEDIA»", + "start_date": "26.06.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 131, + "name": "ООО «APEX MEDIA»", + "tin": "304437322", + "phone": "+998991510909", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 82, + "start_amount": 0, + "amount": 0, + "start_date": "26.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 148, + "description": null, + "type": "supplier", + "name": "OOO «GROUP7 MEDIA»", + "start_date": "26.06.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 130, + "name": "OOO «GROUP7 MEDIA»", + "tin": "306695888", + "phone": "+998334107777", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 81, + "start_amount": 0, + "amount": 0, + "start_date": "26.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 145, + "description": null, + "type": "supplier", + "name": "OOO «LED SERVICE»", + "start_date": "26.06.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 127, + "name": "OOO «LED SERVICE»", + "tin": "303483552", + "phone": "+998946573333", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 77, + "start_amount": 0, + "amount": 0, + "start_date": "26.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 144, + "description": null, + "type": "supplier", + "name": "«М-Exclusive» MChJ", + "start_date": "26.06.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 126, + "name": "«М-Exclusive» MChJ", + "tin": "305230873", + "phone": "+998990785959", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 76, + "start_amount": 0, + "amount": 0, + "start_date": "26.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 124, + "description": null, + "type": "worker", + "name": "Alimov telegram kanal", + "start_date": "25.06.2024", + "status": "active", + "total_amount": -20000, + "credit_amount": 0, + "debt_amount": 20000, + "person": { + "id": 38, + "name": "RINPOLIMER", + "tin": "1234567", + "phone": "+998903912345", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 61, + "start_amount": 0, + "amount": -20000, + "start_date": "25.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 123, + "description": null, + "type": "worker", + "name": "Sanjar videograpf", + "start_date": "25.06.2024", + "status": "active", + "total_amount": -95000, + "credit_amount": 0, + "debt_amount": 95000, + "person": { + "id": 109, + "name": "Sanjar videograpf", + "tin": "12345667", + "phone": "+998971557066", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 60, + "start_amount": 0, + "amount": -3125000, + "start_date": "25.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + }, + { + "id": 62, + "start_amount": 0, + "amount": 250, + "start_date": "25.06.2024", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 122, + "description": null, + "type": "supplier", + "name": "ЧП\" Novastudio \"", + "start_date": "25.06.2024", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 108, + "name": "ЧП\" Novastudio \"", + "tin": "306164875", + "phone": "+998999333388", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 59, + "start_amount": 0, + "amount": 0, + "start_date": "25.06.2024", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 894, + "description": null, + "type": "supplier", + "name": "ООО O'Z GASHKLITI", + "start_date": null, + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 819, + "name": "ООО O'Z GASHKLITI", + "tin": "206328965", + "phone": "+998712412952", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 821, + "start_amount": 0, + "amount": 0, + "start_date": "06.08.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 829, + "description": null, + "type": "supplier", + "name": "ООО BLOK BETON SERVIS", + "start_date": "10.07.2025", + "status": "active", + "total_amount": 267840000, + "credit_amount": 267840000, + "debt_amount": 0, + "person": { + "id": 762, + "name": "ООО BLOK BETON SERVIS", + "tin": "303205105", + "phone": "+998994325050", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 750, + "start_amount": 0, + "amount": 267840000, + "start_date": "10.07.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 658, + "description": null, + "type": "supplier", + "name": "TOSHKENT SHAHAR HUDUDIY QURULISH SOHASIDAGI NAZORAT QILISH INSPEKSIYASI", + "start_date": null, + "status": "active", + "total_amount": 110775289, + "credit_amount": 110775289, + "debt_amount": 0, + "person": { + "id": 612, + "name": "TOSHKENT SHAHAR HUDUDIY QURULISH SOHASIDAGI NAZORAT QILISH INSPEKSIYASI", + "tin": "200898340", + "phone": "+998712333283", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 605, + "start_amount": 0, + "amount": 110775289, + "start_date": "14.05.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 613, + "description": null, + "type": "supplier", + "name": "\"SIPUNI VOSTOK\" MCHJ", + "start_date": null, + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 570, + "name": "\"SIPUNI VOSTOK\" MCHJ", + "tin": "310298906", + "phone": "+998941132044", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 550, + "start_amount": 0, + "amount": 0, + "start_date": "01.05.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 607, + "description": null, + "type": "supplier", + "name": "Ulug'bek aka", + "start_date": null, + "status": "active", + "total_amount": -291160000, + "credit_amount": 0, + "debt_amount": 291160000, + "person": { + "id": 564, + "name": "Ulug'bek aka", + "tin": "09090909", + "phone": "+998946478503", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 714, + "start_amount": 0, + "amount": -23000, + "start_date": "28.06.2025", + "currency": { + "id": 3, + "name": { + "ru": "US dollar", + "uz": "Aqsh dollari" + }, + "symbol": "USD", + "icon": "https://backend.app.uyqur.uz/public/upload/image/LIMeAcPrnbN6X9m5uYMH.webp" + } + }, + { + "id": 865, + "start_amount": 0, + "amount": -12400000, + "start_date": "28.08.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 571, + "description": null, + "type": "supplier", + "name": "Давлат хизматлари маркази - Chilonzor tuman", + "start_date": null, + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 533, + "name": "Давлат хизматлари маркази - Chilonzor tuman", + "tin": "00000000000", + "phone": "+998900880020", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 512, + "start_amount": 0, + "amount": 0, + "start_date": "07.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 524, + "description": null, + "type": "supplier", + "name": "\"O'zbekiston Respublika tovar xom-ashyo birjasi\" AJ", + "start_date": null, + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 490, + "name": "\"O'zbekiston Respublika tovar xom-ashyo birjasi\" AJ", + "tin": "200933985", + "phone": "+998712070033", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 460, + "start_amount": 0, + "amount": 0, + "start_date": "17.03.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 522, + "description": null, + "type": "supplier", + "name": "Sharof aka katlonadzor", + "start_date": null, + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 488, + "name": "Sharof aka katlonadzor", + "tin": "310964963", + "phone": "+998998257708", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 458, + "start_amount": 0, + "amount": 0, + "start_date": "12.03.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 469, + "description": null, + "type": "supplier", + "name": "УЗБЕКТЕЛЕКОМ", + "start_date": "19.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 436, + "name": "УЗБЕКТЕЛЕКОМ", + "tin": "203366731", + "phone": "+998997202090", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 432, + "start_amount": 0, + "amount": 0, + "start_date": "19.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 432, + "description": null, + "type": "supplier", + "name": "Yunusobod ofis komunal", + "start_date": "04.02.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 399, + "name": "Yunusobod ofis komunal", + "tin": "2222222222", + "phone": "+998944088888", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 387, + "start_amount": 0, + "amount": 0, + "start_date": "04.02.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 428, + "description": null, + "type": "supplier", + "name": "GREENNATUREBUILDERS", + "start_date": "30.01.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 395, + "name": "GREENNATUREBUILDERS", + "tin": "311479569", + "phone": "+998994701173", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 375, + "start_amount": 0, + "amount": 0, + "start_date": "30.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 426, + "description": null, + "type": "supplier", + "name": "\"MOBLES DECOR\" MCHJ", + "start_date": "28.01.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 393, + "name": "\"MOBLES DECOR\" MCHJ", + "tin": "311018484", + "phone": "+998935080007", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 373, + "start_amount": 0, + "amount": 0, + "start_date": "28.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 423, + "description": null, + "type": "supplier", + "name": "ООО EMAN", + "start_date": "24.01.2025", + "status": "active", + "total_amount": -4239600, + "credit_amount": 0, + "debt_amount": 4239600, + "person": { + "id": 390, + "name": "ООО EMAN", + "tin": "201348969", + "phone": "+998991900488", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 368, + "start_amount": 0, + "amount": -4239600, + "start_date": "24.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 422, + "description": null, + "type": "supplier", + "name": "Itellektual Mulk Agentligi", + "start_date": "23.01.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 389, + "name": "Itellektual Mulk Agentligi", + "tin": "12345678910", + "phone": "+998917776630", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 367, + "start_amount": 0, + "amount": 0, + "start_date": "23.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 413, + "description": null, + "type": "supplier", + "name": "ASXAB МЧЖ", + "start_date": "16.01.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 380, + "name": "ASXAB МЧЖ", + "tin": "309301662", + "phone": "+998910046630", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 360, + "start_amount": 0, + "amount": 0, + "start_date": "16.01.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 612, + "description": null, + "type": "supplier", + "name": "\"NIPO STANDART\" MCHJ", + "start_date": null, + "status": "active", + "total_amount": 3489920, + "credit_amount": 3489920, + "debt_amount": 0, + "person": { + "id": 569, + "name": "\"NIPO STANDART\" MCHJ", + "tin": "202581474", + "phone": "+998712465917", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 544, + "start_amount": 0, + "amount": 3489920, + "start_date": "30.04.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + }, + { + "id": 689, + "description": null, + "type": "supplier", + "name": "INVENTAR", + "start_date": "22.05.2025", + "status": "active", + "total_amount": 0, + "credit_amount": 0, + "debt_amount": 0, + "person": { + "id": 642, + "name": "INVENTAR", + "tin": "0", + "phone": "+998919602023", + "address": null, + "longitude": null, + "latitude": null, + "district": null, + "region": null + }, + "balances": [ + { + "id": 631, + "start_amount": 0, + "amount": 0, + "start_date": "22.05.2025", + "currency": { + "id": 1, + "name": { + "ru": "Узбекский сум", + "uz": "O'zbek so'mi" + }, + "symbol": "UZS", + "icon": "https://backend.app.uyqur.uz/public/upload/image/YZfoihq4VHMSHaZziQlp.webp" + } + } + ], + "custom_field_values": [], + "is_archived": false + } + ] + }, + "message": { + "uz": "Muvaffaqiyatli!", + "ru": "Успешно!", + "en": "Success!", + "tr": "Başarılı!" + } +} From 8184b13d9f4b3338a76edbed20ad4682f406f974 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Wed, 29 Oct 2025 16:28:16 +0500 Subject: [PATCH 09/17] fix --- core/apps/orders/management/commands/import_orders.py | 5 +---- core/apps/orders/management/commands/import_party.py | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/core/apps/orders/management/commands/import_orders.py b/core/apps/orders/management/commands/import_orders.py index a22a2c3..12836fb 100644 --- a/core/apps/orders/management/commands/import_orders.py +++ b/core/apps/orders/management/commands/import_orders.py @@ -20,7 +20,6 @@ class Command(BaseCommand): with open(file_path, 'r', encoding='utf-8') as f: data = json.load(f) - statuses = set() for item in data['data']['data']: product_name = item['product']['name']['uz'] @@ -55,8 +54,6 @@ class Command(BaseCommand): created_at=created_at, date=delivery_date ) - statuses.add(item['status'].upper()) # break - self.stdout.write(self.style.SUCCESS("Orders imported successfully ✅")) - self.stdout.write(f"Statuslar: {statuses}") \ No newline at end of file + self.stdout.write(self.style.SUCCESS("Orders imported successfully ✅")) \ No newline at end of file diff --git a/core/apps/orders/management/commands/import_party.py b/core/apps/orders/management/commands/import_party.py index fecfc65..8865a72 100644 --- a/core/apps/orders/management/commands/import_party.py +++ b/core/apps/orders/management/commands/import_party.py @@ -63,7 +63,6 @@ class Command(BaseCommand): "process": data["percent"], }, ) - statuses.add(data["status"].upper()) orders = [] total_price = 0 paid_amount = 0 @@ -116,5 +115,4 @@ class Command(BaseCommand): "payment_amount": must_pay_amount, }, ) - self.stdout.write("Parties added") - self.stdout.write(f"Statuslar: {statuses}") \ No newline at end of file + self.stdout.write("Parties added") \ No newline at end of file From be9e415dcd56951083cee8e5dd4ccfe16987016f Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Wed, 29 Oct 2025 17:20:39 +0500 Subject: [PATCH 10/17] add new field --- core/apps/finance/serializers/expence.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/apps/finance/serializers/expence.py b/core/apps/finance/serializers/expence.py index 54c0833..82200d6 100644 --- a/core/apps/finance/serializers/expence.py +++ b/core/apps/finance/serializers/expence.py @@ -94,7 +94,7 @@ class ExpenceListSerializer(serializers.ModelSerializer): fields = [ 'id', 'cash_transaction', 'payment_type', 'project_folder', 'project', 'expence_type', 'counterparty', 'price', 'exchange_rate', 'currency', 'date', 'comment', 'audit', 'file', - 'user', 'expence_chats', + 'user', 'expence_chats', 'created_at' ] def get_user(self, obj): From ffd63944301dd1364f44dc69780ba1cf15421d0e Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Wed, 29 Oct 2025 18:36:25 +0500 Subject: [PATCH 11/17] add new field --- core/apps/finance/serializers/income.py | 284 +++++++++++++++--------- 1 file changed, 179 insertions(+), 105 deletions(-) diff --git a/core/apps/finance/serializers/income.py b/core/apps/finance/serializers/income.py index 7ea3861..14fbe16 100644 --- a/core/apps/finance/serializers/income.py +++ b/core/apps/finance/serializers/income.py @@ -1,137 +1,174 @@ from django.db import transaction - from rest_framework import serializers from core.apps.finance.models import Income class IncomeListSerializer(serializers.ModelSerializer): - cash_transaction = serializers.SerializerMethodField(method_name='get_cash_transaction') - payment_type = serializers.SerializerMethodField(method_name='get_payment_type') - project_folder = serializers.SerializerMethodField(method_name='get_project_folder') - project = serializers.SerializerMethodField(method_name='get_project') - counterparty = serializers.SerializerMethodField(method_name='get_counterparty') - type_income = serializers.SerializerMethodField(method_name='get_type_income') - user = serializers.SerializerMethodField(method_name='get_user') + cash_transaction = serializers.SerializerMethodField( + method_name="get_cash_transaction" + ) + payment_type = serializers.SerializerMethodField(method_name="get_payment_type") + project_folder = serializers.SerializerMethodField(method_name="get_project_folder") + project = serializers.SerializerMethodField(method_name="get_project") + counterparty = serializers.SerializerMethodField(method_name="get_counterparty") + type_income = serializers.SerializerMethodField(method_name="get_type_income") + user = serializers.SerializerMethodField(method_name="get_user") class Meta: model = Income fields = [ - 'id', 'cash_transaction', 'payment_type', 'project_folder', 'project', - 'counterparty', 'type_income', 'currency', 'price', 'exchange_rate', 'date', - 'comment', 'file', 'audit', 'user', 'income_chat' + "id", + "cash_transaction", + "payment_type", + "project_folder", + "project", + "counterparty", + "type_income", + "currency", + "price", + "exchange_rate", + "date", + "comment", + "file", + "audit", + "user", + "income_chat", + "created_at", ] - + def get_cash_transaction(self, obj): - return { - 'id': obj.cash_transaction.id, - 'name': obj.cash_transaction.name - } - + return {"id": obj.cash_transaction.id, "name": obj.cash_transaction.name} + def get_payment_type(self, obj): - return { - 'id': obj.payment_type.id, - 'name': obj.payment_type.name - } - + return {"id": obj.payment_type.id, "name": obj.payment_type.name} + def get_project_folder(self, obj): - return { - 'id': obj.project_folder.id, - 'name': obj.project_folder.name - } if obj.project_folder else None - + return ( + {"id": obj.project_folder.id, "name": obj.project_folder.name} + if obj.project_folder + else None + ) + def get_project(self, obj): - return { - 'id': obj.project.id, - 'name': obj.project.name - } if obj.project else None - + return {"id": obj.project.id, "name": obj.project.name} if obj.project else None + def get_counterparty(self, obj): - return { - 'id': obj.counterparty.id, - 'name': obj.counterparty.name - } if obj.counterparty else None - + return ( + {"id": obj.counterparty.id, "name": obj.counterparty.name} + if obj.counterparty + else None + ) + def get_type_income(self, obj): - return { - 'id': obj.type_income.id, - 'name': obj.type_income.name - } if obj.type_income else None + return ( + {"id": obj.type_income.id, "name": obj.type_income.name} + if obj.type_income + else None + ) def get_user(self, obj): - return { - 'id': obj.user.id, - 'full_name': obj.user.full_name, - } if obj.user else None + return ( + { + "id": obj.user.id, + "full_name": obj.user.full_name, + } + if obj.user + else None + ) class IncomeCreateSerializer(serializers.ModelSerializer): class Meta: model = Income fields = [ - 'cash_transaction', 'payment_type', 'project_folder', 'project', - 'counterparty', 'type_income', 'currency', 'price', 'exchange_rate', 'date', - 'comment', 'file', 'audit' + "cash_transaction", + "payment_type", + "project_folder", + "project", + "counterparty", + "type_income", + "currency", + "price", + "exchange_rate", + "date", + "comment", + "file", + "audit", ] def create(self, validated_data): with transaction.atomic(): income = Income.objects.create( - user=self.context.get('user'), - cash_transaction=validated_data['cash_transaction'], - payment_type=validated_data['payment_type'], - project_folder=validated_data.get('project_folder'), - project=validated_data.get('project'), - counterparty=validated_data.get('counterparty'), - type_income=validated_data.get('type_income'), - currency=validated_data.get('currency'), - price=validated_data.get('price') * validated_data.get('exchange_rate') if validated_data.get('exchange_rate') else validated_data.get('price'), - exchange_rate=validated_data.get('exchange_rate'), - date=validated_data.get('date'), - comment=validated_data.get('comment'), - file=validated_data.get('file'), - audit=validated_data.get('audit') + user=self.context.get("user"), + cash_transaction=validated_data["cash_transaction"], + payment_type=validated_data["payment_type"], + project_folder=validated_data.get("project_folder"), + project=validated_data.get("project"), + counterparty=validated_data.get("counterparty"), + type_income=validated_data.get("type_income"), + currency=validated_data.get("currency"), + price=( + validated_data.get("price") * validated_data.get("exchange_rate") + if validated_data.get("exchange_rate") + else validated_data.get("price") + ), + exchange_rate=validated_data.get("exchange_rate"), + date=validated_data.get("date"), + comment=validated_data.get("comment"), + file=validated_data.get("file"), + audit=validated_data.get("audit"), ) cash_transaction = income.cash_transaction payment_type = income.payment_type - if validated_data.get('currency') == 'uzs': + if validated_data.get("currency") == "uzs": cash_transaction.income_balance_uzs += income.price - cash_transaction.total_balance_uzs = cash_transaction.income_balance_uzs - cash_transaction.expence_balance_uzs + cash_transaction.total_balance_uzs = ( + cash_transaction.income_balance_uzs + - cash_transaction.expence_balance_uzs + ) payment_type.total_uzs += income.price - + if income.counterparty: if income.counterparty.debit_uzs != 0: - income.counterparty.debit_uzs -= income.price + income.counterparty.debit_uzs -= income.price income.counterparty.total_debit -= income.price - income.counterparty.kredit_uzs += income.counterparty.debit_uzs - income.price + income.counterparty.kredit_uzs += ( + income.counterparty.debit_uzs - income.price + ) income.counterparty.total_kredit += income.price else: income.counterparty.kredit_uzs += income.price income.counterparty.total_kredit += income.price income.counterparty.save() - elif validated_data.get('currency') == 'usd': + elif validated_data.get("currency") == "usd": cash_transaction.income_balance_usd += income.price - cash_transaction.total_balance_usd = cash_transaction.income_balance_usd - cash_transaction.expence_balance_usd + cash_transaction.total_balance_usd = ( + cash_transaction.income_balance_usd + - cash_transaction.expence_balance_usd + ) payment_type.total_usd += income.price if income.counterparty: if income.counterparty.debit_usd != 0: - income.counterparty.debit_usd -= validated_data.get('price') + income.counterparty.debit_usd -= validated_data.get("price") income.counterparty.total_debit -= income.price - income.counterparty.kredit_usd += income.counterparty.debit_usd - validated_data.get('price') + income.counterparty.kredit_usd += ( + income.counterparty.debit_usd - validated_data.get("price") + ) income.counterparty.total_kredit += income.price else: - income.counterparty.kredit_usd += validated_data.get('price') + income.counterparty.kredit_usd += validated_data.get("price") income.counterparty.total_kredit += income.price income.counterparty.save() cash_transaction.save() payment_type.save() return income - + class IncomeDeleteSerializer(serializers.Serializer): comment = serializers.CharField() @@ -141,47 +178,84 @@ class IncomeUpdateSerializer(serializers.ModelSerializer): class Meta: model = Income fields = [ - 'project_folder', 'project', 'price', 'type_income', 'counterparty', - 'date', 'comment', 'audit', 'file', + "project_folder", + "project", + "price", + "type_income", + "counterparty", + "date", + "comment", + "audit", + "file", ] extra_kwargs = { - 'price': {'required': False}, + "price": {"required": False}, } - + def update(self, instance, validated_data): old_price = instance.price - instance.project_folder = validated_data.get('project_folder', instance.project_folder) - instance.project = validated_data.get('project', instance.project) - instance.price = validated_data.get('price', instance.price) - instance.type_income = validated_data.get('type_income', instance.type_income) - instance.counterparty = validated_data.get('counterparty', instance.counterparty) - instance.date = validated_data.get('date', instance.date) - instance.comment = validated_data.get('comment', instance.comment) - instance.audit = validated_data.get('audit', instance.audit) - instance.file = validated_data.get('file', instance.file) - if validated_data.get('price'): + instance.project_folder = validated_data.get( + "project_folder", instance.project_folder + ) + instance.project = validated_data.get("project", instance.project) + instance.price = validated_data.get("price", instance.price) + instance.type_income = validated_data.get("type_income", instance.type_income) + instance.counterparty = validated_data.get( + "counterparty", instance.counterparty + ) + instance.date = validated_data.get("date", instance.date) + instance.comment = validated_data.get("comment", instance.comment) + instance.audit = validated_data.get("audit", instance.audit) + instance.file = validated_data.get("file", instance.file) + if validated_data.get("price"): cash_transaction = instance.cash_transaction - payment_type = instance.payment_type - if old_price > validated_data.get('price'): - if instance.currency == 'uzs': - cash_transaction.income_balance_uzs -= (old_price - validated_data.get('price')) - cash_transaction.total_balance_uzs -= (old_price - validated_data.get('price')) - payment_type.total_uzs -= (old_price - validated_data.get('price')) if payment_type.total_uzs > (old_price - validated_data.get('price')) else 0 + payment_type = instance.payment_type + if old_price > validated_data.get("price"): + if instance.currency == "uzs": + cash_transaction.income_balance_uzs -= ( + old_price - validated_data.get("price") + ) + cash_transaction.total_balance_uzs -= ( + old_price - validated_data.get("price") + ) + payment_type.total_uzs -= ( + (old_price - validated_data.get("price")) + if payment_type.total_uzs + > (old_price - validated_data.get("price")) + else 0 + ) else: - cash_transaction.income_balance_usd -= (old_price - validated_data.get('price')) - cash_transaction.total_balance_usd -= (old_price - validated_data.get('price')) - payment_type.total_usd -= (old_price - validated_data.get('price')) if payment_type.total_usd > (old_price - validated_data.get('price')) else 0 + cash_transaction.income_balance_usd -= ( + old_price - validated_data.get("price") + ) + cash_transaction.total_balance_usd -= ( + old_price - validated_data.get("price") + ) + payment_type.total_usd -= ( + (old_price - validated_data.get("price")) + if payment_type.total_usd + > (old_price - validated_data.get("price")) + else 0 + ) - elif old_price < validated_data.get('price'): - if instance.currency == 'uzs': - cash_transaction.income_balance_uzs += (old_price - validated_data.get('price')) - cash_transaction.total_balance_uzs += (old_price - validated_data.get('price')) - payment_type.total_uzs += (old_price - validated_data.get('price')) + elif old_price < validated_data.get("price"): + if instance.currency == "uzs": + cash_transaction.income_balance_uzs += ( + old_price - validated_data.get("price") + ) + cash_transaction.total_balance_uzs += ( + old_price - validated_data.get("price") + ) + payment_type.total_uzs += old_price - validated_data.get("price") else: - cash_transaction.income_balance_usd += (old_price - validated_data.get('price')) - cash_transaction.total_balance_usd += (old_price - validated_data.get('price')) - payment_type.total_usd += (old_price - validated_data.get('price')) + cash_transaction.income_balance_usd += ( + old_price - validated_data.get("price") + ) + cash_transaction.total_balance_usd += ( + old_price - validated_data.get("price") + ) + payment_type.total_usd += old_price - validated_data.get("price") cash_transaction.save() payment_type.save() instance.save() - return instance \ No newline at end of file + return instance From b6b2875e0d422792e3f71fd1af96804803bfb854 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Thu, 30 Oct 2025 14:36:59 +0500 Subject: [PATCH 12/17] shared: fix bug --- core/apps/shared/views/usd_course.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/apps/shared/views/usd_course.py b/core/apps/shared/views/usd_course.py index 5404d76..a1d1a13 100644 --- a/core/apps/shared/views/usd_course.py +++ b/core/apps/shared/views/usd_course.py @@ -1,11 +1,10 @@ from django.shortcuts import get_object_or_404 - from rest_framework import generics from rest_framework.response import Response +from core.apps.accounts.permissions.permissions import HasRolePermission from core.apps.shared.models import UsdCourse from core.apps.shared.serializers.usd_course import UsdCourseSerializer -from core.apps.accounts.permissions.permissions import HasRolePermission class UsdCourseApiView(generics.GenericAPIView): @@ -17,13 +16,18 @@ class UsdCourseApiView(generics.GenericAPIView): value = UsdCourse.objects.first() serializer = self.serializer_class(value) return Response(serializer.data, status=200) - + def patch(self, request): usd_cource = UsdCourse.objects.first() + if not usd_cource: + usd_cource = UsdCourse.objects.create(value=0) + old_value = usd_cource.value serializer = self.serializer_class(data=request.data) if not serializer.is_valid(): return Response(serializer.errors, status=400) - value = serializer.validated_data.get('value') + value = serializer.validated_data.get("value") usd_cource.value = value usd_cource.save() - return Response({'new_value': usd_cource.value, 'old_value': value}, status=200) + return Response( + {"new_value": usd_cource.value, "old_value": old_value}, status=200 + ) From 9b4f343f775e711c88c3c93c1b4f748a8085dadd Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Thu, 30 Oct 2025 14:59:59 +0500 Subject: [PATCH 13/17] notification: add firebase notification to web --- config/firebase.py | 10 ++ config/firebase/firebase-key.json | 13 ++ config/settings/base.py | 148 +++++++++--------- ...type_alter_notification_unique_together.py | 24 +++ .../apps/notifications/models/notification.py | 10 +- .../notifications/serializers/notification.py | 2 +- core/apps/notifications/utils/notify_user.py | 7 +- .../notifications/utils/send_notification.py | 21 ++- core/apps/notifications/views/notification.py | 3 +- requirements.txt | 39 +++++ 10 files changed, 198 insertions(+), 79 deletions(-) create mode 100644 config/firebase.py create mode 100644 config/firebase/firebase-key.json create mode 100644 core/apps/notifications/migrations/0002_notification_type_alter_notification_unique_together.py diff --git a/config/firebase.py b/config/firebase.py new file mode 100644 index 0000000..504a113 --- /dev/null +++ b/config/firebase.py @@ -0,0 +1,10 @@ +import firebase_admin +from firebase_admin import credentials, messaging +from django.conf import settings +import os + +firebase_cred_path = os.path.join(settings.BASE_DIR, 'config/firebase/firebase-key.json') + +if not firebase_admin._apps: + cred = credentials.Certificate(firebase_cred_path) + firebase_admin.initialize_app(cred) diff --git a/config/firebase/firebase-key.json b/config/firebase/firebase-key.json new file mode 100644 index 0000000..9117943 --- /dev/null +++ b/config/firebase/firebase-key.json @@ -0,0 +1,13 @@ +{ + "type": "service_account", + "project_id": "uyqur-9f7af", + "private_key_id": "708733567d3f54fc967b453ae010d96439d4d8e6", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCY/0PLBiteWmIx\nuYUoG4JIkGctHD+GDlGqnhePdpS7mMuVKHpVf0dCe0azLzj/gC3IONB+ueHI8Cod\nUunB4wgp+ExuemUX+dJ46IEZAI/PA1TbetG+zczzc316TFIrZKpVVOi9ExlLp67Y\nxsYLZFIx6ip/WK39BphxqdDRiKRZxRZ4GOLzJyQZ1dsmlZ/hjIReCEuO6Pd2/hKm\nsUT6XsNWpBhq+0GcphS4cZ0Z+XyHEMfACji+Z14vP0Eh0NXI1Lr+96yWqAm1ywoj\n3ugcFY6z75NEyrK7MNOb3APS6UiH1Uk3kmUPYj1QD1RIK11txEYlYpY8e/njQlUG\nS/oQAp5BAgMBAAECggEAFboyi3N91zFovn0FLvPxJZL0RBC96LDB4kP/Po1tg9Ko\nHq+X5+piWUued7XeF1LBrax713NYYCvTH0T2E2XFdAhh+lKBZs1AmZETPFS7F3/2\nnhCsFretQmmFSUfrZ2QtWF7timRa9EaE6x4XY+jET3hcvqb+Vm+IWKPwFsGb7W96\neuhVS1DhfFHTKy3jAkx0PRFlNqjiPa0TcXrcfDnta+Lak20ZnvQUbd5PF0jKn29A\nsNTg86wWpIqcEN2vnzSDk6I5jIKZ+BvRglIkp3ZqZW/iBDZZevhqdWCMUeFrmERb\nNKrKcZYtd0Mw0DBayYIkGV3nx0DQkdbj9QOZhqTh7QKBgQDRibyQrdcMycAK2YmF\nsadg9y5KjMbONIFPHFmCw+OHnISEj/m1puuVaVOH8pECFQOkONjFLWdL3rbQctNx\nOqVI/SBB/WkHlP9DapEfYHmmzap69Nc9jdfkTDKTFbXMbdfU+OWUAY0Qc6CqCTNi\nUwN8H8OeB0INDRYLVVAtcLZoTwKBgQC67AcaB7/MkrJWgOUX5iNlwoMhti+rYESQ\nv6s9qHuu338mGR+4PkxMCflj+Gc+Om/wAbewAoRlJVdhRFrtigc1taeiFfuFwM4m\n/dvarX8VUPVsstpodeJQ/caa8wKl8nABGnMT/mJ5GJkFv6NRSP4xmKQxFhm4ZE/x\nA5jKKuFcbwKBgEkOnwJKukopJZ4izsIgeN1kEW3Iu6A1ykgM+GCRcAleVw3pLQVa\n15TWjls+BbUWIpjlgR7uf6+CTXdMMdCuw+Y460BW3IHaP04AH+0ys/emiaQpLcq2\nY+mjb5a84RAP1ErbJSB/kfGEfyYJ4zKLAxIJ+ShmG291epQlALl3LQIdAoGBAI+n\nm+GeeQJA77xZfTe70BKBxgPfn40nBCr2kyVk2gFQlMhz4JPZlQuPUtJI8xe5E5Qx\nzbkAhj2x0BDZ1sPeI6JchIOmP1LRFd6TlSbf1d5NBQFQB1jm2FMEZmFpR+y/gOLo\nL+76vzVv+RKY8GwlG+6D8BQldwjmVyXUbNVa1S4TAoGAU7ycLnakKHSMnfULM+xL\n960MQ4TNzap8i6Ml8PMBjObpTU5k0pbjzhLHSLbocF100nLCck2Qb2s7d4/xuiMl\nwRqiqK/0iUEmfGC8bGBghIli6IAnIqkxzKbdx+TJCDN0eYhwMs8o6ljny+4we7Tc\nCLDsVraHoBGsfihDjSbHI5E=\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-fbsvc@uyqur-9f7af.iam.gserviceaccount.com", + "client_id": "102992994110464968021", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40uyqur-9f7af.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} diff --git a/config/settings/base.py b/config/settings/base.py index 2c9d2c2..ebf201a 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -1,6 +1,14 @@ from datetime import timedelta from pathlib import Path +from config.conf.celery import * +from config.conf.cors_headers import * +from config.conf.drf_yasg import * +from config.conf.jazzmin import * +from config.conf.logs import * +from config.conf.redis import * +from config.conf.rest_framework import * +from config.conf.rest_framework_simplejwt import * from config.env import env # Build paths inside the project like this: BASE_DIR / 'subdir'. @@ -11,95 +19,95 @@ BASE_DIR = Path(__file__).resolve().parent.parent.parent # See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = env.str('SECRET_KEY') +SECRET_KEY = env.str("SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = env.bool('DEBUG') +DEBUG = env.bool("DEBUG") -ALLOWED_HOSTS = env.list('ALLOWED_HOSTS') +ALLOWED_HOSTS = env.list("ALLOWED_HOSTS") # Application definition APPS = [ - 'core.apps.accounts', - 'core.apps.shared', - 'core.apps.company', - 'core.apps.wherehouse', - 'core.apps.products', - 'core.apps.projects', - 'core.apps.orders', - 'core.apps.finance', - 'core.apps.counterparty', - 'core.apps.notifications', + "core.apps.accounts", + "core.apps.shared", + "core.apps.company", + "core.apps.wherehouse", + "core.apps.products", + "core.apps.projects", + "core.apps.orders", + "core.apps.finance", + "core.apps.counterparty", + "core.apps.notifications", ] PACKAGES = [ - 'drf_yasg', - 'rest_framework', - 'rest_framework_simplejwt', - 'corsheaders', - 'cacheops', + "drf_yasg", + "rest_framework", + "rest_framework_simplejwt", + "corsheaders", + "cacheops", ] DJANGO_APPS = [ - 'jazzmin', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', + "jazzmin", + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", ] INSTALLED_APPS = [] INSTALLED_APPS += DJANGO_APPS -INSTALLED_APPS += PACKAGES +INSTALLED_APPS += PACKAGES INSTALLED_APPS += APPS MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'corsheaders.middleware.CorsMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "corsheaders.middleware.CorsMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", # 'silk.middleware.SilkyMiddleware', ] -ROOT_URLCONF = 'config.urls' +ROOT_URLCONF = "config.urls" TEMPLATES = [ { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", ], }, }, ] -WSGI_APPLICATION = 'config.wsgi.application' +WSGI_APPLICATION = "config.wsgi.application" # Database # https://docs.djangoproject.com/en/5.2/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': env.str('POSTGRES_DB'), - 'USER': env.str('POSTGRES_USER'), - 'PASSWORD': env.str('POSTGRES_PASSWORD'), - 'HOST': env.str('POSTGRES_HOST'), - 'PORT': env.str('POSTGRES_PORT'), + "default": { + "ENGINE": "django.db.backends.postgresql", + "NAME": env.str("POSTGRES_DB"), + "USER": env.str("POSTGRES_USER"), + "PASSWORD": env.str("POSTGRES_PASSWORD"), + "HOST": env.str("POSTGRES_HOST"), + "PORT": env.str("POSTGRES_PORT"), } } @@ -109,16 +117,16 @@ DATABASES = { AUTH_PASSWORD_VALIDATORS = [ { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", }, ] @@ -126,9 +134,9 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/5.2/topics/i18n/ -LANGUAGE_CODE = 'uz' +LANGUAGE_CODE = "uz" -TIME_ZONE = 'Asia/Tashkent' +TIME_ZONE = "Asia/Tashkent" USE_I18N = True @@ -138,25 +146,21 @@ USE_TZ = False # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.2/howto/static-files/ -STATIC_URL = 'static/' -STATIC_ROOT = BASE_DIR / 'resources/static' -MEDIA_URL = 'media/' -MEDIA_ROOT = BASE_DIR / 'resources/media' +STATIC_URL = "static/" +STATIC_ROOT = BASE_DIR / "resources/static" +MEDIA_URL = "media/" +MEDIA_ROOT = BASE_DIR / "resources/media" # Default primary key field type # https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" -AUTH_USER_MODEL = 'accounts.User' +AUTH_USER_MODEL = "accounts.User" -SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', env.str("SWAGGER_PROTOCOL", 'https')) +SECURE_PROXY_SSL_HEADER = ( + "HTTP_X_FORWARDED_PROTO", + env.str("SWAGGER_PROTOCOL", "https"), +) -from config.conf.rest_framework import * -from config.conf.rest_framework_simplejwt import * -from config.conf.logs import * -from config.conf.cors_headers import * -from config.conf.drf_yasg import * -from config.conf.jazzmin import * -from config.conf.celery import * -from config.conf.redis import * \ No newline at end of file +FCM_SERVER_KEY = env.str("FCM_SERVER_KEY") diff --git a/core/apps/notifications/migrations/0002_notification_type_alter_notification_unique_together.py b/core/apps/notifications/migrations/0002_notification_type_alter_notification_unique_together.py new file mode 100644 index 0000000..3c94fde --- /dev/null +++ b/core/apps/notifications/migrations/0002_notification_type_alter_notification_unique_together.py @@ -0,0 +1,24 @@ +# Generated by Django 5.2.4 on 2025-10-30 14:56 + +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('notifications', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.AddField( + model_name='notification', + name='type', + field=models.CharField(choices=[('web', 'web'), ('mobile', 'mobile')], default='mobile', max_length=6), + ), + migrations.AlterUniqueTogether( + name='notification', + unique_together={('type', 'user', 'token')}, + ), + ] diff --git a/core/apps/notifications/models/notification.py b/core/apps/notifications/models/notification.py index b03cf56..d90ccae 100644 --- a/core/apps/notifications/models/notification.py +++ b/core/apps/notifications/models/notification.py @@ -3,7 +3,15 @@ from django.db import models from core.apps.shared.models import BaseModel from core.apps.accounts.models import User + class Notification(BaseModel): + type = models.CharField( + choices=[('web', 'web'), ('mobile', 'mobile')], + max_length=6, + default='mobile' + ) user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='notifications') token = models.CharField(max_length=255, unique=True) - \ No newline at end of file + + class Meta: + unique_together = ('type', 'user', 'token') \ No newline at end of file diff --git a/core/apps/notifications/serializers/notification.py b/core/apps/notifications/serializers/notification.py index 7188384..4b21072 100644 --- a/core/apps/notifications/serializers/notification.py +++ b/core/apps/notifications/serializers/notification.py @@ -7,5 +7,5 @@ class NotificationSerializer(serializers.ModelSerializer): class Meta: model = Notification fields = [ - 'token' + 'type', 'token' ] \ No newline at end of file diff --git a/core/apps/notifications/utils/notify_user.py b/core/apps/notifications/utils/notify_user.py index 83ef144..940d5f7 100644 --- a/core/apps/notifications/utils/notify_user.py +++ b/core/apps/notifications/utils/notify_user.py @@ -1,8 +1,11 @@ from core.apps.notifications.models import Notification -from core.apps.notifications.utils.send_notification import send_notification +from core.apps.notifications.utils.send_notification import send_notification, send_web_notification def notify_user(user, title, body, data): tokens = Notification.objects.filter(user=user) for token in tokens: - send_notification(token.token, title, body, data) \ No newline at end of file + if token.type == 'mobile': + send_notification(token.token, title, body, data) + if token.type == 'web': + send_web_notification(token.token, title, body, data) diff --git a/core/apps/notifications/utils/send_notification.py b/core/apps/notifications/utils/send_notification.py index f0dc668..4daada3 100644 --- a/core/apps/notifications/utils/send_notification.py +++ b/core/apps/notifications/utils/send_notification.py @@ -1,4 +1,8 @@ import requests +from firebase_admin import messaging + +from django.conf import settings + def send_notification(token, title, body, data=None): message = { @@ -11,6 +15,19 @@ def send_notification(token, title, body, data=None): response = requests.post( "https://exp.host/--/api/v2/push/send", json=message, - headers={"Content-Type": "application/json"} + headers={"Content-Type": "application/json"}, ) - return response.json() \ No newline at end of file + return response.json() + + +def send_web_notification(token, title, body, data=None): + message = messaging.MulticastMessage( + notification=messaging.Notification( + title=title, + body=body + ), + data=data or {}, + tokens=token, + ) + + response = messaging.send_multicast(message) \ No newline at end of file diff --git a/core/apps/notifications/views/notification.py b/core/apps/notifications/views/notification.py index 68ef8c9..8ad7c5a 100644 --- a/core/apps/notifications/views/notification.py +++ b/core/apps/notifications/views/notification.py @@ -16,7 +16,8 @@ class RegisterExpoPushToken(generics.GenericAPIView): if serializer.is_valid(): Notification.objects.get_or_create( user=request.user, - token=serializer.validated_data['token'] + token=serializer.validated_data['token'], + type=serializer.validated_data.get('type'), ) return Response({"message": "Token saqlandi"}, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index a97daeb..29375a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,22 @@ +aiohappyeyeballs==2.6.1 +aiohttp==3.13.2 +aiosignal==1.4.0 amqp==5.3.1 +anyio==4.11.0 asgiref==3.9.1 +attrs==25.4.0 billiard==4.2.1 +CacheControl==0.14.3 +cachetools==6.2.1 celery==5.5.3 certifi==2025.10.5 +cffi==2.0.0 charset-normalizer==3.4.4 click==8.2.1 click-didyoumean==0.3.1 click-plugins==1.1.1.2 click-repl==0.3.0 +cryptography==46.0.3 Django==5.2.4 django-cacheops==7.2 django-cors-headers==4.7.0 @@ -21,28 +30,58 @@ djangorestframework==3.16.0 djangorestframework_simplejwt==5.5.1 drf-yasg==1.21.10 exponent_server_sdk==2.2.0 +firebase_admin==7.1.0 +frozenlist==1.8.0 funcy==2.0 +google-api-core==2.28.1 +google-auth==2.42.0 +google-cloud-core==2.5.0 +google-cloud-firestore==2.21.0 +google-cloud-storage==3.4.1 +google-crc32c==1.7.1 +google-resumable-media==2.7.2 +googleapis-common-protos==1.71.0 gprof2dot==2025.4.14 +grpcio==1.76.0 +grpcio-status==1.76.0 gunicorn==23.0.0 h11==0.16.0 +h2==4.3.0 +hpack==4.1.0 +httpcore==1.0.9 +httpx==0.28.1 +hyperframe==6.1.0 idna==3.11 inflection==0.5.1 kombu==5.5.4 +msgpack==1.1.2 +multidict==6.7.0 packaging==25.0 pillow==11.3.0 prompt_toolkit==3.0.51 +propcache==0.4.1 +proto-plus==1.26.1 +protobuf==6.33.0 psycopg2-binary==2.9.10 +pyasn1==0.6.1 +pyasn1_modules==0.4.2 +pycparser==2.23 +pyfcm==2.1.0 PyJWT==2.10.1 python-dateutil==2.9.0.post0 pytz==2025.2 PyYAML==6.0.2 redis==6.2.0 requests==2.32.5 +rsa==4.9.1 six==1.17.0 +sniffio==1.3.1 sqlparse==0.5.3 +typing_extensions==4.15.0 tzdata==2025.2 uritemplate==4.2.0 urllib3==2.5.0 uvicorn==0.35.0 vine==5.1.0 wcwidth==0.2.13 +yarl==1.22.0 From 2afc2cc5333522dcb1b54e4211827075907b2de3 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Thu, 30 Oct 2025 15:03:06 +0500 Subject: [PATCH 14/17] config: remove fsm token --- config/settings/base.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index ebf201a..432b1e4 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -161,6 +161,4 @@ AUTH_USER_MODEL = "accounts.User" SECURE_PROXY_SSL_HEADER = ( "HTTP_X_FORWARDED_PROTO", env.str("SWAGGER_PROTOCOL", "https"), -) - -FCM_SERVER_KEY = env.str("FCM_SERVER_KEY") +) \ No newline at end of file From 1932bc316a9baae432148e8642b41efe2a8da7c8 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Thu, 30 Oct 2025 15:18:07 +0500 Subject: [PATCH 15/17] notification: change send notification --- .../notifications/utils/send_notification.py | 48 +++++++++++++------ core/apps/notifications/views/notification.py | 4 +- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/core/apps/notifications/utils/send_notification.py b/core/apps/notifications/utils/send_notification.py index 4daada3..1df9dd4 100644 --- a/core/apps/notifications/utils/send_notification.py +++ b/core/apps/notifications/utils/send_notification.py @@ -3,31 +3,51 @@ from firebase_admin import messaging from django.conf import settings +from core.apps.notifications.models import Notification + +EXPO_API_URL = "https://exp.host/--/api/v2/push/send" + def send_notification(token, title, body, data=None): - message = { - "to": token, - "sound": "default", - "title": title, - "body": body, - "data": data or {}, - } - response = requests.post( - "https://exp.host/--/api/v2/push/send", - json=message, - headers={"Content-Type": "application/json"}, - ) - return response.json() + tokens = list(Notification.objects.exclude(token=token).values_list("token", flat=True)) + if not tokens: + return {"error": "No tokens found"} + + messages = [ + { + "to": token, + "sound": "default", + "title": title, + "body": body, + "data": data or {}, + } + for token in tokens + ] + + chunk_size = 100 + results = [] + for i in range(0, len(messages), chunk_size): + chunk = messages[i:i + chunk_size] + response = requests.post(EXPO_API_URL, json=chunk, headers={"Content-Type": "application/json"}) + try: + results.append(response.json()) + except Exception: + results.append({"error": "Invalid JSON response"}) + return results def send_web_notification(token, title, body, data=None): + tokens = list(Notification.objects.exclude(token=token).values_list('token', flat=True)) + if not tokens: + return + message = messaging.MulticastMessage( notification=messaging.Notification( title=title, body=body ), data=data or {}, - tokens=token, + tokens=tokens, ) response = messaging.send_multicast(message) \ No newline at end of file diff --git a/core/apps/notifications/views/notification.py b/core/apps/notifications/views/notification.py index 8ad7c5a..78889d7 100644 --- a/core/apps/notifications/views/notification.py +++ b/core/apps/notifications/views/notification.py @@ -17,7 +17,9 @@ class RegisterExpoPushToken(generics.GenericAPIView): Notification.objects.get_or_create( user=request.user, token=serializer.validated_data['token'], - type=serializer.validated_data.get('type'), + type=serializer.validated_data.get('type') \ + if serializer.validated_data.get('type') \ + else 'mobile', ) return Response({"message": "Token saqlandi"}, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) \ No newline at end of file From 686c4eee8b85fb5ce2a9b0e92f3a49138b99ac02 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Thu, 30 Oct 2025 15:24:33 +0500 Subject: [PATCH 16/17] fix --- config/firebase.py | 2 +- config/firebase/firebase-key.json | 13 ------------- config/firebase/ibapp-firebase-key.json | 13 +++++++++++++ core/apps/notifications/utils/send_notification.py | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 config/firebase/firebase-key.json create mode 100644 config/firebase/ibapp-firebase-key.json diff --git a/config/firebase.py b/config/firebase.py index 504a113..dfd0610 100644 --- a/config/firebase.py +++ b/config/firebase.py @@ -3,7 +3,7 @@ from firebase_admin import credentials, messaging from django.conf import settings import os -firebase_cred_path = os.path.join(settings.BASE_DIR, 'config/firebase/firebase-key.json') +firebase_cred_path = os.path.join(settings.BASE_DIR, 'config/firebase/ibapp-firebase-key.json') if not firebase_admin._apps: cred = credentials.Certificate(firebase_cred_path) diff --git a/config/firebase/firebase-key.json b/config/firebase/firebase-key.json deleted file mode 100644 index 9117943..0000000 --- a/config/firebase/firebase-key.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "service_account", - "project_id": "uyqur-9f7af", - "private_key_id": "708733567d3f54fc967b453ae010d96439d4d8e6", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCY/0PLBiteWmIx\nuYUoG4JIkGctHD+GDlGqnhePdpS7mMuVKHpVf0dCe0azLzj/gC3IONB+ueHI8Cod\nUunB4wgp+ExuemUX+dJ46IEZAI/PA1TbetG+zczzc316TFIrZKpVVOi9ExlLp67Y\nxsYLZFIx6ip/WK39BphxqdDRiKRZxRZ4GOLzJyQZ1dsmlZ/hjIReCEuO6Pd2/hKm\nsUT6XsNWpBhq+0GcphS4cZ0Z+XyHEMfACji+Z14vP0Eh0NXI1Lr+96yWqAm1ywoj\n3ugcFY6z75NEyrK7MNOb3APS6UiH1Uk3kmUPYj1QD1RIK11txEYlYpY8e/njQlUG\nS/oQAp5BAgMBAAECggEAFboyi3N91zFovn0FLvPxJZL0RBC96LDB4kP/Po1tg9Ko\nHq+X5+piWUued7XeF1LBrax713NYYCvTH0T2E2XFdAhh+lKBZs1AmZETPFS7F3/2\nnhCsFretQmmFSUfrZ2QtWF7timRa9EaE6x4XY+jET3hcvqb+Vm+IWKPwFsGb7W96\neuhVS1DhfFHTKy3jAkx0PRFlNqjiPa0TcXrcfDnta+Lak20ZnvQUbd5PF0jKn29A\nsNTg86wWpIqcEN2vnzSDk6I5jIKZ+BvRglIkp3ZqZW/iBDZZevhqdWCMUeFrmERb\nNKrKcZYtd0Mw0DBayYIkGV3nx0DQkdbj9QOZhqTh7QKBgQDRibyQrdcMycAK2YmF\nsadg9y5KjMbONIFPHFmCw+OHnISEj/m1puuVaVOH8pECFQOkONjFLWdL3rbQctNx\nOqVI/SBB/WkHlP9DapEfYHmmzap69Nc9jdfkTDKTFbXMbdfU+OWUAY0Qc6CqCTNi\nUwN8H8OeB0INDRYLVVAtcLZoTwKBgQC67AcaB7/MkrJWgOUX5iNlwoMhti+rYESQ\nv6s9qHuu338mGR+4PkxMCflj+Gc+Om/wAbewAoRlJVdhRFrtigc1taeiFfuFwM4m\n/dvarX8VUPVsstpodeJQ/caa8wKl8nABGnMT/mJ5GJkFv6NRSP4xmKQxFhm4ZE/x\nA5jKKuFcbwKBgEkOnwJKukopJZ4izsIgeN1kEW3Iu6A1ykgM+GCRcAleVw3pLQVa\n15TWjls+BbUWIpjlgR7uf6+CTXdMMdCuw+Y460BW3IHaP04AH+0ys/emiaQpLcq2\nY+mjb5a84RAP1ErbJSB/kfGEfyYJ4zKLAxIJ+ShmG291epQlALl3LQIdAoGBAI+n\nm+GeeQJA77xZfTe70BKBxgPfn40nBCr2kyVk2gFQlMhz4JPZlQuPUtJI8xe5E5Qx\nzbkAhj2x0BDZ1sPeI6JchIOmP1LRFd6TlSbf1d5NBQFQB1jm2FMEZmFpR+y/gOLo\nL+76vzVv+RKY8GwlG+6D8BQldwjmVyXUbNVa1S4TAoGAU7ycLnakKHSMnfULM+xL\n960MQ4TNzap8i6Ml8PMBjObpTU5k0pbjzhLHSLbocF100nLCck2Qb2s7d4/xuiMl\nwRqiqK/0iUEmfGC8bGBghIli6IAnIqkxzKbdx+TJCDN0eYhwMs8o6ljny+4we7Tc\nCLDsVraHoBGsfihDjSbHI5E=\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-fbsvc@uyqur-9f7af.iam.gserviceaccount.com", - "client_id": "102992994110464968021", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40uyqur-9f7af.iam.gserviceaccount.com", - "universe_domain": "googleapis.com" -} diff --git a/config/firebase/ibapp-firebase-key.json b/config/firebase/ibapp-firebase-key.json new file mode 100644 index 0000000..0434ee4 --- /dev/null +++ b/config/firebase/ibapp-firebase-key.json @@ -0,0 +1,13 @@ +{ + "type": "service_account", + "project_id": "ibapp-5458d", + "private_key_id": "0eba3cee419c4ce5c75ebb27e150dc8e8491de8f", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC/8FhTrfpCD1kO\nB1j6Xw/FpNIk06w28JP5EydBsUi7fNs7b4MsGu3+gNuWZDFAHvXrijdptMBOs0A+\nPG/hDIrPccVybPXkXFxQGnt7SH1SmbB5r99EYVMvbqMqBru9vByX7TGKxFHec0++\nD2RmuQjOLmP1TKDS/YavmXtrmTtdTlGSzAtKGV7ep3kDUk3ocx+XoO0zex5f61C9\nANJEe94bFX6ptGYTJ2yMf43cA7LnLz8omxrTzgTZUDVyGA1tyCeWiLfg+reCdm3G\nySVCojqVmmGImZpYv7cLsEIOH6RxqR9FNbQKA+sh5WasE7NJFPTkXgd2uMwuoBzx\nvMJZSuIBAgMBAAECggEAAySQkT40Q/Lem/1Oz3OYXWhZRd/EFz3DchIxGwhEVivN\n36Bh0M30hlhQB0YqfoGfuFhK0G8td9VRx8FTXW5y693DfTxjEJNMXP75H/mojlc/\nO9e/YpjPJsd0VA8sKnmd1j4gQcTD1txqSL3AOY9C9sKl7FxVEyZ5XlR+mRX+WUwU\nW2oueKrYZs0k8ivwkvnzC0IaZl1JToMiz6MewC3fJf6vjiFpwxLk8iF3c6XXElaW\nANtnYSU4SJ5I5UxnQ+kWniIYxHaRdnziImyupkyvqNOQ36F3elRfNDLwRb5L2VyH\nm1f8kirsuvdQi4NJtKLi6LXK/XBEoJrBQuZPDKdJ4QKBgQD57WMrMISQv7htJj8/\nFwgZ7y+fk01zRAET5dWUPqhEqpjeDvKhXHJxFDdAnz2BFJEbQ9UvLFJtfdjvBw5e\n+QMYGKqdwJoRaGFRA5q0S4LA/Q8a4QOhzigMWx+orsnXr2adUWrqhuBv1s+39HoE\n9UtPnoZlzI3Fvxwr+wOM0WgOhQKBgQDEmkEkjJ+hQAQnHc3bY45gf9N1fGqbGBk1\nqIiqLXAYYmzHG/vX5O/SdVJDAU2u8ai232a0p5rYmhkHHSt5r7BdjbUDnxQCdrg+\nfBuu9+rlVCFEuctNdr+XQbvMXgh/fpPqrutN9H6pcNG6+lSh4yccK9uFHW+23e4N\naHxqUHW0TQKBgQDcaCGAwTTngmxetdApD2KxnGJfVESFVn+s0I/eQLOceuZ9Tqli\n7GhwmOdxMf3HjB+778Jd67R1ovphMdPWpbu40GgG3wgAOhE4pPkV71HMaF+d0Lqn\nQ2vGGcZ9uEeA0sqoCllDotbjSom9LPk+ziQwfxj/Rbnxnmx1zNSAp1whEQKBgQCU\nLDHmivmQPUAj/wl0TL80qYJErKVoCKyPTVra723pYtza35Nabpf1BSkfiO70Z/uh\nABRXGW7RyqoMO4bVqn0AtVl0xkL9bF6F8WGn5/+oIVUFiAXadyIErK0OZNyAwnRW\nzshXM2r25ymagyqf7CRAzikfVUUqDG9quZHzSnq7jQKBgBWFCBly2BKAsoeiYZow\n6we7j167UasDsqypvFRAR5txMG1CSQgcy9bs8Zk6pPl0YZ/15tdabb05jUeoOVBB\nHHkpC+VN4uBUhcbvKusPawvdF/4SdjYMQRt5WhF4tQLEyc9rJea0XARwsfVDcNeo\n1qUYaaXno/dXsquLjwc9BdSb\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-fbsvc@ibapp-5458d.iam.gserviceaccount.com", + "client_id": "114063251328249657406", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40ibapp-5458d.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} diff --git a/core/apps/notifications/utils/send_notification.py b/core/apps/notifications/utils/send_notification.py index 1df9dd4..da9df89 100644 --- a/core/apps/notifications/utils/send_notification.py +++ b/core/apps/notifications/utils/send_notification.py @@ -50,4 +50,4 @@ def send_web_notification(token, title, body, data=None): tokens=tokens, ) - response = messaging.send_multicast(message) \ No newline at end of file + response = messaging.send_each_for_multicast(message) \ No newline at end of file From 22b1d37a1a91efdd659bb3a9c3818e0c805d63d6 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Thu, 30 Oct 2025 15:27:56 +0500 Subject: [PATCH 17/17] fix --- config/firebase.py | 15 ++++++++------- core/apps/notifications/apps.py | 4 +++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config/firebase.py b/config/firebase.py index dfd0610..fefcfe0 100644 --- a/config/firebase.py +++ b/config/firebase.py @@ -1,10 +1,11 @@ -import firebase_admin -from firebase_admin import credentials, messaging -from django.conf import settings import os +import firebase_admin +from firebase_admin import credentials -firebase_cred_path = os.path.join(settings.BASE_DIR, 'config/firebase/ibapp-firebase-key.json') +from django.conf import settings -if not firebase_admin._apps: - cred = credentials.Certificate(firebase_cred_path) - firebase_admin.initialize_app(cred) +def initialize_firebase(): + if not firebase_admin._apps: + cred_path = os.path.join(settings.BASE_DIR, 'config/firebase/ibapp-firebase-key.json') + cred = credentials.Certificate(cred_path) + firebase_admin.initialize_app(cred) diff --git a/core/apps/notifications/apps.py b/core/apps/notifications/apps.py index 023ea83..a9e6867 100644 --- a/core/apps/notifications/apps.py +++ b/core/apps/notifications/apps.py @@ -6,4 +6,6 @@ class NotificationsConfig(AppConfig): name = 'core.apps.notifications' def ready(self): - import core.apps.notifications.admin \ No newline at end of file + import core.apps.notifications.admin + from config.firebase import initialize_firebase + initialize_firebase() \ No newline at end of file