Merge remote-tracking branch 'Dolibarr/11.0' into 11

This commit is contained in:
Francis Appels 2020-03-30 10:15:17 +02:00
commit 5e4a412ec7
53 changed files with 283 additions and 215 deletions

View File

@ -291,7 +291,7 @@ script:
# Ensure we catch errors
set -e
#parallel-lint --exclude htdocs/includes --blame .
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame .
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/myclabs --exclude htdocs/includes/webmozart --exclude htdocs/includes/phpspec --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame .
set +e
echo

View File

@ -197,7 +197,7 @@ if ($resql) {
$param="&socid=".$socid;
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="socid" value="' . $object->id . '">';
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';

View File

@ -195,7 +195,7 @@ if ($resql) {
$param="&socid=".$socid;
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="socid" value="' . $object->id . '">';
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';

View File

@ -332,7 +332,7 @@ if ($result) {
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
$clickpicto = $form->showCheckAddButtons();
print_liste_field_titre($clickpicto, '', '', '', '', '', '', '', 'center ');
print "</tr>\n";
@ -341,7 +341,7 @@ if ($result) {
$product_static = new Product($db);
while ($objp = $db->fetch_object($result)) {
$codecompta = length_accountg($objp->account_number).' - '.$objp->label_compte;
$codecompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label_compte.'</span>';
$facture_static->ref = $objp->ref;
$facture_static->id = $objp->facid;
@ -390,7 +390,7 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>';
print '<td class="center">';
print '<td>';
print $codecompta.' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
print img_edit();
print '</a>';

View File

@ -287,7 +287,7 @@ if ($result) {
while ($i < min($num_lines, $limit)) {
$objp = $db->fetch_object($result);
$codeCompta = length_accountg($objp->account_number).' - '.$objp->label;
$codeCompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label.'</span>';
$expensereport_static->ref = $objp->ref;
$expensereport_static->id = $objp->erid;
@ -315,7 +315,7 @@ if ($result) {
print '<td>'.$codeCompta.'</td>';
print '<td class="left"><a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
print '<td class="left"><a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
print img_edit();
print '</a></td>';

View File

@ -336,7 +336,7 @@ if ($result) {
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
$checkpicto = $form->showCheckAddButtons();
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
print "</tr>\n";
@ -347,7 +347,7 @@ if ($result) {
while ($i < min($num_lines, $limit)) {
$objp = $db->fetch_object($result);
$codecompta = length_accountg($objp->account_number).' - '.$objp->label;
$codecompta = length_accountg($objp->account_number).' - <span class="opacitymedium">'.$objp->label.'</span>';
$facturefournisseur_static->ref = $objp->ref;
$facturefournisseur_static->id = $objp->facid;
@ -399,7 +399,7 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>';
print '<td class="center">';
print '<td>';
print $codecompta.' <a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
print img_edit();
print '</a></td>';

View File

@ -259,7 +259,7 @@ print '<br>';
print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="foruserid" value="all">';
print '<input type="hidden" name="mode" value="card">';
print '<input type="hidden" name="action" value="builddoc">';
@ -279,7 +279,7 @@ print '<br><br>';
print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="mode" value="cardlogin">';
print '<input type="hidden" name="action" value="builddoc">';
print $langs->trans("DescADHERENT_CARD_TYPE").' ';
@ -299,7 +299,7 @@ print '<br><br>';
print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' ';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="mode" value="label">';
print '<input type="hidden" name="action" value="builddoc">';
print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").' ';

View File

@ -605,7 +605,7 @@ if ($rowid > 0)
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input class="flat" type="hidden" name="rowid" value="'.$object->id.'" size="12"></td>';
print '<br>';

View File

@ -324,7 +324,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
}
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="set">';
print '<table class="noborder allwidth">'."\n";

View File

@ -180,7 +180,7 @@ $head=agenda_prepare_head();
dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action');
print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="set">';
print '<table class="noborder allwidth">'."\n";

View File

@ -119,7 +119,7 @@ if (! empty($conf->global->CLICKTODIAL_URL))
if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest');
print '<form action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print $langs->trans("LinkToTestClickToDial", $user->login).' : ';
print '<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).'">';
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';

View File

@ -185,7 +185,7 @@ else
print '<br>'."\n";
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
// Skins
show_skin(null, 1);

View File

@ -546,7 +546,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">

View File

@ -482,7 +482,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
// Fields title search
@ -502,7 +502,7 @@ foreach ($object->fields as $key => $val)
elseif (strpos($val['type'], 'integer:') === 0) {
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
}
elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
print '</td>';
}
}
@ -582,6 +582,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right';
if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
if (!empty($arrayfields['t.'.$key]['checked']))
{

View File

@ -248,7 +248,7 @@ $nav .= " &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day="
$picto = 'calendarweek';
$nav .= ' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
$nav .= '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
$nav .= '<input type="hidden" name="token" value="'.newToken().'">';
$nav .= '<input type="hidden" name="action" value="'.$action.'">';
$nav .= '<input type="hidden" name="filtert" value="'.$filtert.'">';
$nav .= '<input type="hidden" name="usergroup" value="'.$usergroup.'">';

View File

@ -289,7 +289,7 @@ $nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;da
$nav .= " &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
/*$nav.=' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
$nav.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
$nav.='<input type="hidden" name="token" value="' . newToken() . '">';
$nav.='<input type="hidden" name="action" value="' . $action . '">';
$nav.='<input type="hidden" name="filtert" value="' . $filtert . '">';
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';

View File

@ -1541,7 +1541,7 @@ if ($action == 'create')
$object = new Propal($db);
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
if ($origin != 'project' && $originid) {
print '<input type="hidden" name="origin" value="'.$origin.'">';
@ -1675,7 +1675,7 @@ if ($action == 'create')
$langs->load("projects");
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td>';
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td>';
print '</tr>';
@ -2052,7 +2052,7 @@ if ($action == 'create')
print '</td><td>';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate">';
print $form->selectDate($object->date, 're', '', '', 0, "editdate");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
@ -2078,7 +2078,7 @@ if ($action == 'create')
print '</td><td>';
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setecheance">';
print $form->selectDate($object->fin_validite, 'ech', '', '', '', "editecheance");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
@ -2412,7 +2412,7 @@ if ($action == 'create')
$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">

View File

@ -129,6 +129,13 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
$newdiscount1->amount_tva = price2num($newdiscount1->amount_ttc - $newdiscount1->amount_ht);
$newdiscount2->amount_tva = price2num($newdiscount2->amount_ttc - $newdiscount2->amount_ht);
$newdiscount1->multicurrency_amount_ttc = $amount_ttc_1 * ($discount->multicurrency_amount_ttc / $discount->amount_ttc);
$newdiscount2->multicurrency_amount_ttc = price2num($discount->multicurrency_amount_ttc - $newdiscount1->multicurrency_amount_ttc);
$newdiscount1->multicurrency_amount_ht = price2num($newdiscount1->multicurrency_amount_ttc / (1 + $newdiscount1->tva_tx / 100), 'MT');
$newdiscount2->multicurrency_amount_ht = price2num($newdiscount2->multicurrency_amount_ttc / (1 + $newdiscount2->tva_tx / 100), 'MT');
$newdiscount1->multicurrency_amount_tva = price2num($newdiscount1->multicurrency_amount_ttc - $newdiscount1->multicurrency_amount_ht);
$newdiscount2->multicurrency_amount_tva = price2num($newdiscount2->multicurrency_amount_ttc - $newdiscount2->multicurrency_amount_ht);
$db->begin();
$discount->fk_facture_source = 0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source
// This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source

View File

@ -1594,8 +1594,8 @@ if ($action == 'create' && $usercancreate)
$note_public = $object->getDefaultCreateValueFor('note_public');
}
print '<form name="crea_commande" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="socid" value="' . $soc->id . '">' . "\n";
print '<input type="hidden" name="remise_percent" value="' . $soc->remise_percent . '">';
@ -1734,7 +1734,7 @@ if ($action == 'create' && $usercancreate)
$langs->load("projects");
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td>';
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0);
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td>';
print '</tr>';
@ -2100,7 +2100,7 @@ if ($action == 'create' && $usercancreate)
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>';
} else {
@ -2177,7 +2177,7 @@ if ($action == 'create' && $usercancreate)
print '</td><td>';
if ($action == 'editdate') {
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate">';
print $form->selectDate($object->date, 'order_', '', '', '', "setdate");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
@ -2198,7 +2198,7 @@ if ($action == 'create' && $usercancreate)
print '</td><td>';
if ($action == 'editdate_livraison') {
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
@ -2492,7 +2492,7 @@ if ($action == 'create' && $usercancreate)
$result = $object->getLinesArray();
print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">';

View File

@ -318,7 +318,7 @@ if ($action == "create" || $action == "start")
print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
if ($action == 'start' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '' && GETPOST('posnumber', 'int') != '-1')
{
print '<input type="hidden" name="action" value="add">';

View File

@ -1680,7 +1680,7 @@ else
// Lines
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid')).'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">

View File

@ -302,11 +302,13 @@ if (empty($reshook))
// Note: Other solution if you want to add a negative line on invoice, is to create a discount for customer and consumme it (but this is possible on standard invoice only).
$array_of_total_ht_per_vat_rate = array();
$array_of_total_ht_devise_per_vat_rate = array();
foreach($object->lines as $line) {
if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
$array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->total_ht;
$array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->multicurrency_total_ht;
foreach ($object->lines as $line) {
//$vat_src_code_for_line = $line->vat_src_code; // TODO We chek sign of total per vat without taking into account the vat code because for the moment the vat code is lost/unknown when we add a down payment.
$vat_src_code_for_line = '';
if (empty($array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line])) $array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] = 0;
if (empty($array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line])) $array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] = 0;
$array_of_total_ht_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] += $line->total_ht;
$array_of_total_ht_devise_per_vat_rate[$line->tva_tx.'_'.$vat_src_code_for_line] += $line->multicurrency_total_ht;
}
//var_dump($array_of_total_ht_per_vat_rate);exit;
@ -831,9 +833,9 @@ if (empty($reshook))
$amount_ht[$vatrate] = price2num($amount_ht[$vatrate] * $ratio, 'MU');
$amount_tva[$vatrate] = price2num($amount_tva[$vatrate] * $ratio, 'MU');
$amount_ttc[$vatrate] = price2num($amount_ttc[$vatrate] * $ratio, 'MU');
$multicurrency_amount_ht[$line->tva_tx] = price2num($multicurrency_amount_ht[$vatrate] * $ratio, 'MU');
$multicurrency_amount_tva[$line->tva_tx] = price2num($multicurrency_amount_tva[$vatrate] * $ratio, 'MU');
$multicurrency_amount_ttc[$line->tva_tx] = price2num($multicurrency_amount_ttc[$vatrate] * $ratio, 'MU');
$multicurrency_amount_ht[$vatrate] = price2num($multicurrency_amount_ht[$vatrate] * $ratio, 'MU');
$multicurrency_amount_tva[$vatrate] = price2num($multicurrency_amount_tva[$vatrate] * $ratio, 'MU');
$multicurrency_amount_ttc[$vatrate] = price2num($multicurrency_amount_ttc[$vatrate] * $ratio, 'MU');
}
}
}
@ -2840,7 +2842,7 @@ if ($action == 'create')
}
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
if ($soc->id > 0) print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
print '<input name="ref" type="hidden" value="provisoire">';
@ -4441,7 +4443,7 @@ elseif ($id > 0 || !empty($ref))
print '</td><td>';
if ($action == 'editrevenuestamp') {
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setrevenuestamp">';
print '<input type="hidden" name="revenuestamp" id="revenuestamp_val" value="'.price2num($object->revenuestamp).'">';
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
@ -4945,7 +4947,7 @@ elseif ($id > 0 || !empty($ref))
}
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid')).'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">

View File

@ -95,7 +95,7 @@ abstract class CommonInvoice extends CommonObject
* This does not include open direct debit requests.
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return double Remain of amount to pay
* @return double Remain of amount to pay
*/
public function getRemainToPay($multicurrency = 0)
{
@ -104,7 +104,7 @@ abstract class CommonInvoice extends CommonObject
$alreadypaid+=$this->getSumDepositsUsed($multicurrency);
$alreadypaid+=$this->getSumCreditNotesUsed($multicurrency);
$remaintopay = ($this->total_ttc - $alreadypaid);
$remaintopay = price2num($this->total_ttc - $alreadypaid, 'MT');
if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment
$remaintopay = 0;
}

View File

@ -6638,9 +6638,10 @@ abstract class CommonObject
if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
elseif ($mode == 'view' && empty($visibility)) continue;
if (empty($perms)) continue;
// Load language if required
if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) {
$langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
}
$colspan = '';
if (is_array($params) && count($params) > 0) {
@ -6739,8 +6740,8 @@ abstract class CommonObject
{
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key];
}
$labeltoshow = $langs->trans($label);
$helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]);
$out .= '<td class="';
//$out .= "titlefield";
@ -6749,14 +6750,13 @@ abstract class CommonObject
$tpl_context = isset($params["tpl_context"]) ? $params["tpl_context"] : "none";
if ($tpl_context == "public") { // Public page : red dot instead of fieldrequired characters
$out .= '">';
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow);
else $out .= $labeltoshow;
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= '&nbsp;<font color="red">*</font>';
} else {
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired';
$out .= '"';
$out .= '>';
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
$out .= '">';
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $helptoshow);
else $out .= $labeltoshow;
}
$out .= '</td>';

View File

@ -1577,9 +1577,9 @@ class ExtraFields
if ($type == 'date') $out.=' (YYYY-MM-DD)';
elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)';
*/
if (! empty($help) && $keyprefix != 'search_options_') {
/*if (! empty($help) && $keyprefix != 'search_options_') {
$out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3);
}
}*/
return $out;
}

View File

@ -646,12 +646,14 @@ class Form
/* console.log( index + ": " + $( this ).text() ); */
if ($(this).is(\':checked\')) atleastoneselected++;
});
console.log("initCheckForSelect mode="+mode+" atleastoneselected="+atleastoneselected);
if (atleastoneselected || '.$alwaysvisible.')
{
jQuery(".massaction").show();
'.($selected ? 'if (atleastoneselected) { jQuery(".massactionselect").val("'.$selected.'"); jQuery(".massactionconfirmed").prop(\'disabled\', false); }' : '').'
'.($selected ? 'if (! atleastoneselected) { jQuery(".massactionselect").val("0"); jQuery(".massactionconfirmed").prop(\'disabled\', true); } ' : '').'
'.($selected ? 'if (atleastoneselected) { jQuery(".massactionselect").val("'.$selected.'").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', false); }' : '').'
'.($selected ? 'if (! atleastoneselected) { jQuery(".massactionselect").val("0").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', true); } ' : '').'
}
else
{
@ -3509,11 +3511,11 @@ class Form
/**
* Return list of payment methods
*
* @param string $selected Id du mode de paiement pre-selectionne
* @param string $htmlname Nom de la zone select
* @param string $selected Id or code or preselected payment mode
* @param string $htmlname Name of select field
* @param string $filtertype To filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
* @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
* @param int $empty 1=peut etre vide, 0 sinon
* @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code
* @param int $empty 1=can be empty, 0 otherwise
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @param int $maxlength Max length of label
* @param int $active Active or not, -1 = all
@ -3551,9 +3553,12 @@ class Form
elseif ($format == 1) print '<option value="'.$arraytypes['code'].'"';
elseif ($format == 2) print '<option value="'.$arraytypes['code'].'"';
elseif ($format == 3) print '<option value="'.$id.'"';
// Si selected est text, on compare avec code, sinon avec id
if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) print ' selected';
elseif ($selected == $id) print ' selected';
// Print attribute selected or not
if ($format==1 || $format==2) {
if ($selected == $arraytypes['code']) print ' selected';
} else {
if ($selected == $id) print ' selected';
}
print '>';
if ($format == 0) $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
elseif ($format == 1) $value = $arraytypes['code'];

View File

@ -59,7 +59,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
// Filters
//print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="year" value="' . $year . '">';
print '<input type="hidden" name="month" value="' . $month . '">';
print '<input type="hidden" name="day" value="' . $day . '">';

View File

@ -1098,7 +1098,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
if (!empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
if ($key == 'role') $align .= ($align ? ' ' : '').'left';
if (!empty($arrayfields['sc.'.$key]['checked'])) {
print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'sc.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
}
}
// Extra fields
@ -1317,6 +1317,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
$sortfield_new = implode(',', $sortfield_new_list);
$sql = '';
if (!empty($conf->agenda->enabled))
{
// Recherche histo sur actioncomm
@ -1468,85 +1470,88 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
//TODO Add limit in nb of results
$sql .= $db->order($sortfield_new, $sortorder);
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
if ($sql)
{
$i = 0;
$num = $db->num_rows($resql);
$sql .= $db->order($sortfield_new, $sortorder);
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$i = 0;
$num = $db->num_rows($resql);
while ($i < $num)
{
$obj = $db->fetch_object($resql);
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($obj->type == 'action') {
$contactaction = new ActionComm($db);
$contactaction->id = $obj->id;
$result = $contactaction->fetchResources();
if ($result < 0) {
dol_print_error($db);
setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors');
}
if ($obj->type == 'action') {
$contactaction = new ActionComm($db);
$contactaction->id = $obj->id;
$result = $contactaction->fetchResources();
if ($result < 0) {
dol_print_error($db);
setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors');
}
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
$tododone = '';
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo';
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
$tododone = '';
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo';
$histo[$numaction] = array(
'type'=>$obj->type,
'tododone'=>$tododone,
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
$histo[$numaction] = array(
'type'=>$obj->type,
'tododone'=>$tododone,
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
'userid'=>$obj->user_id,
'login'=>$obj->user_login,
'userfirstname'=>$obj->user_firstname,
'userlastname'=>$obj->user_lastname,
'userphoto'=>$obj->user_photo,
'userid'=>$obj->user_id,
'login'=>$obj->user_login,
'userfirstname'=>$obj->user_firstname,
'userlastname'=>$obj->user_lastname,
'userphoto'=>$obj->user_photo,
'contact_id'=>$obj->fk_contact,
'socpeopleassigned' => $contactaction->socpeopleassigned,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'fk_element'=>$obj->fk_element,
'elementtype'=>$obj->elementtype,
// Type of event
'acode'=>$obj->acode,
'alabel'=>$obj->alabel,
'libelle'=>$obj->alabel, // deprecated
'apicto'=>$obj->apicto
);
} else {
$histo[$numaction] = array(
'type'=>$obj->type,
'tododone'=>'done',
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
'acode'=>$obj->acode,
'contact_id'=>$obj->fk_contact,
'socpeopleassigned' => $contactaction->socpeopleassigned,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'fk_element'=>$obj->fk_element,
'elementtype'=>$obj->elementtype,
// Type of event
'acode'=>$obj->acode,
'alabel'=>$obj->alabel,
'libelle'=>$obj->alabel, // deprecated
'apicto'=>$obj->apicto
);
} else {
$histo[$numaction] = array(
'type'=>$obj->type,
'tododone'=>'done',
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
'acode'=>$obj->acode,
'userid'=>$obj->user_id,
'login'=>$obj->user_login,
'userfirstname'=>$obj->user_firstname,
'userlastname'=>$obj->user_lastname,
'userphoto'=>$obj->user_photo
);
}
'userid'=>$obj->user_id,
'login'=>$obj->user_login,
'userfirstname'=>$obj->user_firstname,
'userlastname'=>$obj->user_lastname,
'userphoto'=>$obj->user_photo
);
}
$numaction++;
$i++;
}
}
else
{
dol_print_error($db);
$numaction++;
$i++;
}
}
else
{
dol_print_error($db);
}
}
if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email)))
@ -1781,9 +1786,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
$out .= "</table>\n";
$out .= "</div>\n";
}
$out .= '</form>';
$out .= '</form>';
}
if ($noprint) return $out;
else print $out;

View File

@ -330,7 +330,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
* @param string $format "rss"
* @param string $title Title of export
* @param string $desc Description of export
* @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category")
* @param array $events_array Array of events ("uid","startdate","summary","url","desc","author","category") or Array of WebsitePage
* @param string $outputfile Output file
* @param string $filter (optional) Filter
* @return int < 0 if ko, Nb of events in file if ok
@ -355,7 +355,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
$date = date("r");
// Print header
fwrite($fichier, '<?xml version="1.0" encoding="".$langs->charset_output.""?>');
fwrite($fichier, '<?xml version="1.0" encoding="'.$langs->charset_output.'"?>');
fwrite($fichier, "\n");
fwrite($fichier, '<rss version="2.0">');
@ -363,11 +363,13 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
fwrite($fichier, "<channel>\n<title>".$title."</title>\n");
$form = "<description><![CDATA[".$desc.".]]></description>"."\n".
/*
fwrite($fichier, "<description><![CDATA[".$desc.".]]></description>"."\n".
// "<language>fr</language>"."\n".
"<copyright>Dolibarr</copyright>"."\n".
"<lastBuildDate>".$date."</lastBuildDate>"."\n".
"<generator>Dolibarr</generator>"."\n";
"<generator>Dolibarr</generator>"."\n");
*/
// Define $urlwithroot
$urlwithouturlroot = preg_replace("/".preg_quote(DOL_URL_ROOT, "/")."$/i", "", trim($dolibarr_main_url_root));
@ -392,6 +394,19 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
if ($eventqualified)
{
if (is_object($event) && get_class($event) == 'WebsitePage') {
// Convert object into an array
$tmpevent = array();
$tmpevent['uid'] = $event->id;
$tmpevent['startdate'] = $event->date_creation;
$tmpevent['summary'] = $event->title;
$tmpevent['url'] = $event->urlpage.'.php';
$tmpevent['author'] = $event->author_alias ? $event->author_alias : 'unknown';
//$tmpevent['category'] = '';
$event = $tmpevent;
}
$uid = $event["uid"];
$startdate = $event["startdate"];
$summary = $event["summary"];

View File

@ -445,7 +445,7 @@ if ($action == 'create')
if (!empty($conf->projet->enabled))
{
print "<tr><td>".$langs->trans("Project")."</td><td>";
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
print "</td></tr>\n";
}
@ -579,7 +579,7 @@ if (!empty($id) && $action == 'edit')
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td>';
$formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1);
$formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
print '</td></tr>';
}
@ -652,7 +652,7 @@ if (!empty($id) && $action != 'edit')
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {

View File

@ -2012,7 +2012,7 @@ elseif ($id || $ref)
if ($action == 'editline')
{
print ' <form name="updateline" id="updateline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;lineid='.$line_id.'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="updateline">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">

View File

@ -1,12 +1,13 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -594,7 +595,7 @@ class ProductFournisseur extends Product
global $conf;
$sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,";
$sql .= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
$sql .= " pfp.rowid as product_fourn_pri_id, pfp.entity, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
$sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,";
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,";
$sql .= " pfp.barcode, pfp.fk_barcode_type";
@ -620,6 +621,7 @@ class ProductFournisseur extends Product
$prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"];
$prodfourn->product_fourn_id = $record["product_fourn_id"];
$prodfourn->product_fourn_entity = $record["entity"];
$prodfourn->fourn_ref = $record["ref_fourn"];
$prodfourn->ref_supplier = $record["ref_fourn"];
$prodfourn->desc_supplier = $record["desc_fourn"];

View File

@ -81,7 +81,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE cf.fk_soc = s.rowid";
$sql .= " AND cf.entity = ".$conf->entity;
$sql .= " AND cf.entity IN (".getEntity('supplier_order').")";
if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid;
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " GROUP BY cf.fk_statut";
@ -267,7 +267,7 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY
}
else
{
$sql.= " WHERE (u.entity IN (".getEntity('user').")";
$sql.= " WHERE (u.entity IN (".getEntity('user')."))";
}
$sql.= " AND u.fk_soc IS NULL"; // An external user can not approved

View File

@ -2077,7 +2077,7 @@ if ($action == 'create')
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td>';
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
print '</td></tr>';
}

View File

@ -916,7 +916,7 @@ if (empty($action) || $action == 'list')
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
// Lines for filters fields
print '<tr class="liste_titre_filter">';
@ -1018,7 +1018,7 @@ if (empty($action) || $action == 'list')
// Amount
print '<td class="right">'.price($objp->pamount).'</td>';
if (!$i) $totalarray['nbfield']++;
$totalarray['pos'][7] = 'amount';
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'amount';
$totalarray['val']['amount'] += $objp->pamount;
// Ref invoice

View File

@ -5115,7 +5115,7 @@ function migrate_members_socialnetworks()
$obj->socialnetworks = '[]';
}
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'adherent SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX."adherent SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'";
$sqlupd.= ', skype=null';
$sqlupd.= ', twitter=null';
$sqlupd.= ', facebook=null';
@ -5209,7 +5209,7 @@ function migrate_contacts_socialnetworks()
$obj->socialnetworks = '[]';
}
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'socpeople SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX."socpeople SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'";
$sqlupd.= ', jabberid=null';
$sqlupd.= ', skype=null';
$sqlupd.= ', twitter=null';
@ -5300,7 +5300,7 @@ function migrate_thirdparties_socialnetworks()
$obj->socialnetworks = '[]';
}
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'societe SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX."societe SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'";
$sqlupd.= ', skype=null';
$sqlupd.= ', twitter=null';
$sqlupd.= ', facebook=null';

View File

@ -401,7 +401,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">

View File

@ -409,7 +409,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
// Fields title search
@ -509,6 +509,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right';
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
if (!empty($arrayfields['t.'.$key]['checked']))
{

View File

@ -497,7 +497,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$object->fetchLines();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">

View File

@ -398,7 +398,7 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
// Fields title search
@ -418,7 +418,7 @@ foreach ($object->fields as $key => $val)
elseif (strpos($val['type'], 'integer:') === 0) {
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
}
elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
print '</td>';
}
}
@ -498,6 +498,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right';
if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
if (!empty($arrayfields['t.'.$key]['checked']))
{

View File

@ -1440,7 +1440,7 @@ else
// Default warehouse
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1);
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&amp;backtopage='.urlencode($_SERVER['PHP_SELF'].'?action=create&type='.GETPOST('type', 'int')).'">'.$langs->trans("AddWarehouse").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&amp;backtopage='.urlencode($_SERVER['PHP_SELF'].'?action=create&type='.GETPOST('type', 'int')).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddWarehouse").'"></span></a>';
print '</td>';
/*
print "<tr>".'<td>'.$langs->trans("StockLimit").'</td><td>';

View File

@ -10,6 +10,7 @@
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -1054,6 +1055,7 @@ SCRIPT;
// Modify-Remove
print '<td class="center nowraponall">';
if ($usercancreate)
{
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;socid='.$productfourn->fourn_id.'&amp;action=update_price&amp;rowid='.$productfourn->product_fourn_price_id.'">'.img_edit()."</a>";

View File

@ -1151,7 +1151,7 @@ if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->se
print load_fiche_titre($langs->trans("UpdateVAT"), '');
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update_vat">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
@ -1185,7 +1185,7 @@ if ($action == 'edit_price' && $object->getRights()->creer)
{
print '<!-- Edit price -->'."\n";
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update_price">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
@ -1660,7 +1660,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print load_fiche_titre($langs->trans('PriceByCustomer'));
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add_customer_price_confirm">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
@ -1747,7 +1747,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES))
}
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update_customer_price_confirm">';
print '<input type="hidden" name="lineid" value="'.$prodcustprice->id.'">';

View File

@ -45,6 +45,7 @@ $result=restrictedArea($user, 'stock');
*/
$producttmp=new Product($db);
$warehouse=new Entrepot($db);
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
llxHeader("", $langs->trans("Stocks"), $help_url);
@ -70,13 +71,14 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
print "</table></div></form><br>";
}
$max = 15;
$sql = "SELECT e.ref as label, e.rowid, e.statut";
$sql = "SELECT e.rowid, e.ref as label, e.lieu, e.statut as status";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE e.statut in (0,1)";
$sql.= " AND e.entity IN (".getEntity('stock').")";
$sql.= $db->order('e.statut', 'DESC');
$sql.= $db->plimit(15, 0);
$sql.= $db->plimit($max + 1, 0);
$result = $db->query($sql);
@ -92,20 +94,31 @@ if ($result)
if ($num)
{
$entrepot=new Entrepot($db);
while ($i < $num)
while ($i < min($max, $num))
{
$objp = $db->fetch_object($result);
$warehouse->id = $objp->rowid;
$warehouse->statut = $objp->status;
$warehouse->label = $objp->label;
$warehouse->lieu = $objp->lieu;
print '<tr class="oddeven">';
print "<td><a href=\"card.php?id=$objp->rowid\">".img_object($langs->trans("ShowStock"), "stock")." ".$objp->label."</a></td>\n";
print '<td class="right">'.$entrepot->LibStatut($objp->statut, 5).'</td>';
print '<td>';
print $warehouse->getNomUrl(1);
print '</td>'."\n";
print '<td class="right">';
print $warehouse->getLibStatut(5);
print '</td>';
print "</tr>\n";
$i++;
}
$db->free($result);
}
if ($num > $max) {
print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td></tr>';
}
print "</table>";
print '</div>';
}
@ -122,7 +135,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
// Last movements
$max=10;
$sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,";
$sql.= " e.ref as stock, e.rowid as entrepot_id,";
$sql.= " e.ref as warehouse_ref, e.rowid as warehouse_id, e.ref as warehouse_label, e.lieu, e.statut as warehouse_status,";
$sql.= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m";
@ -166,6 +179,12 @@ if ($resql)
$producttmp->status_sell = $objp->tosell;
$producttmp->status_buy = $objp->tobuy;
$warehouse->id = $objp->warehouse_id;
$warehouse->ref = $objp->warehouse_ref;
$warehouse->statut = $objp->warehouse_status;
$warehouse->label = $objp->warehouse_label;
$warehouse->lieu = $objp->lieu;
print '<tr class="oddeven">';
print '<td>'.dol_print_date($db->jdate($objp->datem), 'dayhour').'</td>';
print '<td class="tdoverflowmax200">';
@ -177,9 +196,9 @@ if ($resql)
print '<td>'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
print '<td>'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
}
print '<td class="tdoverflowmax200"><a href="card.php?id='.$objp->entrepot_id.'">';
print img_object($langs->trans("ShowWarehouse"), "stock").' '.$objp->stock;
print "</a></td>\n";
print '<td class="tdoverflowmax200">';
print $warehouse->getNomUrl(1);
print "</td>\n";
print '<td class="right">';
if ($objp->qty > 0) print '+';
print $objp->qty.'</td>';
@ -190,6 +209,8 @@ if ($resql)
print "</table>";
print '</div>';
} else {
dol_print_error($db);
}
//print '</td></tr></table>';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -154,7 +155,8 @@ class Task extends CommonObject
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (";
$sql .= "fk_projet";
$sql .= "entity";
$sql .= ", fk_projet";
$sql .= ", ref";
$sql .= ", fk_task_parent";
$sql .= ", label";
@ -166,7 +168,8 @@ class Task extends CommonObject
$sql .= ", planned_workload";
$sql .= ", progress";
$sql .= ") VALUES (";
$sql .= $this->fk_project;
$sql .= $conf->entity;
$sql .= ", ".$this->fk_project;
$sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null');
$sql .= ", ".$this->fk_task_parent;
$sql .= ", '".$this->db->escape($this->label)."'";

View File

@ -1610,7 +1610,7 @@ elseif ($id || $ref)
if ($action == 'editline')
{
print '<form name="updateline" id="updateline" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;lineid='.$line_id.'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="updateline">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">';

View File

@ -256,7 +256,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print load_fiche_titre($langs->trans('PriceByCustomer'));
print '<form action="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add_customer_price_confirm">';
print '<input type="hidden" name="socid" value="'.$object->id.'">';
print '<table class="border centpercent">';
@ -334,7 +334,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
}
print '<form action="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update_customer_price_confirm">';
print '<input type="hidden" name="lineid" value="'.$prodcustprice->id.'">';
print '<table class="border centpercent">';

View File

@ -1041,7 +1041,7 @@ if (empty($reshook))
if (!$error)
{
$result = $object->insertExtraFields('SUPPLIER_PROPOSAL_MODIFY');
$result = $object->insertExtraFields('PROPOSAL_SUPPLIER_MODIFY');
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
@ -1125,7 +1125,7 @@ if ($action == 'create')
$object = new SupplierProposal($db);
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
if ($origin != 'project' && $originid) {
print '<input type="hidden" name="origin" value="'.$origin.'">';
@ -1433,7 +1433,7 @@ if ($action == 'create')
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';
$text .= $notify->confirmMessage('SUPPLIER_PROPOSAL_VALIDATE', $object->socid, $object);
$text .= $notify->confirmMessage('PROPOSAL_SUPPLIER_VALIDATE', $object->socid, $object);
}
if (!$error)
@ -1557,8 +1557,8 @@ if ($action == 'create')
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdate_livraison') {
print '<form name="editdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION ['newtoken'].'">';
print '<form name="editdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post" class="formconsumeproduce">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setdate_livraison">';
print $form->selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison");
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
@ -1762,7 +1762,7 @@ if ($action == 'create')
$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid')).'" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'].'">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">
@ -1806,7 +1806,10 @@ if ($action == 'create')
if ($action == 'statut')
{
// Form to set proposal accepted/refused
$form_close = '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
$form_close = '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST" id="formacceptrefuse" class="formconsumeproduce">';
$form_close .= '<input type="hidden" name="token" value="' . newToken() . '">';
$form_close .= '<input type="hidden" name="action" value="setstatut">';
if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) $form_close .= '<p class="notice">'.$langs->trans('SupplierProposalRefFournNotice').'</p>'; // TODO Suggest a permanent checkbox instead of option
$form_close .= '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
$form_close .= '<table class="border centpercent">';

View File

@ -1481,7 +1481,7 @@ class SupplierProposal extends CommonObject
if (! $error && ! $notrigger)
{
// Call trigger
$result=$this->call_trigger('SUPPLIER_PROPOSAL_VALIDATE', $user);
$result = $this->call_trigger('PROPOSAL_SUPPLIER_VALIDATE', $user);
if ($result < 0) { $error++; }
// End call triggers
}
@ -1683,7 +1683,7 @@ class SupplierProposal extends CommonObject
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('SUPPLIER_PROPOSAL_REOPEN', $user);
$result = $this->call_trigger('PROPOSAL_SUPPLIER_REOPEN', $user);
if ($result < 0) { $error++; }
// End call triggers
}
@ -1736,13 +1736,13 @@ class SupplierProposal extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf;
$triggerName = 'SUPPLIER_PROPOSAL_CLOSE_REFUSED';
$modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED : $this->modelpdf;
$triggerName = 'PROPOSAL_SUPPLIER_CLOSE_REFUSED';
if ($status == 2)
{
$triggerName='SUPPLIER_PROPOSAL_CLOSE_SIGNED';
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf;
$triggerName = 'PROPOSAL_SUPPLIER_CLOSE_SIGNED';
$modelpdf = $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL ? $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL : $this->modelpdf;
if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists
{
@ -1751,7 +1751,7 @@ class SupplierProposal extends CommonObject
}
if ($status == 4)
{
$triggerName='SUPPLIER_PROPOSAL_CLASSIFY_BILLED';
$triggerName = 'PROPOSAL_SUPPLIER_CLASSIFY_BILLED';
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
@ -1916,7 +1916,7 @@ class SupplierProposal extends CommonObject
if (!$error) {
// Call trigger
$result=$this->call_trigger('SUPPLIER_PROPOSAL_UNVALIDATE', $user);
$result = $this->call_trigger('PROPOSAL_SUPPLIER_UNVALIDATE', $user);
if ($result < 0) $error++;
}
@ -2034,7 +2034,7 @@ class SupplierProposal extends CommonObject
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('SUPPLIER_PROPOSAL_DELETE', $user);
$result = $this->call_trigger('PROPOSAL_SUPPLIER_DELETE', $user);
if ($result < 0) { $error++; }
// End call triggers
}

View File

@ -613,7 +613,7 @@ function TerminalsDialog()
function DirectPayment(){
console.log("DirectPayment");
$("#poslines").load("invoice.php?place"+place+"&action=valid&pay=<?php echo $langs->trans("cash"); ?>", function() {
$("#poslines").load("invoice.php?place="+place+"&action=valid&pay=<?php echo $langs->trans("cash"); ?>", function() {
});
}

View File

@ -2886,7 +2886,6 @@ table.paddingtopbottomonly tr td {
background: rgb(<?php echo $colorbacktitle1; ?>) !important;
}
tr.liste_titre_filter td.liste_titre {
border-bottom: 1px solid #FDFFFF;
padding-top: 4px;
padding-bottom: 3px;
}

View File

@ -203,7 +203,8 @@ $stringtoshow = '<script type="text/javascript" language="javascript">
</script>';
$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticket_by_status">'; // hideobject is to start hidden
$stringtoshow .= '<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
$stringtoshow .= '<input type="hidden" name="action" value="refresh">';
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_by_status:year,shownb,showtot">';
$stringtoshow .= $langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
$stringtoshow .= '<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', '', 1).'">';
@ -212,7 +213,7 @@ $stringtoshow .= '</div>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th >'.$langs->trans("Statistics").' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"').'</th></tr>';
print '<tr class="liste_titre"><th >'.$langs->trans("Statistics").' '.$endyear.' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"').'</th></tr>';
print '<tr><td class="center">';
print $stringtoshow;

View File

@ -328,7 +328,7 @@ if ($resql) {
dol_syslog("error for emailing id " . $id . " #" . $i . ($mail->error ? ' - ' . $mail->error : ''), LOG_DEBUG);
$sqlerror = "UPDATE " . MAIN_DB_PREFIX . "mailing_cibles";
$sqlerror .= " SET statut=-1, date_envoi=" . $db->idate($now) . " WHERE rowid=" . $obj->rowid;
$sqlerror .= " SET statut=-1, date_envoi='" . $db->idate($now) . "' WHERE rowid=" . $obj->rowid;
$resqlerror = $db->query($sqlerror);
if (! $resqlerror) {
dol_print_error($db);