mirror of
https://github.com/bcomsugi/dasaproject.git
synced 2026-01-12 00:32:37 +07:00
messages fixed
This commit is contained in:
parent
67ab69750d
commit
abc64aa7a0
@ -4,18 +4,7 @@
|
|||||||
{% block title %}Invoice{% endblock title %}
|
{% block title %}Invoice{% endblock title %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% comment %} {% if messages %}
|
|
||||||
<div class="alert alert-success" role="alert">
|
|
||||||
{{message}}
|
|
||||||
</div>
|
|
||||||
{% endif %} {% endcomment %}
|
|
||||||
{% if messages %}
|
|
||||||
<ul class="messages">
|
|
||||||
{% for message in messages %}
|
|
||||||
<li{% if message.tags %} class="alert alert-{{ message.tags }}"{% endif %}>{{ message }}</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<form action="" method="POST" class="card border-info-subtle p-3 mt-2" autocomplete="off" id="form">
|
<form action="" method="POST" class="card border-info-subtle p-3 mt-2" autocomplete="off" id="form">
|
||||||
@ -23,7 +12,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
</div>
|
</div>
|
||||||
<!-- <input name="customer_fullname" type='text' list='itemname' onchange='changeitem(event)' value='{{customer_name}}' class='textinput form-control'> -->
|
<!-- <input name="customer_fullname" type='text' list='itemname' onchange='changeitem(event)' value='{{customer_name}}' class='textinput form-control'> -->
|
||||||
<input name="customerreffullname" type='text' list='itemname' value='{{customer_name}}' id='id_CustomerRefFullName' class='textinput form-control' autofocus>
|
<input name="customerreffullname" type='text' list='itemname' value='{{customer_name}}' id='id_CustomerRefFullName' class='textinput form-control' placeholder="Choose Customer" autofocus>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary mt-2 me-2 ms-2" id="id_btnsave" onclick="checksubmit(event)">Save</button>
|
<button type="submit" class="btn btn-primary mt-2 me-2 ms-2" id="id_btnsave" onclick="checksubmit(event)">Save</button>
|
||||||
<!-- <button type="submit" class="btn btn-primary mt-2 me-2 ms-2" id="id_btnsave" >Save</button> -->
|
<!-- <button type="submit" class="btn btn-primary mt-2 me-2 ms-2" id="id_btnsave" >Save</button> -->
|
||||||
|
|||||||
@ -5,11 +5,13 @@
|
|||||||
<form method="POST" action="{% url 'Invoice:save_inv' %}" class="modal-content">
|
<form method="POST" action="{% url 'Invoice:save_inv' %}" class="modal-content">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h1>Choose Items</h1>
|
<!-- <h1>Choose Items</h1> -->
|
||||||
|
<h2>{{ customer_fullname }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="mb-3 mt-3">
|
<div class="mb-3 mt-3">
|
||||||
<input type="hidden" name="customer_fullname" value="{{ customer_fullname }}">
|
<input type="hidden" name="customer_fullname" value="{{ customer_fullname }}">
|
||||||
|
|
||||||
<!-- <input name="customerreffullname" type='text' list='itemname' value='{{customer_name}}' id='id_CustomerRefFullName' class='textinput form-control' autofocus> -->
|
<!-- <input name="customerreffullname" type='text' list='itemname' value='{{customer_name}}' id='id_CustomerRefFullName' class='textinput form-control' autofocus> -->
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<form method="POST" action="{% url 'Invoice:choose_inv' %}" class="modal-content">
|
<form method="POST" action="{% url 'Invoice:choose_inv' %}" class="modal-content">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h1>Choose SO</h1>
|
<h2>Select SO Customer: {{ customer_fullname }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="mb-3 mt-3">
|
<div class="mb-3 mt-3">
|
||||||
|
|||||||
@ -59,7 +59,7 @@ def show_customer(request):
|
|||||||
if request.method =="POST":
|
if request.method =="POST":
|
||||||
customer_name = request.POST.get("customerreffullname")
|
customer_name = request.POST.get("customerreffullname")
|
||||||
print(f'customer_name: {customer_name}')
|
print(f'customer_name: {customer_name}')
|
||||||
context['objects'] = [['abc', 'def', 'ghi', 'jkl']]
|
# context['objects'] = [['abc', 'def', 'ghi', 'jkl']]
|
||||||
context['objects'] = []
|
context['objects'] = []
|
||||||
|
|
||||||
if customer_name:
|
if customer_name:
|
||||||
@ -73,8 +73,11 @@ def show_customer(request):
|
|||||||
open_sales_orders = ini.get_open_so()
|
open_sales_orders = ini.get_open_so()
|
||||||
print(f'open sales orders:{open_sales_orders}')
|
print(f'open sales orders:{open_sales_orders}')
|
||||||
ini=None
|
ini=None
|
||||||
if open_sales_orders:
|
if not open_sales_orders:
|
||||||
context['objects'] = open_sales_orders
|
messages.info(request, f"There is No open SO for {customer_name}")
|
||||||
|
return redirect("Invoice:show_customer")
|
||||||
|
# if open_sales_orders:
|
||||||
|
context['objects'] = open_sales_orders
|
||||||
|
|
||||||
|
|
||||||
context['customer_fullname'] = customer_name
|
context['customer_fullname'] = customer_name
|
||||||
@ -331,9 +334,11 @@ def save_inv(request):
|
|||||||
print(result)
|
print(result)
|
||||||
if result and ini.status_ok(result):
|
if result and ini.status_ok(result):
|
||||||
pass
|
pass
|
||||||
|
# context['messages']=[{"alert":"info", "message": "invoice Is Good"}]
|
||||||
messages.success(request, 'Invoice Has Been SAVED')
|
messages.success(request, f"Invoice No: Has Been SAVED with link SO No. : {unique(df['RefNumber'].to_list())}")
|
||||||
|
# messages.info(request, 'Invoice Has Been SAVED2')
|
||||||
return redirect('Invoice:show_customer')
|
return redirect('Invoice:show_customer')
|
||||||
|
return render(request, "Invoice/show-customers.html", context)
|
||||||
return render(request, "Invoice/so_details_form.html", context)
|
return render(request, "Invoice/so_details_form.html", context)
|
||||||
else:
|
else:
|
||||||
return HttpResponse(f"You cannot Save, because There Is No Open Sales Order for Customer: {customer_fullname}")
|
return HttpResponse(f"You cannot Save, because There Is No Open Sales Order for Customer: {customer_fullname}")
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
|
||||||
<link href= {% static 'bootstrap.min.css' %} rel="stylesheet" crossorigin="anonymous">
|
<!-- <link href= {% static 'bootstrap.min.css' %} rel="stylesheet" crossorigin="anonymous">
|
||||||
<script src= {% static 'bootstrap.bundle.min.js' %} ></script>
|
<script src= {% static 'bootstrap.bundle.min.js' %} ></script> -->
|
||||||
<script src="https://unpkg.com/htmx.org@1.9.6"></script>
|
<script src="https://unpkg.com/htmx.org@1.9.6"></script>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
@ -47,9 +47,9 @@
|
|||||||
{% block head %}{% endblock %}
|
{% block head %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar navbar-expand-lg bg-light">
|
<nav class="navbar navbar-expand-lg border-bottom bg-body-tertiary" data-bs-theme='light' >
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="#">DBW</a>
|
<a class="navbar-brand" href="{% url 'Invoice:show_customer' %}">DBW</a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
@ -78,24 +78,26 @@
|
|||||||
<a class="nav-link disabled">Link</a>
|
<a class="nav-link disabled">Link</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div>{% block search_nav %}{% endblock search_nav %}
|
<div>{% block search_nav %}<form class="d-flex" role="search">
|
||||||
|
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
|
||||||
|
<button class="btn btn-outline-success" type="submit">Search</button>
|
||||||
|
</form>
|
||||||
|
{% endblock search_nav %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
|
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
|
||||||
{{ message | safe }}
|
<strong>{{message | safe}}</strong>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div>
|
||||||
{% block body %}{% endblock body %}
|
{% block body %}{% endblock body %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user