Merge pull request #13310 from OPEN-DSI/new-takepos-ticket-paid

NEW no confirm discard ticket if paid
This commit is contained in:
Laurent Destailleur 2020-03-11 20:08:40 +01:00 committed by GitHub
commit 7b93b39bb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 7 deletions

View File

@ -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);
}

View File

@ -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();
}
});
}
/**