commit
df1895b8b0
@ -6,6 +6,10 @@ This directory contains ruleset files to use to develop Dolibarr EPR & CRM.
|
||||
To install/upgrade phpcs:
|
||||
> sudo pear upgrade PHP_CodeSniffer
|
||||
|
||||
To run phpcs:
|
||||
> cd dolibarrgitrepo
|
||||
> phpcs --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 .
|
||||
|
||||
Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with:
|
||||
* tab value to 4
|
||||
* path of code sniffer standard to dev/codesniffer
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowed"/>
|
||||
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning"/>
|
||||
</rule>
|
||||
|
||||
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
|
||||
@ -70,9 +68,6 @@
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<!--
|
||||
<rule ref="Generic.Commenting.Todo" />
|
||||
@ -125,13 +120,6 @@
|
||||
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
|
||||
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<!-- Disallow several spaces after comma -->
|
||||
<!-- We want to allow this because we want to be able to align params on several similare functions on different lines -->
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
|
||||
@ -141,7 +129,7 @@
|
||||
<!-- Tweaks to metrics -->
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="complexity" value="120" />
|
||||
<property name="complexity" value="150" />
|
||||
<property name="absoluteComplexity" value="300" />
|
||||
</properties>
|
||||
</rule>
|
||||
@ -179,7 +167,6 @@
|
||||
<rule ref="Generic.Strings.UnnecessaryStringConcat" />
|
||||
|
||||
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<!-- Disallow usage of tab -->
|
||||
|
||||
@ -488,11 +488,11 @@ if ($resql)
|
||||
// Action
|
||||
print '<td class="center">';
|
||||
if ($user->rights->accounting->chartofaccount) {
|
||||
print '<a href="./card.php?action=update&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
|
||||
print '<a class="editfielda" href="./card.php?action=update&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print ' ';
|
||||
print '<a href="./card.php?action=delete&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
|
||||
print '<a class="marginleftonly" href="./card.php?action=delete&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
@ -696,7 +696,7 @@ if ($id)
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
else print '<td> </td>';
|
||||
|
||||
// Delete link
|
||||
|
||||
@ -408,7 +408,7 @@ llxHeader('', $langs->trans('DictionaryAccountancyCategory'));
|
||||
|
||||
$titre = $langs->trans($tablib[$id]);
|
||||
$linkback = '';
|
||||
$titlepicto = 'title_setup';
|
||||
$titlepicto = 'title_accountancy';
|
||||
|
||||
print load_fiche_titre($titre, $linkback, $titlepicto);
|
||||
|
||||
@ -806,7 +806,7 @@ if ($id)
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
else print '<td> </td>';
|
||||
|
||||
// Delete link
|
||||
|
||||
@ -236,6 +236,7 @@ if (!empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
/* Set this option as a hidden option but keep it for some needs.
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
|
||||
@ -248,6 +249,7 @@ if (!empty($user->admin))
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
|
||||
|
||||
@ -657,7 +657,7 @@ if ($id)
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
else print '<td> </td>';
|
||||
|
||||
// Delete link
|
||||
|
||||
@ -362,7 +362,6 @@ if ($result)
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
|
||||
print '<br>';
|
||||
@ -412,7 +411,7 @@ if ($result)
|
||||
//print '<br><div class="center">'.$buttonsave.'</div>';
|
||||
|
||||
$texte = $langs->trans("ListOfProductsServices");
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';
|
||||
|
||||
@ -704,7 +704,7 @@ class BookKeeping extends CommonObject
|
||||
$sql .= ' WHERE 1 = 1';
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
if (null !== $ref) {
|
||||
$sql .= ' AND t.ref = '.'\''.$ref.'\'';
|
||||
$sql .= " AND t.ref = '".$this->db->escape($ref)."'";
|
||||
} else {
|
||||
$sql .= ' AND t.rowid = '.$id;
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ if ($result) {
|
||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
|
||||
@ -367,7 +367,7 @@ if ($result) {
|
||||
print '<td>';
|
||||
if ($product_static->id > 0) print $product_static->getNomUrl(1);
|
||||
if ($product_static->id > 0 && $objp->product_label) print '<br>';
|
||||
if ($objp->product_label) print $objp->product_label;
|
||||
if ($objp->product_label) print '<span class="opacitymedium">'.$objp->product_label.'</span>';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
|
||||
@ -567,12 +567,12 @@ if ($result) {
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
|
||||
// Found accounts
|
||||
print '<td style="'.$code_sell_p_notset.'">';
|
||||
print '<td>';
|
||||
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
|
||||
$shelp = '';
|
||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
|
||||
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
|
||||
$s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("NotDefined"));
|
||||
$s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
if ($objp->product_id > 0)
|
||||
{
|
||||
@ -583,7 +583,7 @@ if ($result) {
|
||||
elseif ($suggestedaccountingaccountfor == 'eecwithvat') $shelp = $langs->trans("SaleEECWithVAT");
|
||||
elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $shelp = $langs->trans("SaleEECWithoutVATNumber");
|
||||
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
|
||||
$s .= (empty($objp->code_sell_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_sell_p));
|
||||
$s .= (empty($objp->code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_sell_p));
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -88,7 +88,7 @@ if ($conf->accounting->enabled)
|
||||
}
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial);
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'title_accountancy', 0, '', '', $showtutorial);
|
||||
|
||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
@ -101,13 +101,13 @@ if ($conf->accounting->enabled)
|
||||
|
||||
// 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 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 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 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";
|
||||
@ -116,20 +116,20 @@ if ($conf->accounting->enabled)
|
||||
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 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 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>';
|
||||
$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>';
|
||||
$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";
|
||||
@ -145,7 +145,7 @@ if ($conf->accounting->enabled)
|
||||
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 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";
|
||||
}
|
||||
/*
|
||||
@ -169,7 +169,7 @@ if ($conf->accounting->enabled)
|
||||
}*/
|
||||
|
||||
$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 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";
|
||||
|
||||
|
||||
@ -186,17 +186,17 @@ if ($conf->accounting->enabled)
|
||||
$langs->loadLangs(array('bills', 'trips'));
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>'.'</a>')."\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>'.'</a>')."\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>'.'</a>')."\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -994,7 +994,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|
||||
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||
|
||||
@ -508,7 +508,7 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
|
||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
||||
}
|
||||
|
||||
@ -740,7 +740,7 @@ if (empty($action) || $action == 'view') {
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
||||
}
|
||||
@ -936,7 +936,7 @@ if (empty($action) || $action == 'view') {
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Purchase").')'.'</span>';
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Purchase").')</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
@ -959,15 +959,15 @@ if (empty($action) || $action == 'view') {
|
||||
foreach ($tabother[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<!-- VAT counterpart NPR -->";
|
||||
print '<!-- VAT counterpart NPR -->';
|
||||
print "<td>".$date."</td>";
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
print '<td>';
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
if ($accountoshow == '' || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("NPR counterpart").'). Set ACCOUNTING_COUNTERPART_VAT_NPR to the subvention account'.'</span>';
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("NPR counterpart").'). Set ACCOUNTING_COUNTERPART_VAT_NPR to the subvention account</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print '</td>';
|
||||
|
||||
@ -677,7 +677,7 @@ if (empty($action) || $action == 'view') {
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
|
||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
||||
}
|
||||
@ -874,7 +874,7 @@ if (empty($action) || $action == 'view') {
|
||||
$accountoshow = length_accountg($k);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Sale").')'.'</span>';
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Sale").')</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
|
||||
@ -313,7 +313,7 @@ if ($result) {
|
||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
||||
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
|
||||
// print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
|
||||
@ -376,7 +376,7 @@ if ($result) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
if ($product_static->id > 0) print $product_static->getNomUrl(1);
|
||||
if ($product_static->id > 0 && $objp->product_label) print '<br>';
|
||||
if ($objp->product_label) print $objp->product_label;
|
||||
if ($objp->product_label) print '<span class="opacitymedium">'.$objp->product_label.'</span>';
|
||||
print '</td>';
|
||||
|
||||
// Description
|
||||
@ -400,7 +400,7 @@ if ($result) {
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
|
||||
print '<td>';
|
||||
print $codecompta.' <a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print $codecompta.' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
|
||||
|
||||
@ -553,12 +553,12 @@ if ($result) {
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
|
||||
// Found accounts
|
||||
print '<td style="'.$code_buy_p_notset.'">';
|
||||
print '<td>';
|
||||
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
|
||||
$shelp = '';
|
||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
|
||||
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
|
||||
$s .= ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : $langs->trans("NotDefined"));
|
||||
$s .= ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : '<span style="'.$code_buy_p_notset.'">'.$langs->trans("NotDefined").'</span>');
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
if ($objp->product_id > 0)
|
||||
{
|
||||
@ -567,7 +567,7 @@ if ($result) {
|
||||
$shelp = '';
|
||||
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
|
||||
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
|
||||
$s .= (empty($objp->code_buy_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_buy_p));
|
||||
$s .= (empty($objp->code_buy_p) ? '<span style="'.$code_buy_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_buy_p));
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -60,6 +60,9 @@ class Adherent extends CommonObject
|
||||
*/
|
||||
public $ismultientitymanaged = 1;
|
||||
|
||||
public $picto = 'member';
|
||||
|
||||
|
||||
public $mesgs;
|
||||
|
||||
/**
|
||||
|
||||
@ -183,20 +183,14 @@ class AdherentType extends CommonObject
|
||||
$sql2 .= " SET ";
|
||||
$sql2 .= " label='".$this->db->escape($this->label)."',";
|
||||
$sql2 .= " description='".$this->db->escape($this->description)."'";
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", email='".$this->db->escape($this->other)."'";
|
||||
}
|
||||
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", email";
|
||||
}
|
||||
$sql2 .= ")";
|
||||
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
|
||||
$sql2 .= " '".$this->db->escape($this->description)."'";
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", '".$this->db->escape($this->other)."'";
|
||||
}
|
||||
$sql2 .= ")";
|
||||
}
|
||||
dol_syslog(get_class($this).'::setMultiLangs key = current_lang = '.$key);
|
||||
@ -219,20 +213,14 @@ class AdherentType extends CommonObject
|
||||
$sql2 .= " SET ";
|
||||
$sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", email='".$this->db->escape($this->multilangs["$key"]["other"])."'";
|
||||
}
|
||||
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", email";
|
||||
}
|
||||
$sql2 .= ")";
|
||||
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||
$sql2 .= " '".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'";
|
||||
}
|
||||
$sql2 .= ")";
|
||||
}
|
||||
|
||||
|
||||
@ -1718,7 +1718,7 @@ if ($id)
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
if ($canbemodified) print '<td align="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
if ($canbemodified) print '<td align="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
else print '<td> </td>';
|
||||
|
||||
// Delete link
|
||||
|
||||
@ -213,19 +213,17 @@ class Dolistore
|
||||
{
|
||||
$cat = $this->categories[$i];
|
||||
if ($cat->is_root_category == 1 && $parent == 0) {
|
||||
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" '
|
||||
.'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'"'
|
||||
.'>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
|
||||
$html .= self::get_categories($cat->id);
|
||||
$html .= "</li>\n";
|
||||
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" ';
|
||||
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
|
||||
$html .= self::get_categories($cat->id);
|
||||
$html .= "</li>\n";
|
||||
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
|
||||
$select = ($cat->id == $this->categorie) ? ' selected' : '';
|
||||
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"'
|
||||
.' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" '
|
||||
.'>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
|
||||
$html .= self::get_categories($cat->id);
|
||||
$html .= "</li>\n";
|
||||
} else {
|
||||
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"';
|
||||
$html .= ' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" ';
|
||||
$html .= '>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
|
||||
$html .= self::get_categories($cat->id);
|
||||
$html .= "</li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,8 +267,8 @@ class Dolistore
|
||||
// add image or default ?
|
||||
if ($product->id_default_image != '') {
|
||||
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
|
||||
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">'.
|
||||
'<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
|
||||
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">';
|
||||
$images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
|
||||
} else {
|
||||
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
|
||||
}
|
||||
|
||||
@ -368,20 +368,20 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
if (file_exists($dir.'/'.$file))
|
||||
{
|
||||
$name = substr($file, 4, dol_strlen($file) -16);
|
||||
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $classname($db);
|
||||
|
||||
$modulequalified=1;
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name)?$name:$module->name);
|
||||
print (empty($module->name) ? $name : $module->name);
|
||||
print "</td><td>\n";
|
||||
if (method_exists($module, 'info')) print $module->info($langs);
|
||||
else print $module->description;
|
||||
|
||||
@ -240,9 +240,9 @@ dol_syslog("select rss boxes", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$boxlist = InfoBox::listBoxes($db, 'activated', -1, null);
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$boxlist = InfoBox::listBoxes($db, 'activated', -1, null);
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
@ -271,19 +271,19 @@ if ($resql)
|
||||
print '<input type="submit" class="button buttongen" name="delete" value="'.$langs->trans("Delete").'">';
|
||||
print '<input type="hidden" name="norss" value="'.$idrss.'">';
|
||||
print '</td>';
|
||||
print "</tr>"."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td width=\"100px\">".$langs->trans("Title")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_title_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrsstitle)."\"></td>";
|
||||
print "</tr>"."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>".$langs->trans("URL")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_urlrss_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrssurl)."\"></td>";
|
||||
print "</tr>"."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -301,7 +301,7 @@ if ($resql)
|
||||
print '</div>';
|
||||
}
|
||||
print "</td>";
|
||||
print "</tr>"."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Logo
|
||||
if ($result > 0 && empty($rss->error))
|
||||
@ -315,7 +315,7 @@ if ($resql)
|
||||
if ($imageurl) print '<img height="32" src="'.$imageurl.'">';
|
||||
else print $langs->trans("None");
|
||||
print '</td>';
|
||||
print "</tr>"."\n";
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
|
||||
// Active
|
||||
@ -323,11 +323,11 @@ if ($resql)
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans('WidgetEnabled').'</td>';
|
||||
print '<td>'.yn($active).'</td>';
|
||||
print "</tr>"."\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
print "</form>"."\n";
|
||||
print "</form>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -350,9 +350,9 @@ $db->close();
|
||||
*/
|
||||
function _isInBoxList($idrss, array $boxlist)
|
||||
{
|
||||
foreach($boxlist as $box)
|
||||
foreach ($boxlist as $box)
|
||||
{
|
||||
if($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false)
|
||||
if ($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -160,7 +160,6 @@ if ($action == 'update')
|
||||
|
||||
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
|
||||
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
|
||||
@ -278,8 +277,10 @@ print '</tr>';
|
||||
// Disable javascript and ajax
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DisableJavascript").'</td><td>';
|
||||
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print ' <span class="opacitymedium"> '.$langs->trans("DisableJavascriptNote").'</span>';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Max size of lists
|
||||
@ -392,6 +393,13 @@ print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("LoginPage
|
||||
print '<th width="20"> </th>';
|
||||
print '</tr>';
|
||||
|
||||
// Hide helpcenter link on login page
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
|
||||
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Message on login page
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
@ -407,13 +415,6 @@ $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf
|
||||
$doleditor->Create();
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Hide helpcenter link on login page
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
|
||||
print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK', isset($conf->global->MAIN_HELPCENTER_DISABLELINK) ? $conf->global->MAIN_HELPCENTER_DISABLELINK : 0, 1);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Background
|
||||
print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
|
||||
print '<div class="centpercent inline-block">';
|
||||
|
||||
@ -536,7 +536,7 @@ $errors = $hookmanager->errors;
|
||||
|
||||
|
||||
// Line to enter new values (input fields)
|
||||
print "<tr ".$bcnd[$var].">";
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
@ -976,12 +976,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
global $conf, $langs, $user, $db;
|
||||
global $form;
|
||||
global $region_id;
|
||||
global $elementList, $sourceList, $localtax_typeList;
|
||||
global $bc;
|
||||
global $elementList, $sourceList;
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
|
||||
@ -325,6 +325,22 @@ if ($conf->use_javascript_ajax)
|
||||
if (!empty($menu['langs'])) $langs->load($menu['langs']);
|
||||
$titre = $langs->trans($menu['titre']);
|
||||
|
||||
$entry = '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
$entry .= '<strong> <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>';
|
||||
$entry .= '</td><td class="right">';
|
||||
$entry .= '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> ';
|
||||
$entry .= '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> ';
|
||||
$entry .= '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> ';
|
||||
$entry .= ' ';
|
||||
$entry .= '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
|
||||
$entry .= '</td></tr></table>';
|
||||
|
||||
$buttons = '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> ';
|
||||
$buttons .= '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> ';
|
||||
$buttons .= '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> ';
|
||||
$buttons .= ' ';
|
||||
$buttons .= '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
|
||||
|
||||
$data[] = array(
|
||||
'rowid'=>$menu['rowid'],
|
||||
'module'=>$menu['module'],
|
||||
@ -335,20 +351,8 @@ if ($conf->use_javascript_ajax)
|
||||
'fk_mainmenu'=>$menu['fk_mainmenu'],
|
||||
'fk_leftmenu'=>$menu['fk_leftmenu'],
|
||||
'position'=>$menu['position'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.
|
||||
'<strong> <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'.
|
||||
'</td><td class="right">'.
|
||||
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
|
||||
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> '.
|
||||
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> '.
|
||||
' '.
|
||||
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>'.
|
||||
'</td></tr></table>',
|
||||
'buttons'=>'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
|
||||
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> '.
|
||||
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> '.
|
||||
' '.
|
||||
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>'
|
||||
'entry'=>$entry,
|
||||
'buttons'=>$buttons
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@ if ($mode == 'feature')
|
||||
$filedata = dol_buildpath($moduledir.'/sql/data.sql');
|
||||
if (dol_is_file($filedata))
|
||||
{
|
||||
$text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql'.')';
|
||||
$text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql)';
|
||||
}
|
||||
else $text .= $langs->trans("No");
|
||||
|
||||
|
||||
@ -48,19 +48,19 @@ $action = GETPOST('action', 'aZ09');
|
||||
if ($action == 'update' || $action == 'add')
|
||||
{
|
||||
$constlineid = GETPOST('rowid', 'int');
|
||||
$constname=GETPOST('constname', 'alpha');
|
||||
$constname = GETPOST('constname', 'alpha');
|
||||
|
||||
$constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
|
||||
$consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
|
||||
$constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
|
||||
$constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
|
||||
$consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
|
||||
$constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
|
||||
|
||||
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
|
||||
|
||||
$res=dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
if (!$res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
if (!$error)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
@ -183,7 +183,7 @@ $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
// Editing global variables not related to a specific theme
|
||||
$constantes=array();
|
||||
$constantes = array();
|
||||
foreach ($listofnotifiedevents as $notifiedevent)
|
||||
{
|
||||
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
|
||||
@ -210,7 +210,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
$constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
|
||||
}
|
||||
|
||||
$helptext='';
|
||||
$helptext = '';
|
||||
form_constantes($constantes, 0, $helptext);
|
||||
} else {
|
||||
print '<table class="noborder centpercent">';
|
||||
@ -265,7 +265,7 @@ print '<td>'.$langs->trans("Code").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
|
||||
print '<td>'.$langs->trans("Threshold").'</td>';
|
||||
print '<td>'.'</td>';
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($listofnotifiedevents as $notifiedevent)
|
||||
|
||||
@ -66,7 +66,7 @@ if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
|
||||
else
|
||||
{
|
||||
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
|
||||
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
|
||||
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
@ -123,7 +123,7 @@ if (!$foundcache && $test)
|
||||
{
|
||||
$foundcache++;
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "XCache");
|
||||
print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php'.'">Xcache admin page</a>';
|
||||
print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php">Xcache admin page</a>';
|
||||
}
|
||||
$test = function_exists('eaccelerator_info');
|
||||
if (!$foundcache && $test)
|
||||
|
||||
@ -303,7 +303,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
|
||||
print '<br>';
|
||||
print '<fieldset><legend>'.$langs->trans('ExportStructure').'</legend>';
|
||||
print '<input type="checkbox" name="nobin_drop"'.((!isset($_GET["nobin_drop"]) && !isset($_POST["nobin_drop"])) || GETPOST('nobin_drop')) ? ' checked' : ''.' id="checkbox_dump_drop" />';
|
||||
print '<input type="checkbox" name="nobin_drop"'.((! GETPOSTISSET("nobin_drop") || GETPOST('nobin_drop')) ? ' checked' : '').' id="checkbox_dump_drop" />';
|
||||
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
|
||||
print '<br>';
|
||||
print '</fieldset>';
|
||||
|
||||
@ -85,11 +85,11 @@ $workflowcodes = array(
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify_order', 'position'=>41, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order', 'warning'=>''), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
|
||||
'separator2'=>array('family'=>'separator', 'position'=>50),
|
||||
// Automatic classification supplier proposal
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && ! empty($conf->fournisseur->enabled)', 'picto'=>'propal', 'warning'=>''),
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'propal', 'warning'=>''),
|
||||
// Automatic classification supplier order
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'! empty($conf->fournisseur->enabled)', 'picto'=>'order', 'warning'=>''),
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)', 'picto'=>'order', 'warning'=>''),
|
||||
//Automatic classification reception
|
||||
'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && ! empty($conf->fournisseur->enabled)', 'picto'=>'bill'),
|
||||
'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'bill'),
|
||||
);
|
||||
|
||||
if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))
|
||||
|
||||
@ -137,6 +137,15 @@ class DolibarrApi
|
||||
unset($object->labelStatus);
|
||||
unset($object->labelStatusShort);
|
||||
|
||||
unset($object->stats_propale);
|
||||
unset($object->stats_commande);
|
||||
unset($object->stats_contrat);
|
||||
unset($object->stats_facture);
|
||||
unset($object->stats_commande_fournisseur);
|
||||
unset($object->stats_reception);
|
||||
unset($object->stats_mrptoconsume);
|
||||
unset($object->stats_mrptoproduce);
|
||||
|
||||
unset($object->element);
|
||||
unset($object->fk_element);
|
||||
unset($object->table_element);
|
||||
|
||||
@ -1426,7 +1426,7 @@ class Setup extends DolibarrApi
|
||||
throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK');
|
||||
}
|
||||
|
||||
if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || ! isset($conf->global->$constantname)) {
|
||||
if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) {
|
||||
throw new RestException(500, 'Error Bad or unknown value for constantname');
|
||||
}
|
||||
if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) {
|
||||
|
||||
@ -34,15 +34,18 @@ $langs->loadLangs(array("asset"));
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new Asset($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('assetcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
@ -59,23 +62,20 @@ foreach ($object->fields as $key => $val)
|
||||
|
||||
if (empty($action) && empty($id) && empty($ref)) $action = 'view';
|
||||
|
||||
// Security check - Protection if external user
|
||||
//if ($user->socid > 0) accessforbidden();
|
||||
//if ($user->socid > 0) $socid = $user->socid;
|
||||
//$result = restrictedArea($user, 'asset', $id);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||
|
||||
|
||||
$permissiontoread = $user->rights->asset->read;
|
||||
$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
$permissiontodelete = $user->rights->asset->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||
$permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php
|
||||
$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
*/
|
||||
|
||||
$parameters = array();
|
||||
@ -86,16 +86,35 @@ if (empty($reshook))
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
$permissiontoadd = $user->rights->asset->create;
|
||||
$permissiontodelete = $user->rights->asset->delete;
|
||||
$backurlforlist = dol_buildpath('/asset/list.php', 1);
|
||||
|
||||
// Actions cancel, add, update or delete
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
// Actions when linking object each other
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
|
||||
|
||||
// Actions when printing a doc from card
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||
|
||||
// Action to move up and down lines of object
|
||||
//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
|
||||
|
||||
// Action to build doc
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
if ($action == 'set_thirdparty' && $permissiontoadd)
|
||||
{
|
||||
$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MYOBJECT_MODIFY');
|
||||
}
|
||||
if ($action == 'classin' && $permissiontoadd)
|
||||
{
|
||||
$object->setProject(GETPOST('projectid', 'int'));
|
||||
}
|
||||
|
||||
// Actions to send emails
|
||||
$triggersendname = 'ASSET_SENTBYMAIL';
|
||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
|
||||
@ -143,11 +162,12 @@ if ($action == 'create')
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
|
||||
dol_fiche_head(array(), '');
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
print '<table class="border centpercent tableforfieldcreate">'."\n";
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
|
||||
@ -166,6 +186,8 @@ if ($action == 'create')
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
//dol_set_focus('input[name="ref"]');
|
||||
}
|
||||
|
||||
// Part to edit record
|
||||
@ -178,10 +200,12 @@ if (($id || $ref) && $action == 'edit')
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
print '<table class="border centpercent tableforfieldedit">'."\n";
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
|
||||
@ -206,7 +230,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = asset_prepare_head($object);
|
||||
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
|
||||
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, $object->picto);
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
@ -255,10 +279,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<table class="border centpercent">'."\n";
|
||||
|
||||
// Common attributes
|
||||
//$keyforbreak='fieldkeytoswithonsecondcolumn';
|
||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just after this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_soc']); // Hide field already shown in banner
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
@ -266,7 +292,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div><br>';
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@ -349,14 +375,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
//Select mail models is same action as presend
|
||||
/*
|
||||
if (GETPOST('modelselected')) $action = 'presend';
|
||||
|
||||
// Presend form
|
||||
$modelmail='inventory';
|
||||
/*
|
||||
$modelmail='asset';
|
||||
$defaulttopic='InformationMessage';
|
||||
$diroutput = $conf->product->dir_output.'/inventory';
|
||||
$trackid = 'stockinv'.$object->id;
|
||||
$diroutput = $conf->asset->dir_output.'/asset';
|
||||
$trackid = 'asset'.$object->id;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
*/
|
||||
|
||||
@ -77,12 +77,12 @@ class Asset extends CommonObject
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
|
||||
'ref' => array('type'=>'varchar(10)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object",),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text",),
|
||||
'ref' => array('type'=>'varchar(10)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>1),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1),
|
||||
'amount_ht' => array('type'=>'double(24,8)', 'label'=>'AmountHTShort', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
|
||||
'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
|
||||
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",),
|
||||
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",),
|
||||
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>90, 'notnull'=>-1,),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>-1,),
|
||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,),
|
||||
|
||||
@ -202,7 +202,7 @@ class AssetType extends CommonObject
|
||||
$action = 'update';
|
||||
|
||||
// Actions on extra fields
|
||||
if (! $error)
|
||||
if (!$error)
|
||||
{
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
|
||||
@ -223,20 +223,20 @@ if ($action === 'downloadblockchain') {
|
||||
{
|
||||
$statusofrecordnote = $langs->trans("PreviousFingerprint").': '.$previoushash.($statusofrecordnote ? ' - '.$statusofrecordnote : '');
|
||||
}
|
||||
print $obj->rowid
|
||||
.';'.$obj->date_creation
|
||||
.';"'.$obj->user_fullname.'"'
|
||||
.';'.$obj->action
|
||||
.';'.$obj->element
|
||||
.';'.$obj->amounts
|
||||
.';'.$obj->fk_object
|
||||
.';'.$obj->date_object
|
||||
.';"'.$obj->ref_object.'"'
|
||||
.';'.$obj->signature
|
||||
.';'.$statusofrecord
|
||||
.';'.$statusofrecordnote
|
||||
.';"'.str_replace('"', '""', $obj->object_data).'"'
|
||||
."\n";
|
||||
print $obj->rowid;
|
||||
print ';'.$obj->date_creation;
|
||||
print ';"'.str_replace('"', '""', $obj->user_fullname).'"';
|
||||
print ';'.$obj->action;
|
||||
print ';'.$obj->element;
|
||||
print ';'.$obj->amounts;
|
||||
print ';'.$obj->fk_object;
|
||||
print ';'.$obj->date_object;
|
||||
print ';"'.str_replace('"', '""', $obj->ref_object).'"';
|
||||
print ';'.$obj->signature;
|
||||
print ';'.$statusofrecord;
|
||||
print ';'.$statusofrecordnote;
|
||||
print ';"'.str_replace('"', '""', $obj->object_data).'"';
|
||||
print "\n";
|
||||
|
||||
// Set new previous hash for next fetch
|
||||
$previoushash = $obj->signature;
|
||||
|
||||
@ -44,26 +44,26 @@ $signature = GETPOST('s');
|
||||
$newblock = GETPOST('b');
|
||||
$hash = GETPOST('h');
|
||||
|
||||
if($auth->fetch(0, $signature)<=0) {
|
||||
if ($auth->fetch(0, $signature) <= 0) {
|
||||
$auth->signature = $signature;
|
||||
$auth->create($user);
|
||||
}
|
||||
|
||||
|
||||
if(!empty($hash)) {
|
||||
if (!empty($hash)) {
|
||||
echo $auth->checkBlockchain($hash) ? 'hashisok' : 'hashisjunk';
|
||||
}
|
||||
elseif(!empty($newblock)){
|
||||
if($auth->checkBlock($newblock)) {
|
||||
elseif (!empty($newblock)) {
|
||||
if ($auth->checkBlock($newblock)) {
|
||||
$auth->addBlock($newblock);
|
||||
$auth->update($user);
|
||||
|
||||
echo 'blockadded';
|
||||
}
|
||||
else{
|
||||
else {
|
||||
echo 'blockalreadyadded';
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
echo 'idontunderstandwhatihavetodo';
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ $ilink = 0;
|
||||
foreach ($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
$product_static= new Product($db);
|
||||
$product_static = new Product($db);
|
||||
$trclass = 'oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total';
|
||||
echo '<tr class="'.$trclass.'" >';
|
||||
|
||||
@ -74,7 +74,7 @@ if ($nolinesbefore) {
|
||||
print '<td class="linecoledit" colspan="'.$colspan.'"> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr class="pair nodrag nodrop nohoverpair'.($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create'.'">';
|
||||
print '<tr class="pair nodrag nodrop nohoverpair'.(($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create').'">';
|
||||
$coldisplay = 0;
|
||||
|
||||
// Adds a line numbering column
|
||||
|
||||
@ -32,23 +32,23 @@
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// Get list of articles (in warehouse '$conf_fkentrepot' if defined and stock module enabled)
|
||||
if ( GETPOST('filtre', 'alpha') ) {
|
||||
if (GETPOST('filtre', 'alpha')) {
|
||||
// Avec filtre
|
||||
$ret=array(); $i=0;
|
||||
$ret = array(); $i = 0;
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product').")";
|
||||
$sql.= " AND p.tosell = 1";
|
||||
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
|
||||
$sql.= " AND (";
|
||||
$sql.= "p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'";
|
||||
if (! empty($conf->barcode->enabled))
|
||||
if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= ", ps.reel";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
||||
$sql .= " AND p.tosell = 1";
|
||||
if (!$conf->global->CASHDESK_SERVICES) $sql .= " AND p.fk_product_type = 0";
|
||||
$sql .= " AND (";
|
||||
$sql .= "p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'";
|
||||
if (!empty($conf->barcode->enabled))
|
||||
{
|
||||
$filtre = GETPOST('filtre', 'alpha');
|
||||
|
||||
@ -85,23 +85,23 @@ if ( GETPOST('filtre', 'alpha') ) {
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$tab_designations=$ret;
|
||||
$tab_designations = $ret;
|
||||
} else {
|
||||
// Sans filtre
|
||||
$ret=array();
|
||||
$i=0;
|
||||
$ret = array();
|
||||
$i = 0;
|
||||
|
||||
$sql = "SELECT p.rowid, ref, label, tva_tx, p.fk_product_type";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product').")";
|
||||
$sql.= " AND p.tosell = 1";
|
||||
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
|
||||
$sql.= " ORDER BY p.label";
|
||||
if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= ", ps.reel";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
||||
$sql .= " AND p.tosell = 1";
|
||||
if (!$conf->global->CASHDESK_SERVICES) $sql .= " AND p.fk_product_type = 0";
|
||||
$sql .= " ORDER BY p.label";
|
||||
|
||||
dol_syslog($sql);
|
||||
$resql=$db->query($sql);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nbr_enreg = $db->num_rows($resql);
|
||||
|
||||
@ -184,9 +184,7 @@ foreach ($fulltree as $key => $val)
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_parent'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.'</span></td>'.$counter.
|
||||
//'<td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
|
||||
'<td class="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
|
||||
'</tr></table>'
|
||||
'<td class="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td></tr></table>'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -166,12 +166,12 @@ class CActionComm
|
||||
|
||||
if ($qualified && $obj->module)
|
||||
{
|
||||
if ($obj->module == 'invoice' && !$conf->facture->enabled) $qualified = 0;
|
||||
if ($obj->module == 'order' && !$conf->commande->enabled) $qualified = 0;
|
||||
if ($obj->module == 'propal' && !$conf->propal->enabled) $qualified = 0;
|
||||
if ($obj->module == 'invoice_supplier' && !$conf->fournisseur->enabled) $qualified = 0;
|
||||
if ($obj->module == 'order_supplier' && !$conf->fournisseur->enabled) $qualified = 0;
|
||||
if ($obj->module == 'shipping' && !$conf->expedition->enabled) $qualified = 0;
|
||||
if ($obj->module == 'invoice' && !$conf->facture->enabled) $qualified=0;
|
||||
if ($obj->module == 'order' && !$conf->commande->enabled) $qualified=0;
|
||||
if ($obj->module == 'propal' && !$conf->propal->enabled) $qualified=0;
|
||||
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ! $conf->supplier_invoice->enabled)) $qualified=0;
|
||||
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ! $conf->supplier_order->enabled)) $qualified=0;
|
||||
if ($obj->module == 'shipping' && !$conf->expedition->enabled) $qualified=0;
|
||||
}
|
||||
|
||||
if ($qualified)
|
||||
|
||||
@ -35,7 +35,7 @@ if (!empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/cl
|
||||
if (!empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
if (!empty($conf->supplier_proposal->enabled)) require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||
if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
if (!empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_order->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
|
||||
if (!$user->rights->societe->lire) accessforbidden();
|
||||
|
||||
@ -76,7 +76,7 @@ $companystatic = new Societe($db);
|
||||
if (!empty($conf->propal->enabled)) $propalstatic = new Propal($db);
|
||||
if (!empty($conf->supplier_proposal->enabled)) $supplierproposalstatic = new SupplierProposal($db);
|
||||
if (!empty($conf->commande->enabled)) $orderstatic = new Commande($db);
|
||||
if (!empty($conf->fournisseur->enabled)) $supplierorderstatic = new CommandeFournisseur($db);
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) $supplierorderstatic = new CommandeFournisseur($db);
|
||||
|
||||
llxHeader("", $langs->trans("CommercialArea"));
|
||||
|
||||
@ -102,7 +102,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
||||
$listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort');
|
||||
}
|
||||
// Search supplier order
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire)
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
$listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder');
|
||||
}
|
||||
@ -414,7 +414,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
/*
|
||||
* Draft suppliers orders
|
||||
*/
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire)
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
$langs->load("orders");
|
||||
|
||||
@ -581,7 +581,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
|
||||
}
|
||||
|
||||
// Last suppliers
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
|
||||
|
||||
@ -147,15 +147,15 @@ if ($action == 'add') {
|
||||
if (preg_match("/st_dt/", $key)) {
|
||||
$dtarr = array();
|
||||
$dtarr = explode('_', $key);
|
||||
if (!array_key_exists('options_'.$dtarr[1].'_st_dt'.'_cnct', $array_query)) {
|
||||
$array_query['options_'.$dtarr[1].'_st_dt'.'_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear'.'_cnct', 'int'));
|
||||
if (!array_key_exists('options_'.$dtarr[1].'_st_dt_cnct', $array_query)) {
|
||||
$array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear_cnct', 'int'));
|
||||
}
|
||||
} elseif (preg_match("/end_dt/", $key)) {
|
||||
// Special case for end date come with 3 inputs day, month, year
|
||||
$dtarr = array();
|
||||
$dtarr = explode('_', $key);
|
||||
if (!array_key_exists('options_'.$dtarr[1].'_end_dt'.'_cnct', $array_query)) {
|
||||
$array_query['options_'.$dtarr[1].'_end_dt'.'_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear'.'_cnct', 'int'));
|
||||
if (!array_key_exists('options_'.$dtarr[1].'_end_dt_cnct', $array_query)) {
|
||||
$array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear_cnct', 'int'));
|
||||
}
|
||||
} else {
|
||||
$array_query[$key] = GETPOST($key);
|
||||
@ -299,15 +299,15 @@ if ($action == 'savefilter' || $action == 'createfilter') {
|
||||
if (preg_match("/st_dt/", $key)) {
|
||||
$dtarr = array();
|
||||
$dtarr = explode('_', $key);
|
||||
if (!array_key_exists('options_'.$dtarr[1].'_st_dt'.'_cnct', $array_query)) {
|
||||
$array_query['options_'.$dtarr[1].'_st_dt'.'_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear'.'_cnct', 'int'));
|
||||
if (!array_key_exists('options_'.$dtarr[1].'_st_dt_cnct', $array_query)) {
|
||||
$array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear_cnct', 'int'));
|
||||
}
|
||||
} elseif (preg_match("/end_dt/", $key)) {
|
||||
// Special case for end date come with 3 inputs day, month, year
|
||||
$dtarr = array();
|
||||
$dtarr = explode('_', $key);
|
||||
if (!array_key_exists('options_'.$dtarr[1].'_end_dt'.'_cnct', $array_query)) {
|
||||
$array_query['options_'.$dtarr[1].'_end_dt'.'_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear'.'_cnct', 'int'));
|
||||
if (!array_key_exists('options_'.$dtarr[1].'_end_dt_cnct', $array_query)) {
|
||||
$array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear_cnct', 'int'));
|
||||
// print $array_query['cnct_options_'.$dtarr[1].'_end_dt'];
|
||||
// 01/02/1013=1361228400
|
||||
}
|
||||
|
||||
@ -724,13 +724,13 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
}
|
||||
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_max'.'_cnct'])) {
|
||||
$sqlwhere[] = " (te.".$key." >= ".$arrayquery['options_'.$key.'_max'.'_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'.'_cnct'].")";
|
||||
if (!empty($arrayquery['options_'.$key.'_max_cnct'])) {
|
||||
$sqlwhere[] = " (te.".$key." >= ".$arrayquery['options_'.$key.'_max_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min_cnct'].")";
|
||||
}
|
||||
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
|
||||
($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
|
||||
if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])) {
|
||||
$sqlwhere[] = " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')";
|
||||
if (!empty($arrayquery['options_'.$key.'_end_dt_cnct'])) {
|
||||
$sqlwhere[] = " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt_cnct'])."')";
|
||||
}
|
||||
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
|
||||
if ($arrayquery['options_'.$key.'_cnct'] != '') {
|
||||
|
||||
@ -1448,8 +1448,6 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans('Proposal'), 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
@ -1458,6 +1456,9 @@ $formmargin = new FormMargin($db);
|
||||
$companystatic = new Societe($db);
|
||||
if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
|
||||
|
||||
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
|
||||
llxHeader('', $langs->trans('Proposal'), $help_url);
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
// Add new proposal
|
||||
@ -1465,7 +1466,7 @@ if ($action == 'create')
|
||||
{
|
||||
$currency_code = $conf->currency;
|
||||
|
||||
print load_fiche_titre($langs->trans("NewProp"));
|
||||
print load_fiche_titre($langs->trans("NewProp"), '', 'propal');
|
||||
|
||||
$soc = new Societe($db);
|
||||
if ($socid > 0)
|
||||
|
||||
@ -2999,8 +2999,11 @@ class Propal extends CommonObject
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$main = MAIN_DB_PREFIX . 'propaldet';
|
||||
$ef = $main . "_extrafields";
|
||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_propal = " . $this->id . ")";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
if ($this->db->query($sqlef) && $this->db->query($sql))
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propal WHERE rowid = ".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
|
||||
@ -58,7 +58,7 @@ $help_url = "EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|
|
||||
|
||||
llxHeader("", $langs->trans("ProspectionArea"), $help_url);
|
||||
|
||||
print load_fiche_titre($langs->trans("ProspectionArea"), '', 'commercial');
|
||||
print load_fiche_titre($langs->trans("ProspectionArea"), '', 'propal');
|
||||
|
||||
//print '<table width="100%" class="notopnoleftnoright">';
|
||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
|
||||
@ -496,7 +496,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'propal', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$topicmail = "SendPropalRef";
|
||||
$modelmail = "proposal_send";
|
||||
|
||||
@ -67,20 +67,19 @@ $formpropal = new FormPropal($db);
|
||||
|
||||
$langs->loadLangs(array('propal', 'other', 'companies'));
|
||||
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
$title = $langs->trans("ProposalsStatistics");
|
||||
$dir = $conf->propale->dir_temp;
|
||||
}
|
||||
$picto = 'propal';
|
||||
$title = $langs->trans("ProposalsStatistics");
|
||||
$dir = $conf->propale->dir_temp;
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$picto = 'supplier_proposal';
|
||||
$title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")";
|
||||
$dir = $conf->supplier_proposal->dir_temp;
|
||||
}
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
print load_fiche_titre($title, '', 'commercial');
|
||||
print load_fiche_titre($title, '', $picto);
|
||||
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
@ -1493,7 +1493,7 @@ if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
|
||||
// Mode creation
|
||||
if ($action == 'create' && $usercancreate)
|
||||
{
|
||||
print load_fiche_titre($langs->trans('CreateOrder'), '', 'commercial');
|
||||
print load_fiche_titre($langs->trans('CreateOrder'), '', 'order');
|
||||
|
||||
$soc = new Societe($db);
|
||||
if ($socid > 0)
|
||||
|
||||
@ -33,7 +33,8 @@ class Orders extends DolibarrApi
|
||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||
*/
|
||||
static $FIELDS = array(
|
||||
'socid'
|
||||
'socid',
|
||||
'date'
|
||||
);
|
||||
|
||||
/**
|
||||
@ -233,7 +234,9 @@ class Orders extends DolibarrApi
|
||||
}
|
||||
|
||||
/**
|
||||
* Create order object
|
||||
* Create a sale order
|
||||
*
|
||||
* Exemple: { "socid": 2, "date": 1595196000, "type": 0, "lines": [{ "fk_product": 2, "qty": 1 }] }
|
||||
*
|
||||
* @param array $request_data Request data
|
||||
* @return int ID of order
|
||||
|
||||
@ -3409,6 +3409,19 @@ class Commande extends CommonOrder
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
// Delete extrafields of order details
|
||||
$main = MAIN_DB_PREFIX . 'commandedet';
|
||||
$ef = $main . "_extrafields";
|
||||
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = " . $this->id . ")";
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$error++;
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
// Delete order details
|
||||
|
||||
@ -64,7 +64,7 @@ $help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_P
|
||||
llxHeader("", $langs->trans("Orders"), $help_url);
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("OrdersArea"), '', 'commercial');
|
||||
print load_fiche_titre($langs->trans("OrdersArea"), '', 'order');
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
@ -106,6 +106,7 @@ if ($resql)
|
||||
$total = 0;
|
||||
$totalinprocess = 0;
|
||||
$dataseries = array();
|
||||
$colorseries = array();
|
||||
$vals = array();
|
||||
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
|
||||
while ($i < $num)
|
||||
|
||||
@ -502,7 +502,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="search_status" value="'.$search_status.'">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'order', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$topicmail = "SendOrderRef";
|
||||
$modelmail = "order_send";
|
||||
|
||||
@ -66,20 +66,20 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers'));
|
||||
$form = new Form($db);
|
||||
$formorder = new FormOrder($db);
|
||||
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
$title = $langs->trans("OrdersStatistics");
|
||||
$dir = $conf->commande->dir_temp;
|
||||
}
|
||||
$picto = 'order';
|
||||
$title = $langs->trans("OrdersStatistics");
|
||||
$dir = $conf->commande->dir_temp;
|
||||
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$picto = 'supplier_order';
|
||||
$title = $langs->trans("OrdersStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")";
|
||||
$dir = $conf->fournisseur->commande->dir_temp;
|
||||
}
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
print load_fiche_titre($title, '', 'commercial');
|
||||
print load_fiche_titre($title, '', $picto);
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
|
||||
@ -23,8 +23,8 @@
|
||||
* \brief Page to show portoflio and files of a thirdparty and download it
|
||||
*/
|
||||
|
||||
if ($_GET['action'] == 'dl' || $_POST['action'] == 'dl') { // To not replace token when downloading file
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
|
||||
if ((array_key_exists('action', $_GET) && $_GET['action'] == 'dl') || (array_key_exists('action', $_POST) && $_POST['action'] == 'dl')) { // To not replace token when downloading file
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
|
||||
}
|
||||
|
||||
require '../main.inc.php';
|
||||
|
||||
@ -1519,7 +1519,7 @@ if ($resql)
|
||||
// Transaction reconciliated or edit link
|
||||
if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&rowid='.$objp->rowid.'&account='.$objp->bankid.'&page='.$page.'">';
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&rowid='.$objp->rowid.'&account='.$objp->bankid.'&page='.$page.'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
@ -346,7 +346,7 @@ if ($result)
|
||||
$paymenttmp->fetch($links[$key]['url_id']);
|
||||
$paymenttmp->ref = $langs->trans("Payment").' '.$paymenttmp->ref;
|
||||
/*print '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print img_object($langs->trans('Payment'),'payment').' ';
|
||||
print $langs->trans("Payment");
|
||||
print '</a>';*/
|
||||
print $paymenttmp->getNomUrl(1);
|
||||
@ -357,7 +357,7 @@ if ($result)
|
||||
$paymenttmp->fetch($links[$key]['url_id']);
|
||||
$paymenttmp->ref = $langs->trans("Payment").' '.$paymenttmp->ref;
|
||||
/*print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print img_object($langs->trans('Payment'),'payment').' ';
|
||||
print $langs->trans("Payment");
|
||||
print '</a>';*/
|
||||
print $paymenttmp->getNomUrl(1);
|
||||
@ -369,67 +369,67 @@ if ($result)
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'sc') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowSocialContribution'), 'bill').' ';
|
||||
print img_object($langs->trans('SocialContribution'), 'bill').' ';
|
||||
print $langs->trans("SocialContribution").($links[$key]['label'] ? ' - '.$links[$key]['label'] : '');
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'payment_sc') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowPayment'), 'payment').' ';
|
||||
print img_object($langs->trans('Payment'), 'payment').' ';
|
||||
print $langs->trans("SocialContributionPayment");
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'payment_vat') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowVAT'), 'payment').' ';
|
||||
print img_object($langs->trans('VAT'), 'payment').' ';
|
||||
print $langs->trans("VATPayment");
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'payment_salary') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/salaries/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowPaymentSalary'), 'payment').' ';
|
||||
print img_object($langs->trans('PaymentSalary'), 'payment').' ';
|
||||
print $langs->trans("SalaryPayment");
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'payment_loan') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowLoanPayment'), 'payment').' ';
|
||||
print img_object($langs->trans('LoanPayment'), 'payment').' ';
|
||||
print $langs->trans("PaymentLoan");
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'loan') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/loan/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowLoan'), 'bill').' ';
|
||||
print img_object($langs->trans('Loan'), 'bill').' ';
|
||||
print $langs->trans("Loan");
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'member') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowMember'), 'user').' ';
|
||||
print img_object($langs->trans('Member'), 'user').' ';
|
||||
print $links[$key]['label'];
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'payment_donation') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowDonation'), 'payment').' ';
|
||||
print img_object($langs->trans('Donation'), 'payment').' ';
|
||||
print $langs->trans("DonationPayment");
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'banktransfert') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowTransaction'), 'payment').' ';
|
||||
print img_object($langs->trans('Transaction'), 'payment').' ';
|
||||
print $langs->trans("TransactionOnTheOtherAccount");
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'user') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowUser'), 'user').' ';
|
||||
print img_object($langs->trans('User'), 'user').' ';
|
||||
print $langs->trans("User");
|
||||
print '</a>';
|
||||
}
|
||||
elseif ($links[$key]['type'] == 'payment_various') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowVariousPayment'), 'payment').' ';
|
||||
print img_object($langs->trans('VariousPayment'), 'payment').' ';
|
||||
print $langs->trans("VariousPayment");
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
@ -979,7 +979,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['
|
||||
*/
|
||||
if ($action == 'create')
|
||||
{
|
||||
print load_fiche_titre($langs->trans("CreateRepeatableInvoice"), '', 'invoicing');
|
||||
print load_fiche_titre($langs->trans("CreateRepeatableInvoice"), '', 'bill');
|
||||
|
||||
$object = new Facture($db); // Source invoice
|
||||
$product_static = new Product($db);
|
||||
|
||||
@ -1768,6 +1768,8 @@ if (empty($reshook))
|
||||
|
||||
if (!empty($origin) && !empty($originid))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
$object->origin = $origin;
|
||||
$object->origin_id = $originid;
|
||||
|
||||
@ -1800,6 +1802,17 @@ if (empty($reshook))
|
||||
$line->fetch_optionals();
|
||||
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
|
||||
|
||||
// The $line->situation_percent has been modified, so we must recalculate all amounts
|
||||
$tabprice = calcul_price_total($line->qty, $line->subprice, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 0, 'HT', 0, $line->product_type, $mysoc, '', $line->situation_percent);
|
||||
$line->total_ht = $tabprice[0];
|
||||
$line->total_tva = $tabprice[1];
|
||||
$line->total_ttc = $tabprice[2];
|
||||
$line->total_localtax1 = $tabprice[9];
|
||||
$line->total_localtax2 = $tabprice[10];
|
||||
$line->multicurrency_total_ht = $tabprice[16];
|
||||
$line->multicurrency_total_tva = $tabprice[17];
|
||||
$line->multicurrency_total_ttc = $tabprice[18];
|
||||
|
||||
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
|
||||
if ($line->fk_remise_except)
|
||||
{
|
||||
@ -1844,6 +1857,7 @@ if (empty($reshook))
|
||||
{
|
||||
$nextSituationInvoice = new Facture($db);
|
||||
$nextSituationInvoice->fetch($id);
|
||||
|
||||
// create extrafields with data from create form
|
||||
$extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $nextSituationInvoice);
|
||||
@ -2770,7 +2784,7 @@ if ($action == 'create')
|
||||
$facturestatic = new Facture($db);
|
||||
$extrafields->fetch_name_optionals_label($facturestatic->table_element);
|
||||
|
||||
print load_fiche_titre($langs->trans('NewBill'), '', 'invoicing');
|
||||
print load_fiche_titre($langs->trans('NewBill'), '', 'bill');
|
||||
|
||||
if ($socid > 0)
|
||||
$res = $soc->fetch($socid);
|
||||
|
||||
@ -748,9 +748,13 @@ class FactureRec extends CommonInvoice
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
|
||||
$main = MAIN_DB_PREFIX . 'facturedet_rec';
|
||||
$ef = $main . "_extrafields";
|
||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)";
|
||||
dol_syslog($sqlef);
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid;
|
||||
dol_syslog($sql);
|
||||
if ($this->db->query($sql))
|
||||
if ($this->db->query($sqlef) && $this->db->query($sql))
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_rec WHERE rowid = ".$rowid;
|
||||
dol_syslog($sql);
|
||||
@ -759,6 +763,9 @@ class FactureRec extends CommonInvoice
|
||||
// Delete linked object
|
||||
$res = $this->deleteObjectLinked();
|
||||
if ($res < 0) $error = -3;
|
||||
// Delete extrafields
|
||||
$res = $this->deleteExtraFields();
|
||||
if ($res < 0) $error = -4;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1966,6 +1973,14 @@ class FactureLigneRec extends CommonInvoiceLine
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;
|
||||
|
||||
@ -1394,11 +1394,11 @@ class Facture extends CommonInvoice
|
||||
$label = '';
|
||||
|
||||
if ($user->rights->facture->lire) {
|
||||
$label = '<u>'.$langs->trans("ShowInvoice").'</u>';
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label = '<u>'.$langs->transnoentitiesnoconv("ShowInvoiceReplace").'</u>';
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label = '<u>'.$langs->transnoentitiesnoconv("ShowInvoiceAvoir").'</u>';
|
||||
if ($this->type == self::TYPE_DEPOSIT) $label = '<u>'.$langs->transnoentitiesnoconv("ShowInvoiceDeposit").'</u>';
|
||||
if ($this->type == self::TYPE_SITUATION) $label = '<u>'.$langs->transnoentitiesnoconv("ShowInvoiceSituation").'</u>';
|
||||
$label = '<u>'.$langs->trans("Invoice").'</u>';
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label = '<u>'.$langs->transnoentitiesnoconv("ReplacementInvoice").'</u>';
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label = '<u>'.$langs->transnoentitiesnoconv("CreditNote").'</u>';
|
||||
if ($this->type == self::TYPE_DEPOSIT) $label = '<u>'.$langs->transnoentitiesnoconv("Deposit").'</u>';
|
||||
if ($this->type == self::TYPE_SITUATION) $label = '<u>'.$langs->transnoentitiesnoconv("InvoiceSituation").'</u>';
|
||||
if (!empty($this->ref))
|
||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (!empty($this->ref_client))
|
||||
@ -1426,7 +1426,7 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label = $langs->trans("ShowInvoice");
|
||||
$label = $langs->trans("Invoice");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
@ -2186,13 +2186,16 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Invoice line extrafileds
|
||||
$main = MAIN_DB_PREFIX . 'facturedet';
|
||||
$ef = $main . "_extrafields";
|
||||
$sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)";
|
||||
// Delete invoice line
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid;
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
|
||||
if ($this->db->query($sql) && $this->delete_linked_contact())
|
||||
if ($this->db->query($sqlef) && $this->db->query($sql) && $this->delete_linked_contact())
|
||||
{
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.$rowid;
|
||||
|
||||
@ -5477,6 +5480,13 @@ class FactureLigne extends CommonInvoiceLine
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
// extrafields
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
@ -5569,7 +5579,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$sql = 'SELECT fd.situation_percent FROM '.MAIN_DB_PREFIX.'facturedet fd';
|
||||
$sql .= ' JOIN '.MAIN_DB_PREFIX.'facture f ON (f.rowid = fd.fk_facture) ';
|
||||
$sql .= ' WHERE fd.fk_prev_id ='.$this->fk_prev_id;
|
||||
$sql .= ' AND f.situation_cycle_ref = '.$tmpinvoice->situation_cycle_ref; // Prevent cycle outed
|
||||
$sql .= ' AND f.situation_cycle_ref = '.$invoicecache[$invoiceid]->situation_cycle_ref; // Prevent cycle outed
|
||||
$sql .= ' AND f.type = '.Facture::TYPE_CREDIT_NOTE;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
@ -5577,6 +5587,8 @@ class FactureLigne extends CommonInvoiceLine
|
||||
while ($obj = $this->db->fetch_object($res)) {
|
||||
$returnPercent = $returnPercent + floatval($obj->situation_percent);
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -333,7 +333,7 @@ if ($resql)
|
||||
|
||||
$title = $langs->trans("RepeatableInvoices");
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'</span><br><br>';
|
||||
|
||||
|
||||
@ -691,7 +691,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="search_status" value="'.$search_status.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$topicmail = "SendBillRef";
|
||||
$modelmail = "facture_send";
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
/**
|
||||
* \file htdocs/compta/facture/prelevement.php
|
||||
* \ingroup facture
|
||||
* \brief Gestion des prelevement d'une facture
|
||||
* \brief Management of direct debit order of invoices
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@ -32,9 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
if (!$user->rights->facture->lire) accessforbidden();
|
||||
|
||||
|
||||
@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
|
||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('bills', 'companies', 'other'));
|
||||
|
||||
$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
|
||||
if ($mode == 'customer' && !$user->rights->facture->lire) accessforbidden();
|
||||
if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden();
|
||||
@ -57,25 +60,24 @@ $endyear = $year;
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('bills', 'companies', 'other'));
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
$title = $langs->trans("BillsStatistics");
|
||||
$dir = $conf->facture->dir_temp;
|
||||
}
|
||||
$picto = 'bill';
|
||||
$title = $langs->trans("BillsStatistics");
|
||||
$dir = $conf->facture->dir_temp;
|
||||
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$picto = 'supplier_invoice';
|
||||
$title = $langs->trans("BillsStatisticsSuppliers");
|
||||
$dir = $conf->fournisseur->facture->dir_temp;
|
||||
}
|
||||
|
||||
print load_fiche_titre($title, '', 'invoicing');
|
||||
|
||||
print load_fiche_titre($title, '', $picto);
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ $thirdpartystatic = new Societe($db);
|
||||
|
||||
llxHeader("", $langs->trans("AccountancyTreasuryArea"));
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyTreasuryArea"), '', 'invoicing');
|
||||
print load_fiche_titre($langs->trans("AccountancyTreasuryArea"), '', 'bill');
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
@ -101,7 +101,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
|
||||
$listofsearchfields['search_invoice'] = array('text'=>'CustomerInvoice');
|
||||
}
|
||||
// Search supplier invoices
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->lire)
|
||||
{
|
||||
$listofsearchfields['search_supplier_invoice'] = array('text'=>'SupplierInvoice');
|
||||
}
|
||||
@ -231,7 +231,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
/**
|
||||
* Draft suppliers invoices
|
||||
*/
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier";
|
||||
$sql .= ", s.nom as name";
|
||||
@ -447,7 +447,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
|
||||
|
||||
// Last modified supplier invoices
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
$facstatic = new FactureFournisseur($db);
|
||||
@ -958,7 +958,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
/*
|
||||
* Unpayed supplier invoices
|
||||
*/
|
||||
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$facstatic = new FactureFournisseur($db);
|
||||
|
||||
|
||||
@ -250,7 +250,7 @@ llxHeader('', $name);
|
||||
|
||||
//$textprevyear="<a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current-1) . "\">".img_previous()."</a>";
|
||||
//$textnextyear=" <a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current+1) . "\">".img_next()."</a>";
|
||||
//print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear", 'invoicing');
|
||||
//print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear", 'bill');
|
||||
|
||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
||||
//report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode);
|
||||
|
||||
@ -48,7 +48,7 @@ if ($user->rights->tax->charges->creer)
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt + 1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt);
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->transcountry($ltt == 2 ? "LT2Payments" : "LT1Payments", $mysoc->country_code), $newcardbutton, 'invoicing');
|
||||
print load_fiche_titre($langs->transcountry($ltt == 2 ? "LT2Payments" : "LT1Payments", $mysoc->country_code), $newcardbutton, 'title_accountancy');
|
||||
|
||||
$sql = "SELECT rowid, amount, label, f.datev, f.datep";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."localtax as f ";
|
||||
|
||||
@ -185,7 +185,7 @@ class Cpaiement
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
|
||||
if (null !== $ref) {
|
||||
$sql .= ' WHERE t.entity IN ('.getEntity('c_paiement').')';
|
||||
$sql .= ' AND t.code = '.'\''.$ref.'\'';
|
||||
$sql .= " AND t.code = '".$this->db->escape($ref)."'";
|
||||
} else {
|
||||
$sql .= ' WHERE t.id = '.$id;
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="search_status" value="'.$search_status.'">';
|
||||
|
||||
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit, 0, 0, 1);
|
||||
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
@ -88,7 +88,7 @@ $formother = new FormOther($db);
|
||||
llxHeader();
|
||||
|
||||
$titre = ($year ? $langs->trans("PaymentsReportsForYear", $year) : $langs->trans("PaymentsReports"));
|
||||
print load_fiche_titre($titre, '', 'invoicing');
|
||||
print load_fiche_titre($titre, '', 'bill');
|
||||
|
||||
// Formulaire de generation
|
||||
print '<form method="post" action="rapport.php?year='.$year.'">';
|
||||
@ -154,9 +154,11 @@ if ($year)
|
||||
{
|
||||
$tfile = $dir.'/'.$year.'/'.$file;
|
||||
$relativepath = $year.'/'.$file;
|
||||
print '<tr class="oddeven">'.'<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
|
||||
print '<td class="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
|
||||
print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td></tr>';
|
||||
print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
@ -31,12 +31,14 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'categories', 'widthdrawals'));
|
||||
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid', 'int');
|
||||
if ($user->socid) $socid = $user->socid;
|
||||
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
@ -101,7 +103,10 @@ if ($result)
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
$urladd = "&statut=".$statut;
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||
$param .= "&statut=".urlencode($statut);
|
||||
|
||||
$selectedfields = '';
|
||||
|
||||
@ -119,10 +124,9 @@ if ($result)
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
||||
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@ -141,11 +145,11 @@ if ($result)
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', '', 'class="liste_titre"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", "", 'class="liste_titre" align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", "", 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", 'class="right"', $sortfield, $sortorder);
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n";
|
||||
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$directdebitorder = new BonPrelevement($db);
|
||||
|
||||
@ -1229,6 +1229,9 @@ class BonPrelevement extends CommonObject
|
||||
$label = '<u>'.$langs->trans("ShowWithdraw").'</u>';
|
||||
$label .= '<br>';
|
||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (isset($this->statut)) {
|
||||
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
||||
}
|
||||
|
||||
$url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id;
|
||||
|
||||
|
||||
@ -252,7 +252,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="limit" value="'.$limit.'"/>';
|
||||
}
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
|
||||
print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit);
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -32,12 +32,21 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'withdrawals', 'companies', 'categories'));
|
||||
|
||||
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid', 'int');
|
||||
if ($user->socid) $socid=$user->socid;
|
||||
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
|
||||
|
||||
|
||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
@ -57,7 +66,7 @@ $statut = GETPOST('statut', 'int');
|
||||
|
||||
$bon = new BonPrelevement($db, "");
|
||||
$ligne = new LignePrelevement($db, $user);
|
||||
|
||||
$company = new Societe($db);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -81,9 +90,9 @@ $form = new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("WithdrawalsLines"));
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.statut, p.datec";
|
||||
$sql .= " ,f.rowid as facid, f.ref, f.total_ttc";
|
||||
$sql .= " , s.rowid as socid, s.nom as name, s.code_client";
|
||||
$sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
|
||||
$sql .= " ,f.rowid as facid, f.ref as invoiceref, f.total_ttc";
|
||||
$sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.email";
|
||||
$sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
@ -124,14 +133,21 @@ if ($result)
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
$urladd = "&statut=".$statut;
|
||||
$urladd .= "&search_bon=".$search_bon;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $urladd .= '&limit='.urlencode($limit);
|
||||
$param = "&statut=".urlencode($statut);
|
||||
$param .= "&search_bon=".urlencode($search_bon);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
|
||||
print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit, 0, 0, 1);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@ -153,13 +169,13 @@ if ($result)
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Line", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref");
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $urladd);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom");
|
||||
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", '', '', 'align="center"');
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", "", 'align="center"');
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", "", 'class="right"');
|
||||
print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -167,28 +183,37 @@ if ($result)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
$bon->ref = $obj->ref;
|
||||
$bon->statut = $obj->status;
|
||||
|
||||
$company->id = $obj->socid;
|
||||
$company->name = $obj->name;
|
||||
$company->email = $obj->email;
|
||||
$company->code_client = $obj->code_client;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $ligne->LibStatut($obj->statut_ligne, 2);
|
||||
print " ";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
|
||||
print substr('000000'.$obj->rowid_ligne, -6);
|
||||
print '</a></td>';
|
||||
|
||||
print '<td>';
|
||||
print $bon->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print $bon->LibStatut($obj->statut, 2);
|
||||
print " ";
|
||||
|
||||
print '<a href="card.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">';
|
||||
print '<td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">';
|
||||
print img_object($langs->trans("ShowBill"), "bill");
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
|
||||
print '</a></td>';
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->invoiceref."</a></td>\n";
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
print '<td><a href="card.php?id='.$obj->rowid.'">'.$obj->name."</a></td>\n";
|
||||
print '<td>';
|
||||
print $company->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
|
||||
|
||||
|
||||
@ -227,17 +227,15 @@ print "</tr>\n";
|
||||
if ($modecompta == 'BOOKKEEPING')
|
||||
{
|
||||
$predefinedgroupwhere = "(";
|
||||
//$predefinedgroupwhere.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))";
|
||||
$predefinedgroupwhere .= " (pcg_type = 'EXPENSE')";
|
||||
$predefinedgroupwhere .= " OR ";
|
||||
//$predefinedgroupwhere.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))";
|
||||
$predefinedgroupwhere .= " (pcg_type = 'INCOME')";
|
||||
$predefinedgroupwhere .= ")";
|
||||
|
||||
$charofaccountstring = $conf->global->CHARTOFACCOUNTS;
|
||||
$charofaccountstring = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
$sql = "SELECT f.thirdparty_code as name, -1 as socid, aa.pcg_type, aa.pcg_subtype, sum(f.credit - f.debit) as amount";
|
||||
$sql = "SELECT f.thirdparty_code as name, -1 as socid, aa.pcg_type, SUM(f.credit - f.debit) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
$sql .= " WHERE f.numero_compte = aa.account_number";
|
||||
@ -271,7 +269,7 @@ if ($modecompta == 'BOOKKEEPING')
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td> </td>';
|
||||
print '<td>'.$objp->pcg_type.($objp->pcg_subtype != 'XXXXXX' ? ' - '.$objp->pcg_subtype : '').($objp->name ? ' ('.$objp->name.')' : '')."</td>\n";
|
||||
print '<td>'.$objp->pcg_type.($objp->name ? ' ('.$objp->name.')' : '')."</td>\n";
|
||||
print '<td class="right">'.price($objp->amount)."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
@ -282,7 +280,7 @@ if ($modecompta == 'BOOKKEEPING')
|
||||
// This make 14 calls for each detail of account (NP, N and month m)
|
||||
if ($showaccountdetail != 'no')
|
||||
{
|
||||
$tmppredefinedgroupwhere = "pcg_type = '".$db->escape($objp->pcg_type)."' AND pcg_subtype = '".$db->escape($objp->pcg_subtype)."'";
|
||||
$tmppredefinedgroupwhere = "pcg_type = '".$db->escape($objp->pcg_type)."'";
|
||||
$tmppredefinedgroupwhere .= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'";
|
||||
//$tmppredefinedgroupwhere.= " AND thirdparty_code = '".$db->escape($objp->name)."'";
|
||||
|
||||
|
||||
@ -556,7 +556,7 @@ class ChargeSociales extends CommonObject
|
||||
|
||||
if (empty($this->ref)) $this->ref = $this->label;
|
||||
|
||||
$label = '<u>'.$langs->trans("ShowSocialContribution").'</u>';
|
||||
$label = '<u>'.$langs->trans("SocialContribution").'</u>';
|
||||
if (!empty($this->ref))
|
||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (!empty($this->label))
|
||||
@ -569,7 +569,7 @@ class ChargeSociales extends CommonObject
|
||||
{
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label = $langs->trans("ShowSocialContribution");
|
||||
$label = $langs->trans("SocialContribution");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
|
||||
@ -199,7 +199,7 @@ if ($resql)
|
||||
$center = ($year ? "<a href='list.php?year=".($year - 1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='list.php?year=".($year + 1)."'>".img_next()."</a>" : "");
|
||||
}
|
||||
|
||||
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
if (empty($mysoc->country_id) && empty($mysoc->country_code))
|
||||
{
|
||||
|
||||
@ -462,7 +462,7 @@ if (count($amount)) {
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
if ($modecompta != 'CREANCES-DETTES') {
|
||||
print '<td colspan="1"></td>';
|
||||
print '<td></td>';
|
||||
} else {
|
||||
print '<td class="right">'.price($catotal_ht).'</td>';
|
||||
}
|
||||
|
||||
@ -625,7 +625,7 @@ if (count($amount)) {
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
if ($modecompta != 'CREANCES-DETTES') {
|
||||
print '<td colspan="1"></td>';
|
||||
print '<td></td>';
|
||||
} else {
|
||||
print '<td class="right">'.price($catotal_ht).'</td>';
|
||||
}
|
||||
|
||||
@ -574,7 +574,7 @@ if (count($amount)) {
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
if ($modecompta != 'CREANCES-DETTES') {
|
||||
print '<td colspan="1"></td>';
|
||||
print '<td></td>';
|
||||
} else {
|
||||
print '<td class="right">'.price($catotal_ht).'</td>';
|
||||
}
|
||||
|
||||
@ -191,15 +191,15 @@ if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description .= '<br>'.$langs
|
||||
$description .= ($description ? '<br>' : '').$fsearch;
|
||||
if (!empty($conf->global->TAX_REPORT_EXTRA_REPORT))
|
||||
{
|
||||
$description .= '<br>'
|
||||
. '<input type="radio" name="extra_report" value="0" '.($special_report ? '' : 'checked="checked"').'> '
|
||||
. $langs->trans('SimpleReport')
|
||||
. '</input>'
|
||||
. '<br>'
|
||||
. '<input type="radio" name="extra_report" value="1" '.($special_report ? 'checked="checked"' : '').'> '
|
||||
. $langs->trans('AddExtraReport')
|
||||
. '</input>'
|
||||
. '<br>';
|
||||
$description .= '<br>';
|
||||
$description .= '<input type="radio" name="extra_report" value="0" '.($special_report ? '' : 'checked="checked"').'> ';
|
||||
$description .= $langs->trans('SimpleReport');
|
||||
$description .= '</input>';
|
||||
$description .= '<br>';
|
||||
$description .= '<input type="radio" name="extra_report" value="1" '.($special_report ? 'checked="checked"' : '').'> ';
|
||||
$description .= $langs->trans('AddExtraReport');
|
||||
$description .= '</input>';
|
||||
$description .= '<br>';
|
||||
}
|
||||
|
||||
$elementcust = $langs->trans("CustomersInvoices");
|
||||
|
||||
@ -255,7 +255,7 @@ llxHeader('', $name);
|
||||
|
||||
//$textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a>";
|
||||
//$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>";
|
||||
//print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'invoicing');
|
||||
//print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'bill');
|
||||
|
||||
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
|
||||
//report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode);
|
||||
|
||||
@ -147,11 +147,11 @@ if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeA
|
||||
if ($object->thirdparty->fournisseur)
|
||||
{
|
||||
$thirdTypeArray['supplier'] = $langs->trans("supplier");
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire) $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']= $langs->transnoentitiesnoconv('SuppliersOrders');
|
||||
|
||||
// There no contact type for supplier proposals
|
||||
// if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals');
|
||||
// There no contact type for supplier proposals
|
||||
// if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals');
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -57,29 +58,58 @@ $v = new vCard();
|
||||
$v->setProdId('Dolibarr '.DOL_VERSION);
|
||||
|
||||
$v->setUid('DOLIBARR-CONTACTID-'.$contact->id);
|
||||
$v->setName($contact->lastname, $contact->firstname, "", "", "");
|
||||
$v->setFormattedName($contact->getFullName($langs));
|
||||
$v->setName($contact->lastname, $contact->firstname, "", $contact->civility, "");
|
||||
$v->setFormattedName($contact->getFullName($langs, 1));
|
||||
|
||||
// By default, all informations are for work (except phone_perso and phone_mobile)
|
||||
$v->setPhoneNumber($contact->phone_pro, "TYPE=WORK;VOICE");
|
||||
//$v->setPhoneNumber($contact->phone_perso,"TYPE=HOME;VOICE");
|
||||
$v->setPhoneNumber($contact->phone_mobile, "TYPE=CELL;VOICE");
|
||||
$v->setPhoneNumber($contact->fax, "TYPE=WORK;FAX");
|
||||
|
||||
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code ? $contact->country : ''), "TYPE=WORK;POSTAL");
|
||||
$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code ? $contact->country : ''), "TYPE=WORK");
|
||||
$v->setEmail($contact->email, 'TYPE=PREF,INTERNET');
|
||||
$v->setNote($contact->note);
|
||||
$country = $contact->country_code ? $contact->country : '' ;
|
||||
|
||||
$v->setAddress("", "", $contact->address, $contact->town, $contact->state, $contact->zip, $country, "TYPE=WORK;POSTAL");
|
||||
$v->setLabel("", "", $contact->address, $contact->town, $contact->state, $contact->zip, $country, "TYPE=WORK");
|
||||
|
||||
$v->setEmail($contact->email);
|
||||
$v->setNote($contact->note);
|
||||
$v->setTitle($contact->poste);
|
||||
|
||||
// Data from linked company
|
||||
if ($company->id)
|
||||
{
|
||||
$v->setURL($company->url, "TYPE=WORK");
|
||||
if (!$contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
|
||||
if (!$contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
|
||||
if (!$contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country, "TYPE=WORK;POSTAL");
|
||||
if (empty($contact->email)) $v->setEmail($company->email, 'TYPE=PREF,INTERNET');
|
||||
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
|
||||
if (! $contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
|
||||
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, $company->state, $company->zip, $company->country, "TYPE=WORK;POSTAL");
|
||||
|
||||
// when company e-mail is empty, use only contact e-mail
|
||||
if (empty(trim($company->email)))
|
||||
{
|
||||
// was set before, don't set twice
|
||||
}
|
||||
// when contact e-mail is empty, use only company e-mail
|
||||
elseif (empty(trim($contact->email)))
|
||||
{
|
||||
$v->setEmail($company->email);
|
||||
}
|
||||
// when e-mail domain of contact and company are the same, use contact e-mail at first (and company e-mail at second)
|
||||
elseif (strtolower(end(explode("@", $contact->email))) == strtolower(end(explode("@", $company->email))))
|
||||
{
|
||||
$v->setEmail($contact->email);
|
||||
|
||||
// support by Microsoft Outlook (2019 and possible earlier)
|
||||
$v->setEmail($company->email, 'INTERNET');
|
||||
}
|
||||
// when e-mail of contact and company complete different use company e-mail at first (and contact e-mail at second)
|
||||
else
|
||||
{
|
||||
$v->setEmail($company->email);
|
||||
|
||||
// support by Microsoft Outlook (2019 and possible earlier)
|
||||
$v->setEmail($contact->email, 'INTERNET');
|
||||
}
|
||||
|
||||
// Si contact lie a un tiers non de type "particulier"
|
||||
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name);
|
||||
}
|
||||
@ -95,7 +125,7 @@ $db->close();
|
||||
|
||||
$output = $v->getVCard();
|
||||
|
||||
$filename = trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
|
||||
$filename = trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
|
||||
$filenameurlencoded = dol_sanitizeFileName(urlencode($filename));
|
||||
//$filename = dol_sanitizeFileName($filename);
|
||||
|
||||
|
||||
@ -1098,7 +1098,7 @@ if ($result > 0)
|
||||
// Create
|
||||
if ($action == 'create')
|
||||
{
|
||||
print load_fiche_titre($langs->trans('AddContract'), '', 'commercial');
|
||||
print load_fiche_titre($langs->trans('AddContract'), '', 'contract');
|
||||
|
||||
$soc = new Societe($db);
|
||||
if ($socid > 0) $soc->fetch($socid);
|
||||
|
||||
@ -1252,6 +1252,22 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
// Delete contratdet extrafields
|
||||
$main = MAIN_DB_PREFIX . 'contratdet';
|
||||
$ef = $main . "_extrafields";
|
||||
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_contrat = " . $this->id . ")";
|
||||
|
||||
dol_syslog(get_class($this)."::delete contratdet_extrafields", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql)
|
||||
{
|
||||
$this->error = $this->db->error();
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
// Delete contratdet
|
||||
|
||||
@ -70,7 +70,7 @@ $now = dol_now();
|
||||
|
||||
llxHeader();
|
||||
|
||||
print load_fiche_titre($langs->trans("ContractsArea"), '', 'commercial');
|
||||
print load_fiche_titre($langs->trans("ContractsArea"), '', 'contract');
|
||||
|
||||
|
||||
//print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
|
||||
@ -384,7 +384,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'commercial', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'contract', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$topicmail = "SendContractRef";
|
||||
$modelmail = "contract";
|
||||
|
||||
@ -349,7 +349,8 @@ if ($mode == "0") $title = $langs->trans("ListOfInactiveServices"); // Must use
|
||||
if ($mode == "4" && $filter != "expired") $title = $langs->trans("ListOfRunningServices");
|
||||
if ($mode == "4" && $filter == "expired") $title = $langs->trans("ListOfExpiredServices");
|
||||
if ($mode == "5") $title = $langs->trans("ListOfClosedServices");
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'commercial', 0, '', '', $limit);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contract', 0, '', '', $limit);
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
|
||||
@ -40,20 +40,20 @@ top_httphead();
|
||||
//print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
|
||||
|
||||
// Load original field value
|
||||
if (! empty($output) && isset($amount) && isset($tva_tx))
|
||||
if (!empty($output) && isset($amount) && isset($tva_tx))
|
||||
{
|
||||
$return=array();
|
||||
$price='';
|
||||
$return = array();
|
||||
$price = '';
|
||||
|
||||
if (is_numeric($amount) && $amount != '')
|
||||
{
|
||||
if ($output == 'price_ttc') {
|
||||
$price = price2num($amount * (1 + ($tva_tx/100)), 'MU');
|
||||
$price = price2num($amount * (1 + ($tva_tx / 100)), 'MU');
|
||||
$return['price_ht'] = $amount;
|
||||
$return['price_ttc'] = (isset($price) && $price != '' ? price($price) : '');
|
||||
}
|
||||
elseif ($output == 'price_ht') {
|
||||
$price = price2num($amount / (1 + ($tva_tx/100)), 'MU');
|
||||
$price = price2num($amount / (1 + ($tva_tx / 100)), 'MU');
|
||||
$return['price_ht'] = (isset($price) && $price != '' ? price($price) : '');
|
||||
$return['price_ttc'] = ($tva_tx == 0 ? $price : $amount);
|
||||
}
|
||||
|
||||
@ -105,11 +105,11 @@ if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARC
|
||||
{
|
||||
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) && $user->rights->fournisseur->commande->lire)
|
||||
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || ! empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) && $user->rights->fournisseur->facture->lire)
|
||||
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
|
||||
}
|
||||
|
||||
@ -1359,7 +1359,7 @@ abstract class CommonObject
|
||||
}
|
||||
if ($conf->{$modulename}->enabled) {
|
||||
$libelle_element = $langs->trans('ContactDefault_'.$obj->element);
|
||||
$transkey = "TypeContact_".$this->element."_".$source."_".$obj->code;
|
||||
$transkey = "TypeContact_".$obj->element."_".$source."_".$obj->code;
|
||||
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle);
|
||||
if (empty($option))
|
||||
$tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
|
||||
@ -2974,6 +2974,14 @@ abstract class CommonObject
|
||||
// phpcs:enable
|
||||
global $conf, $hookmanager, $action;
|
||||
|
||||
$parameters = array('exclspec' => $exclspec, 'roundingadjust' => $roundingadjust, 'nodatabaseupdate' => $nodatabaseupdate, 'seller' => $seller);
|
||||
$reshook = $hookmanager->executeHooks('updateTotalPrice', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
return 1; // replacement code
|
||||
} elseif ($reshook < 0) {
|
||||
return -1; // failure
|
||||
} // reshook = 0 => execute normal code
|
||||
|
||||
// Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield)
|
||||
$MODULE = "";
|
||||
if ($this->element == 'propal')
|
||||
@ -3028,8 +3036,8 @@ abstract class CommonObject
|
||||
|
||||
$sql = 'SELECT rowid, qty, '.$fieldup.' as up, remise_percent, total_ht, '.$fieldtva.' as total_tva, total_ttc, '.$fieldlocaltax1.' as total_localtax1, '.$fieldlocaltax2.' as total_localtax2,';
|
||||
$sql .= ' tva_tx as vatrate, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, info_bits, product_type';
|
||||
if ($this->table_element_line == 'facturedet') $sql .= ', situation_percent';
|
||||
$sql .= ', multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc';
|
||||
if ($this->table_element_line == 'facturedet') $sql .= ', situation_percent';
|
||||
$sql .= ', multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql .= ' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
if ($exclspec)
|
||||
@ -3068,18 +3076,23 @@ abstract class CommonObject
|
||||
|
||||
if (empty($reshook) && $forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto'
|
||||
{
|
||||
$localtax_array = array($obj->localtax1_type, $obj->localtax1_tx, $obj->localtax2_type, $obj->localtax2_tx);
|
||||
// This part of code is to fix data. We should not call it too often.
|
||||
$localtax_array = array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx);
|
||||
$tmpcal = calcul_price_total($obj->qty, $obj->up, $obj->remise_percent, $obj->vatrate, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->product_type, $seller, $localtax_array, (isset($obj->situation_percent) ? $obj->situation_percent : 100), $multicurrency_tx);
|
||||
$diff = price2num($tmpcal[1] - $obj->total_tva, 'MT', 1);
|
||||
if ($diff)
|
||||
|
||||
$diff_when_using_price_ht = price2num($tmpcal[1] - $obj->total_tva, 'MT', 1); // If price was set with tax price adn unit price HT has a low number of digits, then we may have a diff on recalculation from unit price HT.
|
||||
$diff_on_current_total = price2num($obj->total_ttc - $obj->total_ht - $obj->total_tva - $obj->total_localtax1 - $obj->total_localtax2, 'MT', 1);
|
||||
//var_dump($obj->total_ht.' '.$obj->total_tva.' '.$obj->total_localtax1.' '.$obj->total_localtax2.' =? '.$obj->total_ttc);
|
||||
//var_dump($diff_when_using_price_ht.' '.$diff_on_current_total);
|
||||
|
||||
if ($diff_when_using_price_ht && $diff_on_current_total)
|
||||
{
|
||||
$sqlfix = "UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".$tmpcal[1].", total_ttc = ".$tmpcal[2]." WHERE rowid = ".$obj->rowid;
|
||||
dol_syslog('We found unconsistent data into detailed line (difference of '.$diff.') for line rowid = '.$obj->rowid." (total vat of line calculated=".$tmpcal[1].", database=".$obj->total_tva."). We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix);
|
||||
$resqlfix = $this->db->query($sqlfix);
|
||||
if (!$resqlfix) dol_print_error($this->db, 'Failed to update line');
|
||||
$obj->total_tva = $tmpcal[1];
|
||||
$obj->total_ttc = $tmpcal[2];
|
||||
//
|
||||
dol_syslog('We found unconsistent data into detailed line (diff_when_using_price_ht = '.$diff_when_using_price_ht.' and diff_on_current_total = '.$diff_on_current_total.') for line rowid = '.$obj->rowid." (total vat of line calculated=".$tmpcal[1].", database=".$obj->total_tva."). We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix, LOG_WARNING);
|
||||
$resqlfix = $this->db->query($sqlfix);
|
||||
if (! $resqlfix) dol_print_error($this->db, 'Failed to update line');
|
||||
$obj->total_tva = $tmpcal[1];
|
||||
$obj->total_ttc = $tmpcal[2];
|
||||
}
|
||||
}
|
||||
|
||||
@ -5230,6 +5243,25 @@ abstract class CommonObject
|
||||
|
||||
/* Functions for extrafields */
|
||||
|
||||
/**
|
||||
* Function to make a fetch but set environment to avoid to load computed values before.
|
||||
*
|
||||
* @param int $id ID of object
|
||||
* @return int >0 if OK, 0 if not found, <0 if KO
|
||||
*/
|
||||
public function fetchNoCompute($id)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$savDisableCompute = $conf->disable_compute;
|
||||
$conf->disable_compute = 1;
|
||||
|
||||
$ret = $this->fetch($id);
|
||||
|
||||
$conf->disable_compute = $savDisableCompute;
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
@ -5244,7 +5276,7 @@ abstract class CommonObject
|
||||
public function fetch_optionals($rowid = null, $optionsArray = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $extrafields;
|
||||
global $conf, $extrafields;
|
||||
|
||||
if (empty($rowid)) $rowid = $this->id;
|
||||
if (empty($rowid)) $rowid = $this->rowid;
|
||||
@ -5328,7 +5360,10 @@ abstract class CommonObject
|
||||
foreach ($tab as $key => $value) {
|
||||
if (!empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key]))
|
||||
{
|
||||
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0);
|
||||
//var_dump($conf->disable_compute);
|
||||
if (empty($conf->disable_compute)) {
|
||||
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7125,7 +7160,7 @@ abstract class CommonObject
|
||||
// HTML, select, integer and text add default value
|
||||
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'select', 'int')))
|
||||
{
|
||||
if($action=='create') $value = $extrafields->attributes[$this->table_element]['default'][$key];
|
||||
if ($action == 'create') $value = $extrafields->attributes[$this->table_element]['default'][$key];
|
||||
else $value = $this->array_options['options_'.$key];
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +48,8 @@ class Conf
|
||||
|
||||
//! To store if javascript/ajax is enabked
|
||||
public $use_javascript_ajax;
|
||||
//! To store if javascript/ajax is enabked
|
||||
public $disable_compute;
|
||||
//! Used to store current currency (ISO code like 'USD', 'EUR', ...)
|
||||
public $currency;
|
||||
//! Used to store current css (from theme)
|
||||
|
||||
@ -147,7 +147,7 @@ class CUnits // extends CommonObject
|
||||
/**
|
||||
* Load object in memory from database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param int $id Id of CUnit object to fetch (rowid)
|
||||
* @param string $code Code
|
||||
* @param string $short_label Short Label ('g', 'kg', ...)
|
||||
* @param string $unit_type Unit type ('size', 'surface', 'volume', 'weight', ...)
|
||||
@ -168,7 +168,7 @@ class CUnits // extends CommonObject
|
||||
$sql .= " t.active";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_units as t";
|
||||
$sql_where = array();
|
||||
if ($id) $sql_where[] = " t.id = ".$id;
|
||||
if ($id) $sql_where[] = " t.rowid = ".$id;
|
||||
if ($unit_type) $sql_where[] = " t.unit_type = '".$this->db->escape($unit_type)."'";
|
||||
if ($code) $sql_where[] = " t.code = '".$this->db->escape($code)."'";
|
||||
if ($short_label) $sql_where[] = " t.short_label = '".$this->db->escape($short_label)."'";
|
||||
|
||||
@ -732,7 +732,7 @@ class dolReceiptPrinter extends Printer
|
||||
break;
|
||||
case 'DOL_PRINT_ORDER_LINES':
|
||||
foreach ($object->lines as $line) {
|
||||
if ($line->special_code==$this->orderprinter)
|
||||
if ($line->special_code == $this->orderprinter)
|
||||
{
|
||||
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
|
||||
$spaces = str_repeat(' ', $spacestoadd);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user