complete first version of main proccess

This commit is contained in:
aminhashemi92 2025-08-27 07:11:26 +03:30
parent 6ff4740d04
commit f2fc2362a7
61 changed files with 3280 additions and 28 deletions

View file

@ -106,6 +106,7 @@ def lookup_representative_by_national_code(request):
'phone_number_2': profile.phone_number_2,
'card_number': profile.card_number,
'account_number': profile.account_number,
'bank_name': profile.bank_name,
'address': profile.address,
}
}
@ -135,6 +136,7 @@ def create_request_with_entities(request):
representative_phone_number_2 = request.POST.get('phone_number_2') or request.POST.get('representative_phone_number_2')
representative_card_number = request.POST.get('card_number') or request.POST.get('representative_card_number')
representative_account_number = request.POST.get('account_number') or request.POST.get('representative_account_number')
representative_bank_name = request.POST.get('bank_name') or request.POST.get('representative_bank_name')
representative_address = request.POST.get('address') or request.POST.get('representative_address')
if not process_id:
@ -174,6 +176,8 @@ def create_request_with_entities(request):
representative_profile.card_number = representative_card_number
if representative_account_number is not None:
representative_profile.account_number = representative_account_number
if representative_bank_name is not None:
representative_profile.bank_name = representative_bank_name
if representative_address is not None:
representative_profile.address = representative_address
representative_profile.save()
@ -191,6 +195,7 @@ def create_request_with_entities(request):
'address': representative_address or '',
'card_number': representative_card_number or '',
'account_number': representative_account_number or '',
'bank_name': representative_bank_name or '',
}
customer_form = CustomerForm(customer_data, instance=profile_instance)
customer_form.request = request
@ -365,6 +370,18 @@ def step_detail(request, instance_id, step_id):
return redirect('invoices:quote_preview_step', instance_id=instance.id, step_id=step.id)
elif step.order == 3: # مرحله سوم - ثبت فیش‌های واریزی
return redirect('invoices:quote_payment_step', instance_id=instance.id, step_id=step.id)
elif step.order == 4: # مرحله چهارم - قرارداد
return redirect('contracts:contract_step', instance_id=instance.id, step_id=step.id)
elif step.order == 5: # مرحله پنجم - انتخاب نصاب
return redirect('installations:installation_assign_step', instance_id=instance.id, step_id=step.id)
elif step.order == 6: # مرحله ششم - گزارش نصب
return redirect('installations:installation_report_step', instance_id=instance.id, step_id=step.id)
elif step.order == 7: # مرحله هفتم - فاکتور نهایی
return redirect('invoices:final_invoice_step', instance_id=instance.id, step_id=step.id)
elif step.order == 8: # مرحله هشتم - تسویه حساب نهایی
return redirect('invoices:final_settlement_step', instance_id=instance.id, step_id=step.id)
elif step.order == 9: # مرحله نهم - گواهی نهایی
return redirect('certificates:certificate_step', instance_id=instance.id, step_id=step.id)
# برای سایر مراحل، template عمومی نمایش داده می‌شود
step_instance = instance.step_instances.filter(step=step).first()