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

This commit is contained in:
Laurent Destailleur
2012-08-08 04:09:25 +02:00
8 changed files with 23 additions and 12 deletions

View File

@@ -282,7 +282,7 @@ class Commande extends CommonObject
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'.*');
dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'*.*');
}
}
}

View File

@@ -1714,7 +1714,7 @@ class Facture extends CommonObject
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'.*');
dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*');
}
}
}

View File

@@ -1406,7 +1406,7 @@ class Form
$outval='';
$opt = '<option value="'.$objp->idprodfournprice.'"';
if ($selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
if ($selected && $selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
if ($objp->fprice == '') $opt.=' disabled="disabled"';
$opt.= '>';

View File

@@ -560,7 +560,7 @@ class Expedition extends CommonObject
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($dirdest.'/'.$oldref.'.*');
dol_delete_file($dirdest.'/'.$oldref.'*.*');
}
}
}

View File

@@ -353,7 +353,7 @@ class CommandeFournisseur extends Commande
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($dirdest.'/'.$oldref.'.*');
dol_delete_file($dirdest.'/'.$oldref.'*.*');
}
}
}

View File

@@ -217,13 +217,13 @@ if ($id > 0 || ! empty($ref))
$db->free($resql);
}
$sql = "SELECT l.rowid, l.ref, l.fk_product, l.description, l.subprice, sum(l.qty) as qty";
$sql.= ", p.label";
$sql = "SELECT l.fk_product, l.subprice, SUM(l.qty) as qty,";
$sql.= " p.ref, p.label";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product=p.rowid";
$sql.= " WHERE l.fk_commande = ".$commande->id;
$sql.= " GROUP BY l.fk_product";
$sql.= " ORDER BY l.rowid";
$sql.= " GROUP BY p.ref, p.label, l.fk_product, l.subprice"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product
$sql.= " ORDER BY p.ref, p.label";
$resql = $db->query($sql);
if ($resql)
@@ -260,7 +260,7 @@ if ($id > 0 || ! empty($ref))
{
$nbproduct++;
$remaintodispatch=($objp->qty - $products_dispatched[$objp->fk_product]);
$remaintodispatch=($objp->qty - $products_dispatched[$objp->fk_product]); // Calculation of dispatched
if ($remaintodispatch < 0) $remaintodispatch=0;
$var=!$var;
@@ -268,7 +268,9 @@ if ($id > 0 || ! empty($ref))
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),'product').' '.$objp->ref.'</a>';
print ' - '.$objp->label;
if ($objp->description) print '<br>'.nl2br($objp->description);
// To show detail cref and description value, we must make calculation by cref
//print ($objp->cref?' ('.$objp->cref.')':'');
//if ($objp->description) print '<br>'.nl2br($objp->description);
print '<input name="product_'.$i.'" type="hidden" value="'.$objp->fk_product.'">';
print '<input name="pu_'.$i.'" type="hidden" value="'.$objp->subprice.'">';
print "</td>\n";

View File

@@ -466,6 +466,8 @@ elseif ($action == 'addline')
// cas special pour lequel on a les meme reference que le fournisseur
// $label = '['.$product->ref.'] - '. $product->libelle;
$label = $product->description;
$label.= $product->description && $_POST['np_desc'] ? "\n" : "";
$label.= $_POST['np_desc'];
$tvatx=get_default_tva($object->thirdparty, $mysoc, $product->id, $_POST['idprodfournprice']);
@@ -1746,12 +1748,19 @@ else
print '<td colspan="4">';
$form->select_produits_fournisseurs($object->socid,'','idprodfournprice','',$filtre);
if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) print '<br>';
if (is_object($hookmanager))
{
$parameters=array('filtre'=>$filtre,'htmlname'=>'idprodfournprice');
echo $hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action);
}
$nbrows=ROWS_2;
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor = new DolEditor('np_desc', GETPOST('np_desc'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70);
$doleditor->Create();
print '</td>';
print '<td align="right"><input type="text" name="qty" value="1" size="1"></td>';
print '<td>&nbsp;</td>';

View File

@@ -405,7 +405,7 @@ class Livraison extends CommonObject
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($dirdest.'/'.$oldref.'.*');
dol_delete_file($dirdest.'/'.$oldref.'*.*');
}
}
}