Skip to content

Commit

Permalink
Merge pull request Dolibarr#18539 from GurvanKervern/undef4
Browse files Browse the repository at this point in the history
Undef4
  • Loading branch information
eldy authored Sep 4, 2021
2 parents af03c38 + f79b883 commit 0d6296e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion htdocs/compta/facture/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
);

if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY) {
if (getDolGlobalString("INVOICE_USE_SITUATION") && $conf->global->INVOICE_USE_RETAINED_WARRANTY) {
$arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86);
}
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
Expand Down
34 changes: 17 additions & 17 deletions htdocs/takepos/invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@ function fail($message)
if ($invoiceid > 0) {
$ret = $invoice->fetch($invoiceid);
} else {
$ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')');
$ret = $invoice->fetch('', '(PROV-POS'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '') .'-'.$place.')');
}
if ($ret > 0) {
$placeid = $invoice->id;
}

$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"];
$constforcompanyid = 'CASHDESK_ID_THIRDPARTY'. isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ;

$soc = new Societe($db);
if ($invoice->socid > 0) {
$soc->fetch($invoice->socid);
} else {
$soc->fetch($conf->global->$constforcompanyid);
$soc->fetch(getDolGlobalString("$constforcompanyid"));
}


Expand Down Expand Up @@ -477,10 +477,10 @@ function fail($message)
}

if (($action == "addline" || $action == "freezone") && $placeid == 0) {
$invoice->socid = $conf->global->$constforcompanyid;
$invoice->socid = getDolGlobalString("$constforcompanyid");
$invoice->date = dol_now();
$invoice->module_source = 'takepos';
$invoice->pos_source = $_SESSION["takeposterminal"];
$invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ;
$invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity;

if ($invoice->socid <= 0) {
Expand Down Expand Up @@ -549,7 +549,7 @@ function fail($message)
}
if ($idoflineadded <= 0) {
$invoice->fetch_thirdparty();
$idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, '', '', 0, 100, '', null, 0);
$idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', null, '', '', 0, 100, '', null, 0);
if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) {
$CUSTOMER_DISPLAY_line1 = $prod->label;
$CUSTOMER_DISPLAY_line2 = price($price_ttc);
Expand Down Expand Up @@ -930,7 +930,7 @@ function fail($message)
}
<?php

if ($action == "order" and $order_receipt_printer1 != "") {
if ($action == "order" && !empty($order_receipt_printer1)) {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
?>
$.ajax({
Expand All @@ -951,7 +951,7 @@ function fail($message)
}
}

if ($action == "order" and $order_receipt_printer2 != "") {
if ($action == "order" && !empty($order_receipt_printer2)) {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
?>
$.ajax({
Expand All @@ -972,7 +972,7 @@ function fail($message)
}
}

if ($action == "order" and $order_receipt_printer3 != "") {
if ($action == "order" && !empty($order_receipt_printer3)) {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
?>
$.ajax({
Expand All @@ -992,7 +992,7 @@ function fail($message)
}


if ($action == "temp" and $ticket_printer1 != "") {
if ($action == "temp" && !empty($ticket_printer1)) {
?>
$.ajax({
type: "POST",
Expand Down Expand Up @@ -1039,7 +1039,7 @@ function TakeposPrinting(id){

function TakeposConnector(id){
console.log("TakeposConnector" + id);
$.get("<?php echo DOL_URL_ROOT; ?>/takepos/ajax/ajax.php?action=printinvoiceticket&term=<?php echo urlencode($_SESSION["takeposterminal"]); ?>&id="+id+"&token=<?php echo currentToken(); ?>", function(data, status) {
$.get("<?php echo DOL_URL_ROOT; ?>/takepos/ajax/ajax.php?action=printinvoiceticket&term=<?php echo urlencode(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); ?>&id="+id+"&token=<?php echo currentToken(); ?>", function(data, status) {
$.ajax({
type: "POST",
url: '<?php print getDolGlobalString('TAKEPOS_PRINT_SERVER'); ?>/printer/index.php',
Expand All @@ -1053,7 +1053,7 @@ function DolibarrTakeposPrinting(id) {
$.ajax({
type: "GET",
data: { token: '<?php echo currentToken(); ?>' },
url: "<?php print DOL_URL_ROOT.'/takepos/ajax/ajax.php?action=printinvoiceticket&term='.urlencode($_SESSION["takeposterminal"]).'&id='; ?>" + id,
url: "<?php print DOL_URL_ROOT.'/takepos/ajax/ajax.php?action=printinvoiceticket&term='.urlencode(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '').'&id='; ?>" + id,
});
}

Expand Down Expand Up @@ -1086,7 +1086,7 @@ function SetNote() {
$sql = "SELECT rowid, datec, ref FROM ".MAIN_DB_PREFIX."facture";
if (empty($conf->global->TAKEPOS_CAN_EDIT_IF_ALREADY_VALIDATED)) {
// By default, only invoices with a ref not already defined can in list of open invoice we can edit.
$sql .= " WHERE ref LIKE '(PROV-POS".$db->escape($_SESSION["takeposterminal"])."-0%' AND entity IN (".getEntity('invoice').")";
$sql .= " WHERE ref LIKE '(PROV-POS".$db->escape(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '')."-0%' AND entity IN (".getEntity('invoice').")";
} else {
// If TAKEPOS_CAN_EDIT_IF_ALREADY_VALIDATED set, we show also draft invoice that already has a reference defined
$sql .= " WHERE pos_source = '".$db->escape($_SESSION["takeposterminal"])."'";
Expand Down Expand Up @@ -1127,12 +1127,12 @@ function SetNote() {

$s = '';

$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
if (!empty($conf->stock->enabled) && $conf->global->$constantforkey != "1") {
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
if (!empty($conf->stock->enabled) && getDolGlobalString("$constantforkey") != "1") {
$s = '<span class="small">';
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
$constantforkey = 'CASHDESK_ID_WAREHOUSE'. (isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '');
$warehouse = new Entrepot($db);
$warehouse->fetch($conf->global->$constantforkey);
$warehouse->fetch(getDolGlobalString($constantforkey));
$s .= $langs->trans("Warehouse").'<br>'.$warehouse->ref;
$s .= '</span>';
}
Expand Down

0 comments on commit 0d6296e

Please sign in to comment.