haikal/inventory/urls.py
2024-12-31 15:40:09 +00:00

161 lines
10 KiB
Python

from django.urls import path
from . import views
from allauth.account import views as allauth_views
from django.conf.urls import (
handler400, handler403, handler404, handler500
)
urlpatterns = [
# main URLs
path('', views.HomeView.as_view(), name='landing_page'),
path('welcome/', views.WelcomeView.as_view(), name='welcome'),
# Accounts URLs
path('login/', views.Login.as_view(), name='account_login'),
path('logout/', allauth_views.LogoutView.as_view(template_name='account/logout.html'), name='account_logout'),
# path('signup/', allauth_views.SignupView.as_view(template_name='account/signup.html'), name='account_signup'),
path('signup/', views.dealer_signup, name='account_signup'),
path('password/change/',
allauth_views.PasswordChangeView.as_view(template_name='account/password_change.html'),
name='account_change_password'),
path('password/reset/',
allauth_views.PasswordResetView.as_view(template_name='account/password_reset.html'),
name='account_reset_password'),
path('password/reset/done/',
allauth_views.PasswordResetDoneView.as_view(template_name='account/password_reset_done.html'),
name='account_password_reset_done'),
path('login/code/', allauth_views.RequestLoginCodeView.as_view(template_name='account/request_login_code.html')),
#Dashboards
path('dashboards/accounting/', views.AccountingDashboard.as_view(), name='accounting'),
# Dealer URLs
path('dealers/<int:pk>/', views.DealerDetailView.as_view(), name='dealer_detail'),
path('dealers/<int:pk>/update/', views.DealerUpdateView.as_view(), name='dealer_update'),
path('dealers/activity/', views.UserActivityLogListView.as_view(), name='dealer_activity'),
# path('dealers/<int:pk>/delete/', views.DealerDeleteView.as_view(), name='dealer_delete'),
# Customer URLs
path('customers/', views.CustomerListView.as_view(), name='customer_list'),
path('customers/<int:pk>/', views.CustomerDetailView.as_view(), name='customer_detail'),
path('customers/create/', views.CustomerCreateView.as_view(), name='customer_create'),
path('customers/<int:pk>/update/', views.CustomerUpdateView.as_view(), name='customer_update'),
path('customers/<int:pk>/delete/', views.delete_customer, name='customer_delete'),
# Vendor URLs
path('vendors', views.VendorListView.as_view(), name='vendor_list'),
path('vendors/<int:pk>/', views.VendorDetailView.as_view(), name='vendor_detail'),
path('vendors/create/', views.VendorCreateView.as_view(), name='vendor_create'),
path('vendors/<int:pk>/update/', views.VendorUpdateView.as_view(), name='vendor_update'),
path('vendors/<int:pk>/delete/', views.VendorDetailView.as_view(), name='vendor_delete'),
# Car URLs
path('cars/inventory/',
views.CarInventory.as_view(),
name='car_inventory_all'),
path('cars/inventory/<int:make_id>/<int:model_id>/<int:trim_id>/',
views.CarInventory.as_view(),
name='car_inventory'),
path('cars/inventory/stats', views.inventory_stats_view, name='inventory_stats'),
path('cars/<int:pk>/', views.CarDetailView.as_view(), name='car_detail'),
path('cars/<int:pk>/update/', views.CarUpdateView.as_view(), name='car_update'),
path('cars/<int:pk>/delete/', views.CarDeleteView.as_view(), name='car_delete'),
path('cars/<int:car_pk>/finance/create/', views.CarFinanceCreateView.as_view(), name='car_finance_create'),
path('cars/finance/<int:pk>/update/', views.CarFinanceUpdateView.as_view(), name='car_finance_update'),
path('cars/add/', views.CarCreateView.as_view(), name='car_add'),
path('ajax/', views.AjaxHandlerView.as_view(), name='ajax_handler'),
path('cars/<int:car_pk>/add-color/', views.CarColorCreate.as_view(), name='add_color'),
path('car/<int:car_pk>/location/add/', views.CarLocationCreateView.as_view(), name='add_car_location'),
path('car/<int:pk>/location/update/', views.CarLocationUpdateView.as_view(), name='transfer'),
# path('cars/<int:car_pk>/colors/<int:pk>/update/',views.CarColorUpdateView.as_view(),name='color_update'),
path('cars/reserve/<int:car_id>/', views.reserve_car_view, name='reserve_car'),
path('reservations/<int:reservation_id>/', views.manage_reservation, name='reservations'),
path('cars/<int:car_pk>/add-custom-card/', views.CustomCardCreateView.as_view(), name='add_custom_card'),
# Sales URLs quotation_create
path('sales/quotations/create/', views.QuotationCreateView.as_view(), name='quotation_create'),
path('sales/quotations/<int:pk>/', views.QuotationDetailView.as_view(), name='quotation_detail'),
path('sales/quotations/', views.QuotationListView.as_view(), name='quotation_list'),
path('sales/quotations/<int:pk>/confirm/', views.confirm_quotation, name='confirm_quotation'),
path('sales/orders/detail/<int:order_id>/', views.SalesOrderDetailView.as_view(), name='order_detail'),
path('quotation/<int:quotation_id>/pdf/', views.download_quotation_pdf, name='quotation_pdf'),
path('generate_invoice/<int:pk>/', views.generate_invoice, name='generate_invoice'),
path('sales/quotations/<int:pk>/mark_quotation/', views.mark_quotation, name='mark_quotation'),
path('sales/quotations/<int:pk>/post_quotation/', views.post_quotation, name='post_quotation'),
path('sales/quotations/<int:pk>/invoice_detail/', views.invoice_detail, name='invoice_detail'),
#Payment URLs
# path('sales/quotations/<int:pk>/payment/', views.PaymentCreateView.as_view(), name='payment_create'),
path('sales/quotations/<int:pk>/payment/', views.payment_create, name='payment_create'),
# Users URLs
path('user/create/', views.UserCreateView.as_view(), name='user_create'),
path('user/<int:pk>/update/', views.UserUpdateView.as_view(), name='user_update'),
path('user/<int:pk>/', views.UserDetailView.as_view(), name='user_detail'),
path('user/', views.UserListView.as_view(), name='user_list'),
path('user/<int:pk>/confirm/', views.UserDeleteview, name='user_delete'),
# Organization URLs
path('organizations/', views.OrganizationListView.as_view(), name='organization_list'),
path('organizations/<int:pk>/', views.OrganizationDetailView.as_view(), name='organization_detail'),
path('organizations/create/', views.OrganizationCreateView.as_view(), name='organization_create'),
path('organizations/<int:pk>/update/', views.OrganizationUpdateView.as_view(), name='organization_update'),
path('organizations/<int:pk>/delete/', views.OrganizationDeleteView.as_view(), name='organization_delete'),
# Representative URLs
path('representatives/', views.RepresentativeListView.as_view(), name='representative_list'),
path('representatives/<int:pk>/', views.RepresentativeDetailView.as_view(), name='representative_detail'),
path('representatives/create/', views.RepresentativeCreateView.as_view(), name='representative_create'),
path('representatives/<int:pk>/update/', views.RepresentativeUpdateView.as_view(), name='representative_update'),
path('representatives/<int:pk>/delete/', views.RepresentativeDeleteView.as_view(), name='representative_delete'),
#Ledger URLS
#Bank Account
path('bank_accounts/', views.BankAccountListView.as_view(), name='bank_account_list'),
path('bank_accounts/<uuid:pk>/', views.BankAccountDetailView.as_view(), name='bank_account_detail'),
path('bank_accounts/create/', views.BankAccountCreateView.as_view(), name='bank_account_create'),
path('bank_accounts/<uuid:pk>/update/', views.BankAccountUpdateView.as_view(), name='bank_account_update'),
path('bank_accounts/<uuid:pk>/delete/', views.bank_account_delete, name='bank_account_delete'),
# Account
path('coa_accounts/', views.AccountListView.as_view(), name='account_list'),
path('coa_accounts/<uuid:pk>/', views.AccountDetailView.as_view(), name='account_detail'),
path('coa_accounts/create/', views.AccountCreateView.as_view(), name='account_create'),
path('coa_accounts/<uuid:pk>/update/', views.AccountUpdateView.as_view(), name='account_update'),
path('coa_accounts/<uuid:pk>/delete/', views.account_delete, name='account_delete'),
# Estimate
path('sales/estimates/', views.EstimateListView.as_view(), name='estimate_list'),
path('sales/estimates/<uuid:pk>/', views.EstimateDetailView.as_view(), name='estimate_detail'),
path('sales/estimates/create/', views.create_estimate, name='estimate_create'),
path('sales/estimates/<uuid:pk>/estimate_mark_as/', views.estimate_mark_as, name='estimate_mark_as'),
path('sales/estimates/<uuid:pk>/preview/', views.EstimatePreviewView.as_view(), name='estimate_preview'),
path('send_email/<uuid:pk>/', views.send_email_view, name='send_email'),
# Invoice
path('sales/invoices/', views.InvoiceListView.as_view(), name='invoice_list'),
path('sales/invoices/<uuid:pk>/create/', views.invoice_create, name='invoice_create'),
path('sales/invoices/<uuid:pk>/', views.InvoiceDetailView.as_view(), name='invoice_detail'),
path('sales/invoices/<uuid:pk>/preview/', views.InvoicePreviewView.as_view(), name='invoice_preview'),
path('sales/invoices/<uuid:pk>/invoice_mark_as/', views.invoice_mark_as, name='invoice_mark_as'),
# path('sales/estimates/<uuid:pk>/preview/', views.EstimatePreviewView.as_view(), name='estimate_preview'),
# path('send_email/<uuid:pk>', views.send_email, name='send_email'),
#Payment
path('sales/payments/', views.PaymentListView, name='payment_list'),
path('sales/payments/<uuid:pk>/create/', views.PaymentCreateView, name='payment_create'),
path('sales/payments/create/', views.PaymentCreateView, name='payment_create'),
path('sales/payments/<uuid:pk>/payment_details/', views.PaymentDetailView, name='payment_details'),
# path('sales/payments/<uuid:pk>/update/', views.JournalEntryUpdateView.as_view(), name='payment_update'),
# path('sales/payments/<uuid:pk>/delete/', views.JournalEntryDeleteView.as_view(), name='payment_delete'),
# path('sales/payments/<uuid:pk>/preview/', views.JournalEntryPreviewView.as_view(), name='payment_preview'),
# # Journal
# path('sales/journal/<uuid:pk>/create/', views.JournalEntryCreateView.as_view(), name='journal_create'),
]
handler404 = 'inventory.views.custom_page_not_found_view'
handler500 = 'inventory.views.custom_error_view'
handler403 = 'inventory.views.custom_permission_denied_view'
handler400 = 'inventory.views.custom_bad_request_view'