Merge pull request #13310 from OPEN-DSI/new-takepos-ticket-paid
NEW no confirm discard ticket if paid
This commit is contained in:
commit
7b93b39bb8
@ -120,4 +120,13 @@ elseif ($action == 'search' && $term != '') {
|
||||
$object->fetch($id);
|
||||
$ret = $printer->sendToPrinter($object, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term});
|
||||
}
|
||||
} elseif ($action == 'getInvoice' && $user->rights->facture->lire) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
|
||||
$object = new Facture($db);
|
||||
if ($id > 0) {
|
||||
$object->fetch($id);
|
||||
}
|
||||
|
||||
echo json_encode($object);
|
||||
}
|
||||
|
||||
@ -435,13 +435,24 @@ function Refresh() {
|
||||
function New() {
|
||||
// If we go here,it means $conf->global->TAKEPOS_BAR_RESTAURANT is not defined
|
||||
console.log("New with place = <?php echo $place; ?>, js place="+place);
|
||||
var r = confirm('<?php echo ($place > 0 ? $langs->transnoentitiesnoconv("ConfirmDeletionOfThisPOSSale") : $langs->transnoentitiesnoconv("ConfirmDiscardOfThisPOSSale")); ?>');
|
||||
if (r == true) {
|
||||
$("#poslines").load("invoice.php?action=delete&place="+place, function() {
|
||||
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
||||
});
|
||||
ClearSearch();
|
||||
}
|
||||
|
||||
invoiceid = $("#invoiceid").val();
|
||||
$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&id='+invoiceid, function(data) {
|
||||
var r;
|
||||
|
||||
if (parseInt(data['paye']) === 1) {
|
||||
r = true;
|
||||
} else {
|
||||
r = confirm('<?php echo ($place > 0 ? $langs->transnoentitiesnoconv("ConfirmDeletionOfThisPOSSale") : $langs->transnoentitiesnoconv("ConfirmDiscardOfThisPOSSale")); ?>');
|
||||
}
|
||||
|
||||
if (r == true) {
|
||||
$("#poslines").load("invoice.php?action=delete&place=" + place, function () {
|
||||
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
||||
});
|
||||
ClearSearch();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user