FIX When creating a new POS sell, the creation date must be modified.
This commit is contained in:
parent
c6c697cb43
commit
1ec763fc14
@ -448,7 +448,7 @@ function TakeposOrderNotes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Refresh() {
|
function Refresh() {
|
||||||
console.log("Refresh");
|
console.log("Refresh by reloading place="+place);
|
||||||
$("#poslines").load("invoice.php?place="+place, function() {
|
$("#poslines").load("invoice.php?place="+place, function() {
|
||||||
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
||||||
});
|
});
|
||||||
@ -456,9 +456,10 @@ function Refresh() {
|
|||||||
|
|
||||||
function New() {
|
function New() {
|
||||||
// If we go here,it means $conf->global->TAKEPOS_BAR_RESTAURANT is not defined
|
// 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);
|
|
||||||
|
|
||||||
invoiceid = $("#invoiceid").val();
|
invoiceid = $("#invoiceid").val();
|
||||||
|
|
||||||
|
console.log("New with place = <?php echo $place; ?>, js place="+place+", invoiceid="+invoiceid);
|
||||||
|
|
||||||
$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&id='+invoiceid, function(data) {
|
$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=getInvoice&id='+invoiceid, function(data) {
|
||||||
var r;
|
var r;
|
||||||
|
|
||||||
|
|||||||
@ -395,16 +395,9 @@ if ($action == "deleteline") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Action to delete or discard an invoice
|
||||||
if ($action == "delete") {
|
if ($action == "delete") {
|
||||||
// $placeid is the invoice id (it differs from place) and is defined if the place is set and the ref of invoice is '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')', so the fetch at begining of page works.
|
// $placeid is the invoice id (it differs from place) and is defined if the place is set and the ref of invoice is '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')', so the fetch at begining of page works.
|
||||||
|
|
||||||
/*$reg = array();
|
|
||||||
if (preg_match('/^(\d+)-(\d+)$/', $place, $reg)) {
|
|
||||||
|
|
||||||
$place = $reg[1];
|
|
||||||
var_dump($place);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if ($placeid > 0) {
|
if ($placeid > 0) {
|
||||||
$result = $invoice->fetch($placeid);
|
$result = $invoice->fetch($placeid);
|
||||||
|
|
||||||
@ -422,7 +415,9 @@ if ($action == "delete") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]};
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture";
|
||||||
|
$sql .= " SET fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}.", ";
|
||||||
|
$sql .= " datec = '".$db->idate(dol_now())."'";
|
||||||
$sql .= " WHERE ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
$sql .= " WHERE ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
|
||||||
$resql1 = $db->query($sql);
|
$resql1 = $db->query($sql);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user