diff --git a/RSI/__pycache__/__init__.cpython-39.pyc b/RSI/__pycache__/__init__.cpython-39.pyc index b331875..6739edd 100644 Binary files a/RSI/__pycache__/__init__.cpython-39.pyc and b/RSI/__pycache__/__init__.cpython-39.pyc differ diff --git a/RSI/__pycache__/settings.cpython-39.pyc b/RSI/__pycache__/settings.cpython-39.pyc index 5992137..5ffe58d 100644 Binary files a/RSI/__pycache__/settings.cpython-39.pyc and b/RSI/__pycache__/settings.cpython-39.pyc differ diff --git a/RSI/__pycache__/urls.cpython-39.pyc b/RSI/__pycache__/urls.cpython-39.pyc index aeebbb9..977dd48 100644 Binary files a/RSI/__pycache__/urls.cpython-39.pyc and b/RSI/__pycache__/urls.cpython-39.pyc differ diff --git a/RSI/__pycache__/wsgi.cpython-39.pyc b/RSI/__pycache__/wsgi.cpython-39.pyc index ec42f43..983bdc0 100644 Binary files a/RSI/__pycache__/wsgi.cpython-39.pyc and b/RSI/__pycache__/wsgi.cpython-39.pyc differ diff --git a/__pycache__/helpers.cpython-39.pyc b/__pycache__/helpers.cpython-39.pyc index aa626db..c3abf02 100644 Binary files a/__pycache__/helpers.cpython-39.pyc and b/__pycache__/helpers.cpython-39.pyc differ diff --git a/app/__pycache__/__init__.cpython-39.pyc b/app/__pycache__/__init__.cpython-39.pyc index 4e3a271..d177bcd 100644 Binary files a/app/__pycache__/__init__.cpython-39.pyc and b/app/__pycache__/__init__.cpython-39.pyc differ diff --git a/app/__pycache__/admin.cpython-39.pyc b/app/__pycache__/admin.cpython-39.pyc index a101e30..ffc08e0 100644 Binary files a/app/__pycache__/admin.cpython-39.pyc and b/app/__pycache__/admin.cpython-39.pyc differ diff --git a/app/__pycache__/apps.cpython-39.pyc b/app/__pycache__/apps.cpython-39.pyc index dae28ef..80a3b98 100644 Binary files a/app/__pycache__/apps.cpython-39.pyc and b/app/__pycache__/apps.cpython-39.pyc differ diff --git a/app/__pycache__/cityandprovince.cpython-39.pyc b/app/__pycache__/cityandprovince.cpython-39.pyc index 2352e09..2adbe7d 100644 Binary files a/app/__pycache__/cityandprovince.cpython-39.pyc and b/app/__pycache__/cityandprovince.cpython-39.pyc differ diff --git a/app/__pycache__/excel_processing.cpython-39.pyc b/app/__pycache__/excel_processing.cpython-39.pyc index 0e9ade1..b9041bc 100644 Binary files a/app/__pycache__/excel_processing.cpython-39.pyc and b/app/__pycache__/excel_processing.cpython-39.pyc differ diff --git a/app/__pycache__/filtersets.cpython-39.pyc b/app/__pycache__/filtersets.cpython-39.pyc index 4acabfd..f5da017 100644 Binary files a/app/__pycache__/filtersets.cpython-39.pyc and b/app/__pycache__/filtersets.cpython-39.pyc differ diff --git a/app/__pycache__/helper.cpython-39.pyc b/app/__pycache__/helper.cpython-39.pyc index 65d0266..16bf342 100644 Binary files a/app/__pycache__/helper.cpython-39.pyc and b/app/__pycache__/helper.cpython-39.pyc differ diff --git a/app/__pycache__/helper_excel.cpython-39.pyc b/app/__pycache__/helper_excel.cpython-39.pyc index ff0e54b..7b69508 100644 Binary files a/app/__pycache__/helper_excel.cpython-39.pyc and b/app/__pycache__/helper_excel.cpython-39.pyc differ diff --git a/app/__pycache__/models.cpython-39.pyc b/app/__pycache__/models.cpython-39.pyc index aa56fc7..0a3f598 100644 Binary files a/app/__pycache__/models.cpython-39.pyc and b/app/__pycache__/models.cpython-39.pyc differ diff --git a/app/__pycache__/scripts.cpython-39.pyc b/app/__pycache__/scripts.cpython-39.pyc index b55f85d..2de3648 100644 Binary files a/app/__pycache__/scripts.cpython-39.pyc and b/app/__pycache__/scripts.cpython-39.pyc differ diff --git a/app/__pycache__/serializers.cpython-39.pyc b/app/__pycache__/serializers.cpython-39.pyc index 342c9ac..39e965d 100644 Binary files a/app/__pycache__/serializers.cpython-39.pyc and b/app/__pycache__/serializers.cpython-39.pyc differ diff --git a/app/__pycache__/urls.cpython-39.pyc b/app/__pycache__/urls.cpython-39.pyc index b8a2656..8daa7bd 100644 Binary files a/app/__pycache__/urls.cpython-39.pyc and b/app/__pycache__/urls.cpython-39.pyc differ diff --git a/app/__pycache__/views.cpython-39.pyc b/app/__pycache__/views.cpython-39.pyc index 5189962..db36bc7 100644 Binary files a/app/__pycache__/views.cpython-39.pyc and b/app/__pycache__/views.cpython-39.pyc differ diff --git a/app/excel_processing.py b/app/excel_processing.py index 7502e76..a65ecda 100644 --- a/app/excel_processing.py +++ b/app/excel_processing.py @@ -14,11 +14,12 @@ from rest_framework.permissions import AllowAny from app.filtersets import TransportingDetailFilterSet, KillHouseFilterSet, HatchingsFilterSet, GuildsFilterSet, \ TransportCarcassDetailFilterSet, AllProductsTransportFilterSet -from app.helper_excel import create_header, create_header_freez, shamsi_date, excel_description, create_value +from app.helper_excel import create_header, create_header_freez, shamsi_date, excel_description, create_value, \ + convert_str_to_date from app.models import TransportingDetail, KillHouse, Hatching, TransportCarcassDetail, Guilds, AllProductsTransport from app.serializers import TransportingDetailSerializer, HatchingDetailSerializer, \ StewardForTransportCarcassSerializer, KillHouseForTransportCarcassSerializer, TransportCarcassDetailSerializer, \ - GuildsForTransportCarcassSerializer, AllProductsTransportSerializer + GuildsForTransportCarcassSerializer, AllProductsTransportSerializer, AllProductsTransportCustomSerializer from helpers import build_query from app.helper import get_hatching_permit_code @@ -2571,4 +2572,228 @@ def import_transporting_detail(request): new_obj.save() created_count += 1 - return HttpResponse(f"{created_count} رکورد جدید اضافه شد ✅") \ No newline at end of file + return HttpResponse(f"{created_count} رکورد جدید اضافه شد ✅") + + +def all_products_transport_excel(request): + filterset_class = AllProductsTransportFilterSet + + transports = AllProductsTransport.objects.filter(trash=False) + + product_type = request.GET.get('product_type') + destination_province = request.GET.get('destination_province') + date1 = request.GET.get('date1') + date2 = request.GET.get('date2') + search = request.GET.get('search') + + if product_type and product_type != 'undefined': + transports = transports.filter(product=product_type) + + if destination_province and destination_province != 'undefined': + transports = transports.filter(destination_province=destination_province) + + if date1 and date2 and date1 != 'undefined' and date2 != 'undefined': + try: + start_date = datetime.datetime.strptime(str(date1), '%Y-%m-%d') + end_date = datetime.datetime.strptime(str(date2), '%Y-%m-%d') + transports = transports.filter(date__gte=start_date, date__lte=end_date) + except ValueError: + pass + + if search: + if search != 'undefined' and search.strip(): + transports = transports.filter( + build_query(filterset_class.Meta.fields, search) + ) + + serializer = AllProductsTransportCustomSerializer(transports.order_by('-date', '-create_date'), many=True).data + + excel_options = [ + 'ردیف', + 'کد رهگیری', + 'محصول', + 'اقلام', + 'مقدار', + 'واحد', + 'تاریخ', + 'مقصد', + 'شناسه مقصد', + 'استان مقصد', + 'شهرستان مقصد', + 'مبدا', + 'شناسه مبدا', + 'استان مبدا', + 'شهرستان مبدا', + 'نوع حمل', + 'مقصد قبلی', + 'تغییر مقصد', + 'کد رهگیری خودرو', + 'تاریخ تخلیه', + 'تخلیه', + + ] + + output = BytesIO() + workbook = Workbook() + worksheet = workbook.active + worksheet.sheet_view.rightToLeft = True + worksheet.insert_rows(1) + cell = worksheet.cell(row=1, column=1) + cell.alignment = Alignment(horizontal='center', vertical='center') + + if 'date1' in request.GET: + date1 = datetime.datetime.strptime(str(request.GET['date1']), '%Y-%m-%d').date() + date2 = datetime.datetime.strptime(str(request.GET['date2']), '%Y-%m-%d').date() + from_date_1 = shamsi_date(date1) + to_date_1 = shamsi_date(date2) + worksheet['A3'] = f'از تاریخ:({from_date_1}) تا تاریخ:({to_date_1})' + excel_description(worksheet, 'A5', f'اطلاعات بار کل کشور', color='red', row2='C5') + if destination_province and destination_province != 'undefined': + excel_description(worksheet, 'A4', f'استان {destination_province}', row2='C4') + + if product_type and product_type != 'undefined': + excel_description(worksheet, 'A1', f'محصول {product_type}', row2='C1') + + # header_list2 = [ + # 'تعداد کشتارگاه ها', + # 'تعداد بار', + # 'حجم بار', + # 'تعداد بار داخل استان', + # 'حجم بار داخل استان', + # 'درصد بار داخل استان', + # 'تعداد بار خارج استان', + # 'حجم بار خارج استان', + # 'درصد بار خارج استان', + # + # ] + # create_header(worksheet, header_list2, 5, 2, height=20.8, border_style='thin') + create_header_freez(worksheet, excel_options, 1, 6, 7, 20) + l = 5 + m = 1 + if serializer: + for data in serializer: + list1 = [ + m, # ردیف + + data.get("tracking"), + data.get("product"), + data.get("items") if data.get("items") else '-', + data.get("quantity"), + data.get("unit"), + str(shamsi_date(convert_str_to_date(data.get("date")),in_value=True)) if data.get('date') else '-', + data.get("destination"), + data.get("jihadi_destination"), + data.get("destination_province"), + data.get("destination_city"), + data.get("origin"), + data.get("jihadi_origin"), + data.get("origin_province"), + data.get("origin_city"), + "داخل استان" if data.get("origin_province") == data.get("destination_province") else "خارج استان", + data.get("destination_prev") if data.get("destination_prev") else '-', + data.get("destination_changed") if data.get("destination_changed") else '-', + data.get("car_tracking_code"), + str(shamsi_date(convert_str_to_date(data.get("unloading_date")), in_value=True)) if data.get("unloading_date") else '-', + data.get("unloading") if data.get("unloading") else '-', + ] + + + m += 1 + + l += 1 + create_value(worksheet, list1, l + 1, 1) + total_quantity = sum( + item['quantity'] for item in serializer) + # aggregation1_bars = all_bars.aggregate( + # total=Sum('GoodAmount'), + # input_total=Sum('GoodAmount', filter=Q(Out=False)), + # output_total=Sum('GoodAmount', filter=Q(Out=True)), + # input_count=Count('id', filter=Q(Out=False)), + # output_count=Count('id', filter=Q(Out=True)), + # total_count=Count('id') + # ) + # + # aggregation1_all_products = all_products_transport.aggregate( + # total=Sum('quantity'), + # input_total=Sum('quantity', filter=Q(out=False)), + # output_total=Sum('quantity', filter=Q(out=True)), + # input_count=Count('id', filter=Q(out=False)), + # output_count=Count('id', filter=Q(out=True)), + # total_count=Count('id') + # ) + # + # total_count = (aggregation1_bars['total_count'] or 0) + (aggregation1_all_products['total_count'] or 0) + # total_bars_quantity = (aggregation1_bars['total'] or 0) + (aggregation1_all_products['total'] or 0) + # total_input_bars_quantity = (aggregation1_bars['input_total'] or 0) + ( + # aggregation1_all_products['input_total'] or 0) + # total_output_bars_quantity = (aggregation1_bars['output_total'] or 0) + ( + # aggregation1_all_products['output_total'] or 0) + # input_bars_count = (aggregation1_bars['input_count'] or 0) + (aggregation1_all_products['input_count'] or 0) + # output_bars_count = (aggregation1_bars['output_count'] or 0) + (aggregation1_all_products['output_count'] or 0) + # + # if total_count > 0: + # total_input_bars_percent = round((input_bars_count / total_count) * 100, 1) + # total_output_bars_percent = round((output_bars_count / total_count) * 100, 1) + # else: + # total_input_bars_percent = 0 + # total_output_bars_percent = 0 + # value_header_list2 = [ + # kill_houses.count(), + # total_count, + # total_bars_quantity, + # input_bars_count, + # total_input_bars_quantity, + # total_input_bars_percent, + # output_bars_count, + # total_output_bars_quantity, + # total_output_bars_percent, + # + # ] + # + # create_value(worksheet, value_header_list2, 3, 5, border_style='thin') + + list2 = [ + 'مجموع==>', + '', + '', + '', + total_quantity, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + # total_count, + # total_bars_quantity, + # input_bars_count, + # total_input_bars_quantity, + # total_input_bars_percent, + # output_bars_count, + # total_output_bars_quantity, + # total_output_bars_percent, + + ] + create_value(worksheet, list2, l + 3, 1, color='green') + + workbook.save(output) + output.seek(0) + + response = HttpResponse( + content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') + + response[ + 'Content-Disposition'] = f'attachment; filename="اطلاعات حمل محصولات.xlsx"'.encode( + 'utf-8') + response.write(output.getvalue()) + return response \ No newline at end of file diff --git a/app/helper_excel.py b/app/helper_excel.py index 4ddaf21..7c4e788 100644 --- a/app/helper_excel.py +++ b/app/helper_excel.py @@ -1,3 +1,4 @@ +from datetime import datetime from io import BytesIO import jdatetime @@ -324,4 +325,56 @@ def add_chart( # chart_title="نمودار تغییرات وزن در سردخانه‌ها", # x_axis_title="سردخانه‌ها", # y_axis_title="وزن (کیلوگرم)" - # ) \ No newline at end of file + # ) + + +def convert_str_to_date(string, with_datetime=None): + """ + Convert a string to a datetime.date object. + + This function tries multiple common date formats, including ISO 8601 with or + without milliseconds, and plain 'YYYY-MM-DD'. If the string cannot be parsed, + it returns None. + + Parameters: + ----------- + string : str + The date string to convert. + + Returns: + -------- + datetime.date or None + A datetime.date object if conversion succeeds, otherwise None. + + Supported formats: + ------------------ + - 'YYYY-MM-DDTHH:MM:SS.sssZ' (ISO 8601 with milliseconds) + - 'YYYY-MM-DDTHH:MM:SSZ' (ISO 8601 without milliseconds) + - 'YYYY-MM-DD' (Simple date) + """ + string = str(string).strip() + + # فرمت‌های مختلف تاریخ + date_formats = [ + '%Y-%m-%dT%H:%M:%S.%fZ', + '%Y-%m-%dT%H:%M:%SZ', + '%Y-%m-%dT%H:%M:%S.%f%z', # ✅ با میلی‌ثانیه و تایم‌زون + '%Y-%m-%dT%H:%M:%S%z', # ✅ مثل: 2025-02-26T03:30:00+03:30 + '%Y-%m-%dT%H:%M:%S.%f', + '%Y-%m-%dT%H:%M:%S', + '%Y-%m-%d %H:%M:%S.%f', + '%Y-%m-%d %H:%M:%S', + '%Y-%m-%d' + ] + + for fmt in date_formats: + try: + if with_datetime: + date = datetime.strptime(string, fmt) + else: + date = datetime.strptime(string, fmt).date() + return date + except ValueError: + continue + + return None \ No newline at end of file diff --git a/app/migrations/__pycache__/0001_initial.cpython-39.pyc b/app/migrations/__pycache__/0001_initial.cpython-39.pyc index d246d10..59257f6 100644 Binary files a/app/migrations/__pycache__/0001_initial.cpython-39.pyc and b/app/migrations/__pycache__/0001_initial.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0002_remove_poultry_allowinsert_and_more.cpython-39.pyc b/app/migrations/__pycache__/0002_remove_poultry_allowinsert_and_more.cpython-39.pyc index f04bc5c..8ceafba 100644 Binary files a/app/migrations/__pycache__/0002_remove_poultry_allowinsert_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0002_remove_poultry_allowinsert_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0003_poultry_allowinsert_poultry_allowupdate_and_more.cpython-39.pyc b/app/migrations/__pycache__/0003_poultry_allowinsert_poultry_allowupdate_and_more.cpython-39.pyc index ce071be..ae2ac43 100644 Binary files a/app/migrations/__pycache__/0003_poultry_allowinsert_poultry_allowupdate_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0003_poultry_allowinsert_poultry_allowupdate_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0004_poultryhatching_date_poultryhatching_hatchingage.cpython-39.pyc b/app/migrations/__pycache__/0004_poultryhatching_date_poultryhatching_hatchingage.cpython-39.pyc index 465473f..99eba7f 100644 Binary files a/app/migrations/__pycache__/0004_poultryhatching_date_poultryhatching_hatchingage.cpython-39.pyc and b/app/migrations/__pycache__/0004_poultryhatching_date_poultryhatching_hatchingage.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0005_remove_poultryhatching_basehatchingcount_and_more.cpython-39.pyc b/app/migrations/__pycache__/0005_remove_poultryhatching_basehatchingcount_and_more.cpython-39.pyc index 0d3148a..bc336e1 100644 Binary files a/app/migrations/__pycache__/0005_remove_poultryhatching_basehatchingcount_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0005_remove_poultryhatching_basehatchingcount_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0006_poultryhatching_basehatchingcount_and_more.cpython-39.pyc b/app/migrations/__pycache__/0006_poultryhatching_basehatchingcount_and_more.cpython-39.pyc index 2458098..75b8bac 100644 Binary files a/app/migrations/__pycache__/0006_poultryhatching_basehatchingcount_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0006_poultryhatching_basehatchingcount_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0007_transportingchickendetail.cpython-39.pyc b/app/migrations/__pycache__/0007_transportingchickendetail.cpython-39.pyc index 7556ceb..1175350 100644 Binary files a/app/migrations/__pycache__/0007_transportingchickendetail.cpython-39.pyc and b/app/migrations/__pycache__/0007_transportingchickendetail.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0008_transportingchickendetail_certid_and_more.cpython-39.pyc b/app/migrations/__pycache__/0008_transportingchickendetail_certid_and_more.cpython-39.pyc index 2be0291..03764f8 100644 Binary files a/app/migrations/__pycache__/0008_transportingchickendetail_certid_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0008_transportingchickendetail_certid_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0009_transportingchickendetail_broilerflockrequestid_and_more.cpython-39.pyc b/app/migrations/__pycache__/0009_transportingchickendetail_broilerflockrequestid_and_more.cpython-39.pyc index d3703db..b3ab61f 100644 Binary files a/app/migrations/__pycache__/0009_transportingchickendetail_broilerflockrequestid_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0009_transportingchickendetail_broilerflockrequestid_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0010_transportingchickendetail_province_and_more.cpython-39.pyc b/app/migrations/__pycache__/0010_transportingchickendetail_province_and_more.cpython-39.pyc index c99dc6f..313c525 100644 Binary files a/app/migrations/__pycache__/0010_transportingchickendetail_province_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0010_transportingchickendetail_province_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0011_poultryhatching_pedigreename.cpython-39.pyc b/app/migrations/__pycache__/0011_poultryhatching_pedigreename.cpython-39.pyc index c1fdae0..f761acf 100644 Binary files a/app/migrations/__pycache__/0011_poultryhatching_pedigreename.cpython-39.pyc and b/app/migrations/__pycache__/0011_poultryhatching_pedigreename.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0012_transportingchickendetail_age.cpython-39.pyc b/app/migrations/__pycache__/0012_transportingchickendetail_age.cpython-39.pyc index 9c3ec5f..9804eba 100644 Binary files a/app/migrations/__pycache__/0012_transportingchickendetail_age.cpython-39.pyc and b/app/migrations/__pycache__/0012_transportingchickendetail_age.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0013_poultryhatching_leftover.cpython-39.pyc b/app/migrations/__pycache__/0013_poultryhatching_leftover.cpython-39.pyc index 9d73eb8..4f7d0cb 100644 Binary files a/app/migrations/__pycache__/0013_poultryhatching_leftover.cpython-39.pyc and b/app/migrations/__pycache__/0013_poultryhatching_leftover.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0014_poultry_locationnamecity_and_more.cpython-39.pyc b/app/migrations/__pycache__/0014_poultry_locationnamecity_and_more.cpython-39.pyc index fcab7dd..71e298c 100644 Binary files a/app/migrations/__pycache__/0014_poultry_locationnamecity_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0014_poultry_locationnamecity_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0015_hatching_transportingdetail.cpython-39.pyc b/app/migrations/__pycache__/0015_hatching_transportingdetail.cpython-39.pyc index 2425708..03f06a8 100644 Binary files a/app/migrations/__pycache__/0015_hatching_transportingdetail.cpython-39.pyc and b/app/migrations/__pycache__/0015_hatching_transportingdetail.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0016_remove_transportingdetail_certid_and_more.cpython-39.pyc b/app/migrations/__pycache__/0016_remove_transportingdetail_certid_and_more.cpython-39.pyc index 35bf1dd..ecdb4fc 100644 Binary files a/app/migrations/__pycache__/0016_remove_transportingdetail_certid_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0016_remove_transportingdetail_certid_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0017_hatching_archivedate.cpython-39.pyc b/app/migrations/__pycache__/0017_hatching_archivedate.cpython-39.pyc index 2b642b1..c129df3 100644 Binary files a/app/migrations/__pycache__/0017_hatching_archivedate.cpython-39.pyc and b/app/migrations/__pycache__/0017_hatching_archivedate.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0018_remove_hatching_capacityfemale.cpython-39.pyc b/app/migrations/__pycache__/0018_remove_hatching_capacityfemale.cpython-39.pyc index 8d7a091..767ddaa 100644 Binary files a/app/migrations/__pycache__/0018_remove_hatching_capacityfemale.cpython-39.pyc and b/app/migrations/__pycache__/0018_remove_hatching_capacityfemale.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0019_hatching_capacityfemale.cpython-39.pyc b/app/migrations/__pycache__/0019_hatching_capacityfemale.cpython-39.pyc index 9167677..e78fe77 100644 Binary files a/app/migrations/__pycache__/0019_hatching_capacityfemale.cpython-39.pyc and b/app/migrations/__pycache__/0019_hatching_capacityfemale.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0020_killhouse.cpython-39.pyc b/app/migrations/__pycache__/0020_killhouse.cpython-39.pyc index b23307d..dc398b3 100644 Binary files a/app/migrations/__pycache__/0020_killhouse.cpython-39.pyc and b/app/migrations/__pycache__/0020_killhouse.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0021_hatching_killingave_transportingdetail_out_and_more.cpython-39.pyc b/app/migrations/__pycache__/0021_hatching_killingave_transportingdetail_out_and_more.cpython-39.pyc index ea6b3a5..e73ac3e 100644 Binary files a/app/migrations/__pycache__/0021_hatching_killingave_transportingdetail_out_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0021_hatching_killingave_transportingdetail_out_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0022_alter_hatching_killingave.cpython-39.pyc b/app/migrations/__pycache__/0022_alter_hatching_killingave.cpython-39.pyc index 12c21ef..6d63858 100644 Binary files a/app/migrations/__pycache__/0022_alter_hatching_killingave.cpython-39.pyc and b/app/migrations/__pycache__/0022_alter_hatching_killingave.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0023_killhouse_cityid_killhouse_provinceid.cpython-39.pyc b/app/migrations/__pycache__/0023_killhouse_cityid_killhouse_provinceid.cpython-39.pyc index 633af08..2f93d9e 100644 Binary files a/app/migrations/__pycache__/0023_killhouse_cityid_killhouse_provinceid.cpython-39.pyc and b/app/migrations/__pycache__/0023_killhouse_cityid_killhouse_provinceid.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0024_poultry_city_poultry_province.cpython-39.pyc b/app/migrations/__pycache__/0024_poultry_city_poultry_province.cpython-39.pyc index f083241..e0a61cd 100644 Binary files a/app/migrations/__pycache__/0024_poultry_city_poultry_province.cpython-39.pyc and b/app/migrations/__pycache__/0024_poultry_city_poultry_province.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0025_delete_transportingdetail.cpython-39.pyc b/app/migrations/__pycache__/0025_delete_transportingdetail.cpython-39.pyc index 33cc70b..1f5979c 100644 Binary files a/app/migrations/__pycache__/0025_delete_transportingdetail.cpython-39.pyc and b/app/migrations/__pycache__/0025_delete_transportingdetail.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0026_transportingdetail.cpython-39.pyc b/app/migrations/__pycache__/0026_transportingdetail.cpython-39.pyc index 750e146..0cd67ee 100644 Binary files a/app/migrations/__pycache__/0026_transportingdetail.cpython-39.pyc and b/app/migrations/__pycache__/0026_transportingdetail.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0027_hatching_samasat_discharge_percentage_and_more.cpython-39.pyc b/app/migrations/__pycache__/0027_hatching_samasat_discharge_percentage_and_more.cpython-39.pyc index c92ee79..4e301d9 100644 Binary files a/app/migrations/__pycache__/0027_hatching_samasat_discharge_percentage_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0027_hatching_samasat_discharge_percentage_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0028_hatching_goodsum.cpython-39.pyc b/app/migrations/__pycache__/0028_hatching_goodsum.cpython-39.pyc index 1bfa0e4..19f755f 100644 Binary files a/app/migrations/__pycache__/0028_hatching_goodsum.cpython-39.pyc and b/app/migrations/__pycache__/0028_hatching_goodsum.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0029_apkinfo.cpython-39.pyc b/app/migrations/__pycache__/0029_apkinfo.cpython-39.pyc index e0a22d6..b5340f6 100644 Binary files a/app/migrations/__pycache__/0029_apkinfo.cpython-39.pyc and b/app/migrations/__pycache__/0029_apkinfo.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0030_transportcarcassdetail.cpython-39.pyc b/app/migrations/__pycache__/0030_transportcarcassdetail.cpython-39.pyc index ff1c79a..e56f092 100644 Binary files a/app/migrations/__pycache__/0030_transportcarcassdetail.cpython-39.pyc and b/app/migrations/__pycache__/0030_transportcarcassdetail.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0031_auto_20250921_1447.cpython-39.pyc b/app/migrations/__pycache__/0031_auto_20250921_1447.cpython-39.pyc index ef11270..34613e0 100644 Binary files a/app/migrations/__pycache__/0031_auto_20250921_1447.cpython-39.pyc and b/app/migrations/__pycache__/0031_auto_20250921_1447.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0032_delete_transportcarcassdetail.cpython-39.pyc b/app/migrations/__pycache__/0032_delete_transportcarcassdetail.cpython-39.pyc index a3e1794..58b7dfd 100644 Binary files a/app/migrations/__pycache__/0032_delete_transportcarcassdetail.cpython-39.pyc and b/app/migrations/__pycache__/0032_delete_transportcarcassdetail.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0033_transportcarcassdetail.cpython-39.pyc b/app/migrations/__pycache__/0033_transportcarcassdetail.cpython-39.pyc index ff7a798..6fcc93a 100644 Binary files a/app/migrations/__pycache__/0033_transportcarcassdetail.cpython-39.pyc and b/app/migrations/__pycache__/0033_transportcarcassdetail.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0034_guilds.cpython-39.pyc b/app/migrations/__pycache__/0034_guilds.cpython-39.pyc index f73e0a0..962dc22 100644 Binary files a/app/migrations/__pycache__/0034_guilds.cpython-39.pyc and b/app/migrations/__pycache__/0034_guilds.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0035_guilds_is_steward.cpython-39.pyc b/app/migrations/__pycache__/0035_guilds_is_steward.cpython-39.pyc index 5658ec0..c57f669 100644 Binary files a/app/migrations/__pycache__/0035_guilds_is_steward.cpython-39.pyc and b/app/migrations/__pycache__/0035_guilds_is_steward.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0036_driver.cpython-39.pyc b/app/migrations/__pycache__/0036_driver.cpython-39.pyc index 85ca016..ccde44a 100644 Binary files a/app/migrations/__pycache__/0036_driver.cpython-39.pyc and b/app/migrations/__pycache__/0036_driver.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0037_driver_product.cpython-39.pyc b/app/migrations/__pycache__/0037_driver_product.cpython-39.pyc index c79e1a2..f3ec73e 100644 Binary files a/app/migrations/__pycache__/0037_driver_product.cpython-39.pyc and b/app/migrations/__pycache__/0037_driver_product.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0038_auto_20250927_0848.cpython-39.pyc b/app/migrations/__pycache__/0038_auto_20250927_0848.cpython-39.pyc index 4b72ad0..89fddf8 100644 Binary files a/app/migrations/__pycache__/0038_auto_20250927_0848.cpython-39.pyc and b/app/migrations/__pycache__/0038_auto_20250927_0848.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0039_alter_transportcarcassdetail_tracking.cpython-39.pyc b/app/migrations/__pycache__/0039_alter_transportcarcassdetail_tracking.cpython-39.pyc index 76bad83..409a5cc 100644 Binary files a/app/migrations/__pycache__/0039_alter_transportcarcassdetail_tracking.cpython-39.pyc and b/app/migrations/__pycache__/0039_alter_transportcarcassdetail_tracking.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0040_transportcarcassdetail_product_date.cpython-39.pyc b/app/migrations/__pycache__/0040_transportcarcassdetail_product_date.cpython-39.pyc index b823613..bcd4d85 100644 Binary files a/app/migrations/__pycache__/0040_transportcarcassdetail_product_date.cpython-39.pyc and b/app/migrations/__pycache__/0040_transportcarcassdetail_product_date.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0041_transportcarcassdetail_has_product_date.cpython-39.pyc b/app/migrations/__pycache__/0041_transportcarcassdetail_has_product_date.cpython-39.pyc index 616e0a8..9a7d7ab 100644 Binary files a/app/migrations/__pycache__/0041_transportcarcassdetail_has_product_date.cpython-39.pyc and b/app/migrations/__pycache__/0041_transportcarcassdetail_has_product_date.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0042_alter_driver_created_by_alter_driver_modified_by_and_more.cpython-39.pyc b/app/migrations/__pycache__/0042_alter_driver_created_by_alter_driver_modified_by_and_more.cpython-39.pyc index bedc2b3..7780844 100644 Binary files a/app/migrations/__pycache__/0042_alter_driver_created_by_alter_driver_modified_by_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0042_alter_driver_created_by_alter_driver_modified_by_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0043_allproductstransport.cpython-39.pyc b/app/migrations/__pycache__/0043_allproductstransport.cpython-39.pyc index 6e71007..56e91f8 100644 Binary files a/app/migrations/__pycache__/0043_allproductstransport.cpython-39.pyc and b/app/migrations/__pycache__/0043_allproductstransport.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0044_evacuationdetail.cpython-39.pyc b/app/migrations/__pycache__/0044_evacuationdetail.cpython-39.pyc index dbd645d..8d56f9c 100644 Binary files a/app/migrations/__pycache__/0044_evacuationdetail.cpython-39.pyc and b/app/migrations/__pycache__/0044_evacuationdetail.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0045_remove_evacuationdetail_broilerflockrequestid_and_more.cpython-39.pyc b/app/migrations/__pycache__/0045_remove_evacuationdetail_broilerflockrequestid_and_more.cpython-39.pyc index 790ab8f..94e82f5 100644 Binary files a/app/migrations/__pycache__/0045_remove_evacuationdetail_broilerflockrequestid_and_more.cpython-39.pyc and b/app/migrations/__pycache__/0045_remove_evacuationdetail_broilerflockrequestid_and_more.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/0046_rasadyarappinfo.cpython-39.pyc b/app/migrations/__pycache__/0046_rasadyarappinfo.cpython-39.pyc index 4d24685..959ffb1 100644 Binary files a/app/migrations/__pycache__/0046_rasadyarappinfo.cpython-39.pyc and b/app/migrations/__pycache__/0046_rasadyarappinfo.cpython-39.pyc differ diff --git a/app/migrations/__pycache__/__init__.cpython-39.pyc b/app/migrations/__pycache__/__init__.cpython-39.pyc index ca5bdc6..0f40f12 100644 Binary files a/app/migrations/__pycache__/__init__.cpython-39.pyc and b/app/migrations/__pycache__/__init__.cpython-39.pyc differ diff --git a/app/urls.py b/app/urls.py index 137bbd6..abd0ebf 100644 --- a/app/urls.py +++ b/app/urls.py @@ -2,7 +2,8 @@ from django.urls import include, path from rest_framework.routers import DefaultRouter from app import views as app_views from app.excel_processing import transporting_detail_excel, total_killhouse_excel, hatching_excel, all_hatching_excel, \ - all_send_different_bar_excel, transport_carcass_detail_excel, guilds_transport_carcass_detail_excel + all_send_different_bar_excel, transport_carcass_detail_excel, guilds_transport_carcass_detail_excel, \ + all_products_transport_excel from app.helper import get_bar_info, test_city, api_get_hatching_permit_code from app.scripts import update_poultry_city_province from app.views import get_transport_to_kill, add_kill_house, update_hatching, get_breeds, dashboard_total_kill_house, \ @@ -234,6 +235,7 @@ urlpatterns = [ path('get-all-products-transport-dashboard-by-code/', get_all_products_transport_dashboard_by_code), path('get-all-products-transport-products-by-code/', get_all_products_transport_products_by_code), path('get-all-products-transport-provinces-by-code/', get_all_products_transport_provinces_by_code), + path('all_products_transport_excel/', all_products_transport_excel), ] diff --git a/authentication/__pycache__/__init__.cpython-39.pyc b/authentication/__pycache__/__init__.cpython-39.pyc index ccc34e1..2eb3c6b 100644 Binary files a/authentication/__pycache__/__init__.cpython-39.pyc and b/authentication/__pycache__/__init__.cpython-39.pyc differ diff --git a/authentication/__pycache__/admin.cpython-39.pyc b/authentication/__pycache__/admin.cpython-39.pyc index 8f0af95..0434e32 100644 Binary files a/authentication/__pycache__/admin.cpython-39.pyc and b/authentication/__pycache__/admin.cpython-39.pyc differ diff --git a/authentication/__pycache__/apps.cpython-39.pyc b/authentication/__pycache__/apps.cpython-39.pyc index 03c1b08..b19ad11 100644 Binary files a/authentication/__pycache__/apps.cpython-39.pyc and b/authentication/__pycache__/apps.cpython-39.pyc differ diff --git a/authentication/__pycache__/models.cpython-39.pyc b/authentication/__pycache__/models.cpython-39.pyc index 21670e0..b4dd9ab 100644 Binary files a/authentication/__pycache__/models.cpython-39.pyc and b/authentication/__pycache__/models.cpython-39.pyc differ diff --git a/authentication/__pycache__/serializers.cpython-39.pyc b/authentication/__pycache__/serializers.cpython-39.pyc index 1502365..7483bad 100644 Binary files a/authentication/__pycache__/serializers.cpython-39.pyc and b/authentication/__pycache__/serializers.cpython-39.pyc differ diff --git a/authentication/__pycache__/urls.cpython-39.pyc b/authentication/__pycache__/urls.cpython-39.pyc index 4443b9e..f08aa32 100644 Binary files a/authentication/__pycache__/urls.cpython-39.pyc and b/authentication/__pycache__/urls.cpython-39.pyc differ diff --git a/authentication/__pycache__/views.cpython-39.pyc b/authentication/__pycache__/views.cpython-39.pyc index 2a92cd0..6b2bfed 100644 Binary files a/authentication/__pycache__/views.cpython-39.pyc and b/authentication/__pycache__/views.cpython-39.pyc differ diff --git a/authentication/migrations/__pycache__/0001_initial.cpython-39.pyc b/authentication/migrations/__pycache__/0001_initial.cpython-39.pyc index eee51c0..ab417b3 100644 Binary files a/authentication/migrations/__pycache__/0001_initial.cpython-39.pyc and b/authentication/migrations/__pycache__/0001_initial.cpython-39.pyc differ diff --git a/authentication/migrations/__pycache__/0002_city_lat_city_lng_province_lat_province_lng.cpython-39.pyc b/authentication/migrations/__pycache__/0002_city_lat_city_lng_province_lat_province_lng.cpython-39.pyc index 8789660..1ba5a03 100644 Binary files a/authentication/migrations/__pycache__/0002_city_lat_city_lng_province_lat_province_lng.cpython-39.pyc and b/authentication/migrations/__pycache__/0002_city_lat_city_lng_province_lat_province_lng.cpython-39.pyc differ diff --git a/authentication/migrations/__pycache__/0003_auto_20250809_1248.cpython-39.pyc b/authentication/migrations/__pycache__/0003_auto_20250809_1248.cpython-39.pyc index bafefbd..4d64063 100644 Binary files a/authentication/migrations/__pycache__/0003_auto_20250809_1248.cpython-39.pyc and b/authentication/migrations/__pycache__/0003_auto_20250809_1248.cpython-39.pyc differ diff --git a/authentication/migrations/__pycache__/0004_province_tel_prefix.cpython-39.pyc b/authentication/migrations/__pycache__/0004_province_tel_prefix.cpython-39.pyc index 2ee2cc6..d7a93f2 100644 Binary files a/authentication/migrations/__pycache__/0004_province_tel_prefix.cpython-39.pyc and b/authentication/migrations/__pycache__/0004_province_tel_prefix.cpython-39.pyc differ diff --git a/authentication/migrations/__pycache__/__init__.cpython-39.pyc b/authentication/migrations/__pycache__/__init__.cpython-39.pyc index d092132..ee1aabe 100644 Binary files a/authentication/migrations/__pycache__/__init__.cpython-39.pyc and b/authentication/migrations/__pycache__/__init__.cpython-39.pyc differ