Skip to content

Commit

Permalink
Merge pull request #4 from Dolibarr/develop
Browse files Browse the repository at this point in the history
Update fork
  • Loading branch information
TheGivrix authored Nov 19, 2020
2 parents e857526 + 772d401 commit 99f5192
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 113 deletions.
233 changes: 129 additions & 104 deletions htdocs/commande/list.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6475,7 +6475,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,

$substitutionarray['__AMOUNT_FORMATED__'] = is_object($object) ? ($object->total_ttc ? price($object->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : '';
$substitutionarray['__AMOUNT_EXCL_TAX_FORMATED__'] = is_object($object) ? ($object->total_ht ? price($object->total_ht, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : '';
$substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object) ? ($object->total_vat ? price($object->total_vat, 0, $outputlangs, 0, 0, -1, $conf->currency) : ($object->total_tva ? price($object->total_tva, 0, $outputlangs, 0, 0, -1, $conf->currency) : null)) : '';
$substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object) ? (isset($object->total_vat) ? price($object->total_vat, 0, $outputlangs, 0, 0, -1, $conf->currency) : ($object->total_tva ? price($object->total_tva, 0, $outputlangs, 0, 0, -1, $conf->currency) : null)) : '';
if ($onlykey != 2 || $mysoc->useLocalTax(1)) $substitutionarray['__AMOUNT_TAX2_FORMATED__'] = is_object($object) ? ($object->total_localtax1 ? price($object->total_localtax1, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : '';
if ($onlykey != 2 || $mysoc->useLocalTax(2)) $substitutionarray['__AMOUNT_TAX3_FORMATED__'] = is_object($object) ? ($object->total_localtax2 ? price($object->total_localtax2, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : '';

Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/deliveries.lang
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ Recipient=Recipient
ErrorStockIsNotEnough=There's not enough stock
Shippable=Shippable
NonShippable=Not Shippable
ShowShippableStatus=Show shippable status
ShowReceiving=Show delivery receipt
NonExistentOrder=Nonexistent order
1 change: 1 addition & 0 deletions htdocs/langs/fr_FR/deliveries.lang
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ Recipient=Destinataire
ErrorStockIsNotEnough=Le stock est insuffisant
Shippable=Expédiable
NonShippable=Non expédiable
ShowShippableCommand=Afficher statut expédiabilité
ShowReceiving=Afficher le bon de réception
NonExistentOrder=Commande inexistante
2 changes: 1 addition & 1 deletion htdocs/main.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type)
$user->getrights();
}

dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.constant('NOTOKENRENEWAL'));
dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.(defined('NOTOKENRENEWAL')?constant('NOTOKENRENEWAL'):''));
//Another call for easy debugg
//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));

Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/class/product.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4898,7 +4898,7 @@ public function load_stock($option = '', $includedraftpoforvirtual = null)
$this->db->free($result);

if (!preg_match('/novirtual/', $option)) {
$this->load_virtual_stock($includedraftpoforvirtual); // This also load stats_commande_fournisseur, ...
$this->load_virtual_stock($includedraftpoforvirtual); // This also load all arrays stats_xxx...
}

return 1;
Expand Down
22 changes: 16 additions & 6 deletions scripts/emailings/mailing-send.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,20 @@
}

if (!isset($argv[1]) || !$argv[1]) {
print "Usage: ".$script_file." (ID_MAILING|all)\n";
print "Usage: ".$script_file." (ID_MAILING|all) [userloginforsignature] [maxnbofemails]\n";
exit(-1);
}

$id = $argv[1];
if (isset($argv[2]) || !empty($argv[2]))
$login = $argv[2];

if (isset($argv[2]) || !empty($argv[2])) $login = $argv[2];
else $login = '';

$max = 0;

if (isset($argv[3]) || !empty($argv[3])) $max = $argv[3];


require_once $path."../../htdocs/master.inc.php";
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
require_once DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php";
Expand Down Expand Up @@ -113,9 +119,13 @@
// ou envoyes en erreur (statut=-1)
$sql2 = "SELECT mc.rowid, mc.fk_mailing, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
$sql2 .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql2 .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id;
if ($conf->global->MAILING_LIMIT_SENDBYCLI > 0) {
$sql2 .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".((int) $id);
if ($conf->global->MAILING_LIMIT_SENDBYCLI > 0 && empty($max)) {
$sql2 .= " LIMIT ".$conf->global->MAILING_LIMIT_SENDBYCLI;
} elseif ($conf->global->MAILING_LIMIT_SENDBYCLI > 0 && $max > 0) {
$sql2 .= " LIMIT ".min($conf->global->MAILING_LIMIT_SENDBYCLI, $max);
} elseif ($max > 0) {
$sql2 .= " LIMIT ".$max;
}

$resql2 = $db->query($sql2);
Expand All @@ -128,7 +138,7 @@
$now = dol_now();

// Positionne date debut envoi
$sqlstartdate = "UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi='".$db->idate($now)."' WHERE rowid=".$id;
$sqlstartdate = "UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi='".$db->idate($now)."' WHERE rowid=".((int) $id);
$resqlstartdate = $db->query($sqlstartdate);
if (!$resqlstartdate) {
dol_print_error($db);
Expand Down

0 comments on commit 99f5192

Please sign in to comment.