Merge remote-tracking branch 'upstream/3.9' into 3.9

This commit is contained in:
Juanjo Menent 2016-06-01 10:36:18 +02:00
commit 7773afcbbe
12 changed files with 29 additions and 36 deletions

View File

@ -48,7 +48,7 @@ $filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filt
$usergroup = GETPOST("usergroup","int",3); $usergroup = GETPOST("usergroup","int",3);
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
// If not choice done on calendar owner, we filter on user. // If not choice done on calendar owner (like on left menu link "Agenda"), we filter on user.
if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS))
{ {
$filtert=$user->id; $filtert=$user->id;

View File

@ -341,22 +341,22 @@ if ($socid > 0)
$var = !$var; $var = !$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
if ($obj->description == '(CREDIT_NOTE)') if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
{ {
print '<td class="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
print $langs->trans("CreditNote").' '.$facturestatic->getNomURl(1); print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1);
print '</td>'; print '</td>';
} }
elseif ($obj->description == '(DEPOSIT)') elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
{ {
print '<td class="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
print $langs->trans("InvoiceDeposit").' '.$facturestatic->getNomURl(1); print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1);
print '</td>'; print '</td>';
} }
else else
@ -500,22 +500,22 @@ if ($socid > 0)
$var = !$var; $var = !$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
if ($obj->description == '(CREDIT_NOTE)') if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
{ {
print '<td class="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
print $langs->trans("CreditNote").' '.$facturestatic->getNomURl(1); print preg_replace('/\(CREDIT_NOTE\)/',$langs->trans("CreditNote"),$obj->description).' '.$facturestatic->getNomURl(1);
print '</td>'; print '</td>';
} }
elseif ($obj->description == '(DEPOSIT)') elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
{ {
print '<td class="nowrap">'; print '<td class="nowrap">';
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
print $langs->trans("InvoiceDeposit").' '.$facturestatic->getNomURl(1); print preg_replace('/\(DEPOSIT\)/',$langs->trans("InvoiceDeposit"),$obj->description).' '.$facturestatic->getNomURl(1);
print '</td>'; print '</td>';
} }
else else

View File

@ -1900,8 +1900,8 @@ if ($action == 'create' && $user->rights->commande->creer)
// invoice // invoice
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
} else { } else {
$filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')"; $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')";
$filtercreditnote = "fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'"; $filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%'";
} }
// Relative and absolute discounts // Relative and absolute discounts

View File

@ -2563,8 +2563,8 @@ else if ($id > 0 || ! empty($ref))
$filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
} else { } else {
$filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')"; $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')";
$filtercreditnote = "fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'"; $filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%'";
} }
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount); $absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
@ -2982,9 +2982,9 @@ else if ($id > 0 || ! empty($ref))
// Remise dispo de type avoir // Remise dispo de type avoir
if (! $absolute_discount) if (! $absolute_discount)
print '<br>'; print '<br>';
// $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, // $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer
// $filtercreditnote, $resteapayer); $more=' ('.$addcreditnote.')';
$form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0); // We allow credit note even if amount is higher $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0, $more); // We allow credit note even if amount is higher
} }
} }
if (! $absolute_discount && ! $absolute_creditnote) { if (! $absolute_discount && ! $absolute_creditnote) {

View File

@ -1025,7 +1025,7 @@ if ($action == 'create')
$projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:''); $projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:'');
$soc = $objectsrc->client; $soc = $objectsrc->thirdparty;
$note_private = (! empty($objectsrc->note_private) ? $objectsrc->note_private : ''); $note_private = (! empty($objectsrc->note_private) ? $objectsrc->note_private : '');
$note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : ''); $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : '');

View File

@ -1128,8 +1128,8 @@ class Form
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$desc=dol_trunc($obj->description,40); $desc=dol_trunc($obj->description,40);
if ($desc=='(CREDIT_NOTE)') $desc=$langs->trans("CreditNote"); if (preg_match('/\(CREDIT_NOTE\)/', $desc)) $desc=preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $desc);
if ($desc=='(DEPOSIT)') $desc=$langs->trans("Deposit"); if (preg_match('/\(DEPOSIT\)/', $desc)) $desc=preg_replace('/\(DEPOSIT\)/', $langs->trans("Deposit"), $desc);
$selectstring=''; $selectstring='';
if ($selected > 0 && $selected == $obj->rowid) $selectstring=' selected'; if ($selected > 0 && $selected == $obj->rowid) $selectstring=' selected';
@ -3762,7 +3762,7 @@ class Form
} }
else else
{ {
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': '; else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
} }
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles $newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
@ -3773,7 +3773,7 @@ class Form
if ($nbqualifiedlines > 0) if ($nbqualifiedlines > 0)
{ {
print ' &nbsp; <input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; print ' &nbsp; <input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
if ($filter && $filter != "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; if ($filter && $filter != "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
print '>'; print '>';
} }
if ($more) print $more; if ($more) print $more;

View File

@ -1099,7 +1099,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("stocks"); $langs->load("stocks");
$newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); $newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
} }
if (! empty($conf->propal->enabled)) if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled) || ! empty($conf->supplier_proposal->enabled))
{ {
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire);
} }
@ -1111,7 +1111,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/product/index.php?leftmenu=service&amp;type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); $newmenu->add("/product/index.php?leftmenu=service&amp;type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
$newmenu->add("/product/card.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); $newmenu->add("/product/card.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
$newmenu->add("/product/list.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->rights->service->lire); $newmenu->add("/product/list.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->rights->service->lire);
if (! empty($conf->propal->enabled)) if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled) || ! empty($conf->supplier_proposal->enabled))
{ {
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire);
} }

View File

@ -266,7 +266,7 @@ class modAgenda extends DolibarrModules
'type'=>'left', 'type'=>'left',
'titre'=>'MenuToDoActions', 'titre'=>'MenuToDoActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=todo', 'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=todo&amp;filtert=-1',
'langs'=>'agenda', 'langs'=>'agenda',
'position'=>105, 'position'=>105,
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',
@ -278,7 +278,7 @@ class modAgenda extends DolibarrModules
'type'=>'left', 'type'=>'left',
'titre'=>'MenuDoneActions', 'titre'=>'MenuDoneActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=done', 'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=done&amp;filtert=-1',
'langs'=>'agenda', 'langs'=>'agenda',
'position'=>106, 'position'=>106,
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',
@ -327,7 +327,7 @@ class modAgenda extends DolibarrModules
'type'=>'left', 'type'=>'left',
'titre'=>'MenuToDoActions', 'titre'=>'MenuToDoActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
'url'=>'/comm/action/listactions.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=todo', 'url'=>'/comm/action/listactions.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=todo&amp;filtert=-1',
'langs'=>'agenda', 'langs'=>'agenda',
'position'=>115, 'position'=>115,
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',
@ -339,7 +339,7 @@ class modAgenda extends DolibarrModules
'type'=>'left', 'type'=>'left',
'titre'=>'MenuDoneActions', 'titre'=>'MenuDoneActions',
'mainmenu'=>'agenda', 'mainmenu'=>'agenda',
'url'=>'/comm/action/listactions.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=done', 'url'=>'/comm/action/listactions.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=done&amp;filtert=-1',
'langs'=>'agenda', 'langs'=>'agenda',
'position'=>116, 'position'=>116,
'perms'=>'$user->rights->agenda->allactions->read', 'perms'=>'$user->rights->agenda->allactions->read',

View File

@ -1352,7 +1352,7 @@ if ($action == 'create')
} }
else else
{ {
print $form->select_company(GETPOST('socid','int'),'socid','s.fournisseur = 1',1); print $form->select_company(GETPOST('socid','int'),'socid','s.fournisseur = 1','SelectThirdParty');
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -45,8 +45,6 @@ LastProducts=Last products
CardProduct0=Product card CardProduct0=Product card
CardProduct1=Service card CardProduct1=Service card
CardContract=Contract card CardContract=Contract card
Warehouse=Warehouse
Warehouses=Warehouses
WarehouseOpened=Warehouse open WarehouseOpened=Warehouse open
WarehouseClosed=Warehouse closed WarehouseClosed=Warehouse closed
Stock=Stock Stock=Stock

View File

@ -87,11 +87,6 @@ if ($socid)
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'; print '<table class="border centpercent">';
// Alias names (commercial, trademark or alias names)
print '<tr><td class="titlefield">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{ {
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';

View File

@ -359,7 +359,7 @@ $sql.= " ,".MAIN_DB_PREFIX."c_stcomm as st";
// We'll need this table joined to the select in order to filter by sale // We'll need this table joined to the select in order to filter by sale
if ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
// We'll need this table joined to the select in order to filter by categ // We'll need this table joined to the select in order to filter by categ
if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_".($type=='f'?"fournisseur":"societe")." as cs";
$sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " WHERE s.fk_stcomm = st.id";
$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND s.entity IN (".getEntity('societe', 1).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;