Merge pull request #21 from Dolibarr/develop

pull from develop
This commit is contained in:
Tobias Sekan 2020-04-29 13:04:18 +02:00 committed by GitHub
commit df1895b8b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
259 changed files with 1910 additions and 1489 deletions

View File

@ -6,6 +6,10 @@ This directory contains ruleset files to use to develop Dolibarr EPR & CRM.
To install/upgrade phpcs: To install/upgrade phpcs:
> sudo pear upgrade PHP_CodeSniffer > 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: Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with:
* tab value to 4 * tab value to 4
* path of code sniffer standard to dev/codesniffer * path of code sniffer standard to dev/codesniffer

View File

@ -36,8 +36,6 @@
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/> <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/> <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/> <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowed"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning"/>
</rule> </rule>
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> --> <!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
@ -70,9 +68,6 @@
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod">
<severity>0</severity>
</rule>
<!-- <!--
<rule ref="Generic.Commenting.Todo" /> <rule ref="Generic.Commenting.Todo" />
@ -125,13 +120,6 @@
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" /> <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 --> <!-- 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 --> <!-- 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"> <rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
@ -141,7 +129,7 @@
<!-- Tweaks to metrics --> <!-- Tweaks to metrics -->
<rule ref="Generic.Metrics.CyclomaticComplexity"> <rule ref="Generic.Metrics.CyclomaticComplexity">
<properties> <properties>
<property name="complexity" value="120" /> <property name="complexity" value="150" />
<property name="absoluteComplexity" value="300" /> <property name="absoluteComplexity" value="300" />
</properties> </properties>
</rule> </rule>
@ -179,7 +167,6 @@
<rule ref="Generic.Strings.UnnecessaryStringConcat" /> <rule ref="Generic.Strings.UnnecessaryStringConcat" />
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found"> <rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
<severity>0</severity>
</rule> </rule>
<!-- Disallow usage of tab --> <!-- Disallow usage of tab -->

View File

@ -488,11 +488,11 @@ if ($resql)
// Action // Action
print '<td class="center">'; print '<td class="center">';
if ($user->rights->accounting->chartofaccount) { 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 img_edit();
print '</a>'; print '</a>';
print '&nbsp;'; print '&nbsp;';
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 img_delete();
print '</a>'; print '</a>';
} }

View File

@ -696,7 +696,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // 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>&nbsp;</td>'; else print '<td>&nbsp;</td>';
// Delete link // Delete link

View File

@ -408,7 +408,7 @@ llxHeader('', $langs->trans('DictionaryAccountancyCategory'));
$titre = $langs->trans($tablib[$id]); $titre = $langs->trans($tablib[$id]);
$linkback = ''; $linkback = '';
$titlepicto = 'title_setup'; $titlepicto = 'title_accountancy';
print load_fiche_titre($titre, $linkback, $titlepicto); print load_fiche_titre($titre, $linkback, $titlepicto);
@ -806,7 +806,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // 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>&nbsp;</td>'; else print '<td>&nbsp;</td>';
// Delete link // Delete link

View File

@ -236,6 +236,7 @@ if (!empty($user->admin))
} }
print '</tr>'; print '</tr>';
/* Set this option as a hidden option but keep it for some needs.
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>'; print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) { if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
@ -248,6 +249,7 @@ if (!empty($user->admin))
print '</a></td>'; print '</a></td>';
} }
print '</tr>'; print '</tr>';
*/
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>'; print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';

View File

@ -657,7 +657,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // 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>&nbsp;</td>'; else print '<td>&nbsp;</td>';
// Delete link // Delete link

View File

@ -362,7 +362,6 @@ if ($result)
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; 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 load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
print '<br>'; print '<br>';
@ -412,7 +411,7 @@ if ($result)
//print '<br><div class="center">'.$buttonsave.'</div>'; //print '<br><div class="center">'.$buttonsave.'</div>';
$texte = $langs->trans("ListOfProductsServices"); $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 '<div class="div-table-responsive">';
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">'; print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';

View File

@ -704,7 +704,7 @@ class BookKeeping extends CommonObject
$sql .= ' WHERE 1 = 1'; $sql .= ' WHERE 1 = 1';
$sql .= " AND entity IN (".getEntity('accountancy').")"; $sql .= " AND entity IN (".getEntity('accountancy').")";
if (null !== $ref) { if (null !== $ref) {
$sql .= ' AND t.ref = '.'\''.$ref.'\''; $sql .= " AND t.ref = '".$this->db->escape($ref)."'";
} else { } else {
$sql .= ' AND t.rowid = '.$id; $sql .= ' AND t.rowid = '.$id;
} }

View File

@ -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" 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 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 '<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 '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></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>'; print '<td>';
if ($product_static->id > 0) print $product_static->getNomUrl(1); if ($product_static->id > 0) print $product_static->getNomUrl(1);
if ($product_static->id > 0 && $objp->product_label) print '<br>'; 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>';
print '<td class="tdoverflowonsmartphone">'; print '<td class="tdoverflowonsmartphone">';

View File

@ -567,12 +567,12 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>'; print '<td>'.$objp->tva_intra.'</td>';
// Found accounts // 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>'; $s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
$shelp = ''; $shelp = '';
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC"); if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport"); 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); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if ($objp->product_id > 0) if ($objp->product_id > 0)
{ {
@ -583,7 +583,7 @@ if ($result) {
elseif ($suggestedaccountingaccountfor == 'eecwithvat') $shelp = $langs->trans("SaleEECWithVAT"); elseif ($suggestedaccountingaccountfor == 'eecwithvat') $shelp = $langs->trans("SaleEECWithVAT");
elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $shelp = $langs->trans("SaleEECWithoutVATNumber"); elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $shelp = $langs->trans("SaleEECWithoutVATNumber");
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport"); 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 $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
} }
print '</td>'; print '</td>';

View File

@ -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 '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
print "<br>\n"; print "<br>\n";
@ -101,13 +101,13 @@ if ($conf->accounting->enabled)
// STEPS // STEPS
$step++; $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"; print "<br>\n";
$step++; $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"; print "<br>\n";
$step++; $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";
print "<br>\n"; print "<br>\n";
@ -116,20 +116,20 @@ if ($conf->accounting->enabled)
print "<br>\n"; print "<br>\n";
$step++; $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"; print "<br>\n";
$step++; $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"; print "<br>\n";
$step++; $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 img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
print "<br>\n"; print "<br>\n";
if (!empty($conf->tax->enabled)) 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++; $step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink); print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
print "<br>\n"; 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. 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++; $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"; print "<br>\n";
} }
/* /*
@ -169,7 +169,7 @@ if ($conf->accounting->enabled)
}*/ }*/
$step++; $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"; print "<br>\n";
@ -186,17 +186,17 @@ if ($conf->accounting->enabled)
$langs->loadLangs(array('bills', 'trips')); $langs->loadLangs(array('bills', 'trips'));
$step++; $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"; print "<br>\n";
$step++; $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"; print "<br>\n";
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled)) if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled))
{ {
$step++; $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"; print "<br>\n";
} }

View File

@ -994,7 +994,7 @@ if (empty($action) || $action == 'view') {
print '<div class="tabsAction tabsActionNoBottom">'; 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' if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { || ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {

View File

@ -508,7 +508,7 @@ if (empty($action) || $action == 'view') {
} }
print '<div class="tabsAction tabsActionNoBottom">'; 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') { 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").'" />'; print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
} }

View File

@ -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 ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
} }
print '<div class="tabsAction tabsActionNoBottom">'; 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') { 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").'" />'; 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); $accountoshow = length_accountg($k);
if (($accountoshow == "") || $accountoshow == 'NotDefined') 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; else print $accountoshow;
print "</td>"; print "</td>";
@ -959,15 +959,15 @@ if (empty($action) || $action == 'view') {
foreach ($tabother[$key] as $k => $mt) { foreach ($tabother[$key] as $k => $mt) {
if ($mt) { if ($mt) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<!-- VAT counterpart NPR -->"; print '<!-- VAT counterpart NPR -->';
print "<td>".$date."</td>"; print "<td>".$date."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>"; print "<td>".$invoicestatic->getNomUrl(1)."</td>";
// Account // Account
print "<td>"; print '<td>';
$accountoshow = length_accountg($k); $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; else print $accountoshow;
print '</td>'; print '</td>';

View File

@ -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 ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
} }
print '<div class="tabsAction tabsActionNoBottom">'; 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') { 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").'" />'; 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); $accountoshow = length_accountg($k);
if (($accountoshow == "") || $accountoshow == 'NotDefined') 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; else print $accountoshow;
print "</td>"; print "</td>";

View File

@ -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_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 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 '<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 '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></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">'; print '<td class="tdoverflowmax100">';
if ($product_static->id > 0) print $product_static->getNomUrl(1); if ($product_static->id > 0) print $product_static->getNomUrl(1);
if ($product_static->id > 0 && $objp->product_label) print '<br>'; 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>';
// Description // Description
@ -400,7 +400,7 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>'; print '<td>'.$objp->tva_intra.'</td>';
print '<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 img_edit();
print '</a></td>'; print '</a></td>';
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>'; print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';

View File

@ -553,12 +553,12 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>'; print '<td>'.$objp->tva_intra.'</td>';
// Found accounts // 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>'; $s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
$shelp = ''; $shelp = '';
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC"); if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport"); 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); print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if ($objp->product_id > 0) if ($objp->product_id > 0)
{ {
@ -567,7 +567,7 @@ if ($result) {
$shelp = ''; $shelp = '';
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC"); if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport"); 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 $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
} }
print '</td>'; print '</td>';

View File

@ -60,6 +60,9 @@ class Adherent extends CommonObject
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
public $picto = 'member';
public $mesgs; public $mesgs;
/** /**

View File

@ -183,20 +183,14 @@ class AdherentType extends CommonObject
$sql2 .= " SET "; $sql2 .= " SET ";
$sql2 .= " label='".$this->db->escape($this->label)."',"; $sql2 .= " label='".$this->db->escape($this->label)."',";
$sql2 .= " description='".$this->db->escape($this->description)."'"; $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)."'"; $sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
} }
else else
{ {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description"; $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 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',"; $sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
$sql2 .= " '".$this->db->escape($this->description)."'"; $sql2 .= " '".$this->db->escape($this->description)."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", '".$this->db->escape($this->other)."'";
}
$sql2 .= ")"; $sql2 .= ")";
} }
dol_syslog(get_class($this).'::setMultiLangs key = current_lang = '.$key); dol_syslog(get_class($this).'::setMultiLangs key = current_lang = '.$key);
@ -219,20 +213,14 @@ class AdherentType extends CommonObject
$sql2 .= " SET "; $sql2 .= " SET ";
$sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',"; $sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'"; $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)."'"; $sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
} }
else else
{ {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description"; $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 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',"; $sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " '".$this->db->escape($this->multilangs["$key"]["description"])."'"; $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 .= ")"; $sql2 .= ")";
} }

View File

@ -1718,7 +1718,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // 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>&nbsp;</td>'; else print '<td>&nbsp;</td>';
// Delete link // Delete link

View File

@ -213,19 +213,17 @@ class Dolistore
{ {
$cat = $this->categories[$i]; $cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) { 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.'" ' $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])).'"' $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>';
.'>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= self::get_categories($cat->id); $html .= self::get_categories($cat->id);
$html .= "</li>\n"; $html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau } 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' : ''; $select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"' $html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"';
.' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" ' $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>'; $html .= '>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= self::get_categories($cat->id); $html .= self::get_categories($cat->id);
$html .= "</li>\n"; $html .= "</li>\n";
} else {
} }
} }
@ -269,8 +267,8 @@ class Dolistore
// add image or default ? // add image or default ?
if ($product->id_default_image != '') { 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; $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.'">'. $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 .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else { } else {
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />'; $images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
} }

View File

@ -271,19 +271,19 @@ if ($resql)
print '<input type="submit" class="button buttongen" name="delete" value="'.$langs->trans("Delete").'">'; print '<input type="submit" class="button buttongen" name="delete" value="'.$langs->trans("Delete").'">';
print '<input type="hidden" name="norss" value="'.$idrss.'">'; print '<input type="hidden" name="norss" value="'.$idrss.'">';
print '</td>'; print '</td>';
print "</tr>"."\n"; print '</tr>'."\n";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td width=\"100px\">".$langs->trans("Title")."</td>"; 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 "<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 '<tr class="oddeven">';
print "<td>".$langs->trans("URL")."</td>"; 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 "<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">'; print '<tr class="oddeven">';
@ -301,7 +301,7 @@ if ($resql)
print '</div>'; print '</div>';
} }
print "</td>"; print "</td>";
print "</tr>"."\n"; print '</tr>'."\n";
// Logo // Logo
if ($result > 0 && empty($rss->error)) if ($result > 0 && empty($rss->error))
@ -315,7 +315,7 @@ if ($resql)
if ($imageurl) print '<img height="32" src="'.$imageurl.'">'; if ($imageurl) print '<img height="32" src="'.$imageurl.'">';
else print $langs->trans("None"); else print $langs->trans("None");
print '</td>'; print '</td>';
print "</tr>"."\n"; print '</tr>'."\n";
} }
// Active // Active
@ -323,11 +323,11 @@ if ($resql)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans('WidgetEnabled').'</td>'; print '<td>'.$langs->trans('WidgetEnabled').'</td>';
print '<td>'.yn($active).'</td>'; print '<td>'.yn($active).'</td>';
print "</tr>"."\n"; print '</tr>'."\n";
print '</table>'."\n"; print '</table>'."\n";
print "</form>"."\n"; print "</form>\n";
$i++; $i++;
} }

View File

@ -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_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_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_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 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 // Disable javascript and ajax
print '<tr class="oddeven"><td>'.$langs->trans("DisableJavascript").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("DisableJavascript").'</td><td>';
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0); print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
print ' <span class="opacitymedium"> &nbsp; &nbsp; '.$langs->trans("DisableJavascriptNote").'</span>';
print '</td>';
print '<td>';
print '</td>'; print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>'; print '</tr>';
// Max size of lists // Max size of lists
@ -392,6 +393,13 @@ print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("LoginPage
print '<th width="20">&nbsp;</th>'; print '<th width="20">&nbsp;</th>';
print '</tr>'; 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">&nbsp;</td>';
print '</tr>';
// Message on login page // Message on login page
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user')); $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
complete_substitutions_array($substitutionarray, $langs); complete_substitutions_array($substitutionarray, $langs);
@ -407,13 +415,6 @@ $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'."\n"; 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">&nbsp;</td>';
print '</tr>';
// Background // Background
print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">'; print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
print '<div class="centpercent inline-block">'; print '<div class="centpercent inline-block">';

View File

@ -536,7 +536,7 @@ $errors = $hookmanager->errors;
// Line to enter new values (input fields) // Line to enter new values (input fields)
print "<tr ".$bcnd[$var].">"; print '<tr class="oddeven">';
if (empty($reshook)) if (empty($reshook))
{ {
@ -976,12 +976,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{ {
global $conf, $langs, $user, $db; global $conf, $langs, $user, $db;
global $form; global $form;
global $region_id; global $elementList, $sourceList;
global $elementList, $sourceList, $localtax_typeList;
global $bc;
$formadmin = new FormAdmin($db); $formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
foreach ($fieldlist as $field => $value) foreach ($fieldlist as $field => $value)
{ {

View File

@ -325,6 +325,22 @@ if ($conf->use_javascript_ajax)
if (!empty($menu['langs'])) $langs->load($menu['langs']); if (!empty($menu['langs'])) $langs->load($menu['langs']);
$titre = $langs->trans($menu['titre']); $titre = $langs->trans($menu['titre']);
$entry = '<table class="nobordernopadding centpercent"><tr><td>';
$entry .= '<strong> &nbsp; <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 .= '&nbsp; &nbsp; &nbsp;';
$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 .= '&nbsp; &nbsp; &nbsp;';
$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( $data[] = array(
'rowid'=>$menu['rowid'], 'rowid'=>$menu['rowid'],
'module'=>$menu['module'], 'module'=>$menu['module'],
@ -335,20 +351,8 @@ if ($conf->use_javascript_ajax)
'fk_mainmenu'=>$menu['fk_mainmenu'], 'fk_mainmenu'=>$menu['fk_mainmenu'],
'fk_leftmenu'=>$menu['fk_leftmenu'], 'fk_leftmenu'=>$menu['fk_leftmenu'],
'position'=>$menu['position'], 'position'=>$menu['position'],
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'. 'entry'=>$entry,
'<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'. 'buttons'=>$buttons
'</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> '.
'&nbsp; &nbsp; &nbsp;'.
'<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> '.
'&nbsp; &nbsp; &nbsp;'.
'<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>'
); );
$i++; $i++;
} }

View File

@ -387,7 +387,7 @@ if ($mode == 'feature')
$filedata = dol_buildpath($moduledir.'/sql/data.sql'); $filedata = dol_buildpath($moduledir.'/sql/data.sql');
if (dol_is_file($filedata)) 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"); else $text .= $langs->trans("No");

View File

@ -265,7 +265,7 @@ print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("FixedEmailTarget").'</td>'; print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
print '<td>'.$langs->trans("Threshold").'</td>'; print '<td>'.$langs->trans("Threshold").'</td>';
print '<td>'.'</td>'; print '<td></td>';
print "</tr>\n"; print "</tr>\n";
foreach ($listofnotifiedevents as $notifiedevent) foreach ($listofnotifiedevents as $notifiedevent)

View File

@ -66,7 +66,7 @@ if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
else else
{ {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug")); 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>'; print '<br>';
@ -123,7 +123,7 @@ if (!$foundcache && $test)
{ {
$foundcache++; $foundcache++;
print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "XCache"); 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'); $test = function_exists('eaccelerator_info');
if (!$foundcache && $test) if (!$foundcache && $test)

View File

@ -303,7 +303,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '<br>'; print '<br>';
print '<fieldset><legend>'.$langs->trans('ExportStructure').'</legend>'; 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 '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
print '<br>'; print '<br>';
print '</fieldset>'; print '</fieldset>';

View File

@ -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. '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), 'separator2'=>array('family'=>'separator', 'position'=>50),
// Automatic classification supplier proposal // 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 // 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 //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'])) if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))

View File

@ -137,6 +137,15 @@ class DolibarrApi
unset($object->labelStatus); unset($object->labelStatus);
unset($object->labelStatusShort); 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->element);
unset($object->fk_element); unset($object->fk_element);
unset($object->table_element); unset($object->table_element);

View File

@ -34,15 +34,18 @@ $langs->loadLangs(array("asset"));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
// Initialize technical objects // Initialize technical objects
$object = new Asset($db); $object = new Asset($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; $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 // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $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'; 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 // Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. 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 $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 $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 * Actions
*
* Put here all code to do according to value of "action" parameter
*/ */
$parameters = array(); $parameters = array();
@ -86,16 +86,35 @@ if (empty($reshook))
{ {
$error = 0; $error = 0;
$permissiontoadd = $user->rights->asset->create;
$permissiontodelete = $user->rights->asset->delete;
$backurlforlist = dol_buildpath('/asset/list.php', 1); $backurlforlist = dol_buildpath('/asset/list.php', 1);
// Actions cancel, add, update or delete // Actions cancel, add, update or delete
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; 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 // Actions when printing a doc from card
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; 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 // Actions to send emails
$triggersendname = 'ASSET_SENTBYMAIL'; $triggersendname = 'ASSET_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
@ -143,11 +162,12 @@ if ($action == 'create')
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">'; 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(), ''); dol_fiche_head(array(), '');
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent tableforfieldcreate">'."\n";
// Common attributes // Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
@ -166,6 +186,8 @@ if ($action == 'create')
print '</div>'; print '</div>';
print '</form>'; print '</form>';
//dol_set_focus('input[name="ref"]');
} }
// Part to edit record // 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="action" value="update">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; 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(); dol_fiche_head();
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent tableforfieldedit">'."\n";
// Common attributes // Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; 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(); $res = $object->fetch_optionals();
$head = asset_prepare_head($object); $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 = ''; $formconfirm = '';
@ -255,10 +279,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent">'."\n";
// Common attributes // 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'; 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'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>'; print '</table>';
@ -266,7 +292,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</div>'; print '</div>';
print '</div>'; print '</div>';
print '<div class="clearboth"></div><br>'; print '<div class="clearboth"></div>';
dol_fiche_end(); 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 //Select mail models is same action as presend
/*
if (GETPOST('modelselected')) $action = 'presend'; if (GETPOST('modelselected')) $action = 'presend';
// Presend form // Presend form
$modelmail='inventory'; /*
$modelmail='asset';
$defaulttopic='InformationMessage'; $defaulttopic='InformationMessage';
$diroutput = $conf->product->dir_output.'/inventory'; $diroutput = $conf->asset->dir_output.'/asset';
$trackid = 'stockinv'.$object->id; $trackid = 'asset'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
*/ */

View File

@ -77,12 +77,12 @@ class Asset extends CommonObject
*/ */
public $fields = array( public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), '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",), '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'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>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, 'help'=>"Help text",), '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_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",), '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,), '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_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,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,),

View File

@ -223,20 +223,20 @@ if ($action === 'downloadblockchain') {
{ {
$statusofrecordnote = $langs->trans("PreviousFingerprint").': '.$previoushash.($statusofrecordnote ? ' - '.$statusofrecordnote : ''); $statusofrecordnote = $langs->trans("PreviousFingerprint").': '.$previoushash.($statusofrecordnote ? ' - '.$statusofrecordnote : '');
} }
print $obj->rowid print $obj->rowid;
.';'.$obj->date_creation print ';'.$obj->date_creation;
.';"'.$obj->user_fullname.'"' print ';"'.str_replace('"', '""', $obj->user_fullname).'"';
.';'.$obj->action print ';'.$obj->action;
.';'.$obj->element print ';'.$obj->element;
.';'.$obj->amounts print ';'.$obj->amounts;
.';'.$obj->fk_object print ';'.$obj->fk_object;
.';'.$obj->date_object print ';'.$obj->date_object;
.';"'.$obj->ref_object.'"' print ';"'.str_replace('"', '""', $obj->ref_object).'"';
.';'.$obj->signature print ';'.$obj->signature;
.';'.$statusofrecord print ';'.$statusofrecord;
.';'.$statusofrecordnote print ';'.$statusofrecordnote;
.';"'.str_replace('"', '""', $obj->object_data).'"' print ';"'.str_replace('"', '""', $obj->object_data).'"';
."\n"; print "\n";
// Set new previous hash for next fetch // Set new previous hash for next fetch
$previoushash = $obj->signature; $previoushash = $obj->signature;

View File

@ -74,7 +74,7 @@ if ($nolinesbefore) {
print '<td class="linecoledit" colspan="'.$colspan.'">&nbsp;</td>'; print '<td class="linecoledit" colspan="'.$colspan.'">&nbsp;</td>';
print '</tr>'; 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; $coldisplay = 0;
// Adds a line numbering column // Adds a line numbering column

View File

@ -184,9 +184,7 @@ foreach ($fulltree as $key => $val)
'rowid'=>$val['rowid'], 'rowid'=>$val['rowid'],
'fk_menu'=>$val['fk_parent'], '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. '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>'
); );
} }

View File

@ -169,8 +169,8 @@ class CActionComm
if ($obj->module == 'invoice' && !$conf->facture->enabled) $qualified=0; if ($obj->module == 'invoice' && !$conf->facture->enabled) $qualified=0;
if ($obj->module == 'order' && !$conf->commande->enabled) $qualified=0; if ($obj->module == 'order' && !$conf->commande->enabled) $qualified=0;
if ($obj->module == 'propal' && !$conf->propal->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 == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ! $conf->supplier_invoice->enabled)) $qualified=0;
if ($obj->module == 'order_supplier' && !$conf->fournisseur->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 ($obj->module == 'shipping' && !$conf->expedition->enabled) $qualified=0;
} }

View File

@ -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->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->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->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(); 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->propal->enabled)) $propalstatic = new Propal($db);
if (!empty($conf->supplier_proposal->enabled)) $supplierproposalstatic = new SupplierProposal($db); if (!empty($conf->supplier_proposal->enabled)) $supplierproposalstatic = new SupplierProposal($db);
if (!empty($conf->commande->enabled)) $orderstatic = new Commande($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")); 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'); $listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort');
} }
// Search supplier order // 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'); $listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder');
} }
@ -414,7 +414,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
/* /*
* Draft suppliers orders * 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"); $langs->load("orders");
@ -581,7 +581,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
} }
// Last suppliers // 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"); $langs->load("boxes");

View File

@ -147,15 +147,15 @@ if ($action == 'add') {
if (preg_match("/st_dt/", $key)) { if (preg_match("/st_dt/", $key)) {
$dtarr = array(); $dtarr = array();
$dtarr = explode('_', $key); $dtarr = explode('_', $key);
if (!array_key_exists('options_'.$dtarr[1].'_st_dt'.'_cnct', $array_query)) { 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')); $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)) { } elseif (preg_match("/end_dt/", $key)) {
// Special case for end date come with 3 inputs day, month, year // Special case for end date come with 3 inputs day, month, year
$dtarr = array(); $dtarr = array();
$dtarr = explode('_', $key); $dtarr = explode('_', $key);
if (!array_key_exists('options_'.$dtarr[1].'_end_dt'.'_cnct', $array_query)) { 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')); $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 { } else {
$array_query[$key] = GETPOST($key); $array_query[$key] = GETPOST($key);
@ -299,15 +299,15 @@ if ($action == 'savefilter' || $action == 'createfilter') {
if (preg_match("/st_dt/", $key)) { if (preg_match("/st_dt/", $key)) {
$dtarr = array(); $dtarr = array();
$dtarr = explode('_', $key); $dtarr = explode('_', $key);
if (!array_key_exists('options_'.$dtarr[1].'_st_dt'.'_cnct', $array_query)) { 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')); $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)) { } elseif (preg_match("/end_dt/", $key)) {
// Special case for end date come with 3 inputs day, month, year // Special case for end date come with 3 inputs day, month, year
$dtarr = array(); $dtarr = array();
$dtarr = explode('_', $key); $dtarr = explode('_', $key);
if (!array_key_exists('options_'.$dtarr[1].'_end_dt'.'_cnct', $array_query)) { 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')); $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']; // print $array_query['cnct_options_'.$dtarr[1].'_end_dt'];
// 01/02/1013=1361228400 // 01/02/1013=1361228400
} }

View File

@ -724,13 +724,13 @@ class AdvanceTargetingMailing extends CommonObject
} }
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') || } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'int') ||
($extrafields->attributes[$elementtype]['type'][$key] == 'double')) { ($extrafields->attributes[$elementtype]['type'][$key] == 'double')) {
if (!empty($arrayquery['options_'.$key.'_max'.'_cnct'])) { if (!empty($arrayquery['options_'.$key.'_max_cnct'])) {
$sqlwhere[] = " (te.".$key." >= ".$arrayquery['options_'.$key.'_max'.'_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'.'_cnct'].")"; $sqlwhere[] = " (te.".$key." >= ".$arrayquery['options_'.$key.'_max_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min_cnct'].")";
} }
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') || } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'date') ||
($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) { ($extrafields->attributes[$elementtype]['type'][$key] == 'datetime')) {
if (!empty($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'])."')"; $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') { } elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'boolean') {
if ($arrayquery['options_'.$key.'_cnct'] != '') { if ($arrayquery['options_'.$key.'_cnct'] != '') {

View File

@ -1448,8 +1448,6 @@ if (empty($reshook))
* View * View
*/ */
llxHeader('', $langs->trans('Proposal'), 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
$form = new Form($db); $form = new Form($db);
$formother = new FormOther($db); $formother = new FormOther($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
@ -1458,6 +1456,9 @@ $formmargin = new FormMargin($db);
$companystatic = new Societe($db); $companystatic = new Societe($db);
if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($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(); $now = dol_now();
// Add new proposal // Add new proposal
@ -1465,7 +1466,7 @@ if ($action == 'create')
{ {
$currency_code = $conf->currency; $currency_code = $conf->currency;
print load_fiche_titre($langs->trans("NewProp")); print load_fiche_titre($langs->trans("NewProp"), '', 'propal');
$soc = new Societe($db); $soc = new Societe($db);
if ($socid > 0) if ($socid > 0)

View File

@ -2999,8 +2999,11 @@ class Propal extends CommonObject
if (!$error) 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; $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; $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal WHERE rowid = ".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))

View File

@ -58,7 +58,7 @@ $help_url = "EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|
llxHeader("", $langs->trans("ProspectionArea"), $help_url); 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 '<table width="100%" class="notopnoleftnoright">';
//print '<tr><td valign="top" width="30%" class="notopnoleft">'; //print '<tr><td valign="top" width="30%" class="notopnoleft">';

View File

@ -496,7 +496,7 @@ if ($resql)
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; 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"; $topicmail = "SendPropalRef";
$modelmail = "proposal_send"; $modelmail = "proposal_send";

View File

@ -67,20 +67,19 @@ $formpropal = new FormPropal($db);
$langs->loadLangs(array('propal', 'other', 'companies')); $langs->loadLangs(array('propal', 'other', 'companies'));
if ($mode == 'customer') $picto = 'propal';
{
$title = $langs->trans("ProposalsStatistics"); $title = $langs->trans("ProposalsStatistics");
$dir = $conf->propale->dir_temp; $dir = $conf->propale->dir_temp;
}
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$picto = 'supplier_proposal';
$title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; $title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")";
$dir = $conf->supplier_proposal->dir_temp; $dir = $conf->supplier_proposal->dir_temp;
} }
llxHeader('', $title); llxHeader('', $title);
print load_fiche_titre($title, '', 'commercial'); print load_fiche_titre($title, '', $picto);
dol_mkdir($dir); dol_mkdir($dir);

View File

@ -1493,7 +1493,7 @@ if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
// Mode creation // Mode creation
if ($action == 'create' && $usercancreate) if ($action == 'create' && $usercancreate)
{ {
print load_fiche_titre($langs->trans('CreateOrder'), '', 'commercial'); print load_fiche_titre($langs->trans('CreateOrder'), '', 'order');
$soc = new Societe($db); $soc = new Societe($db);
if ($socid > 0) if ($socid > 0)

View File

@ -33,7 +33,8 @@ class Orders extends DolibarrApi
* @var array $FIELDS Mandatory fields, checked when create and update object * @var array $FIELDS Mandatory fields, checked when create and update object
*/ */
static $FIELDS = array( 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 * @param array $request_data Request data
* @return int ID of order * @return int ID of order

View File

@ -3409,6 +3409,19 @@ class Commande extends CommonOrder
$error++; $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) if (!$error)
{ {
// Delete order details // Delete order details

View File

@ -64,7 +64,7 @@ $help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_P
llxHeader("", $langs->trans("Orders"), $help_url); 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">'; print '<div class="fichecenter"><div class="fichethirdleft">';
@ -106,6 +106,7 @@ if ($resql)
$total = 0; $total = 0;
$totalinprocess = 0; $totalinprocess = 0;
$dataseries = array(); $dataseries = array();
$colorseries = array();
$vals = array(); $vals = array();
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not) // -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
while ($i < $num) while ($i < $num)

View File

@ -502,7 +502,7 @@ if ($resql)
print '<input type="hidden" name="search_status" value="'.$search_status.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">'; 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"; $topicmail = "SendOrderRef";
$modelmail = "order_send"; $modelmail = "order_send";

View File

@ -66,20 +66,20 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers'));
$form = new Form($db); $form = new Form($db);
$formorder = new FormOrder($db); $formorder = new FormOrder($db);
if ($mode == 'customer') $picto = 'order';
{
$title = $langs->trans("OrdersStatistics"); $title = $langs->trans("OrdersStatistics");
$dir = $conf->commande->dir_temp; $dir = $conf->commande->dir_temp;
}
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$picto = 'supplier_order';
$title = $langs->trans("OrdersStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; $title = $langs->trans("OrdersStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")";
$dir = $conf->fournisseur->commande->dir_temp; $dir = $conf->fournisseur->commande->dir_temp;
} }
llxHeader('', $title); llxHeader('', $title);
print load_fiche_titre($title, '', 'commercial'); print load_fiche_titre($title, '', $picto);
dol_mkdir($dir); dol_mkdir($dir);

View File

@ -23,7 +23,7 @@
* \brief Page to show portoflio and files of a thirdparty and download it * \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 ((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'); if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
} }

View File

@ -1519,7 +1519,7 @@ if ($resql)
// Transaction reconciliated or edit link // Transaction reconciliated or edit link
if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated 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&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">'; print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
} }

View File

@ -346,7 +346,7 @@ if ($result)
$paymenttmp->fetch($links[$key]['url_id']); $paymenttmp->fetch($links[$key]['url_id']);
$paymenttmp->ref = $langs->trans("Payment").' '.$paymenttmp->ref; $paymenttmp->ref = $langs->trans("Payment").' '.$paymenttmp->ref;
/*print '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$links[$key]['url_id'].'">'; /*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 $langs->trans("Payment");
print '</a>';*/ print '</a>';*/
print $paymenttmp->getNomUrl(1); print $paymenttmp->getNomUrl(1);
@ -357,7 +357,7 @@ if ($result)
$paymenttmp->fetch($links[$key]['url_id']); $paymenttmp->fetch($links[$key]['url_id']);
$paymenttmp->ref = $langs->trans("Payment").' '.$paymenttmp->ref; $paymenttmp->ref = $langs->trans("Payment").' '.$paymenttmp->ref;
/*print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$links[$key]['url_id'].'">'; /*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 $langs->trans("Payment");
print '</a>';*/ print '</a>';*/
print $paymenttmp->getNomUrl(1); print $paymenttmp->getNomUrl(1);
@ -369,67 +369,67 @@ if ($result)
} }
elseif ($links[$key]['type'] == 'sc') { elseif ($links[$key]['type'] == 'sc') {
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("SocialContribution").($links[$key]['label'] ? ' - '.$links[$key]['label'] : '');
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'payment_sc') { elseif ($links[$key]['type'] == 'payment_sc') {
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("SocialContributionPayment");
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'payment_vat') { elseif ($links[$key]['type'] == 'payment_vat') {
print '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("VATPayment");
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'payment_salary') { elseif ($links[$key]['type'] == 'payment_salary') {
print '<a href="'.DOL_URL_ROOT.'/salaries/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("SalaryPayment");
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'payment_loan') { elseif ($links[$key]['type'] == 'payment_loan') {
print '<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("PaymentLoan");
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'loan') { elseif ($links[$key]['type'] == 'loan') {
print '<a href="'.DOL_URL_ROOT.'/loan/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("Loan");
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'member') { elseif ($links[$key]['type'] == 'member') {
print '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$links[$key]['url_id'].'">'; 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 $links[$key]['label'];
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'payment_donation') { elseif ($links[$key]['type'] == 'payment_donation') {
print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("DonationPayment");
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'banktransfert') { elseif ($links[$key]['type'] == 'banktransfert') {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$links[$key]['url_id'].'">'; 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 $langs->trans("TransactionOnTheOtherAccount");
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'user') { elseif ($links[$key]['type'] == 'user') {
print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("User");
print '</a>'; print '</a>';
} }
elseif ($links[$key]['type'] == 'payment_various') { elseif ($links[$key]['type'] == 'payment_various') {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$links[$key]['url_id'].'">'; 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 $langs->trans("VariousPayment");
print '</a>'; print '</a>';
} }

View File

@ -979,7 +979,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['
*/ */
if ($action == 'create') 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 $object = new Facture($db); // Source invoice
$product_static = new Product($db); $product_static = new Product($db);

View File

@ -1768,6 +1768,8 @@ if (empty($reshook))
if (!empty($origin) && !empty($originid)) if (!empty($origin) && !empty($originid))
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
$object->origin = $origin; $object->origin = $origin;
$object->origin_id = $originid; $object->origin_id = $originid;
@ -1800,6 +1802,17 @@ if (empty($reshook))
$line->fetch_optionals(); $line->fetch_optionals();
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note $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 // Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
if ($line->fk_remise_except) if ($line->fk_remise_except)
{ {
@ -1844,6 +1857,7 @@ if (empty($reshook))
{ {
$nextSituationInvoice = new Facture($db); $nextSituationInvoice = new Facture($db);
$nextSituationInvoice->fetch($id); $nextSituationInvoice->fetch($id);
// create extrafields with data from create form // create extrafields with data from create form
$extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element); $extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element);
$ret = $extrafields->setOptionalsFromPost(null, $nextSituationInvoice); $ret = $extrafields->setOptionalsFromPost(null, $nextSituationInvoice);
@ -2770,7 +2784,7 @@ if ($action == 'create')
$facturestatic = new Facture($db); $facturestatic = new Facture($db);
$extrafields->fetch_name_optionals_label($facturestatic->table_element); $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) if ($socid > 0)
$res = $soc->fetch($socid); $res = $soc->fetch($socid);

View File

@ -748,9 +748,13 @@ class FactureRec extends CommonInvoice
$error = 0; $error = 0;
$this->db->begin(); $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; $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid;
dol_syslog($sql); 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; $sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_rec WHERE rowid = ".$rowid;
dol_syslog($sql); dol_syslog($sql);
@ -759,6 +763,9 @@ class FactureRec extends CommonInvoice
// Delete linked object // Delete linked object
$res = $this->deleteObjectLinked(); $res = $this->deleteObjectLinked();
if ($res < 0) $error = -3; if ($res < 0) $error = -3;
// Delete extrafields
$res = $this->deleteExtraFields();
if ($res < 0) $error = -4;
} }
else else
{ {
@ -1966,6 +1973,14 @@ class FactureLigneRec extends CommonInvoiceLine
} }
} }
if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0) {
$error++;
}
}
if (!$error) if (!$error)
{ {
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;

View File

@ -1394,11 +1394,11 @@ class Facture extends CommonInvoice
$label = ''; $label = '';
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
$label = '<u>'.$langs->trans("ShowInvoice").'</u>'; $label = '<u>'.$langs->trans("Invoice").'</u>';
if ($this->type == self::TYPE_REPLACEMENT) $label = '<u>'.$langs->transnoentitiesnoconv("ShowInvoiceReplace").'</u>'; if ($this->type == self::TYPE_REPLACEMENT) $label = '<u>'.$langs->transnoentitiesnoconv("ReplacementInvoice").'</u>';
if ($this->type == self::TYPE_CREDIT_NOTE) $label = '<u>'.$langs->transnoentitiesnoconv("ShowInvoiceAvoir").'</u>'; if ($this->type == self::TYPE_CREDIT_NOTE) $label = '<u>'.$langs->transnoentitiesnoconv("CreditNote").'</u>';
if ($this->type == self::TYPE_DEPOSIT) $label = '<u>'.$langs->transnoentitiesnoconv("ShowInvoiceDeposit").'</u>'; if ($this->type == self::TYPE_DEPOSIT) $label = '<u>'.$langs->transnoentitiesnoconv("Deposit").'</u>';
if ($this->type == self::TYPE_SITUATION) $label = '<u>'.$langs->transnoentitiesnoconv("ShowInvoiceSituation").'</u>'; if ($this->type == self::TYPE_SITUATION) $label = '<u>'.$langs->transnoentitiesnoconv("InvoiceSituation").'</u>';
if (!empty($this->ref)) if (!empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->ref_client)) if (!empty($this->ref_client))
@ -1426,7 +1426,7 @@ class Facture extends CommonInvoice
{ {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
$label = $langs->trans("ShowInvoice"); $label = $langs->trans("Invoice");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
} }
$linkclose .= ' title="'.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 // Delete invoice line
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid;
dol_syslog(get_class($this)."::delete", LOG_DEBUG); 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; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.$rowid;
@ -5477,6 +5480,13 @@ class FactureLigne extends CommonInvoiceLine
} }
// End call triggers // 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; $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid;
dol_syslog(get_class($this)."::delete", LOG_DEBUG); 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 = 'SELECT fd.situation_percent FROM '.MAIN_DB_PREFIX.'facturedet fd';
$sql .= ' JOIN '.MAIN_DB_PREFIX.'facture f ON (f.rowid = fd.fk_facture) '; $sql .= ' JOIN '.MAIN_DB_PREFIX.'facture f ON (f.rowid = fd.fk_facture) ';
$sql .= ' WHERE fd.fk_prev_id ='.$this->fk_prev_id; $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; $sql .= ' AND f.type = '.Facture::TYPE_CREDIT_NOTE;
$res = $this->db->query($sql); $res = $this->db->query($sql);
@ -5577,6 +5587,8 @@ class FactureLigne extends CommonInvoiceLine
while ($obj = $this->db->fetch_object($res)) { while ($obj = $this->db->fetch_object($res)) {
$returnPercent = $returnPercent + floatval($obj->situation_percent); $returnPercent = $returnPercent + floatval($obj->situation_percent);
} }
} else {
dol_print_error($this->db);
} }
} }

View File

@ -333,7 +333,7 @@ if ($resql)
$title = $langs->trans("RepeatableInvoices"); $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>'; print '<span class="opacitymedium">'.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'</span><br><br>';

View File

@ -691,7 +691,7 @@ if ($resql)
print '<input type="hidden" name="search_status" value="'.$search_status.'">'; print '<input type="hidden" name="search_status" value="'.$search_status.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; 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"; $topicmail = "SendBillRef";
$modelmail = "facture_send"; $modelmail = "facture_send";

View File

@ -24,7 +24,7 @@
/** /**
* \file htdocs/compta/facture/prelevement.php * \file htdocs/compta/facture/prelevement.php
* \ingroup facture * \ingroup facture
* \brief Gestion des prelevement d'une facture * \brief Management of direct debit order of invoices
*/ */
require '../../main.inc.php'; 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/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.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(); if (!$user->rights->facture->lire) accessforbidden();

View File

@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
// Load translation files required by the page
$langs->loadLangs(array('bills', 'companies', 'other'));
$mode = GETPOST("mode") ?GETPOST("mode") : 'customer'; $mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
if ($mode == 'customer' && !$user->rights->facture->lire) accessforbidden(); if ($mode == 'customer' && !$user->rights->facture->lire) accessforbidden();
if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden(); if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden();
@ -57,25 +60,24 @@ $endyear = $year;
/* /*
* View * View
*/ */
// Load translation files required by the page
$langs->loadLangs(array('bills', 'companies', 'other'));
$form = new Form($db); $form = new Form($db);
llxHeader(); llxHeader();
if ($mode == 'customer') $picto = 'bill';
{
$title = $langs->trans("BillsStatistics"); $title = $langs->trans("BillsStatistics");
$dir = $conf->facture->dir_temp; $dir = $conf->facture->dir_temp;
}
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$picto = 'supplier_invoice';
$title = $langs->trans("BillsStatisticsSuppliers"); $title = $langs->trans("BillsStatisticsSuppliers");
$dir = $conf->fournisseur->facture->dir_temp; $dir = $conf->fournisseur->facture->dir_temp;
} }
print load_fiche_titre($title, '', 'invoicing');
print load_fiche_titre($title, '', $picto);
dol_mkdir($dir); dol_mkdir($dir);

View File

@ -87,7 +87,7 @@ $thirdpartystatic = new Societe($db);
llxHeader("", $langs->trans("AccountancyTreasuryArea")); 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">'; 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'); $listofsearchfields['search_invoice'] = array('text'=>'CustomerInvoice');
} }
// Search supplier invoices // 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'); $listofsearchfields['search_supplier_invoice'] = array('text'=>'SupplierInvoice');
} }
@ -231,7 +231,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
/** /**
* Draft suppliers invoices * 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 = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier";
$sql .= ", s.nom as name"; $sql .= ", s.nom as name";
@ -447,7 +447,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
// Last modified supplier invoices // 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"); $langs->load("boxes");
$facstatic = new FactureFournisseur($db); $facstatic = new FactureFournisseur($db);
@ -958,7 +958,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
/* /*
* Unpayed supplier invoices * 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); $facstatic = new FactureFournisseur($db);

View File

@ -250,7 +250,7 @@ llxHeader('', $name);
//$textprevyear="<a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current-1) . "\">".img_previous()."</a>"; //$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>"; //$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, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
//report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode); //report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode);

View File

@ -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); $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 = "SELECT rowid, amount, label, f.datev, f.datep";
$sql .= " FROM ".MAIN_DB_PREFIX."localtax as f "; $sql .= " FROM ".MAIN_DB_PREFIX."localtax as f ";

View File

@ -185,7 +185,7 @@ class Cpaiement
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
if (null !== $ref) { if (null !== $ref) {
$sql .= ' WHERE t.entity IN ('.getEntity('c_paiement').')'; $sql .= ' WHERE t.entity IN ('.getEntity('c_paiement').')';
$sql .= ' AND t.code = '.'\''.$ref.'\''; $sql .= " AND t.code = '".$this->db->escape($ref)."'";
} else { } else {
$sql .= ' WHERE t.id = '.$id; $sql .= ' WHERE t.id = '.$id;
} }

View File

@ -217,7 +217,7 @@ if ($resql)
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="search_status" value="'.$search_status.'">'; 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 '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";

View File

@ -88,7 +88,7 @@ $formother = new FormOther($db);
llxHeader(); llxHeader();
$titre = ($year ? $langs->trans("PaymentsReportsForYear", $year) : $langs->trans("PaymentsReports")); $titre = ($year ? $langs->trans("PaymentsReportsForYear", $year) : $langs->trans("PaymentsReports"));
print load_fiche_titre($titre, '', 'invoicing'); print load_fiche_titre($titre, '', 'bill');
// Formulaire de generation // Formulaire de generation
print '<form method="post" action="rapport.php?year='.$year.'">'; print '<form method="post" action="rapport.php?year='.$year.'">';
@ -154,9 +154,11 @@ if ($year)
{ {
$tfile = $dir.'/'.$year.'/'.$file; $tfile = $dir.'/'.$year.'/'.$file;
$relativepath = $year.'/'.$file; $relativepath = $year.'/'.$file;
print '<tr class="oddeven">'.'<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&amp;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&amp;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_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); closedir($handle);

View File

@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'widthdrawals')); $langs->loadLangs(array('banks', 'categories', 'widthdrawals'));
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
// Security check // Security check
$socid = GETPOST('socid', 'int'); $socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid; if ($user->socid) $socid = $user->socid;
@ -101,7 +103,10 @@ if ($result)
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
$urladd = "&amp;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 = ''; $selectedfields = '';
@ -119,10 +124,9 @@ if ($result)
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; 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 '<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 = ''; $moreforfilter = '';
@ -141,11 +145,11 @@ if ($result)
print '</tr>'; print '</tr>';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', '', 'class="liste_titre"', $sortfield, $sortorder); print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", "", 'class="liste_titre" align="center"', $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", "", "", 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n";
print "</tr>\n"; print "</tr>\n";
$directdebitorder = new BonPrelevement($db); $directdebitorder = new BonPrelevement($db);

View File

@ -1229,6 +1229,9 @@ class BonPrelevement extends CommonObject
$label = '<u>'.$langs->trans("ShowWithdraw").'</u>'; $label = '<u>'.$langs->trans("ShowWithdraw").'</u>';
$label .= '<br>'; $label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref; $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; $url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id;

View File

@ -252,7 +252,7 @@ if ($resql)
print '<input type="hidden" name="limit" value="'.$limit.'"/>'; 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 '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';

View File

@ -32,12 +32,21 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('banks', 'withdrawals', 'companies', 'categories')); $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 // Security check
$socid = GETPOST('socid', 'int'); $socid = GETPOST('socid', 'int');
if ($user->socid) $socid=$user->socid; if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons'); $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'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
@ -57,7 +66,7 @@ $statut = GETPOST('statut', 'int');
$bon = new BonPrelevement($db, ""); $bon = new BonPrelevement($db, "");
$ligne = new LignePrelevement($db, $user); $ligne = new LignePrelevement($db, $user);
$company = new Societe($db);
/* /*
* Actions * Actions
@ -81,9 +90,9 @@ $form = new Form($db);
llxHeader('', $langs->trans("WithdrawalsLines")); llxHeader('', $langs->trans("WithdrawalsLines"));
$sql = "SELECT p.rowid, p.ref, p.statut, p.datec"; $sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
$sql .= " ,f.rowid as facid, f.ref, f.total_ttc"; $sql .= " ,f.rowid as facid, f.ref as invoiceref, f.total_ttc";
$sql .= " , s.rowid as socid, s.nom as name, s.code_client"; $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 .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
@ -124,14 +133,21 @@ if ($result)
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
$urladd = "&amp;statut=".$statut; $param = "&amp;statut=".urlencode($statut);
$urladd .= "&amp;search_bon=".$search_bon; $param .= "&amp;search_bon=".urlencode($search_bon);
if ($limit > 0 && $limit != $conf->liste_limit) $urladd .= '&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
print"\n<!-- debut table -->\n"; 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 = ''; $moreforfilter = '';
@ -153,13 +169,13 @@ if ($result)
print '</tr>'; print '</tr>';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("Line", $_SERVER["PHP_SELF"]); print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref"); print_liste_field_titre("WithdrawalsReceipts", $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $urladd); print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom"); print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", '', '', 'align="center"'); 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", "", "", 'align="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", "", "", 'class="right"'); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";
@ -167,28 +183,37 @@ if ($result)
{ {
$obj = $db->fetch_object($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 $ligne->LibStatut($obj->statut_ligne, 2);
print "&nbsp;"; print "&nbsp;";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">'; print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
print substr('000000'.$obj->rowid_ligne, -6); print substr('000000'.$obj->rowid_ligne, -6);
print '</a></td>'; print '</a></td>';
print '<td>'; print '<td>';
print $bon->getNomUrl(1);
print "</td>\n";
print $bon->LibStatut($obj->statut, 2); print '<td>';
print "&nbsp;"; print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">';
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 img_object($langs->trans("ShowBill"), "bill"); print img_object($langs->trans("ShowBill"), "bill");
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n"; print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->invoiceref."</a></td>\n";
print '</a></td>'; 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"; print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";

View File

@ -227,17 +227,15 @@ print "</tr>\n";
if ($modecompta == 'BOOKKEEPING') if ($modecompta == 'BOOKKEEPING')
{ {
$predefinedgroupwhere = "("; $predefinedgroupwhere = "(";
//$predefinedgroupwhere.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))";
$predefinedgroupwhere .= " (pcg_type = 'EXPENSE')"; $predefinedgroupwhere .= " (pcg_type = 'EXPENSE')";
$predefinedgroupwhere .= " OR "; $predefinedgroupwhere .= " OR ";
//$predefinedgroupwhere.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))";
$predefinedgroupwhere .= " (pcg_type = 'INCOME')"; $predefinedgroupwhere .= " (pcg_type = 'INCOME')";
$predefinedgroupwhere .= ")"; $predefinedgroupwhere .= ")";
$charofaccountstring = $conf->global->CHARTOFACCOUNTS; $charofaccountstring = $conf->global->CHARTOFACCOUNTS;
$charofaccountstring = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); $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 .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as f";
$sql .= ", ".MAIN_DB_PREFIX."accounting_account as aa"; $sql .= ", ".MAIN_DB_PREFIX."accounting_account as aa";
$sql .= " WHERE f.numero_compte = aa.account_number"; $sql .= " WHERE f.numero_compte = aa.account_number";
@ -271,7 +269,7 @@ if ($modecompta == 'BOOKKEEPING')
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</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 '<td class="right">'.price($objp->amount)."</td>\n";
print "</tr>\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) // This make 14 calls for each detail of account (NP, N and month m)
if ($showaccountdetail != 'no') 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 fk_pcg_version = '".$db->escape($charofaccountstring)."'";
//$tmppredefinedgroupwhere.= " AND thirdparty_code = '".$db->escape($objp->name)."'"; //$tmppredefinedgroupwhere.= " AND thirdparty_code = '".$db->escape($objp->name)."'";

View File

@ -556,7 +556,7 @@ class ChargeSociales extends CommonObject
if (empty($this->ref)) $this->ref = $this->label; if (empty($this->ref)) $this->ref = $this->label;
$label = '<u>'.$langs->trans("ShowSocialContribution").'</u>'; $label = '<u>'.$langs->trans("SocialContribution").'</u>';
if (!empty($this->ref)) if (!empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (!empty($this->label)) if (!empty($this->label))
@ -569,7 +569,7 @@ class ChargeSociales extends CommonObject
{ {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
$label = $langs->trans("ShowSocialContribution"); $label = $langs->trans("SocialContribution");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
} }
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';

View File

@ -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>" : ""); $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)) if (empty($mysoc->country_id) && empty($mysoc->country_code))
{ {

View File

@ -462,7 +462,7 @@ if (count($amount)) {
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td>'.$langs->trans("Total").'</td>'; print '<td>'.$langs->trans("Total").'</td>';
if ($modecompta != 'CREANCES-DETTES') { if ($modecompta != 'CREANCES-DETTES') {
print '<td colspan="1"></td>'; print '<td></td>';
} else { } else {
print '<td class="right">'.price($catotal_ht).'</td>'; print '<td class="right">'.price($catotal_ht).'</td>';
} }

View File

@ -625,7 +625,7 @@ if (count($amount)) {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
if ($modecompta != 'CREANCES-DETTES') { if ($modecompta != 'CREANCES-DETTES') {
print '<td colspan="1"></td>'; print '<td></td>';
} else { } else {
print '<td class="right">'.price($catotal_ht).'</td>'; print '<td class="right">'.price($catotal_ht).'</td>';
} }

View File

@ -574,7 +574,7 @@ if (count($amount)) {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
if ($modecompta != 'CREANCES-DETTES') { if ($modecompta != 'CREANCES-DETTES') {
print '<td colspan="1"></td>'; print '<td></td>';
} else { } else {
print '<td class="right">'.price($catotal_ht).'</td>'; print '<td class="right">'.price($catotal_ht).'</td>';
} }

View File

@ -191,15 +191,15 @@ if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description .= '<br>'.$langs
$description .= ($description ? '<br>' : '').$fsearch; $description .= ($description ? '<br>' : '').$fsearch;
if (!empty($conf->global->TAX_REPORT_EXTRA_REPORT)) if (!empty($conf->global->TAX_REPORT_EXTRA_REPORT))
{ {
$description .= '<br>' $description .= '<br>';
. '<input type="radio" name="extra_report" value="0" '.($special_report ? '' : 'checked="checked"').'> ' $description .= '<input type="radio" name="extra_report" value="0" '.($special_report ? '' : 'checked="checked"').'> ';
. $langs->trans('SimpleReport') $description .= $langs->trans('SimpleReport');
. '</input>' $description .= '</input>';
. '<br>' $description .= '<br>';
. '<input type="radio" name="extra_report" value="1" '.($special_report ? 'checked="checked"' : '').'> ' $description .= '<input type="radio" name="extra_report" value="1" '.($special_report ? 'checked="checked"' : '').'> ';
. $langs->trans('AddExtraReport') $description .= $langs->trans('AddExtraReport');
. '</input>' $description .= '</input>';
. '<br>'; $description .= '<br>';
} }
$elementcust = $langs->trans("CustomersInvoices"); $elementcust = $langs->trans("CustomersInvoices");

View File

@ -255,7 +255,7 @@ llxHeader('', $name);
//$textprevyear="<a href=\"index.php?year=" . ($year_current-1) . "\">".img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a>"; //$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>"; //$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, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
//report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode); //report_header($name,'',$textprevyear.$langs->trans("Year")." ".$year_start.$textnextyear,'',$description,$builddate,$exportlink,array(),$calcmode);

View File

@ -147,11 +147,11 @@ if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeA
if ($object->thirdparty->fournisseur) if ($object->thirdparty->fournisseur)
{ {
$thirdTypeArray['supplier'] = $langs->trans("supplier"); $thirdTypeArray['supplier'] = $langs->trans("supplier");
if ($conf->fournisseur->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_invoice->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_order->enabled)) && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']= $langs->transnoentitiesnoconv('SuppliersOrders');
// There no contact type for supplier proposals // There no contact type for supplier proposals
// if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals'); // 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>'; print '</table>';

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -57,19 +58,21 @@ $v = new vCard();
$v->setProdId('Dolibarr '.DOL_VERSION); $v->setProdId('Dolibarr '.DOL_VERSION);
$v->setUid('DOLIBARR-CONTACTID-'.$contact->id); $v->setUid('DOLIBARR-CONTACTID-'.$contact->id);
$v->setName($contact->lastname, $contact->firstname, "", "", ""); $v->setName($contact->lastname, $contact->firstname, "", $contact->civility, "");
$v->setFormattedName($contact->getFullName($langs)); $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_pro, "TYPE=WORK;VOICE");
//$v->setPhoneNumber($contact->phone_perso,"TYPE=HOME;VOICE");
$v->setPhoneNumber($contact->phone_mobile, "TYPE=CELL;VOICE"); $v->setPhoneNumber($contact->phone_mobile, "TYPE=CELL;VOICE");
$v->setPhoneNumber($contact->fax, "TYPE=WORK;FAX"); $v->setPhoneNumber($contact->fax, "TYPE=WORK;FAX");
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code ? $contact->country : ''), "TYPE=WORK;POSTAL"); $country = $contact->country_code ? $contact->country : '' ;
$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);
$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); $v->setTitle($contact->poste);
// Data from linked company // Data from linked company
@ -78,8 +81,35 @@ if ($company->id)
$v->setURL($company->url, "TYPE=WORK"); $v->setURL($company->url, "TYPE=WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE"); if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX"); 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 (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, $company->state, $company->zip, $company->country, "TYPE=WORK;POSTAL");
if (empty($contact->email)) $v->setEmail($company->email, 'TYPE=PREF,INTERNET');
// 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" // Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name); if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name);
} }

View File

@ -1098,7 +1098,7 @@ if ($result > 0)
// Create // Create
if ($action == 'create') if ($action == 'create')
{ {
print load_fiche_titre($langs->trans('AddContract'), '', 'commercial'); print load_fiche_titre($langs->trans('AddContract'), '', 'contract');
$soc = new Societe($db); $soc = new Societe($db);
if ($socid > 0) $soc->fetch($socid); if ($socid > 0) $soc->fetch($socid);

View File

@ -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) if (!$error)
{ {
// Delete contratdet // Delete contratdet

View File

@ -70,7 +70,7 @@ $now = dol_now();
llxHeader(); 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">'; //print '<table border="0" width="100%" class="notopnoleftnoright">';

View File

@ -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="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; 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"; $topicmail = "SendContractRef";
$modelmail = "contract"; $modelmail = "contract";

View File

@ -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("ListOfRunningServices");
if ($mode == "4" && $filter == "expired") $title = $langs->trans("ListOfExpiredServices"); if ($mode == "4" && $filter == "expired") $title = $langs->trans("ListOfExpiredServices");
if ($mode == "5") $title = $langs->trans("ListOfClosedServices"); 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) if ($sall)
{ {

View File

@ -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) : '')); $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) : '')); $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) : '')); $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) : ''));
} }

View File

@ -1359,7 +1359,7 @@ abstract class CommonObject
} }
if ($conf->{$modulename}->enabled) { if ($conf->{$modulename}->enabled) {
$libelle_element = $langs->trans('ContactDefault_'.$obj->element); $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); $libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle);
if (empty($option)) if (empty($option))
$tab[$obj->rowid] = $libelle_element.' - '.$libelle_type; $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
@ -2974,6 +2974,14 @@ abstract class CommonObject
// phpcs:enable // phpcs:enable
global $conf, $hookmanager, $action; 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) // Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield)
$MODULE = ""; $MODULE = "";
if ($this->element == 'propal') if ($this->element == 'propal')
@ -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' 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'
{ {
// 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); $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); $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; $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); 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); $resqlfix = $this->db->query($sqlfix);
if (! $resqlfix) dol_print_error($this->db, 'Failed to update line'); if (! $resqlfix) dol_print_error($this->db, 'Failed to update line');
$obj->total_tva = $tmpcal[1]; $obj->total_tva = $tmpcal[1];
$obj->total_ttc = $tmpcal[2]; $obj->total_ttc = $tmpcal[2];
//
} }
} }
@ -5230,6 +5243,25 @@ abstract class CommonObject
/* Functions for extrafields */ /* 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 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
@ -5244,7 +5276,7 @@ abstract class CommonObject
public function fetch_optionals($rowid = null, $optionsArray = null) public function fetch_optionals($rowid = null, $optionsArray = null)
{ {
// phpcs:enable // phpcs:enable
global $extrafields; global $conf, $extrafields;
if (empty($rowid)) $rowid = $this->id; if (empty($rowid)) $rowid = $this->id;
if (empty($rowid)) $rowid = $this->rowid; if (empty($rowid)) $rowid = $this->rowid;
@ -5328,10 +5360,13 @@ abstract class CommonObject
foreach ($tab as $key => $value) { foreach ($tab as $key => $value) {
if (!empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) if (!empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key]))
{ {
//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); $this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0);
} }
} }
} }
}
$this->db->free($resql); $this->db->free($resql);

View File

@ -48,6 +48,8 @@ class Conf
//! To store if javascript/ajax is enabked //! To store if javascript/ajax is enabked
public $use_javascript_ajax; public $use_javascript_ajax;
//! To store if javascript/ajax is enabked
public $disable_compute;
//! Used to store current currency (ISO code like 'USD', 'EUR', ...) //! Used to store current currency (ISO code like 'USD', 'EUR', ...)
public $currency; public $currency;
//! Used to store current css (from theme) //! Used to store current css (from theme)

View File

@ -147,7 +147,7 @@ class CUnits // extends CommonObject
/** /**
* Load object in memory from database * 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 $code Code
* @param string $short_label Short Label ('g', 'kg', ...) * @param string $short_label Short Label ('g', 'kg', ...)
* @param string $unit_type Unit type ('size', 'surface', 'volume', 'weight', ...) * @param string $unit_type Unit type ('size', 'surface', 'volume', 'weight', ...)
@ -168,7 +168,7 @@ class CUnits // extends CommonObject
$sql .= " t.active"; $sql .= " t.active";
$sql .= " FROM ".MAIN_DB_PREFIX."c_units as t"; $sql .= " FROM ".MAIN_DB_PREFIX."c_units as t";
$sql_where = array(); $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 ($unit_type) $sql_where[] = " t.unit_type = '".$this->db->escape($unit_type)."'";
if ($code) $sql_where[] = " t.code = '".$this->db->escape($code)."'"; if ($code) $sql_where[] = " t.code = '".$this->db->escape($code)."'";
if ($short_label) $sql_where[] = " t.short_label = '".$this->db->escape($short_label)."'"; if ($short_label) $sql_where[] = " t.short_label = '".$this->db->escape($short_label)."'";

View File

@ -1671,7 +1671,8 @@ class ExtraFields
} }
elseif ($type == 'price') elseif ($type == 'price')
{ {
$value = price($value, 0, $langs, 0, 0, -1, $conf->currency); //$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
if ($value || $value == '0') $value = price($value, 0, $langs, 0, 0, -1);
} }
elseif ($type == 'select') elseif ($type == 'select')
{ {

View File

@ -6642,8 +6642,7 @@ class Form
$out .= 'function formatResult(record) {'."\n"; $out .= 'function formatResult(record) {'."\n";
if ($elemtype == 'category') if ($elemtype == 'category')
{ {
$out .= ' //return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> <a href="'.DOL_URL_ROOT.'/categories/viewcat.php?type=0&id=\'+record.id+\'">\'+record.text+\'</a></span>\'; $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> \'+record.text+\'</span>\';';
} }
else else
{ {
@ -6653,8 +6652,7 @@ class Form
$out .= 'function formatSelection(record) {'."\n"; $out .= 'function formatSelection(record) {'."\n";
if ($elemtype == 'category') if ($elemtype == 'category')
{ {
$out .= ' //return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> <a href="'.DOL_URL_ROOT.'/categories/viewcat.php?type=0&id=\'+record.id+\'">\'+record.text+\'</a></span>\'; $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> \'+record.text+\'</span>\';';
} }
else else
{ {

View File

@ -247,7 +247,7 @@ class FormTicket
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';
// FK_USER_CREATE // User of creation
if ($this->withusercreate > 0 && $this->fk_user_create) { if ($this->withusercreate > 0 && $this->fk_user_create) {
print '<tr><td class="titlefield">'.$langs->trans("CreatedBy").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("CreatedBy").'</td><td>';
$langs->load("users"); $langs->load("users");
@ -270,6 +270,7 @@ class FormTicket
print '<tr><td class="titlefield">'.$langs->trans("ThirdParty").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("ThirdParty").'</td><td>';
$events = array(); $events = array();
$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
print img_picto('', 'company', 'class="paddingright"');
print $form->select_company($this->withfromsocid, 'socid', '', 1, 1, '', $events, 0, 'minwidth200'); print $form->select_company($this->withfromsocid, 'socid', '', 1, 1, '', $events, 0, 'minwidth200');
print '</td></tr>'; print '</td></tr>';
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { if (!empty($conf->use_javascript_ajax) && !empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) {
@ -330,6 +331,7 @@ class FormTicket
print '<tr><td>'.$langs->trans("Contact").'</td><td>'; print '<tr><td>'.$langs->trans("Contact").'</td><td>';
// If no socid, set to -1 to avoid full contacts list // If no socid, set to -1 to avoid full contacts list
$selectedCompany = ($this->withfromsocid > 0) ? $this->withfromsocid : -1; $selectedCompany = ($this->withfromsocid > 0) ? $this->withfromsocid : -1;
print img_picto('', 'contact', 'class="paddingright"');
$nbofcontacts = $form->select_contacts($selectedCompany, $this->withfromcontactid, 'contactid', 3, '', '', 0, 'minwidth200'); $nbofcontacts = $form->select_contacts($selectedCompany, $this->withfromcontactid, 'contactid', 3, '', '', 0, 'minwidth200');
print ' '; print ' ';
$formcompany->selectTypeContact($ticketstatic, '', 'type', 'external', '', 0, 'maginleftonly'); $formcompany->selectTypeContact($ticketstatic, '', 'type', 'external', '', 0, 'maginleftonly');

View File

@ -533,12 +533,9 @@ class SMTPs
/** /**
* Now send the message * Now send the message
* *
* @param boolean $_bolTestMsg whether to run this method in 'Test' mode. * @return boolean|null Result
* @param boolean $_bolDebug whether to log all communication between this Class and the Mail Server.
* @return boolean|null void
* $_strMsg If this is run in 'Test' mode, the actual message structure will be returned
*/ */
public function sendMsg($_bolTestMsg = false, $_bolDebug = false) public function sendMsg()
{ {
global $conf; global $conf;
@ -1510,8 +1507,8 @@ class SMTPs
} }
// always end related and end alternative after inline images // always end related and end alternative after inline images
$content .= "--".$this->_getBoundary('related')."--"."\r\n"; $content .= "--".$this->_getBoundary('related')."--\r\n";
$content .= "\r\n"."--".$this->_getBoundary('alternative')."--"."\r\n"; $content .= "\r\n--".$this->_getBoundary('alternative')."--\r\n";
$content .= "\r\n"; $content .= "\r\n";
} }
else else
@ -1537,34 +1534,25 @@ class SMTPs
$content .= "--".$this->_getBoundary('alternative')."\r\n"; $content .= "--".$this->_getBoundary('alternative')."\r\n";
} }
$content .= 'Content-Type: '.$_content['mimeType'].'; ' $content .= 'Content-Type: '.$_content['mimeType'].'; charset='.$this->getCharSet();
// . 'charset="' . $this->getCharSet() . '"';
. 'charset='.$this->getCharSet().'';
// $content .= ( $type == 'html') ? '; name="HTML Part"' : '';
$content .= "\r\n"; $content .= "\r\n";
// $content .= 'Content-Transfer-Encoding: ';
// $content .= ($type == 'html') ? 'quoted-printable' : $this->getTransEncodeType();
// $content .= "\r\n"
// . 'Content-Disposition: inline' . "\r\n"
// . 'Content-Description: ' . $type . ' message' . "\r\n";
if ($this->getMD5flag()) if ($this->getMD5flag()) {
$content .= 'Content-MD5: '.$_content['md5']."\r\n"; $content .= 'Content-MD5: '.$_content['md5']."\r\n";
}
$content .= "\r\n".$_content['data']."\r\n"; $content .= "\r\n".$_content['data']."\r\n";
if (!key_exists('image', $this->_msgContent) && $_content['dataText'] && !empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part after html part if (!key_exists('image', $this->_msgContent) && $_content['dataText'] && !empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part after html part
{ {
$content .= "--".$this->_getBoundary('alternative')."--"."\r\n"; $content .= "--".$this->_getBoundary('alternative')."--\r\n";
} }
$content .= "\r\n"; $content .= "\r\n";
} }
} }
// Close message boundries
// $content .= "\r\n--" . $this->_getBoundary() . '--' . "\r\n" ;
$content .= "--".$this->_getBoundary('mixed').'--'."\r\n"; $content .= "--".$this->_getBoundary('mixed').'--'."\r\n";
} }

View File

@ -32,6 +32,7 @@ class Translate
public $dir; // Directories that contains /langs subdirectory public $dir; // Directories that contains /langs subdirectory
public $defaultlang; // Current language for current user public $defaultlang; // Current language for current user
public $shortlang; // Short language for current user
public $charset_output = 'UTF-8'; // Codage used by "trans" method outputs public $charset_output = 'UTF-8'; // Codage used by "trans" method outputs
public $tab_translate = array(); // Array of all translations key=>value public $tab_translate = array(); // Array of all translations key=>value
@ -122,6 +123,7 @@ class Translate
} }
$this->defaultlang = $srclang; $this->defaultlang = $srclang;
$this->shortlang = substr($srclang, 0, 2);
//print 'this->defaultlang='.$this->defaultlang; //print 'this->defaultlang='.$this->defaultlang;
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) Kai Blankenhorn <kaib@bitfolge.de> /* Copyright (C) Kai Blankenhorn <kaib@bitfolge.de>
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.org> * Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -135,11 +136,11 @@ class vCard
/** /**
* mise en forme du nom complet * mise en forme du nom complet
* *
* @param string $family Family * @param string $family Family name
* @param string $first First * @param string $first First name
* @param string $additional Additionnal * @param string $additional Additional (e.g. second name, nick name)
* @param string $prefix Prefix * @param string $prefix Prefix (e.g. "Mr.", "Ms.", "Prof.")
* @param string $suffix Suffix * @param string $suffix Suffix (e.g. "sen." for senior, "jun." for junior)
* @return void * @return void
*/ */
public function setName($family = "", $first = "", $additional = "", $prefix = "", $suffix = "") public function setName($family = "", $first = "", $additional = "", $prefix = "", $suffix = "")
@ -216,15 +217,17 @@ class vCard
} }
/** /**
* mise en forme de l'email * Add a e-mail address to this vCard
* *
* @param string $address EMail * @param string $address E-mail address
* @param string $type Vcard type * @param string $type (optional) The type of the e-mail (typical "PREF;INTERNET" or "INTERNET")
* @return void * @return void
*/ */
public function setEmail($address, $type = "internet,pref") public function setEmail($address, $type = "TYPE=INTERNET;PREF")
{ {
$this->properties["EMAIL;TYPE=".$type] = $address; $key = "EMAIL";
if ($type != "") $key .= ";".$type;
$this->properties[$key] = $address;
} }
/** /**
@ -330,4 +333,32 @@ class vCard
{ {
return $this->filename; return $this->filename;
} }
/* Example from Microsoft Outlook 2019
BEGIN:VCARD
VERSION:2.1
N;LANGUAGE=de:surename;forename;secondname;Sir;jun.
FN:Sir surename secondname forename jun.
ORG:Companyname
TITLE:position
TEL;WORK;VOICE:work-phone-number
TEL;HOME;VOICE:private-phone-number
TEL;CELL;VOICE:mobile-phone-number
TEL;WORK;FAX:fax-phone-number
ADR;WORK;PREF:;;street and number;town;region;012345;Deutschland
LABEL;WORK;PREF;ENCODING=QUOTED-PRINTABLE:street and number=0D=0A=
=0D=0A=
012345 town region
X-MS-OL-DEFAULT-POSTAL-ADDRESS:2
URL;WORK:www.mywebpage.de
EMAIL;PREF;INTERNET:test1@test1.de
EMAIL;INTERNET:test2@test2.de
EMAIL;INTERNET:test3@test3.de
X-MS-IMADDRESS:test@jabber.org
REV:20200424T104242Z
END:VCARD
*/
} }

View File

@ -1325,7 +1325,7 @@ class DoliDBSqlite3 extends DoliDB
if ($this->db) if ($this->db)
{ {
$newname = preg_replace('/_/', '', $name); $newname = preg_replace('/_/', '', $name);
$localname = __CLASS__.'::'.'db'.$newname; $localname = __CLASS__.'::db'.$newname;
$reflectClass = new ReflectionClass(__CLASS__); $reflectClass = new ReflectionClass(__CLASS__);
$reflectFunction = $reflectClass->getMethod('db'.$newname); $reflectFunction = $reflectClass->getMethod('db'.$newname);
if ($arg_count < 0) { if ($arg_count < 0) {

View File

@ -56,16 +56,10 @@ function RemoveFromEnd($sourceString, $charToRemove)
*/ */
function FindBadUtf8($string) function FindBadUtf8($string)
{ {
$regex = '([\x00-\x7F]'. $regex = '([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]';
'|[\xC2-\xDF][\x80-\xBF]'. $regex .= '|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2}|(.{1}))';
'|\xE0[\xA0-\xBF][\x80-\xBF]'.
'|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'.
'|\xED[\x80-\x9F][\x80-\xBF]'.
'|\xF0[\x90-\xBF][\x80-\xBF]{2}'.
'|[\xF1-\xF3][\x80-\xBF]{3}'.
'|\xF4[\x80-\x8F][\x80-\xBF]{2}'.
'|(.{1}))';
$matches =array();
while (preg_match('/'.$regex.'/S', $string, $matches)) { while (preg_match('/'.$regex.'/S', $string, $matches)) {
if (isset($matches[2])) { if (isset($matches[2])) {
return true; return true;

Some files were not shown because too many files have changed in this diff Show More