PreorderBilling WIP & Api changed
This commit is contained in:
@@ -512,6 +512,14 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(".datepicker").datepicker({
|
||||
//orientation: "bottom",
|
||||
language: 'de',
|
||||
format: "dd.mm.yyyy",
|
||||
showWeekDays: true,
|
||||
todayBtn: 'linked',
|
||||
autoclose: true
|
||||
});
|
||||
$("#filter_type").select2({closeOnSelect: false});
|
||||
$("#filter_status").select2({closeOnSelect: false});
|
||||
$("#filter_partner_id").select2({closeOnSelect: false});
|
||||
@@ -1195,6 +1203,62 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
'json');
|
||||
}
|
||||
|
||||
function toggleActivationdateControl(pid) {
|
||||
// set select to current status id
|
||||
//$("#preorder-detail-activationdate-" + pid + "-input select").val($("#preorder-detail-activationdate-" + pid + "-text").data("activationdate"));
|
||||
|
||||
// toggle controls
|
||||
$("#preorder-detail-activationdate-" + pid + "-text").toggle();
|
||||
$("#preorder-detail-activationdate-" + pid + "-input").toggle();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function savePreorderActivationdateControl(pid) {
|
||||
if(!Number.isInteger(pid) || pid < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var value = $("#preorder-detail-activationdate-" + pid + "-input input").val();
|
||||
|
||||
//console.log("add opacity-5 to ")
|
||||
$("#preorder-" + pid + "-body").addClass("opacity-5");
|
||||
$("#preorder-" + pid + "-body .loader-big").show();
|
||||
|
||||
// reset loading overlay if request times out
|
||||
setTimeout(() => {
|
||||
$("#preorder-" + pid + "-body").removeClass("opacity-5");
|
||||
$("#preorder-" + pid + "-body .loader-big").hide();
|
||||
}, 5000);
|
||||
|
||||
$.post("<?=self::getUrl("Preorder","Api")?>",
|
||||
{
|
||||
'do': "saveActivationdate",
|
||||
id: pid,
|
||||
activation_date: value
|
||||
},
|
||||
function(success) {
|
||||
if(success.status == "OK") {
|
||||
console.log(success);
|
||||
var new_activationdate = success.result.activation_date;
|
||||
var pid = success.result.preorder_id;
|
||||
//console.log(updates);
|
||||
$("#preorder-detail-activationdate-" + pid + "-textpart").text(new_activationdate);
|
||||
$("#preorder-detail-activationdate-" + pid + "-input").val(new_activationdate);
|
||||
|
||||
$("#preorder-detail-activationdate-" + pid + "-text").addClass("text-success");
|
||||
setTimeout(() => { $("#preorder-detail-activationdate-" + pid + "-text").removeClass("text-success") }, 1500);
|
||||
|
||||
toggleActivationdateControl(pid);
|
||||
|
||||
}
|
||||
|
||||
$("#preorder-" + pid + "-body").removeClass("opacity-5");
|
||||
$("#preorder-" + pid + "-body .loader-big").hide();
|
||||
},
|
||||
'json');
|
||||
}
|
||||
|
||||
function createWorkorder(pid) {
|
||||
if(!Number.isInteger(pid) || pid < 1) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user