From a0cc1f021c4f3a86d73d916d9a7ed839a3c61c29 Mon Sep 17 00:00:00 2001 From: 7nimor <7nimor@gmail.com> Date: Tue, 10 Feb 2026 16:35:21 +0330 Subject: [PATCH] update excel --- authentication/register.py | 22 ++++++++++++++++++++++ cron_gid.py | 3 ++- panel/urls.py | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/authentication/register.py b/authentication/register.py index e1a1dc3..3ac2e5a 100644 --- a/authentication/register.py +++ b/authentication/register.py @@ -4486,3 +4486,25 @@ def canceled_out_province_request_manual(request): req = send_sms_request( f"http://webservice.sahandsms.com/newsmswebservice.asmx/SendPostUrl?username={USERNAME_SMS_FINANCIAL}&password={PASSWORD_SMS_FINANCIAL}&from=30002501&to={UNION_NUMBER}&message={message}") return HttpResponse('ok') + + +@api_view(["GET"]) +@csrf_exempt +@permission_classes([AllowAny]) +def archive_unknown_hatching(request): + hatchings = PoultryHatching.objects.filter(trash=False, unknown=True,left_over__lt=F('quantity') * 0.1) + for hatching in hatchings: + hatching.archive=True + hatching.state='complete' + hatching.allow_hatching='True' + hatching.save() + return Response("done!") + + +def archive_unknown_hatching_cron(): + hatchings = PoultryHatching.objects.filter(trash=False, unknown=True,left_over__lt=F('quantity') * 0.1) + for hatching in hatchings: + hatching.archive=True + hatching.state='complete' + hatching.allow_hatching='True' + hatching.save() \ No newline at end of file diff --git a/cron_gid.py b/cron_gid.py index 1bb08dc..55d8699 100644 --- a/cron_gid.py +++ b/cron_gid.py @@ -6,7 +6,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "HaChickenStore.settings") django.setup() from panel.ReportingPanel.views import cron_find_gid_code, get_gid_out_province_cron_job, hatching_unknown_cron from panel.KillHouse.helpers import create_kill_house_free_bar_cron -from authentication.register import add_to_warehouse, fix_duplicate_order_code_cron +from authentication.register import add_to_warehouse, fix_duplicate_order_code_cron, archive_unknown_hatching_cron from bot_eata import daily_report_for_each_vet_farm_cron from panel.excel_processing import test_all_excel_functions_cron @@ -18,3 +18,4 @@ fix_duplicate_order_code_cron() daily_report_for_each_vet_farm_cron() test_all_excel_functions_cron() hatching_unknown_cron() +archive_unknown_hatching_cron() diff --git a/panel/urls.py b/panel/urls.py index 0564232..bf3eef3 100644 --- a/panel/urls.py +++ b/panel/urls.py @@ -1,5 +1,5 @@ from authentication.register import add_zero_for_user_mobile, accept_bar_difference_request_pending_manual, \ - canceled_out_province_request_manual + canceled_out_province_request_manual, archive_unknown_hatching from authentication.sms_management import send_daily_slaughter_statistics_sms_manual, \ send_daily_distribution_report_sms_manual, send_kill_house_debt_report_pdf_sms_manual from pdf.views import kill_request_pdf, management_all_poultry_and_warehouse_pdf, summary_report_pdf, \ @@ -1405,6 +1405,7 @@ urlpatterns = [ path('delete_steward_allocation_manual/', delete_steward_allocation_manual), path('delete_sale_bar_manual/', delete_sale_bar_manual), path('send_credit_sahandsms_sms_manual/', send_credit_sahandsms_sms_manual), + path('archive_unknown_hatching/', archive_unknown_hatching),