Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf57e7e88b | ||
|
|
a186e16568 | ||
|
|
52138372ce | ||
|
|
a27538f582 | ||
|
|
a621032643 | ||
|
|
32646cb7f4 | ||
|
|
74b67eb6c6 | ||
|
|
644f365455 | ||
|
|
667890247c | ||
|
|
c727bbb530 | ||
|
|
e2b5315e23 | ||
|
|
2462daf1ed | ||
|
|
9c7381601f | ||
|
|
35a25599e5 | ||
|
|
9bfeb5e424 | ||
|
|
973a2ede97 | ||
|
|
d3fc152001 | ||
|
|
e8fd551043 | ||
|
|
34b3113bb7 | ||
|
|
90854dc2bf | ||
|
|
b44ddaa696 | ||
|
|
d10f277bba | ||
|
|
03a9daa3e6 | ||
|
|
e5193f16cc | ||
|
|
9abde6c057 | ||
|
|
a52ae607ba | ||
|
|
6aa8ba8935 | ||
|
|
5ad7894849 | ||
|
|
2c1571c514 | ||
|
|
f782ac6654 | ||
|
|
1e54e695b2 | ||
|
|
f2eb3c1a55 | ||
|
|
41a970c90f | ||
|
|
3d9b2a1676 | ||
|
|
7be0e0da1c | ||
|
|
bb01ad7d9a | ||
|
|
c81c91755d | ||
|
|
cd2b9538c1 | ||
|
|
eeaa4f8205 | ||
|
|
380cae761a | ||
|
|
192510316b | ||
|
|
6f83c8c6f3 | ||
|
|
8213756c37 | ||
|
|
a254412c61 | ||
|
|
cc1a3080d0 | ||
|
|
b5f887b3e4 | ||
|
|
694357d48e | ||
|
|
c4f80b4e71 | ||
|
|
ece9f3037a | ||
|
|
8dd44246b0 | ||
|
|
76470c9548 | ||
|
|
19be5f662d | ||
|
|
3eebbc0b14 | ||
|
|
87b187bded | ||
|
|
400f6b244b | ||
|
|
1129222064 | ||
|
|
7cb657c991 |
@@ -121,9 +121,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||
|
||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@@ -93,87 +93,88 @@ if ($conf->accounting->enabled)
|
||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
print "<br>\n"; print "<br>\n";
|
||||
if (!empty($user->rights->accounting->chartofaccount)){
|
||||
print "<br>\n"; print "<br>\n";
|
||||
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
if (!empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
if (!empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
}
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
// htdocs/admin/salaries.php
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->adherents->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
// htdocs/admin/salaries.php
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->adherents->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Step A - E
|
||||
|
||||
|
||||
@@ -123,9 +123,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@@ -494,6 +494,12 @@ $sql .= " ".MAIN_DB_PREFIX."bank as b";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND type = 'company'";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid";
|
||||
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListJoin', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " WHERE b.fk_account = ba.rowid";
|
||||
$sql .= " AND ba.entity IN (".getEntity('bank_account').")";
|
||||
if ($search_account > 0) $sql .= " AND b.fk_account = ".$search_account;
|
||||
@@ -1514,6 +1520,11 @@ if ($resql)
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Action edit/delete
|
||||
print '<td class="nowraponall" align="center">';
|
||||
// Transaction reconciliated or edit link
|
||||
|
||||
@@ -419,7 +419,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
// Quantity
|
||||
print '<td class="right">';
|
||||
print $qty[$key];
|
||||
print price($qty[$key], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
|
||||
// Percent;
|
||||
|
||||
@@ -468,10 +468,9 @@ class Translate
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found && !empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
||||
{
|
||||
if (!$found && !empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
|
||||
// Overwrite translation with database read
|
||||
$sql = "SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where lang='".$db->escape($this->defaultlang)."' OR lang IS NULL";
|
||||
$sql = "SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where (lang='".$db->escape($this->defaultlang)."' OR lang IS NULL)";
|
||||
$sql .= " AND entity IN (0, ".getEntity('overwrite_trans').")";
|
||||
$sql .= $db->order("lang", "DESC");
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@@ -390,7 +390,7 @@ class Utils
|
||||
if ($compression == 'none') fclose($handle);
|
||||
if ($compression == 'gz') gzclose($handle);
|
||||
if ($compression == 'bz') bzclose($handle);
|
||||
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error
|
||||
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg) || preg_match('/^\/\*M?!999999/', $errormsg)) { // Start of file is ok, NOT an error
|
||||
$errormsg = '';
|
||||
}
|
||||
else
|
||||
|
||||
@@ -64,6 +64,17 @@ function getDolGlobalInt($key)
|
||||
return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is Dolibarr module enabled
|
||||
* @param string $module module name to check
|
||||
* @return int
|
||||
*/
|
||||
function isModEnabled($module)
|
||||
{
|
||||
global $conf;
|
||||
return !empty($conf->$module->enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a DoliDB instance (database handler).
|
||||
*
|
||||
|
||||
@@ -388,7 +388,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_propale['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_propale['qty'];
|
||||
print price($product->stats_propale['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -406,7 +406,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_proposal_supplier['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_proposal_supplier['qty'];
|
||||
print price($product->stats_proposal_supplier['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -424,7 +424,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_commande['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_commande['qty'];
|
||||
print price($product->stats_commande['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -442,7 +442,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_commande_fournisseur['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_commande_fournisseur['qty'];
|
||||
print price($product->stats_commande_fournisseur['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -460,7 +460,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_facture['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_facture['qty'];
|
||||
print price($product->stats_facture['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -478,7 +478,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_facture_fournisseur['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_facture_fournisseur['qty'];
|
||||
print price($product->stats_facture_fournisseur['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -497,7 +497,7 @@ function show_stats_for_company($product, $socid)
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_contrat['nb'];
|
||||
print '</td><td class="right">';
|
||||
print $product->stats_contrat['qty'];
|
||||
print price($product->stats_contrat['qty'], 1, $langs, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@@ -1270,11 +1270,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo))
|
||||
|
||||
@@ -1653,11 +1653,9 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo))
|
||||
|
||||
@@ -1482,11 +1482,9 @@ class pdf_azur extends ModelePDFPropales
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo))
|
||||
|
||||
@@ -1556,11 +1556,9 @@ class pdf_cyan extends ModelePDFPropales
|
||||
{
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo))
|
||||
|
||||
@@ -72,7 +72,7 @@ class DolLogsCollector extends MessagesCollector
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$uselogfile = $conf->global->DEBUGBAR_USE_LOGFILE;
|
||||
$uselogfile = $conf->global->DEBUGBAR_USE_LOG_FILE;
|
||||
|
||||
if ($uselogfile)
|
||||
{
|
||||
|
||||
@@ -531,6 +531,9 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cf.fk_projet";
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql .= ' WHERE cf.fk_soc = s.rowid';
|
||||
$sql .= ' AND cf.entity IN ('.getEntity('supplier_order').')';
|
||||
if ($socid > 0) $sql .= " AND s.rowid = ".$socid;
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
@@ -531,11 +531,11 @@ class Productbatch extends CommonObject
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_lot as pl";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pl.fk_product";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_batch AS pb ON pl.batch = pb.batch";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock AS ps ON ps.rowid = pb.fk_product_stock";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock AS ps ON ps.rowid = pb.fk_product_stock AND ps.fk_product = ".((int) $fk_product);
|
||||
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
||||
$sql .= " AND pl.fk_product = ".$fk_product;
|
||||
$sql .= " AND pl.fk_product = ".((int) $fk_product);
|
||||
if ($fk_warehouse > 0) {
|
||||
$sql .= " AND ps.fk_entrepot = ".$fk_warehouse;
|
||||
$sql .= " AND ps.fk_entrepot = ".((int) $fk_warehouse);
|
||||
}
|
||||
if ($qty_min !== null) {
|
||||
$sql .= " AND pb.qty > ".$qty_min;
|
||||
|
||||
@@ -328,10 +328,14 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sqlfields = $sql; // $sql fields to remove for count total
|
||||
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
|
||||
if (!empty($searchCategoryProductList) || !empty($catid)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
$linktopfp = " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
$sql .= $linktopfp;
|
||||
// multilang
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang()."'";
|
||||
|
||||
@@ -426,8 +430,24 @@ $sql .= $db->order($sortfield, $sortorder);
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/'.preg_quote($linktopfp, '/').'/', '', $sqlforcount);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
||||
$resql = $db->query($sqlforcount);
|
||||
if ($resql) {
|
||||
$objforcount = $db->fetch_object($resql);
|
||||
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
/*
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
*/
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
{
|
||||
$page = 0;
|
||||
|
||||
@@ -620,6 +620,11 @@ $restrictviewformytask = ((!isset($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSI
|
||||
|
||||
// Get if user is available or not for each day
|
||||
$isavailable = array();
|
||||
|
||||
// Assume from Monday to Friday if conf empty or badly formed
|
||||
$numstartworkingday = 1;
|
||||
$numendworkingday = 5;
|
||||
|
||||
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
||||
{
|
||||
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
|
||||
|
||||
@@ -521,6 +521,11 @@ $startday = dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['
|
||||
|
||||
// Get if user is available or not for each day
|
||||
$isavailable = array();
|
||||
|
||||
// Assume from Monday to Friday if conf empty or badly formed
|
||||
$numstartworkingday = 1;
|
||||
$numendworkingday = 5;
|
||||
|
||||
if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
||||
{
|
||||
$tmparray = explode('-', $conf->global->MAIN_DEFAULT_WORKING_DAYS);
|
||||
@@ -530,7 +535,6 @@ if (!empty($conf->global->MAIN_DEFAULT_WORKING_DAYS))
|
||||
$numendworkingday = $tmparray[1];
|
||||
}
|
||||
}
|
||||
|
||||
for ($idw = 0; $idw < 7; $idw++)
|
||||
{
|
||||
$dayinloopfromfirstdaytoshow = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); // $firstdaytoshow is a date with hours = 0
|
||||
|
||||
@@ -279,7 +279,10 @@ if ($action == 'add')
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $adh);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$result = $adh->create($user);
|
||||
if (empty($error)) {
|
||||
$result = $adh->create($user);
|
||||
}
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
|
||||
@@ -1062,7 +1062,7 @@ class Thirdparties extends DolibarrApi
|
||||
{
|
||||
global $db, $conf;
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->facture->lire) {
|
||||
if (!DolibarrApiAccess::$user->rights->societe->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
if (empty($id)) {
|
||||
|
||||
@@ -327,7 +327,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
$holiday->id = $objp->rowid;
|
||||
$holiday->ref = $objp->rowid;
|
||||
$holiday->fk_type = $objp->fk_type;
|
||||
$nbopenedday = num_open_day($db->jdate($objp->date_debut), $db->jdate($objp->date_fin), 0, 1, $objp->halfday);
|
||||
$nbopenedday = num_open_day($db->jdate($objp->date_debut, 'gmt'), $db->jdate($objp->date_fin, 'gmt'), 0, 1, $objp->halfday);
|
||||
|
||||
print $holiday->getNomUrl(1);
|
||||
print '</td><td class="right" width="80px">'.dol_print_date($db->jdate($objp->date_debut), 'day')."</td>\n";
|
||||
|
||||
@@ -1905,7 +1905,7 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
|
||||
{
|
||||
@@ -1917,7 +1917,7 @@ else
|
||||
}
|
||||
}
|
||||
elseif ($caneditpassword && !$object->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("EditPassword").'</a></div>';
|
||||
}
|
||||
@@ -1930,7 +1930,7 @@ else
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||
}
|
||||
elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=password">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||
}
|
||||
@@ -1940,7 +1940,7 @@ else
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
}
|
||||
elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
@@ -1949,13 +1949,13 @@ else
|
||||
|
||||
// Enable user
|
||||
if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable">'.$langs->trans("Reactivate").'</a></div>';
|
||||
}
|
||||
// Disable user
|
||||
if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'">'.$langs->trans("DisableUser").'</a></div>';
|
||||
}
|
||||
@@ -1968,7 +1968,7 @@ else
|
||||
}
|
||||
// Delete
|
||||
if ($user->id <> $id && $candisableuser &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1)))
|
||||
{
|
||||
if ($user->admin || !$object->admin) // If user edited is admin, delete is possible on for an admin
|
||||
{
|
||||
|
||||