304 lines
11 KiB
HTML
304 lines
11 KiB
HTML
{% extends "./base.html" %}
|
|
{% load custom_tags %}
|
|
|
|
{% if perms.admin_panel.ViewReportMali %}
|
|
{% block bodyPage %}
|
|
<div class="">
|
|
<div class="columns m-0">
|
|
<div class="column is-12">
|
|
<div class="buttons">
|
|
|
|
</div>
|
|
|
|
<p class="has-text-centered">
|
|
{% if page_name == 'sarresidShodeha' %}
|
|
<p class="toCurrency has-text-centered">
|
|
سررسید شده ها
|
|
{{ sum_sarresid }}
|
|
</p>
|
|
{% endif %}
|
|
{% if page_name == 'sarresidNaShodeha' %}
|
|
<p class="toCurrency has-text-centered">
|
|
سررسید نشده ها
|
|
{{ sarresidNashode }}
|
|
</p>
|
|
{% endif %}
|
|
{% if page_name == 'checkPass' %}
|
|
چک های پاس شده
|
|
{% endif %}
|
|
{% if page_name == 'checkPassFaild' %}
|
|
|
|
<p class="toCurrency has-text-centered">
|
|
چک های پاس نشده
|
|
{{ count_check_passfail }}
|
|
عدد | جمع مبلغ:
|
|
{{ sum_check_passfail }}
|
|
</p>
|
|
{% endif %}
|
|
|
|
<span class="toCurrency">{{ mandehesabKP }}</span>
|
|
</p>
|
|
|
|
<div class="table-container column is-12-desktop is-12-mobile m-0">
|
|
<table class="table m-auto has-text-centered table is-bordered is-striped is-narrow is-fullwidth mojodiTB ">
|
|
<thead>
|
|
<tr>
|
|
<th style="min-width: 150px;">مبلغ</th>
|
|
<th style="min-width: 150px;">نام</th>
|
|
<th style="min-width: 100px;">نوع</th>
|
|
<th style="min-width: 100px;">سررسید</th>
|
|
<th style="min-width: 100px;">ثبت</th>
|
|
<th style="min-width: 400px;">توضیحات</th>
|
|
<th style="min-width: 100;">وضعیت</th>
|
|
<th style="min-width: 100;">وصول شد</th>
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<tfoot>
|
|
<tr>
|
|
<th class="toCurrency" style="min-width: 150px;">مبلغ</th>
|
|
<th style="min-width: 150px;">نام</th>
|
|
<th style="min-width: 100px;">نوع</th>
|
|
<th style="min-width: 100px;">سررسید</th>
|
|
<th style="min-width: 100px;">ثبت</th>
|
|
<th style="min-width: 400px;">توضیحات</th>
|
|
<th style="min-width: 100;">وضعیت</th>
|
|
<th style="min-width: 100;">وصول شد</th>
|
|
|
|
</tr>
|
|
</tfoot>
|
|
<tbody id="listPrds">
|
|
|
|
{% for sarresid in all_sarresid %}
|
|
<tr class="IteamPrd">
|
|
<td>
|
|
<span class="bedehkar toCurrency">{{ sarresid.price }}</span>
|
|
<span class=" is-hidden"></span>
|
|
</td>
|
|
|
|
<td class="">
|
|
<a target="_blank" href="{% url 'admin_panel:customerNew' sarresid.customer.id %}">
|
|
{{ sarresid.customer.name_family }}
|
|
</a>
|
|
</td>
|
|
|
|
|
|
<td class="">
|
|
{% if sarresid.type == 'check' %}چک{% endif %}
|
|
{% if sarresid.type == 'nesiye' %}نسیه{% endif %}
|
|
|
|
</td>
|
|
<td class="">{{ sarresid.sarresidDT | toJalali }}</td>
|
|
<td class="">{{ sarresid.createdDT | toJalali }}</td>
|
|
<td class="desc">
|
|
{% if sarresid.desc %}
|
|
{{ sarresid.desc }}
|
|
{% endif %}
|
|
{% if sarresid.factor %}
|
|
فاکتور شماره {{ sarresid.factor.id }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="">
|
|
{% if sarresid.payStatus == "true" %}پرداخت شده{% endif %}
|
|
{% if sarresid.payStatus == "false" %}پرداخت نشده{% endif %}
|
|
</td>
|
|
|
|
<td class="">
|
|
{% if sarresid.payStatus == "false" %}
|
|
<span class="button is-danger VosolButton" csid= {{ sarresid.customer.id }} price={{ sarresid.price }} type={{ sarresid.type }} articlID={{ sarresid.id }}>وصول شد</span>
|
|
{% else %}
|
|
<span>بله</span>
|
|
{% endif %}
|
|
</td>
|
|
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
{% if all_sarresid.has_previous %}
|
|
<a href="?page={{ all_sarresid.previous_page_number }}" class="button is-danger">صفحه قبل</a>
|
|
{% endif %}
|
|
{% if all_sarresid.has_next %}
|
|
<a href="?page={{ all_sarresid.next_page_number }}" class="button is-danger">صفحه بعد</a>
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal">
|
|
<div class="modal-background"></div>
|
|
<div class="modal-card">
|
|
<header class="modal-card-head">
|
|
<p class="modal-card-title">Modal title</p>
|
|
<button class="delete" aria-label="close"></button>
|
|
</header>
|
|
<section class="modal-card-body">
|
|
<form>
|
|
<input type="text" class="is-hidden" name="articlID">
|
|
</form>
|
|
</section>
|
|
<footer class="modal-card-foot">
|
|
<button class="button is-success">Save changes</button>
|
|
<button class="button">Cancel</button>
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
|
|
<form class="modal nesiyeModal" method="post" action="{% url 'admin_panel:pardakhtNesiye' 9101010101 %}">
|
|
{% csrf_token %}
|
|
<div class="modal-background"></div>
|
|
<div class="modal-card">
|
|
<header class="modal-card-head">
|
|
<p class="modal-card-title">نسیه</p>
|
|
<button class="delete" aria-label="close"></button>
|
|
</header>
|
|
<section class="modal-card-body">
|
|
|
|
|
|
<div class="field">
|
|
<label class="label">مانده از این نسیه</label>
|
|
<div class="control">
|
|
<input id="priceBedehi" disabled class="input reset_input" type="text" placeholder="واحد تومان">
|
|
</div>
|
|
</div>
|
|
|
|
<input name="sr_articlID" id="sr_articlID" class="input reset_input is-hidden" type="text">
|
|
|
|
|
|
<div class="field">
|
|
<label class="label">مبلغ پرداختی فعلی</label>
|
|
<div class="control">
|
|
<input name="next_sarresidPrice" required class="input reset_input" type="text" placeholder="واحد تومان">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label class="label">نحوه پرداخت</label>
|
|
<div class="control">
|
|
<div class="select is-fullwidth">
|
|
<select required class="reset_input" name="nahvePardakht">
|
|
<option></option>
|
|
<option value="check">چک</option>
|
|
<option value="naghd">نقد</option>
|
|
<option value="kartbekart">کارت به کارت</option>
|
|
<option value="kartkhan">کارت خوان</option>
|
|
<option value="takhfif">تخفیف</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label class="label">سررسید بعدی</label>
|
|
<div class="control">
|
|
<input name="xxxxxaaaa" required class="input reset_input" id="NextSarResid" type="text">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label class="label">توضیحات</label>
|
|
<div class="control">
|
|
<textarea name="desc_sar" class="input"></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<input required type="text" class="is-hidden reset_input" name="next_sarresidDateTime" id="NextSarResidVal">
|
|
|
|
|
|
|
|
</section>
|
|
<footer class="modal-card-foot">
|
|
<input type="submit" class="button is-success" value="ثبت">
|
|
<span class="button cancellBTNSR">لغو</span>
|
|
</footer>
|
|
</div>
|
|
</form>
|
|
{% csrf_token %}
|
|
{% endblock %}
|
|
|
|
{% block jsEnd %}
|
|
<script>
|
|
$(document).ready(function() {
|
|
|
|
|
|
var csrftoken = jQuery("[name=csrfmiddlewaretoken]").val();
|
|
|
|
|
|
$(".modal-background").click(function(){
|
|
$(".modal").removeClass("is-active");
|
|
$('.reset_input').val('');
|
|
})
|
|
$(".cancellBTNSR").click(function(){
|
|
$(".modal").removeClass("is-active");
|
|
$('.reset_input').val('');
|
|
})
|
|
|
|
$("#NextSarResid").pDatepicker({
|
|
initialValue: false,
|
|
initialValueType: 'en',
|
|
format: 'YYYY/MM/DD',
|
|
autoClose: true,
|
|
calendar:{
|
|
persian: {
|
|
locale: 'fa'
|
|
}
|
|
},
|
|
onSelect: (unix)=>{
|
|
$("#NextSarResidVal").val(unix)
|
|
}
|
|
});
|
|
|
|
var csid = null
|
|
$(".VosolButton").click(function(){
|
|
|
|
var articlID = $(this).attr("articlID")
|
|
var type = $(this).attr("type")
|
|
var price = $(this).attr("price")
|
|
csid = $(this).attr("csid")
|
|
|
|
if(type=="check"){
|
|
if( confirm('چک وصول شده؟') ){
|
|
var prompt_desc = prompt('لطفا توضیحات را وارد کنید و تایید کنید')
|
|
var url_check = '/panel/passCheck/'+articlID;
|
|
if( prompt_desc ){
|
|
$.ajax({
|
|
url: url_check,
|
|
type: 'post',
|
|
data: {
|
|
message: prompt_desc
|
|
},
|
|
headers: {'X-CSRFToken': csrftoken },
|
|
success: function (data) {
|
|
console.log("ok ok");
|
|
window.location.reload();
|
|
|
|
}
|
|
});
|
|
}
|
|
}
|
|
} else {
|
|
var actionUrl = $(".nesiyeModal").attr('action')
|
|
//alert(actionUrl.replace("9101010101", csid ))
|
|
//$(".nesiyeModal").attr('action', actionUrl.replace("9101010101", csid ) )
|
|
$(".nesiyeModal").addClass("is-active");
|
|
$("#priceBedehi").val(price);
|
|
$("#sr_articlID").val(articlID)
|
|
}
|
|
});
|
|
|
|
$("form").submit(function(e){
|
|
var actionUrl = $(".nesiyeModal").attr('action')
|
|
$(".nesiyeModal").attr('action', actionUrl.replace("9101010101", csid ) )
|
|
|
|
});
|
|
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
{% endif %}
|