Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
d5328d1cec
@ -121,10 +121,12 @@ class AdherentType extends CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (";
|
||||||
$sql.= "libelle";
|
$sql.= " morphy";
|
||||||
|
$sql.= ", libelle";
|
||||||
$sql.= ", entity";
|
$sql.= ", entity";
|
||||||
$sql.= ") VALUES (";
|
$sql.= ") VALUES (";
|
||||||
$sql.= "'".$this->db->escape($this->label)."'";
|
$sql.= "'".$this->db->escape($this->morphy)."'";
|
||||||
|
$sql.= ", '".$this->db->escape($this->label)."'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
|
|||||||
@ -173,7 +173,9 @@ if ($action == 'valid' && $user->rights->facture->creer)
|
|||||||
}
|
}
|
||||||
elseif (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1")
|
elseif (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1")
|
||||||
{
|
{
|
||||||
$invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]});
|
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
|
||||||
|
dol_syslog("Validate invoice with stock change into warehouse id ".$constantforkey);
|
||||||
|
$invoice->validate($user, '', $conf->global->$cosntantforkey);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -297,12 +299,28 @@ if ($action == "deleteline") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "delete") {
|
if ($action == "delete") {
|
||||||
if ($placeid > 0) { //If invoice exists
|
// $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.
|
||||||
|
if ($placeid > 0) {
|
||||||
$result = $invoice->fetch($placeid);
|
$result = $invoice->fetch($placeid);
|
||||||
if ($result > 0)
|
|
||||||
|
if ($result > 0 && $invoice->statut == Facture::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture='".$placeid."'";
|
$db->begin();
|
||||||
$resql = $db->query($sql);
|
|
||||||
|
// We delete the lines
|
||||||
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "facturedet_extrafields where fk_object = ".$placeid;
|
||||||
|
$resql1 = $db->query($sql);
|
||||||
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture = ".$placeid;
|
||||||
|
$resql2 = $db->query($sql);
|
||||||
|
|
||||||
|
if ($resql1 && $resql2)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
|
||||||
$invoice->fetch($placeid);
|
$invoice->fetch($placeid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -398,8 +398,9 @@ function Refresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function New() {
|
function New() {
|
||||||
console.log("New");
|
// If we go here,it means $conf->global->TAKEPOS_BAR_RESTAURANT is not defined
|
||||||
var r = confirm('<?php echo $langs->trans("ConfirmDeletionOfThisPOSSale"); ?>');
|
console.log("New with place = <?php echo $place; ?>, js place="+place);
|
||||||
|
var r = confirm('<?php echo ($place > 0 ? $langs->trans("ConfirmDeletionOfThisPOSSale") : $langs->trans("ConfirmDiscardOfThisPOSSale")); ?>');
|
||||||
if (r == true) {
|
if (r == true) {
|
||||||
$("#poslines").load("invoice.php?action=delete&place="+place, function() {
|
$("#poslines").load("invoice.php?action=delete&place="+place, function() {
|
||||||
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
|
||||||
@ -664,7 +665,7 @@ if (empty($conf->global->TAKEPOS_BAR_RESTAURANT))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// BAR RESTAURANT specific menu
|
// BAR RESTAURANT specific menu
|
||||||
$menus[$r++]=array('title'=>'<span class="fa fa-layer-group paddingrightonly"></span><div class="trunc">'.$langs->trans("Floors").'</div>', 'action'=>'Floors();');
|
$menus[$r++]=array('title'=>'<span class="fa fa-layer-group paddingrightonly"></span><div class="trunc">'.$langs->trans("Place").'</div>', 'action'=>'Floors();');
|
||||||
}
|
}
|
||||||
|
|
||||||
$menus[$r++]=array('title'=>'<span class="far fa-building paddingrightonly"></span><div class="trunc">'.$langs->trans("Customer").'</div>', 'action'=>'Customer();');
|
$menus[$r++]=array('title'=>'<span class="far fa-building paddingrightonly"></span><div class="trunc">'.$langs->trans("Customer").'</div>', 'action'=>'Customer();');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user