2
0
forked from Wavyzz/dolibarr

Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0

This commit is contained in:
Laurent Destailleur
2024-02-18 15:41:18 +01:00
5 changed files with 90 additions and 10 deletions

View File

@@ -108,6 +108,7 @@ if ($action == 'initbarcodethirdparties') {
$nbok = 0;
if (!empty($eraseallthirdpartybarcode)) {
$sql = "UPDATE ".MAIN_DB_PREFIX."societe";
$sql .= " AND entity IN (".getEntity('societe').")";
$sql .= " SET barcode = NULL";
$resql = $db->query($sql);
if ($resql) {
@@ -120,6 +121,7 @@ if ($action == 'initbarcodethirdparties') {
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe";
$sql .= " WHERE barcode IS NULL or barcode = ''";
$sql .= " AND entity IN (".getEntity('societe').")";
$sql .= $db->order("datec", "ASC");
$sql .= $db->plimit($maxperinit);
@@ -212,6 +214,7 @@ if ($action == 'initbarcodeproducts') {
if (!empty($eraseallproductbarcode)) {
$sql = "UPDATE ".MAIN_DB_PREFIX."product";
$sql .= " SET barcode = NULL";
$sql .= " WHERE entity IN (".getEntity('product').")";
$resql = $db->query($sql);
if ($resql) {
setEventMessages($langs->trans("AllBarcodeReset"), null, 'mesgs');
@@ -223,6 +226,7 @@ if ($action == 'initbarcodeproducts') {
$sql = "SELECT rowid, ref, fk_product_type";
$sql .= " FROM ".MAIN_DB_PREFIX."product";
$sql .= " WHERE barcode IS NULL or barcode = ''";
$sql .= " AND entity IN (".getEntity('product').")";
$sql .= $db->order("datec", "ASC");
$sql .= $db->plimit($maxperinit);
@@ -324,6 +328,7 @@ if (isModEnabled('societe')) {
}
$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe";
$sql .= " WHERE entity IN (".getEntity('societe').")";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
@@ -378,6 +383,7 @@ if (isModEnabled('product') || isModEnabled('service')) {
$sql = "SELECT count(rowid) as nb, fk_product_type, datec";
$sql .= " FROM ".MAIN_DB_PREFIX."product";
$sql .= " WHERE barcode IS NULL OR barcode = ''";
$sql .= " AND entity IN (".getEntity('product').")";
$sql .= " GROUP BY fk_product_type, datec";
$sql .= " ORDER BY datec";
$resql = $db->query($sql);
@@ -396,6 +402,7 @@ if (isModEnabled('product') || isModEnabled('service')) {
}
$sql = "SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."product";
$sql .= " WHERE entity IN (".getEntity('product').")";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);