Merge remote-tracking branch 'upstream/develop' into dolibarr-3510
Conflicts: htdocs/install/mysql/migration/3.9.0-4.0.0.sql
This commit is contained in:
commit
cd6c6f64c5
@ -161,11 +161,11 @@ if ($result) {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
@ -190,7 +190,7 @@ if ($result) {
|
||||
print '<td>' . $accountstatic->getNomUrl(1) . '</td>';
|
||||
print '<td>' . $obj->label . '</td>';
|
||||
|
||||
if ($obj->account_parent)
|
||||
if (! empty($obj->account_parent))
|
||||
{
|
||||
$accountparent->id = $obj->rowid2;
|
||||
$accountparent->label = $obj->label2;
|
||||
|
||||
@ -59,12 +59,17 @@ if ($action == 'add') {
|
||||
|
||||
// Clean code
|
||||
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
|
||||
if (GETPOST('account_category') <= 0) {
|
||||
$account_parent = '';
|
||||
} else {
|
||||
$account_parent = GETPOST('account_category','int');
|
||||
}
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type');
|
||||
$object->pcg_subtype = GETPOST('pcg_subtype');
|
||||
$object->account_number = $account_number;
|
||||
$object->account_parent = GETPOST('account_parent', 'int');
|
||||
$object->account_parent = $account_parent;
|
||||
$object->account_category = GETPOST('account_category');
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
$object->active = 1;
|
||||
@ -96,12 +101,17 @@ if ($action == 'add') {
|
||||
|
||||
// Clean code
|
||||
$account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right
|
||||
|
||||
if (GETPOST('account_category') <= 0) {
|
||||
$account_parent = '';
|
||||
} else {
|
||||
$account_parent = GETPOST('account_category','int');
|
||||
}
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type');
|
||||
$object->pcg_subtype = GETPOST('pcg_subtype');
|
||||
$object->account_number = $account_number;
|
||||
$object->account_parent = GETPOST('account_parent', 'int');
|
||||
$object->account_parent = $account_parent;
|
||||
$object->account_category = GETPOST('account_category');
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
|
||||
|
||||
@ -3423,26 +3423,26 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
|
||||
* @param string $forceunitoutput 'no' or numeric (-3, -6, ...) compared to $unit
|
||||
* @return string String to show dimensions
|
||||
*/
|
||||
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitouput='no')
|
||||
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
||||
|
||||
if (($forceunitouput == 'no' && $dimension < 1/10000) || (is_numeric($forceunitouput) && $forceunitouput == -6))
|
||||
if (($forceunitoutput == 'no' && $dimension < 1/10000) || (is_numeric($forceunitoutput) && $forceunitoutput == -6))
|
||||
{
|
||||
$dimension = $dimension * 1000000;
|
||||
$unit = $unit - 6;
|
||||
}
|
||||
elseif (($forceunitouput == 'no' && $dimension < 1/10) || (is_numeric($forceunitouput) && $forceunitouput == -3))
|
||||
elseif (($forceunitoutput == 'no' && $dimension < 1/10) || (is_numeric($forceunitoutput) && $forceunitoutput == -3))
|
||||
{
|
||||
$dimension = $dimension * 1000;
|
||||
$unit = $unit - 3;
|
||||
}
|
||||
elseif (($forceunitouput == 'no' && $dimension > 100000000) || (is_numeric($forceunitouput) && $forceunitouput == 6))
|
||||
elseif (($forceunitoutput == 'no' && $dimension > 100000000) || (is_numeric($forceunitoutput) && $forceunitoutput == 6))
|
||||
{
|
||||
$dimension = $dimension / 1000000;
|
||||
$unit = $unit + 6;
|
||||
}
|
||||
elseif (($forceunitouput == 'no' && $dimension > 100000) || (is_numeric($forceunitouput) && $forceunitouput == 3))
|
||||
elseif (($forceunitoutput == 'no' && $dimension > 100000) || (is_numeric($forceunitoutput) && $forceunitoutput == 3))
|
||||
{
|
||||
$dimension = $dimension / 1000;
|
||||
$unit = $unit + 3;
|
||||
|
||||
@ -343,6 +343,8 @@ CREATE TABLE llx_c_accounting_category (
|
||||
|
||||
ALTER TABLE llx_c_accounting_category ADD UNIQUE INDEX uk_c_accounting_category(code);
|
||||
|
||||
ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer;
|
||||
|
||||
|
||||
DROP INDEX uk_bordereau_cheque ON llx_bordereau_cheque;
|
||||
ALTER TABLE llx_bordereau_cheque CHANGE number ref VARCHAR(30) NOT NULL;
|
||||
|
||||
@ -29,7 +29,7 @@ create table llx_accounting_account
|
||||
pcg_type varchar(20) NOT NULL,
|
||||
pcg_subtype varchar(20) NOT NULL,
|
||||
account_number varchar(32) NOT NULL,
|
||||
account_parent varchar(32),
|
||||
account_parent integer, -- Hierarchic parent
|
||||
label varchar(255) NOT NULL,
|
||||
fk_accounting_category integer DEFAULT 0,
|
||||
fk_user_author integer DEFAULT NULL,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user