Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into NEW_Show_Region_in_company_info_&_Global_option_to_show_state_code_MAIN_SHOW_STATE_CODE

This commit is contained in:
Rui Strecht 2017-09-20 12:16:09 +01:00
commit 42a57aab26
47 changed files with 507 additions and 268 deletions

View File

@ -53,12 +53,10 @@ if (! $user->rights->accounting->chartofaccount) accessforbidden();
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'sortorder');
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -210,7 +210,7 @@ else {
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Solde", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
print "</tr>\n";
@ -280,4 +280,4 @@ else {
llxFooter();
}
$db->close();
$db->close();

View File

@ -45,6 +45,10 @@ if($action)
{
$db->begin();
if ($action == 'STOCK_SUPPORTS_SERVICES')
{
$res = dolibarr_set_const($db, "STOCK_SUPPORTS_SERVICES", GETPOST('STOCK_SUPPORTS_SERVICES','alpha'),'chaine',0,'',$conf->entity);
}
if ($action == 'STOCK_USERSTOCK_AUTOCREATE')
{
$res = dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", GETPOST('STOCK_USERSTOCK_AUTOCREATE','alpha'),'chaine',0,'',$conf->entity);
@ -164,8 +168,8 @@ $found=0;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("DeStockOnBill").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("DeStockOnBill").'</td>';
print '<td align="right">';
if (! empty($conf->facture->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@ -184,8 +188,8 @@ $found++;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td align="right">';
if (! empty($conf->commande->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@ -206,8 +210,8 @@ $found++;
//{
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("DeStockOnShipment").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("DeStockOnShipment").'</td>';
print '<td align="right">';
if (! empty($conf->expedition->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@ -226,8 +230,8 @@ $found++;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
print '<td align="right">';
if (! empty($conf->expedition->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@ -268,8 +272,8 @@ $found=0;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("ReStockOnBill").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("ReStockOnBill").'</td>';
print '<td align="right">';
if (! empty($conf->fournisseur->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@ -289,8 +293,8 @@ $found++;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("ReStockOnValidateOrder").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
print '<td align="right">';
if (! empty($conf->fournisseur->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@ -309,8 +313,8 @@ $found++;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("ReStockOnDispatchOrder").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
print '<td align="right">';
if (! empty($conf->fournisseur->enabled))
{
print "<form method=\"post\" action=\"stock.php\">";
@ -346,8 +350,8 @@ print '</tr>'."\n";
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("WarehouseAllowNegativeTransfer").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("WarehouseAllowNegativeTransfer").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_ALLOW_NEGATIVE_TRANSFER\">";
@ -361,8 +365,8 @@ print "</tr>\n";
if($conf->invoice->enabled) {
$var = !$var;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_INVOICE\">";
@ -376,8 +380,8 @@ if($conf->invoice->enabled) {
if($conf->order->enabled) {
$var = !$var;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_ORDER\">";
@ -391,8 +395,8 @@ if($conf->order->enabled) {
if($conf->expedition->enabled) {
$var = !$var;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT\">";
@ -404,6 +408,9 @@ if($conf->expedition->enabled) {
}
print '</table>';
print '<br>';
$virtualdiffersfromphysical=0;
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|| ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
@ -411,7 +418,6 @@ if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
if ($virtualdiffersfromphysical)
{
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("RuleForStockReplenishment")." ".img_help('help',$langs->trans("VirtualDiffersFromPhysical"))."</td>\n";
@ -419,8 +425,8 @@ if ($virtualdiffersfromphysical)
print '</tr>'."\n";
$var = !$var;
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("UseVirtualStockByDefault").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("UseVirtualStockByDefault").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USE_VIRTUAL_STOCK\">";
@ -430,9 +436,70 @@ if ($virtualdiffersfromphysical)
print "</td>\n";
print "</tr>\n";
print '</table>';
print '<br>';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("Other")."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UserWarehouseAutoCreate").'</td>';
print '<td class="width100" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>';
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")).'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_SUPPORTS_SERVICES\">";
print $form->selectyesno("STOCK_SUPPORTS_SERVICES",$conf->global->STOCK_SUPPORTS_SERVICES,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AllowAddLimitStockByWarehouse").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE\">";
print $form->selectyesno("STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE",$conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"SUPPLIER_ORDER_USE_DISPATCH_STATUS\">";
print $form->selectyesno("SUPPLIER_ORDER_USE_DISPATCH_STATUS",$conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</form>\n";
print "</td>\n</tr>\n";
}
print '</table>';
print '<br>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
@ -484,54 +551,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '</table>';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print " <td>".$langs->trans("Other")."</td>\n";
print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n";
if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) {
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("UseDispatchStatus").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"SUPPLIER_ORDER_USE_DISPATCH_STATUS\">";
print $form->selectyesno("SUPPLIER_ORDER_USE_DISPATCH_STATUS",$conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</form>\n";
print "</td>\n</tr>\n";
}
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("UserWarehouseAutoCreate").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("AllowAddLimitStockByWarehouse").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE\">";
print $form->selectyesno("STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE",$conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
print '<br>';
/* I keep the option/feature, but hidden to end users for the moment. If feature is used by module, no need to have users see it.
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
if ($conf->global->PRODUIT_SOUSPRODUITS)
@ -539,9 +558,8 @@ if ($conf->global->PRODUIT_SOUSPRODUITS)
print '<tr class="oddeven">';
print '<td width="60%">'.$langs->trans("IndependantSubProductStock").'</td>';
print '<td width="160" align="right">';
print '<td>'.$langs->trans("IndependantSubProductStock").'</td>';
print '<td align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"INDEPENDANT_SUBPRODUCT_STOCK\">";
@ -553,8 +571,6 @@ if ($conf->global->PRODUIT_SOUSPRODUITS)
}
*/
print '</table>';
llxFooter();

View File

@ -336,7 +336,7 @@ jQuery(document).ready(function() {
var compjsphpstring;
getjsphpurl = $.ajax({
type: "GET",
url: \''.DOL_URL_ROOT.'/core/js/datepicker.js.php\',
url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\',
cache: false,
/* async: false, */
/* crossDomain: true,*/

View File

@ -128,7 +128,7 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
// Show message
$message='';
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&userpassword=<strong>thepassword</strong>[&reset=1]';
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
$message.=img_picto('','object_globe.png').' '.$url;
print $message;

View File

@ -45,13 +45,13 @@ if (! empty($conf->categorie->enabled)) {
if (! $user->rights->mailing->lire || $user->societe_id > 0)
accessforbidden();
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder)

View File

@ -125,7 +125,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
if ($res > 0 && $newid1 > 0 && $newid2 > 0)
{
$db->commit();
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id); // To avoid pb whith back
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id.($backtopage?'&backtopage='.urlencode($backtopage):'')); // To avoid pb whith back
exit;
}
else
@ -275,13 +275,13 @@ if ($socid > 0)
print '</table>';
print '</div>';
if ($user->rights->societe->creer)
{
print '<br>';
print load_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("AmountHT").'</td>';
@ -293,7 +293,7 @@ if ($socid > 0)
print '</td></tr>';
print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>';
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc').'"></td></tr>';
print "</table>";
}
@ -362,7 +362,7 @@ if ($socid > 0)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
@ -408,14 +408,14 @@ if ($socid > 0)
if ($user->rights->societe->creer || $user->rights->facture->creer)
{
print '<td class="nowrap">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=split&amp;remid='.$obj->rowid.'">'.img_split($langs->trans("SplitDiscount")).'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
print ' &nbsp; ';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=remove&amp;remid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
print '</td>';
}
else print '<td>&nbsp;</td>';
print '</tr>';
if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
{
$showconfirminfo['rowid']=$obj->rowid;
@ -427,7 +427,7 @@ if ($socid > 0)
else
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
}
$db->free($resql);
print "</table>";
@ -441,7 +441,7 @@ if ($socid > 0)
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
);
$langs->load("dict");
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage?'&backtopage='.urlencode($backtopage):''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
}
}
else
@ -590,7 +590,7 @@ if ($socid > 0)
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table>";
}
else

View File

@ -46,7 +46,7 @@ $toselect = GETPOST('toselect', 'array');
$search_ref=GETPOST('search_ref','alpha');
$search_label=GETPOST('search_label','alpha');
$search_number=GETPOST('search_number','alpha');
$statut=GETPOST('statut')?GETPOST('statut', 'alpha'):'opened'; // 'all' or ''='opened'
$search_status=GETPOST('search_status')?GETPOST('search_status', 'alpha'):'opened'; // 'all' or ''='opened'
$optioncss = GETPOST('optioncss','alpha');
// Security check
@ -123,11 +123,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$statut = 'all';
$search_ref='';
$search_label='';
$search_number='';
$search_statut='';
$search_status='';
}
@ -153,8 +152,8 @@ $sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bankcacount_extrafields as ef on (c.rowid = ef.fk_object)";
$sql.= " WHERE entity IN (".getEntity('bank_account').")";
if ($statut == 'opened') $sql.= " AND clos = 0";
if ($statut == 'closed') $sql.= " AND clos = 1";
if ($search_status == 'opened') $sql.= " AND clos = 0";
if ($search_status == 'closed') $sql.= " AND clos = 1";
if ($search_ref != '') $sql.=natural_search('b.ref', $search_ref);
if ($search_label != '') $sql.=natural_search('b.label', $search_label);
if ($search_number != '') $sql.=natural_search('b.number', $search_number);
@ -222,7 +221,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_ref != '') $param.='&search_ref='.$search_ref;
if ($search_label != '') $param.='&search_label='.$search_label;
if ($search_number != '') $param.='&search_number='.$search_number;
if ($statut != '') $param.='&statut='.$statut;
if ($search_status != '') $param.='&search_status='.$search_status;
if ($show_files) $param.='&show_files=' .$show_files;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
@ -377,7 +376,7 @@ if (! empty($arrayfields['b.tms']['checked']))
print '<td class="liste_titre">';
print '</td>';
}
// Statut
// Status
if (! empty($arrayfields['b.clos']['checked']))
{
print '<td class="liste_titre center">';
@ -385,7 +384,7 @@ if (! empty($arrayfields['b.clos']['checked']))
'opened'=>$langs->trans("Opened"),
'closed'=>$langs->trans("Closed")
);
print $form->selectarray("statut", $array, $statut, 1);
print $form->selectarray("search_status", $array, $search_status, 1);
print '</td>';
}
// Balance
@ -584,7 +583,7 @@ foreach ($accounts as $key=>$type)
if (! $i) $totalarray['nbfield']++;
}
// Statut
// Status
if (! empty($arrayfields['b.clos']['checked']))
{
print '<td align="center">'.$acc->getLibStatut(5).'</td>';

View File

@ -386,7 +386,9 @@ if (empty($reshook))
else if ($action == "setabsolutediscount" && $user->rights->facture->creer)
{
// POST[remise_id] ou POST[remise_id_for_payment]
// POST[remise_id] or POST[remise_id_for_payment]
// We use the credit to reduce amount of invoice
if (! empty($_POST["remise_id"])) {
$ret = $object->fetch($id);
if ($ret > 0) {
@ -398,14 +400,28 @@ if (empty($reshook))
dol_print_error($db, $object->error);
}
}
if (! empty($_POST["remise_id_for_payment"])) {
// We use the credit to reduce remain to pay
if (! empty($_POST["remise_id_for_payment"]))
{
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
$discount = new DiscountAbsolute($db);
$discount->fetch($_POST["remise_id_for_payment"]);
$result = $discount->link_to_invoice(0, $id);
if ($result < 0) {
setEventMessages($discount->error, $discount->errors, 'errors');
//var_dump($object->getRemainToPay(0));
//var_dump($discount->amount_ttc);exit;
if ($discount->amount_ttc > $object->getRemainToPay(0))
{
// TODO Split the discount in 2 automatically
$error++;
setEventMessages($langs->trans("ErrorDiscountLargerThanRemainToPaySplitItBefore"), null, 'errors');
}
if (! $error)
{
$result = $discount->link_to_invoice(0, $id);
if ($result < 0) {
setEventMessages($discount->error, $discount->errors, 'errors');
}
}
}
@ -890,13 +906,18 @@ if (empty($reshook))
$line->fk_facture = $object->id;
$line->fk_parent_line = $fk_parent_line;
$line->subprice =-$line->subprice; // invert price for object
$line->subprice = -$line->subprice; // invert price for object
$line->pa_ht = $line->pa_ht; // we choosed to have buy/cost price always positive, so no revert of sign here
$line->total_ht=-$line->total_ht;
$line->total_tva=-$line->total_tva;
$line->total_ttc=-$line->total_ttc;
$line->total_localtax1=-$line->total_localtax1;
$line->total_localtax2=-$line->total_localtax2;
$line->total_ht = -$line->total_ht;
$line->total_tva = -$line->total_tva;
$line->total_ttc = -$line->total_ttc;
$line->total_localtax1 = -$line->total_localtax1;
$line->total_localtax2 = -$line->total_localtax2;
$line->multicurrency_subprice = -$line->multicurrency_subprice;
$line->multicurrency_total_ht = -$line->multicurrency_total_ht;
$line->multicurrency_total_tva = -$line->multicurrency_total_tva;
$line->multicurrency_total_ttc = -$line->multicurrency_total_ttc;
$result = $line->insert(0, 1); // When creating credit note with same lines than source, we must ignore error if discount alreayd linked
@ -3224,6 +3245,7 @@ else if ($id > 0 || ! empty($ref))
$addrelativediscount = '<a href="' . DOL_URL_ROOT . '/comm/remise.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditRelativeDiscounts") . '</a>';
$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $soc->id . '&type=2&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("AddCreditNote") . '</a>';
$viewabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("ViewAvailableGlobalDiscounts") . '</a>';
print '<!-- Discounts --><tr><td>' . $langs->trans('Discounts');
print '</td><td>';
@ -3233,7 +3255,7 @@ else if ($id > 0 || ! empty($ref))
print $langs->trans("CompanyHasNoRelativeDiscount");
// print ' ('.$addrelativediscount.')';
// Is there commercial discount or down payment available ?
// Is there is commercial discount or down payment available ?
if ($absolute_discount > 0) {
print '. ';
if ($object->statut > 0 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
@ -3258,7 +3280,7 @@ else if ($id > 0 || ! empty($ref))
} else {
if ($absolute_creditnote > 0) // If not, link will be added later
{
if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
if ($object->statut == Facture::STATUS_DRAFT && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
print ' (' . $addabsolutediscount . ')<br>';
else
print '. ';
@ -3269,7 +3291,7 @@ else if ($id > 0 || ! empty($ref))
if ($absolute_creditnote > 0)
{
// If validated, we show link "add credit note to payment"
if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE) {
if ($object->statut != Facture::STATUS_VALIDATED || $object->type == Facture::TYPE_CREDIT_NOTE) {
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {
$text = $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency));
print $form->textwithpicto($text, $langs->trans("CreditNoteDepositUse"));
@ -3280,13 +3302,13 @@ else if ($id > 0 || ! empty($ref))
// There is credit notes discounts available
if (! $absolute_discount) print '<br>';
// $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer);
$more=' ('.$addcreditnote.')';
$more=' ('.$addcreditnote. (($addcreditnote && $viewabsolutediscount) ? ' - ' : '') . $viewabsolutediscount . ')';
$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) {
print $langs->trans("CompanyHasNoAbsoluteDiscount");
if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
if ($object->statut == Facture::STATUS_DRAFT && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
print ' (' . $addabsolutediscount . ')<br>';
else
print '. ';

View File

@ -715,6 +715,9 @@ class FactureRec extends CommonInvoice
dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,fk_product=$fk_product,remise_percent=$remise_percent,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type,fk_unit=$fk_unit", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent = 0;
// Check parameters
if ($type < 0) return -1;

View File

@ -1577,7 +1577,7 @@ class Facture extends CommonInvoice
$facligne->desc=$remise->description; // Description ligne
$facligne->vat_src_code=$remise->vat_src_code;
$facligne->tva_tx=$remise->tva_tx;
$facligne->subprice=-$remise->amount_ht;
$facligne->subprice = -$remise->amount_ht;
$facligne->fk_product=0; // Id produit predefini
$facligne->qty=1;
$facligne->remise_percent=0;
@ -1600,6 +1600,11 @@ class Facture extends CommonInvoice
$facligne->total_tva = -$remise->amount_tva;
$facligne->total_ttc = -$remise->amount_ttc;
$facligne->multicurrency_subprice = -$remise->multicurrency_subprice;
$facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht;
$facligne->multicurrency_total_tva = -$remise->multicurrency_total_tva;
$facligne->multicurrency_total_ttc = -$remise->multicurrency_total_ttc;
$lineid=$facligne->insert();
if ($lineid > 0)
{

View File

@ -953,6 +953,7 @@ class BonPrelevement extends CommonObject
{
$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
$this->id = $prev_id;
$this->ref = $ref;
}
else
{

View File

@ -80,7 +80,7 @@ if ($action == 'create')
}
else
{
setEventMessages($langs->trans("DirectDebitOrderCreated"), null);
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
}
}

View File

@ -145,9 +145,9 @@ if ($prev_id > 0 || $ref)
// List of invoices
$sql = "SELECT pf.rowid";
$sql.= ",f.rowid as facid, f.facnumber as ref, f.total_ttc";
$sql.= ", s.rowid as socid, s.nom as name, pl.statut";
$sql = "SELECT pf.rowid,";
$sql.= " f.rowid as facid, f.facnumber as ref, f.total_ttc,";
$sql.= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture as pf";
@ -202,14 +202,14 @@ if ($result)
print '<tr class="liste_titre">';
print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder);
print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder);
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("AmountInvoice",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("AmountRequested",$_SERVER["PHP_SELF"],"pl.amount_requested","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("StatusDebitCredit",$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print "</tr>\n";
$var=false;
$total = 0;
$totalinvoices = 0;
$totalamount_requested = 0;
while ($i < min($num, $limit))
{
@ -231,9 +231,12 @@ if ($result)
print $thirdpartytmp->getNomUrl(1);
print "</td>\n";
// Amount
// Amount of invoice
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
// Amount requested
print '<td align="right">'.price($obj->amount_requested)."</td>\n";
// Status of requests
print '<td align="center">';
@ -256,7 +259,8 @@ if ($result)
print "</tr>\n";
$total += $obj->total_ttc;
$totalinvoices += $obj->total_ttc;
$totalamount_requested += $obj->amount_requested;
$i++;
}
@ -267,8 +271,11 @@ if ($result)
print '<td>'.$langs->trans("Total").'</td>';
print '<td>&nbsp;</td>';
print '<td align="right">';
if ($total != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices");
print price($total);
//if ($totalinvoices != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices"); // It is normal to have total that differs. For an amount of invoice of 100, request to pay may be 50 only.
if ($totalamount_requested != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices");
print "</td>\n";
print '<td align="right">';
print price($totalamount_requested);
print "</td>\n";
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';

View File

@ -538,11 +538,13 @@ class Contrat extends CommonObject
/**
* Load a contract from database
*
* @param int $id Id of contract to load
* @param string $ref Ref
* @return int <0 if KO, id of contract if OK
* @param int $id Id of contract to load
* @param string $ref Ref
* @param string $ref_customer Customer ref
* @param string $ref_supplier Supplier ref
* @return int <0 if KO, 0 if not found, Id of contract if OK
*/
function fetch($id,$ref='')
function fetch($id, $ref='', $ref_customer='', $ref_supplier='')
{
$sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,";
$sql.= " ref_supplier, ref_customer,";
@ -553,12 +555,20 @@ class Contrat extends CommonObject
$sql.= " fk_commercial_signature, fk_commercial_suivi,";
$sql.= " note_private, note_public, model_pdf, extraparams";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
if (! $id) $sql.=" WHERE entity IN (".getEntity('contract', 0).")";
else $sql.= " WHERE rowid=".$id;
if ($ref_customer)
{
$sql.= " AND ref_customer = '".$this->db->escape($ref_customer)."'";
}
if ($ref_supplier)
{
$sql.= " AND ref_supplier = '".$this->db->escape($ref_supplier)."'";
}
if ($ref)
{
$sql.= " WHERE ref='".$this->db->escape($ref)."'";
$sql.= " AND entity IN (".getEntity('contract', 0).")";
$sql.= " AND ref='".$this->db->escape($ref)."'";
}
else $sql.= " WHERE rowid=".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -628,7 +638,7 @@ class Contrat extends CommonObject
{
dol_syslog(get_class($this)."::Fetch Erreur contrat non trouve");
$this->error="Contract not found";
return -2;
return 0;
}
}
else
@ -2834,6 +2844,7 @@ class ContratLigne extends CommonObjectLine
if (empty($this->total_ttc)) $this->total_ttc = 0;
if (empty($this->localtax1_tx)) $this->localtax1_tx = 0;
if (empty($this->localtax2_tx)) $this->localtax2_tx = 0;
if (empty($this->remise_percent)) $this->remise_percent = 0;
// Check parameters
// Put here code to add control on parameters values

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -278,11 +278,8 @@ $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.re
$sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
$sql.= " typent.code,";
$sql.= " state.code_departement, state.nom";
// Add where from extra fields
foreach ($extrafields->attribute_label as $key => $val)
{
$sql .= ', ef.'.$key;
}
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook

View File

@ -147,11 +147,11 @@ if (! $error && $massaction == 'confirm_presend')
foreach($receiver as $key=>$val)
{
// Recipient was provided from combo list
if ($val == 'thirdparty') // Id of third party
if ($val == 'thirdparty') // Id of third party or user
{
$tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
}
elseif ($val) // Id du contact
elseif ($val && method_exists($thirdparty, 'contact_get_property')) // Id of contact
{
$tmparray[] = $thirdparty->contact_get_property((int) $val,'email');
$sendtoid[] = $val;

View File

@ -78,6 +78,7 @@ class DiscountAbsolute
$sql = "SELECT sr.rowid, sr.fk_soc,";
$sql.= " sr.fk_user,";
$sql.= " sr.amount_ht, sr.amount_tva, sr.amount_ttc, sr.tva_tx,";
$sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,";
$sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.description,";
$sql.= " sr.datec,";
$sql.= " f.facnumber as ref_facture_source";
@ -97,9 +98,15 @@ class DiscountAbsolute
$this->id = $obj->rowid;
$this->fk_soc = $obj->fk_soc;
$this->amount_ht = $obj->amount_ht;
$this->amount_tva = $obj->amount_tva;
$this->amount_ttc = $obj->amount_ttc;
$this->multicurrency_amount_ht = $obj->multicurrency_amount_ht;
$this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
$this->tva_tx = $obj->tva_tx;
$this->fk_user = $obj->fk_user;
$this->fk_facture_line = $obj->fk_facture_line;

View File

@ -5046,11 +5046,11 @@ class Form
else return 'BadValueForParameterTypeHour';
if ($typehour!='text') $retstring.=' '.$langs->trans('HourShort');
else $retstring.=':';
else $retstring.='<span class="hideonsmartphone">:</span>';
// Minutes
if ($minunderhours) $retstring.='<br>';
else $retstring.="&nbsp;";
else $retstring.='<span class="hideonsmartphone">&nbsp;</span>';
if ($typehour=='select' || $typehour=='textselect')
{

View File

@ -54,6 +54,9 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
$langs->load("companies");
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
// Filters
print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
@ -95,9 +98,6 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '</td></tr>';
}
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
// Type
print '<tr>';
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';

View File

@ -1648,7 +1648,7 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
}
/**
* Convert an image file into anoher format.
* Convert an image file into another format.
* This need Imagick php extension.
*
* @param string $fileinput Input file name
@ -1656,14 +1656,19 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
* @param string $fileoutput Output filename
* @return int <0 if KO, 0=Nothing done, >0 if OK
*/
function dol_convert_file($fileinput,$ext='png',$fileoutput='')
function dol_convert_file($fileinput, $ext='png', $fileoutput='')
{
global $langs;
if (class_exists('Imagick'))
{
$image=new Imagick();
$ret = $image->readImage($fileinput);
try {
$ret = $image->readImage($fileinput);
} catch(Exception $e) {
dol_syslog("Failed to read image using Imagick. Try to install package 'apt-get install ghostscript'.", LOG_WARNING);
return 0;
}
if ($ret)
{
$ret = $image->setImageFormat($ext);

View File

@ -46,7 +46,7 @@ if (! function_exists('json_encode'))
*/
function dol_json_encode($elements)
{
dol_syslog("For better permorfance, enable the native json in your PHP", LOG_WARNING);
dol_syslog("For better performance, enable the native json in your PHP", LOG_WARNING);
$num=0;
if (is_object($elements)) // Count number of properties for an object
@ -225,12 +225,11 @@ if (! function_exists('json_decode'))
* @param string $json Json encoded to PHP Object or Array
* @param bool $assoc False return an object, true return an array. Try to always use it with true !
* @return mixed Object or Array or false on error
* @deprecated PHP >= 5.3 supports native json_decode
* @see json_decode()
*/
function dol_json_decode($json, $assoc=false)
{
dol_syslog('dol_json_decode() is deprecated. Please update your code to use native json_decode().', LOG_WARNING);
dol_syslog("For better performance, enable the native json in your PHP", LOG_WARNING);
$comment = false;

View File

@ -576,10 +576,10 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
* @param string $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @param int $preselectedday Preselected day
* @param boolean $var Var for css of lines
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
* @return $inc
*/
function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=1, $preselectedday='', $var=false)
function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable)
{
global $conf, $db, $user, $bc, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
@ -732,8 +732,13 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
print $tableCell;
print '</td>';
$cssonholiday='';
if (! $isavailable[$preselectedday]['morning'] && ! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayallday ';
elseif (! $isavailable[$preselectedday]['morning']) $cssonholiday.='onholidaymorning ';
elseif (! $isavailable[$preselectedday]['afternoon']) $cssonholiday.='onholidayafternoon ';
// Duration
print '<td align="right">';
print '<td align="center" class="duration'.($cssonholiday?' '.$cssonholiday:'').'">';
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id];
$alreadyspent='';
@ -743,7 +748,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
$tableCell='';
$tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center" size="2" disabled id="timespent['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="'.$alreadyspent.'"></span>';
$tableCell.=' + ';
$tableCell.='<span class="hideonsmartphone"> + </span>';
//$tableCell.='&nbsp;&nbsp;&nbsp;';
$tableCell.=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
//$tableCell.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled':'').' value="'.$langs->trans("Add").'">';
@ -783,8 +788,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
$level++;
if ($lines[$i]->id > 0)
{
if ($parent == 0) projectLinesPerDay($inc, $lines[$i]->id, $fuser, $lineswithoutlevel0, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $var);
else projectLinesPerDay($inc, $lines[$i]->id, $fuser, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $var);
if ($parent == 0) projectLinesPerDay($inc, $lines[$i]->id, $fuser, $lineswithoutlevel0, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $isavailable);
else projectLinesPerDay($inc, $lines[$i]->id, $fuser, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $isavailable);
}
$level--;
}
@ -798,7 +803,6 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
}
/**
* Output a task line into a perday intput mode
*
@ -812,10 +816,10 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
* @param string $tasksrole Array of roles user has on task
* @param string $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @param boolean $var Var for css of lines
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
* @return $inc
*/
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=1, $var=false)
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable)
{
global $conf, $db, $user, $bc, $langs;
global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
@ -851,7 +855,6 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
// Break on a new project
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
{
//$var = ! $var;
$lastprojectid=$lines[$i]->fk_project;
$projectstatic->id = $lines[$i]->fk_project;
}
@ -966,13 +969,19 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
for ($idw = 0; $idw < 7; $idw++)
{
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
$cssonholiday='';
if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
$tmparray=dol_getdate($tmpday);
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id];
$alreadyspent='';
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($dayWorkLoad,'allhourmin');
$alttitle=$langs->trans("AddHereTimeSpentForDay",$tmparray['day'],$tmparray['mon']);
$tableCell ='<td align="center" class="hide'.$idw.'">';
$tableCell ='<td align="center" class="hide'.$idw.($cssonholiday?' '.$cssonholiday:'').'">';
if ($alreadyspent)
{
$tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center smallpadd" size="2" disabled id="timespent['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="'.$alreadyspent.'"></span>';
@ -1008,8 +1017,8 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
$level++;
if ($lines[$i]->id > 0)
{
if ($parent == 0) projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lineswithoutlevel0, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $var);
else projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $var);
if ($parent == 0) projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lineswithoutlevel0, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $isavailable);
else projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $isavailable);
}
$level--;
}
@ -1163,7 +1172,6 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
$sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, s.nom, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount, p.dateo, p.datee";
$sql2.= " ORDER BY p.title, p.ref";
$var=true;
$resql = $db->query($sql2);
if ($resql)
{

View File

@ -977,7 +977,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50);
if (! empty($conf->banque->enabled))
{
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/compta/bank/index.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_bank', 51);
}
if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled))
{

View File

@ -70,7 +70,7 @@ class modCashDesk extends DolibarrModules
$this->phpmin = array(4,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module
$this->langfiles = array("cashdesk");
//$this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text')
$this->warnings_activation = array('FR'=>'WarningNoteModulePOSForFrenchLaw'); // Warning to show when we activate module. array('always'='text') or array('FR'='text')
//$this->warnings_activation_ext = array('FR'=>'WarningInstallationMayBecomeNotCompliantWithLaw'); // Warning to show when we activate an external module. array('always'='text') or array('FR'='text')
// Constants

View File

@ -49,7 +49,8 @@ print load_fiche_titre($text);
print $langs->trans("ToolsDesc").'<br><br>';
// Show logo
print '<div class="center"><div class="logo_setup"></div></div>';
llxFooter();

View File

@ -215,20 +215,22 @@ class ExpenseReport extends CommonObject
$resql=$this->db->query($sql);
if (!$resql) $error++;
foreach ($this->lines as $i => $val)
{
$newndfline=new ExpenseReportLine($this->db);
$newndfline=$this->lines[$i];
$newndfline->fk_expensereport=$this->id;
if ($result >= 0)
{
$result=$newndfline->insert();
}
if ($result < 0)
{
$error++;
break;
}
if (is_array($this->lines) && count($this->lines)>0) {
foreach ($this->lines as $i => $val)
{
$newndfline=new ExpenseReportLine($this->db);
$newndfline=$this->lines[$i];
$newndfline->fk_expensereport=$this->id;
if ($result >= 0)
{
$result=$newndfline->insert();
}
if ($result < 0)
{
$error++;
break;
}
}
}
if (! $error)

View File

@ -284,7 +284,7 @@ class Holiday extends CommonObject
* @param string $filter SQL Filter
* @return int -1 if KO, 1 if OK, 2 if no result
*/
function fetchByUser($user_id,$order='',$filter='')
function fetchByUser($user_id, $order='', $filter='')
{
global $langs, $conf;
@ -692,13 +692,17 @@ class Holiday extends CommonObject
}
/**
* verifDateHolidayCP
* Check if a user is on holiday (partially or completely) into a period.
* This function can be used to avoid to have 2 leave requests on same period for example.
* Warning: It consumes a lot of memory because it load in ->holiday all holiday of a dedicated user at each call.
*
* @param int $fk_user Id user
* @param date $dateDebut Start date
* @param date $dateFin End date
* @param int $halfday Tag to define half day when holiday start and end
* @return boolean
* @param date $dateDebut Start date of period to check
* @param date $dateFin End date of period to check
* @param int $halfday Tag to define how start and end the period to check:
* 0:Full days, 2:Sart afternoon end monring, -1:Start afternoon, 1:End morning
* @return boolean False is on holiday at least partially into the period, True is never on holiday during chcked period.
* @see verifDateHolidayForTimestamp
*/
function verifDateHolidayCP($fk_user, $dateDebut, $dateFin, $halfday=0)
{
@ -710,14 +714,103 @@ class Holiday extends CommonObject
if ($infos_CP['statut'] == 5) continue; // ignore not validated holidays
// TODO Also use halfday for the check
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
if ($halfday == 0)
{
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
}
elseif ($halfday == -1)
{
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
}
elseif ($halfday == 1)
{
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
}
elseif ($halfday == 2)
{
if ($dateDebut >= $infos_CP['date_debut'] && $dateDebut <= $infos_CP['date_fin'] || $dateFin <= $infos_CP['date_fin'] && $dateFin >= $infos_CP['date_debut'])
{
return false;
}
}
else
{
dol_print_error('', 'Bad value of parameter halfday when calling function verifDateHolidayCP');
}
}
return true;
}
/**
* Check a user is not on holiday for a particular timestamp
*
* @param int $fk_user Id user
* @param timestamp $timestamp Time stamp date for a day (YYYY-MM-DD) without hours (= 12:00AM in english and not 12:00PM that is 12:00)
* @return array array('morning'=> ,'afternoon'=> ), Boolean is true if user is available for day timestamp.
* @see verifDateHolidayCP
*/
function verifDateHolidayForTimestamp($fk_user, $timestamp)
{
global $langs, $conf;
$isavailablemorning=true;
$isavailableafternoon=true;
$sql = "SELECT cp.rowid, cp.date_debut as date_start, cp.date_fin as date_end, cp.halfday";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp";
$sql.= " WHERE cp.entity IN (".getEntity('holiday').")";
$sql.= " AND cp.fk_user = ".(int) $fk_user;
$sql.= " AND date_debut <= '".$this->db->idate($timestamp)."' AND date_fin >= '".$this->db->idate($timestamp)."'";
$resql = $this->db->query($sql);
if ($resql)
{
$num_rows = $this->db->num_rows($resql); // Note, we can have 2 records if on is morning and the other one is afternoon
if ($num_rows > 0)
{
$i=0;
while ($i < $num_rows)
{
$obj = $this->db->fetch_object($resql);
// Note: $obj->halday is 0:Full days, 2:Sart afternoon end morning, -1:Start afternoon, 1:End morning
$arrayofrecord[$obj->rowid]=array('date_start'=>$this->db->jdate($obj->date_start), 'date_end'=>$this->db->jdate($obj->date_end), 'halfday'=>$obj->halfday);
$i++;
}
// We found a record, user is on holiday by default, so is not available is true.
$isavailablemorning = true;
foreach($arrayofrecord as $record)
{
if ($timestamp == $record['date_start'] && $record['halfday'] == 2) continue;
if ($timestamp == $record['date_start'] && $record['halfday'] == -1) continue;
$isavailablemorning = false;
break;
}
$isavailableafternoon = true;
foreach($arrayofrecord as $record)
{
if ($timestamp == $record['date_end'] && $record['halfday'] == 2) continue;
if ($timestamp == $record['date_end'] && $record['halfday'] == 1) continue;
$isavailableafternoon = false;
break;
}
}
}
else dol_print_error($this->db);
return array('morning'=>$isavailablemorning, 'afternoon'=>$isavailableafternoon);
}

View File

@ -24,7 +24,7 @@ class Segment implements IteratorAggregate, Countable
protected $images = array();
protected $odf;
protected $file;
/**
* Constructor
*
@ -86,15 +86,15 @@ class Segment implements IteratorAggregate, Countable
*/
public function merge()
{
// To provide debug information on line number processed
// To provide debug information on line number processed
global $count;
if (empty($count)) $count=1;
else $count++;
if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps
$this->xml = $this->savxml;
$tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values
// Search all tags fou into condition to complete $tmpvars, so we will proceed all tests even if not defined
$reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
@ -106,7 +106,7 @@ class Segment implements IteratorAggregate, Countable
$tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop
}
}
// Conditionals substitution
// Note: must be done before static substitution, else the variable will be replaced by its value and the conditional won't work anymore
foreach($tmpvars as $key => $value)
@ -133,7 +133,7 @@ class Segment implements IteratorAggregate, Countable
$this->xml = preg_replace($reg, '', $this->xml);
}
}
$this->xmlParsed .= str_replace(array_keys($tmpvars), array_values($tmpvars), $this->xml);
if ($this->hasChildren()) {
foreach ($this->children as $child) {
@ -143,7 +143,7 @@ class Segment implements IteratorAggregate, Countable
}
$reg = "/\[!--\sBEGIN\s$this->name\s--\](.*)\[!--\sEND\s$this->name\s--\]/sm";
$this->xmlParsed = preg_replace($reg, '$1', $this->xmlParsed);
// Miguel Erill 09704/2017 - Add macro replacement to invoice lines
// Miguel Erill 09704/2017 - Add macro replacement to invoice lines
$this->xmlParsed = $this->macroReplace($this->xmlParsed);
$this->file->open($this->odf->getTmpfile());
foreach ($this->images as $imageKey => $imageValue) {
@ -155,28 +155,28 @@ class Segment implements IteratorAggregate, Countable
}
}
$this->file->close();
return $this->xmlParsed;
}
/**
* Function to replace macros for invoice short and long month, invoice year
*
*
* Substitution occur when the invoice is generated, not considering the invoice date
* so do not (re)generate in a diferent date than the one that the invoice belongs to
* Perhaps it would be better to use the invoice issued date but I still do not know
* how to get it here
*
* Miguel Erill 09/04/2017
*
*
* @param string $value String to convert
*/
public function macroReplace($text)
{
global $langs;
$patterns=array( '__CURRENTDAY__','__CURRENTDAYTEXT__','__CURRENTMONTHSHORT__','__CURRENTMONTH__','__CURRENTYEAR__' );
$values=array( date('j'), $langs->trans(date('l')), $langs->trans(date('M')), $langs->trans(date('F')), date('Y') );
$patterns=array('/__CURRENTDAY__/','/__CURRENTDAYTEXT__/','/__CURRENTMONTHSHORT__/','/__CURRENTMONTH__/','/__CURRENTYEAR__/');
$values=array(date('j'), $langs->trans(date('l')), $langs->trans(date('M')), $langs->trans(date('F')), date('Y'));
$text=preg_replace($patterns, $values, $text);
@ -203,7 +203,7 @@ class Segment implements IteratorAggregate, Countable
}
return $this;
}
/**
* Assign a template variable to replace
*

View File

@ -510,6 +510,7 @@ ALTER TABLE llx_user_rights DROP FOREIGN KEY fk_user_rights_fk_user_user;
ALTER TABLE llx_user_rights DROP INDEX uk_user_rights;
ALTER TABLE llx_user_rights DROP INDEX fk_user;
ALTER TABLE llx_user_rights ADD UNIQUE INDEX uk_user_rights (entity, fk_user, fk_id);
DELETE FROM llx_user_rights WHERE fk_user NOT IN (select rowid from llx_user);
ALTER TABLE llx_user_rights ADD CONSTRAINT fk_user_rights_fk_user_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);
ALTER TABLE llx_usergroup_rights ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;

View File

@ -90,6 +90,7 @@ delete from llx_livraison where ref = '';
delete from llx_expeditiondet where fk_expedition in (select rowid from llx_expedition where ref = '');
delete from llx_expedition where ref = '';
delete from llx_holiday_logs where fk_user_update not IN (select rowid from llx_user);
delete from llx_user_rights where fk_user not IN (select rowid from llx_user);
update llx_deplacement set dated='2010-01-01' where dated < '2000-01-01';

View File

@ -211,7 +211,8 @@ if ($ok)
$extrafields=new ExtraFields($db);
$listofmodulesextra=array('societe'=>'societe','adherent'=>'adherent','product'=>'product',
'socpeople'=>'socpeople', 'commande'=>'commande', 'facture'=>'facture',
'commande_fournisseur'=>'commande_fournisseur', 'actioncomm'=>'actioncomm',
'supplier_proposal'=>'supplier_proposal', 'commande_fournisseur'=>'commande_fournisseur', 'facture_fourn'=>'facture_fourn',
'actioncomm'=>'actioncomm',
'adherent_type'=>'adherent_type','user'=>'user','projet'=>'projet', 'projet_task'=>'projet_task');
print '<tr><td colspan="2"><br>*** Check fields into extra table structure match table of definition. If not add column into table</td></tr>';
foreach($listofmodulesextra as $tablename => $elementtype)
@ -303,6 +304,10 @@ if ($ok)
print "</td><td>&nbsp;</td></tr>\n";
}
else
{
dol_print_error($db);
}
}
}

View File

@ -343,6 +343,7 @@ DateIsNotEnough=Date not reached yet
InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s
WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date
WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date
ViewAvailableGlobalDiscounts=View available discounts
# PaymentConditions
Statut=Status
PaymentConditionShortRECEP=Due Upon Receipt

View File

@ -200,7 +200,7 @@ ErrorObjectMustHaveStatusDraftToBeValidated=Object %s must have status 'Draft' t
ErrorObjectMustHaveLinesToBeValidated=Object %s must have lines to be validated.
ErrorOnlyInvoiceValidatedCanBeSentInMassAction=Only validated invoices can be sent using the "Send by email" mass action.
ErrorChooseBetweenFreeEntryOrPredefinedProduct=You must choose if article is a predefined product or not
ErrorDiscountLargerThanRemainToPaySplitItBefore=The discount you try to apply is larger than remain to pay. Split the discount in 2 smaller discounts before.
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@ -195,4 +195,6 @@ InventoryFlushed=Inventory flushed
ExitEditMode=Exit edition
inventoryDeleteLine=Delete line
RegulateStock=Regulate Stock
ListInventory=List
ListInventory=List
StockSupportServices=Stock management support services
StockSupportServicesDesc=By default, you can stock only product with type "product". If on, and if module service is on, you can also stock a product with type "service"

View File

@ -12,7 +12,7 @@ WithdrawalsLines=Direct debit order lines
RequestStandingOrderToTreat=Request for direct debit payment order to process
RequestStandingOrderTreated=Request for direct debit payment order processed
NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw status must be set to 'credited' before declaring reject on specific lines.
NbOfInvoiceToWithdraw=Nb. of invoice with direct debit order
NbOfInvoiceToWithdraw=Nb. of qualified invoice with waiting direct debit order
NbOfInvoiceToWithdrawWithInfo=Nb. of customer invoice with direct debit payment orders having defined bank account information
InvoiceWaitingWithdraw=Invoice waiting for direct debit
AmountToWithdraw=Amount to withdraw
@ -72,7 +72,7 @@ IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one
DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null.
WithdrawalFile=Withdrawal file
SetToStatusSent=Set to status "File Sent"
ThisWillAlsoAddPaymentOnInvoice=This will also apply payments to invoices and will classify them as "Paid"
ThisWillAlsoAddPaymentOnInvoice=This will also record payments to invoices and will classify them as "Paid" if remain to pay is null
StatisticsByLineStatus=Statistics by status of lines
RUM=UMR
RUMLong=Unique Mandate Reference
@ -94,6 +94,8 @@ SEPAFrstOrRecur=Type of payment
ModeRECUR=Reccurent payment
ModeFRST=One-off payment
PleaseCheckOne=Please check one only
DirectDebitOrderCreated=Direct debit order %s created
AmountRequested=Amount requested
### Notifications
InfoCreditSubject=Payment of direct debit payment order %s by the bank

View File

@ -1322,10 +1322,10 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php'.($ext?'?'.$ext:'').'"></script>'."\n";
// Add datepicker default options
if (! defined('DISABLE_DATE_PICKER'))
/*if (! defined('DISABLE_DATE_PICKER'))
{
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/datepicker.js.php?lang='.$langs->defaultlang.($ext?'&'.$ext:'').'"></script>'."\n";
}
}*/
// JS forced by modules (relative url starting with /)
if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))

View File

@ -238,6 +238,21 @@ foreach ($search_array_options as $key => $val)
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
/* If a group by is required
$sql.= " GROUP BY "
foreach($object->fields as $key => $val)
{
$sql.='t.'.$key.', ';
}
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
*/
$sql.=$db->order($sortfield,$sortorder);
// Count total nb of records

View File

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014-2015 Philippe Grand <philippe.grand@atoo-net.com>
@ -1171,7 +1171,7 @@ if ($action == 'edit_price' && $object->getRights()->creer)
}
print '</td>';
print '</tr>';
$parameters=array('colspan' => 2);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@ -1493,10 +1493,8 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0);
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -51,13 +51,13 @@ $hookmanager->initHooks(array (
$mesg = '';
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder)

View File

@ -48,11 +48,13 @@ $hookmanager->initHooks(array ('productstatspropal'));
$mesg = '';
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) { $page = 0;}
$offset = $conf->liste_limit * $page;
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder = "DESC";

View File

@ -48,11 +48,13 @@ $hookmanager->initHooks(array ('productstatspropal'));
$mesg = '';
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == - 1) { $page = 0;}
$offset = $conf->liste_limit * $page;
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder = "DESC";

View File

@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$langs->load('projects');
$langs->load('users');
@ -84,7 +85,7 @@ if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id)
$usertoprocess=$user;
$search_usertoprocessid=$usertoprocess->id;
}
elseif (search_usertoprocessid > 0)
elseif ($search_usertoprocessid > 0)
{
$usertoprocess=new User($db);
$usertoprocess->fetch($search_usertoprocessid);
@ -484,10 +485,17 @@ print "</tr>\n";
// By default, we can edit only tasks we are assigned to
$restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)?1:0);
// Get if user is available or not for each day
$holiday = new Holiday($db);
$isavailable=array();
$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse); // $daytoparse is a date with hours = 0
$isavailable[$daytoparse]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day
if (count($tasksarray) > 0)
{
$j=0;
projectLinesPerDay($j, 0, $usertoprocess, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $daytoparse);
projectLinesPerDay($j, 0, $usertoprocess, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $daytoparse, $isavailable);
$colspan = 8;
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) $colspan++;

View File

@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$langs->load('projects');
$langs->load('users');
@ -97,7 +98,7 @@ if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id)
$usertoprocess=$user;
$search_usertoprocessid=$usertoprocess->id;
}
elseif (search_usertoprocessid > 0)
elseif ($search_usertoprocessid > 0)
{
$usertoprocess=new User($db);
$usertoprocess->fetch($search_usertoprocessid);
@ -474,9 +475,25 @@ print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpent").'</td>'
$startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['first_day'], $startdayarray['first_year']);
for($i=0;$i<7;$i++)
// Get if user is available or not for each day
$holiday = new Holiday($db);
$isavailable=array();
for ($i=0;$i<7;$i++)
{
print '<td width="6%" align="center" class="hide'.$i.'">'.dol_print_date($startday + ($i * 3600 * 24), '%a').'<br>'.dol_print_date($startday + ($i * 3600 * 24), 'dayreduceformat').'</td>';
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $i, 'd'); // $firstdaytoshow is a date with hours = 0
$dayinloop = dol_time_plus_duree($startday, $i, 'd');
// Useless because $dayinloopwithouthours should be same than $dayinloopfromfirstdaytoshow
//$tmparray = dol_getdate($dayinloop);
//$dayinloopwithouthours=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
//print dol_print_date($dayinloop, 'dayhour').' ';
//print dol_print_date($dayinloopwithouthours, 'dayhour').' ';
//print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour').'<br>';
$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow);
$isavailable[$dayinloopfromfirstdaytoshow]=$isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day
print '<td width="6%" align="center" class="hide'.$i.'">'.dol_print_date($dayinloopfromfirstdaytoshow, '%a').'<br>'.dol_print_date($dayinloopfromfirstdaytoshow, 'dayreduceformat').'</td>';
}
print '<td></td>';
print "</tr>\n";
@ -491,7 +508,7 @@ if (count($tasksarray) > 0)
$j=0;
$level=0;
projectLinesPerWeek($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask);
projectLinesPerWeek($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable);
$colspan=7;
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) $colspan++;

View File

@ -237,9 +237,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
$sortorder = GETPOST("sortorder", 'alpha');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page", 'int');
if ($page == - 1) {
$page = 0;
}
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@ -387,12 +387,18 @@ input.buttonpaymentstripe {
background-repeat: no-repeat;
background-position: 8px 7px;
}
/* Used by timesheets */
span.timesheetalreadyrecorded input {
border: none;
border-bottom: solid 1px rgba(0,0,0,0.4);
margin-right: 1px !important;
}
td.onholidaymorning, td.onholidayafternoon {
background-color: #fdf6f2;
}
td.onholidayallday {
background-color: #f4eede;
}
select.flat, form.flat select {
font-weight: normal;
}

View File

@ -384,11 +384,18 @@ input.buttonpaymentstripe {
background-repeat: no-repeat;
background-position: 8px 7px;
}
/* Used for timesheets */
span.timesheetalreadyrecorded input {
border: none;
border-bottom: solid 1px rgba(0,0,0,0.1);
margin-right: 1px !important;
}
td.onholidaymorning, td.onholidayafternoon {
background-color: #fdf6f2;
}
td.onholidayallday {
background-color: #f4eede;
}
select.flat, form.flat select {
font-weight: normal;