573 lines
20 KiB
Python
573 lines
20 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"
|
|
),
|
|
path("test/", views.TestView.as_view(), name="test"),
|
|
# 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'),
|
|
# CRM URLs
|
|
path("customers/", views.CustomerListView.as_view(), name="customer_list"),
|
|
path(
|
|
"customers/<uuid:pk>/",
|
|
views.CustomerDetailView.as_view(),
|
|
name="customer_detail",
|
|
),
|
|
path(
|
|
"customers/create/", views.CustomerCreateView, name="customer_create"
|
|
),
|
|
path(
|
|
"customers/<str:pk>/update/",
|
|
views.CustomerUpdateView,
|
|
name="customer_update",
|
|
),
|
|
path("customers/<str:pk>/delete/", views.delete_customer, name="customer_delete"),
|
|
path(
|
|
"customers/<str:customer_id>/opportunities/create/",
|
|
views.OpportunityCreateView.as_view(),
|
|
name="create_opportunity",
|
|
),
|
|
path(
|
|
"customers/<str:pk>/add-note/",
|
|
views.add_note_to_customer,
|
|
name="add_note_to_customer",
|
|
),
|
|
path("crm/leads/", views.LeadListView.as_view(), name="lead_list"),
|
|
path(
|
|
"crm/leads/<int:pk>/view/", views.LeadDetailView.as_view(), name="lead_detail"
|
|
),
|
|
path("crm/leads/create/", views.LeadCreateView.as_view(), name="lead_create"),
|
|
path(
|
|
"crm/leads/<int:pk>/update/", views.LeadUpdateView.as_view(), name="lead_update"
|
|
),
|
|
path(
|
|
"crm/leads/<int:pk>/delete/", views.LeadDeleteView.as_view(), name="lead_delete"
|
|
),
|
|
path("crm/leads/<int:pk>/add-note/", views.add_note_to_lead, name="add_note"),
|
|
path(
|
|
"crm/leads/<int:pk>/add-activity/",
|
|
views.add_activity_to_lead,
|
|
name="add_activity",
|
|
),
|
|
path(
|
|
"crm/opportunities/create/",
|
|
views.OpportunityCreateView.as_view(),
|
|
name="opportunity_create",
|
|
),
|
|
path(
|
|
"crm/opportunities/<int:pk>/",
|
|
views.OpportunityDetailView.as_view(),
|
|
name="opportunity_detail",
|
|
),
|
|
path(
|
|
"crm/opportunities/<int:pk>/edit/",
|
|
views.OpportunityUpdateView.as_view(),
|
|
name="update_opportunity",
|
|
),
|
|
path(
|
|
"crm/opportunities/",
|
|
views.OpportunityListView.as_view(),
|
|
name="opportunity_list",
|
|
),
|
|
path(
|
|
"crm/opportunities/<int:pk>/delete/",
|
|
views.delete_opportunity,
|
|
name="delete_opportunity",
|
|
),
|
|
# path('crm/opportunities/<int:pk>/logs/', views.OpportunityLogsView.as_view(), name='opportunity_logs'),
|
|
path(
|
|
"crm/notifications/",
|
|
views.NotificationListView.as_view(),
|
|
name="notifications_history",
|
|
),
|
|
path(
|
|
"crm/fetch_notifications/",
|
|
views.fetch_notifications,
|
|
name="fetch_notifications",
|
|
),
|
|
path(
|
|
"crm/notifications/<int:pk>/mark_as_read/",
|
|
views.mark_notification_as_read,
|
|
name="mark_notification_as_read",
|
|
),
|
|
# Vendor URLs
|
|
path("vendors", views.VendorListView.as_view(), name="vendor_list"),
|
|
path("vendors/<uuid:pk>/", views.VendorDetailView.as_view(), name="vendor_detail"),
|
|
path("vendors/create/", views.VendorCreateView.as_view(), name="vendor_create"),
|
|
path(
|
|
"vendors/<uuid:pk>/update/",
|
|
views.VendorUpdateView.as_view(),
|
|
name="vendor_update",
|
|
),
|
|
path(
|
|
"vendors/<uuid:pk>/delete/",
|
|
views.delete_vendor,
|
|
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/get-car-models/", views.get_car_models, name="get_car_models"),
|
|
path(
|
|
"cars/<int:car_pk>/add-color/", views.CarColorCreate.as_view(), name="add_color"
|
|
),
|
|
path(
|
|
"cars/<int:car_pk>/location/add/",
|
|
views.CarLocationCreateView.as_view(),
|
|
name="add_car_location",
|
|
),
|
|
path(
|
|
"cars/<int:pk>/location/update/",
|
|
views.CarTransferCreateView.as_view(),
|
|
name="transfer",
|
|
),
|
|
path(
|
|
"cars/<int:pk>/location/detail/",
|
|
views.CarTransferDetailView,
|
|
name="transfer_detail",
|
|
),
|
|
path(
|
|
"cars/<int:car_pk>/location/<int:transfer_pk>/transfer_approve/",
|
|
views.car_transfer_approve,
|
|
name="transfer_confirm",
|
|
),
|
|
path(
|
|
"cars/<int:car_pk>/location/<int:transfer_pk>/transfer_accept_reject/",
|
|
views.car_transfer_accept_reject,
|
|
name="transfer_accept_reject",
|
|
),
|
|
path(
|
|
"cars/<int:car_pk>/location/<int:transfer_pk>/preview/",
|
|
views.CarTransferPreviewView,
|
|
name="transfer_preview",
|
|
),
|
|
path("cars/inventory/search/", views.SearchCodeView.as_view(), name="car_search"),
|
|
# 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",
|
|
# ),
|
|
# path("subscriptions", views.SubscriptionPlans.as_view(), name="subscriptions"),
|
|
# 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/<uuid:pk>/",
|
|
views.OrganizationDetailView.as_view(),
|
|
name="organization_detail",
|
|
),
|
|
path(
|
|
"organizations/create/",
|
|
views.OrganizationCreateView,
|
|
name="organization_create",
|
|
),
|
|
path(
|
|
"organizations/<uuid:pk>/update/",
|
|
views.OrganizationUpdateView,
|
|
name="organization_update",
|
|
),
|
|
path(
|
|
"organizations/<uuid: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(
|
|
"sales/estimates/<uuid:pk>/payment_request/",
|
|
views.PaymentRequest.as_view(),
|
|
name="payment_request",
|
|
),
|
|
path(
|
|
"sales/estimates/<uuid:pk>/send_email", views.send_email_view, name="send_email"
|
|
),
|
|
path('sales/estimates/<uuid:pk>/sale_order/', views.create_sale_order, name='create_sale_order'),
|
|
path('sales/estimates/<uuid:pk>/sale_order/preview/', views.preview_sale_order, name='preview_sale_order'),
|
|
|
|
# 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/invoices/<uuid:pk>/draft_invoice_update/",
|
|
views.DraftInvoiceModelUpdateFormView.as_view(),
|
|
name="draft_invoice_update",
|
|
),
|
|
path(
|
|
"sales/invoices/<uuid:pk>/approved_invoice_update/",
|
|
views.ApprovedInvoiceModelUpdateFormView.as_view(),
|
|
name="approved_invoice_update",
|
|
),
|
|
path(
|
|
"sales/invoices/<uuid:pk>/paid_invoice_update/",
|
|
views.PaidInvoiceModelUpdateFormView.as_view(),
|
|
name="paid_invoice_update",
|
|
),
|
|
# 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>/payment_mark_as_paid/",
|
|
views.payment_mark_as_paid,
|
|
name="payment_mark_as_paid",
|
|
),
|
|
# 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'),
|
|
# Items
|
|
path(
|
|
"items/services/", views.ItemServiceListView.as_view(), name="item_service_list"
|
|
),
|
|
path(
|
|
"items/services/create/",
|
|
views.ItemServiceCreateView.as_view(),
|
|
name="item_service_create",
|
|
),
|
|
path(
|
|
"items/services/<int:pk>/update/",
|
|
views.ItemServiceUpdateView.as_view(),
|
|
name="item_service_update",
|
|
),
|
|
# Expanese
|
|
path(
|
|
"items/expeneses/",
|
|
views.ItemExpenseListView.as_view(),
|
|
name="item_expense_list",
|
|
),
|
|
path(
|
|
"items/expeneses/create/",
|
|
views.ItemExpenseCreateView.as_view(),
|
|
name="item_expense_create",
|
|
),
|
|
path(
|
|
"items/expeneses/<uuid:pk>/update/",
|
|
views.ItemExpenseUpdateView.as_view(),
|
|
name="item_expense_update",
|
|
),
|
|
# Bills
|
|
path("items/bills/", views.BillListView.as_view(), name="bill_list"),
|
|
path("items/bills/create/", views.bill_create, name="bill_create"),
|
|
path(
|
|
"items/bills/<uuid:pk>/bill_detail/",
|
|
views.BillDetailView.as_view(),
|
|
name="bill_detail",
|
|
),
|
|
path("items/bills/<uuid:pk>/delete/", views.BillDeleteView, name="bill_delete"),
|
|
path(
|
|
"items/bills/<uuid:pk>/in_review/",
|
|
views.InReviewBillView.as_view(),
|
|
name="in_review_bill",
|
|
),
|
|
path(
|
|
"items/bills/<uuid:pk>/in_approve/",
|
|
views.ApprovedBillModelView.as_view(),
|
|
name="in_approve_bill",
|
|
),
|
|
path(
|
|
"items/bills/<uuid:pk>/mark_as_approved/",
|
|
views.bill_mark_as_approved,
|
|
name="bill_mark_as_approved",
|
|
),
|
|
path(
|
|
"items/bills/<uuid:pk>/mark_as_paid/",
|
|
views.bill_mark_as_paid,
|
|
name="bill_mark_as_paid",
|
|
),
|
|
|
|
# orders
|
|
path("orders/", views.OrderListView.as_view(), name="order_list"),
|
|
|
|
# BALANCE SHEET Reports...
|
|
# Entities...
|
|
path('entity/<slug:entity_slug>/balance-sheet/',
|
|
views.BaseBalanceSheetRedirectView.as_view(),
|
|
name='entity-bs'),
|
|
path('entity/<slug:entity_slug>/balance-sheet/year/<int:year>/',
|
|
views.FiscalYearBalanceSheetViewBase.as_view(),
|
|
name='entity-bs-year'),
|
|
path('entity/<slug:entity_slug>/balance-sheet/quarter/<int:year>/<int:quarter>/',
|
|
views.QuarterlyBalanceSheetView.as_view(),
|
|
name='entity-bs-quarter'),
|
|
path('entity/<slug:entity_slug>/balance-sheet/month/<int:year>/<int:month>/',
|
|
views.MonthlyBalanceSheetView.as_view(),
|
|
name='entity-bs-month'),
|
|
path('entity/<slug:entity_slug>/balance-sheet/date/<int:year>/<int:month>/<int:day>/',
|
|
views.DateBalanceSheetView.as_view(),
|
|
name='entity-bs-date'),
|
|
# INCOME STATEMENT Reports ----
|
|
# Entity .....
|
|
path('entity/<slug:entity_slug>/income-statement/',
|
|
views.BaseIncomeStatementRedirectViewBase.as_view(),
|
|
name='entity-ic'),
|
|
path('entity/<slug:entity_slug>/income-statement/year/<int:year>/',
|
|
views.FiscalYearIncomeStatementViewBase.as_view(),
|
|
name='entity-ic-year'),
|
|
# path('entity/<slug:entity_slug>/income-statement/quarter/<int:year>/<int:quarter>/',
|
|
# views.QuarterlyIncomeStatementView.as_view(),
|
|
# name='entity-ic-quarter'),
|
|
# path('entity/<slug:entity_slug>/income-statement/month/<int:year>/<int:month>/',
|
|
# views.MonthlyIncomeStatementView.as_view(),
|
|
# name='entity-ic-month'),
|
|
# path('entity/<slug:entity_slug>/income-statement/date/<int:year>/<int:month>/<int:day>/',
|
|
# views.MonthlyIncomeStatementView.as_view(),
|
|
# name='entity-ic-date'),
|
|
]
|
|
|
|
|
|
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"
|