diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c8b3c7664e2..0983ec5d0ef 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -148,9 +148,9 @@ $FILENAMEEXEDOLIWAMP = "DoliWamp-$MAJOR.$MINOR.$BUILD"; $ARCH='noarch'; $newbuild = $BUILD; $newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev (fedora) -$newbuild =~ s/beta/0.2.beta1/gi; # beta (fedora) -$newbuild =~ s/rc./0.3.rc1/gi; # rc (fedora) -if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale (fedora) +$newbuild =~ s/beta(.?)/0.2.beta/gi; # beta (fedora) (we want beta1, beta2, betax to be same package name) +$newbuild =~ s/rc(.?)/0.3.rc/gi; # rc (fedora) (we want rc1, rc2, rcx to be same package name) +if ($newbuild !~ /-/) { $newbuild.='-0.4'; } # finale (fedora) #$newbuild =~ s/(dev|alpha)/0/gi; # dev #$newbuild =~ s/beta/1/gi; # beta #$newbuild =~ s/rc./2/gi; # rc @@ -162,10 +162,10 @@ $FILENAMERPM=$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm"; # For Deb $newbuild = $BUILD; $newbuild =~ s/(dev|alpha)/1/gi; # dev -$newbuild =~ s/beta/2/gi; # beta -$newbuild =~ s/rc./3/gi; # rc -if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale is same than rc. -# now newbuild is 0-1 or 0-3 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management +$newbuild =~ s/beta(.?)/2/gi; # beta (we want beta1, beta2, betax to be same package name) +$newbuild =~ s/rc(.?)/3/gi; # rc (we want rc1, rc2, rcx to be same package name) +if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc. +# now newbuild is 0-1 or 0-4 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management $build = $newbuild; $build =~ s/-.*$//g; # now build is 0 for example diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 8ebaa93d96c..3f251e0090b 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2015 Alexandre Spangaro +/* Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Alexandre Spangaro * * 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 @@ -17,9 +17,9 @@ */ /** - * \file htdocs/accountancy/admin/account.php - * \ingroup Accounting Expert - * \brief List accounting account + * \file htdocs/accountancy/admin/account.php + * \ingroup Advanced accountancy + * \brief List accounting account */ require '../../main.inc.php'; @@ -104,10 +104,12 @@ llxHeader('', $langs->trans("ListAccounts")); $pcgver = $conf->global->CHARTOFACCOUNTS; -$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active "; -$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa, " . MAIN_DB_PREFIX . "accounting_system as asy"; -$sql .= " WHERE aa.fk_pcg_version = asy.pcg_version"; -$sql .= " AND asy.rowid = " . $pcgver; +$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, "; +$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2"; +$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON aa.account_parent = a2.rowid"; +$sql .= " WHERE asy.rowid = " . $pcgver; if (strlen(trim($search_account))) { $sql .= " AND aa.account_number like '%" . $search_account . "%'"; @@ -175,6 +177,7 @@ if ($result) { $var = false; $accountstatic = new AccountingAccount($db); + $accountparent = new AccountingAccount($db); while ( $i < min($num, $limit) ) { $obj = $db->fetch_object($resql); @@ -186,7 +189,19 @@ if ($result) { print ''; print '' . $accountstatic->getNomUrl(1) . ''; print '' . $obj->label . ''; - print '' . $obj->account_parent . ''; + + if ($obj->account_parent) + { + $accountparent->id = $obj->rowid2; + $accountparent->label = $obj->label2; + $accountparent->account_number = $obj->account_number2; + + print '' . $accountparent->getNomUrl(1) . ''; + } + else + { + print ' '; + } print '' . $obj->pcg_type . ''; print '' . $obj->pcg_subtype . ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 2d7242ff225..b77bc5446af 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2015 Alexandre Spangaro +/* Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2016 Alexandre Spangaro * * 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 @@ -18,13 +18,14 @@ */ /** - * \file htdocs/accountancy/bookkeeping/card.php - * \ingroup Accounting Expert - * \brief Page to show account + * \file htdocs/accountancy/bookkeeping/card.php + * \ingroup Advanced accountancy + * \brief Page to show book-entry */ require '../../main.inc.php'; // Class +require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; @@ -190,6 +191,9 @@ else if ($action == "confirm_create") { } } +/* + * View + */ llxHeader(); $html = new Form($db); @@ -237,29 +241,32 @@ if ($action == 'create') { print ''; print ''; - print ''; + print ''; print ''; print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; print ''; + print ''; print ''; print ''; print ''; + print ''; print ''; print ''; print ''; + print '
' . $langs->trans("NumMvts") . '' . $langs->trans("NumMvts") . '' . $next_num_mvt . '
' . $langs->trans("Docdate") . ''; print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1); print '
' . $langs->trans("Codejournal") . '' . $html->selectarray('code_journal', $code_journal_array) . '
' . $langs->trans("Docref") . '
' . $langs->trans("Doctype") . '
'; dol_fiche_end(); @@ -281,7 +288,7 @@ if ($action == 'create') { print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -301,6 +308,7 @@ if ($action == 'create') { print ''; print ''; print '
' . $langs->trans("NumMvts") . '' . $langs->trans("NumMvts") . '' . $book->piece_num . '
' . $book->doc_type . '
'; + print '
'; $result = $book->fetch_all_per_mvt($piece_num); if ($result < 0) { @@ -328,11 +336,11 @@ if ($action == 'create') { print_liste_field_titre($langs->trans("Numerocompte")); print_liste_field_titre($langs->trans("Code_tiers")); print_liste_field_titre($langs->trans("Labelcompte")); - print_liste_field_titre($langs->trans("Debit")); - print_liste_field_titre($langs->trans("Credit")); - print_liste_field_titre($langs->trans("Amount")); - print_liste_field_titre($langs->trans("Sens")); - print_liste_field_titre(''); + print_liste_field_titre($langs->trans("Debit"), "", "", "", "", 'align="center"'); + print_liste_field_titre($langs->trans("Credit"), "", "", "", "", 'align="center"'); + print_liste_field_titre($langs->trans("Amount"), "", "", "", "", 'align="center"'); + print_liste_field_titre($langs->trans("Sens"), "", "", "", "", 'align="center"'); + print_liste_field_titre($langs->trans("Action"), "", "", "", "", 'width="60" align="center"'); print "\n"; @@ -352,24 +360,24 @@ if ($action == 'create') { print $formventilation->select_auxaccount($line->code_tiers, 'code_tiers', 1); print ''; print ''; - print ''; - print ''; - print '' . $line->montant . ''; - print '' . $line->sens . ''; + print ''; + print ''; + print '' . price($line->montant) . ''; + print '' . $line->sens . ''; print ''; print '' . "\n"; print ''; print ''; } else { - print '' . $line->numero_compte . ''; - print '' . $line->code_tiers . ''; + print '' . length_accountg($line->numero_compte) . ''; + print '' . length_accounta($line->code_tiers) . ''; print '' . $line->label_compte . ''; - print '' . $line->debit . ''; - print '' . $line->credit . ''; - print '' . $line->montant . ''; - print '' . $line->sens . ''; + print '' . price($line->debit) . ''; + print '' . price($line->credit) . ''; + print '' . price($line->montant) . ''; + print '' . $line->sens . ''; - print ''; + print ''; print ''; print img_edit(); print ' '; @@ -400,8 +408,8 @@ if ($action == 'create') { print $formventilation->select_auxaccount($code_tiers, 'code_tiers', 1); print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -417,4 +425,4 @@ if ($action == 'create') { } llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index d6925ac1995..387df40122c 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2015 Alexandre Spangaro +/* Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2016 Alexandre Spangaro * * 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 @@ -19,9 +19,9 @@ */ /** - * \file htdocs/accountancy/bookkeeping/list.php - * \ingroup Accounting Expert - * \brief List operation of book keeping + * \file htdocs/accountancy/bookkeeping/list.php + * \ingroup Advanced accountancy + * \brief List operation of book keeping */ require '../../main.inc.php'; @@ -260,8 +260,8 @@ if ($action == 'delbookkeeping') { $date = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE); print $date . $sep; print $line->doc_ref . $sep; - print length_accounta($line->numero_compte) . $sep; - print length_accountg($line->code_tiers) . $sep; + print length_accountg($line->numero_compte) . $sep; + print length_accounta($line->code_tiers) . $sep; print price($line->debit) . $sep; print price($line->credit) . $sep; @@ -277,7 +277,7 @@ if ($action == 'delbookkeeping') { $date = dol_print_date($line->doc_date, '%d/%m/%Y'); print $date . $sep; print $line->code_journal . $sep; - print length_accounta($line->numero_compte) . $sep; + print length_accountg($line->numero_compte) . $sep; print $line->piece_num . $sep; print $line->doc_ref . $sep; print price($line->debit) . $sep; @@ -289,6 +289,9 @@ if ($action == 'delbookkeeping') { } } +/* + * View + */ else { $title_page = $langs->trans("Bookkeeping") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end); @@ -352,8 +355,8 @@ else { print '
'; print '
' . "\n"; - print '
'; - print '' . $langs->trans("NewAccountingMvt") . ''; + print '
'; + print ''; // print '' . $langs->trans("Export") . ''; print '
'; @@ -396,12 +399,12 @@ else { print ''; print ''; - print ''; + print ''; print ''; print $langs->trans('From') . ': '; print $form->select_date($search_date_start, 'date_start', 0, 0, 1); print '
'; - print $langs->trans('To') . ': '; + print $langs->trans('to') . ': '; print $form->select_date($search_date_end, 'date_end', 0, 0, 1); // print $form->select_date($search_doc_date, 'doc_date', 0, 0, 1); print ''; @@ -412,7 +415,7 @@ else { print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, ''); // print $langs->trans('To') . ' ' . $langs->trans('AccountAccounting') . ': '; print '
'; - print $langs->trans('To'); + print $langs->trans('to'); print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, ''); print ''; // print ''; @@ -422,7 +425,7 @@ else { print $formventilation->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1); // print $langs->trans('To') . ' ' . $langs->trans('ThirdPartyAccount') . ': '; print '
'; - print $langs->trans('To'); + print $langs->trans('to'); print $formventilation->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1); print ''; // print ''; @@ -468,7 +471,7 @@ else { // print '' . $line->sens . ''; print '' . $line->code_journal . ''; print ''; - print '' . img_edit() . ''; + print '' . img_edit() . ' '; print '' . img_delete() . ''; print ''; print "\n"; diff --git a/htdocs/accountancy/bookkeeping/listbyyear.php b/htdocs/accountancy/bookkeeping/listbyyear.php index 3ec0a704407..dfd52ec0f00 100644 --- a/htdocs/accountancy/bookkeeping/listbyyear.php +++ b/htdocs/accountancy/bookkeeping/listbyyear.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro - * Copyright (C) 2013-2014 Florian Henry +/* Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Florian Henry * * 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 @@ -19,9 +19,9 @@ */ /** - * \file htdocs/accountancy/bookkeeping/listbyyear.php - * \ingroup Accounting Expert - * \brief Book keeping by year + * \file htdocs/accountancy/bookkeeping/listbyyear.php + * \ingroup Advanced accountancy + * \brief Book keeping by year */ require '../../main.inc.php'; @@ -184,13 +184,13 @@ print '
'; print '
'; print $langs->trans('From') . ' ' . $langs->trans('AccountAccounting') . ': '; print $formventilation->select_account($search_numero_compte_start, 'search_numero_compte_start', 1, array (), 1, 1, ''); -print $langs->trans('To') . ' ' . $langs->trans('AccountAccounting') . ': '; +print $langs->trans('to') . ' ' . $langs->trans('AccountAccounting') . ': '; print $formventilation->select_account($search_numero_compte_end, 'search_numero_compte_end', 1, array (), 1, 1, ''); print '
'; print '
'; print $langs->trans('From') . ' ' . $langs->trans('ThirdPartyAccount') . ': '; print $formventilation->select_auxaccount($search_code_tiers_start, 'search_code_tiers_start', 1); -print $langs->trans('To') . ' ' . $langs->trans('ThirdPartyAccount') . ': '; +print $langs->trans('to') . ' ' . $langs->trans('ThirdPartyAccount') . ': '; print $formventilation->select_auxaccount($search_code_tiers_end, 'searchcode_tiers_end', 1); print '
'; print ""; @@ -204,16 +204,14 @@ print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'] print_liste_field_titre($langs->trans("ThirdPartyAccount"), $_SERVER['PHP_SELF'], "t.code_tiers", "", $options, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, "", $sortfield, $sortorder); -print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, "", $sortfield, $sortorder); -print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "t.montant", "", $options, "", $sortfield, $sortorder); -print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "t.sens", "", $options, "", $sortfield, $sortorder); -print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, "", $sortfield, $sortorder); -print '\n"; print ''; - print ''; @@ -251,11 +249,11 @@ print ''; print ''; -print ''; -print ''; @@ -272,7 +270,6 @@ foreach ( $object->lines as $line ) { $var = ! $var; print ""; - print '' . "\n"; print '' . "\n"; print ''; @@ -283,9 +280,9 @@ foreach ( $object->lines as $line ) { print ''; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print "\n"; } print "
'; -print ''; +print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "t.montant", "", $options, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "t.sens", "", $options, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder); print "
'; print ''; print ''; print ''; +print ''; print ''; print ''; +print ''; print ''; print '
' . $line->piece_num . '' . $line->doc_type . '' . dol_print_date($line->doc_date) . '' . price($line->debit) . '' . price($line->credit) . '' . price($line->montant) . '' . $line->sens . '' . $line->code_journal . '' . img_edit() . '' . $line->sens . '' . $line->code_journal . '' . img_edit() . '
"; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 3f62dfbe40e..4529fe08278 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -23,9 +23,9 @@ */ /** - * \file htdocs/accountancy/journal/bankjournal.php - * \ingroup Accounting Expert - * \brief Page with bank journal + * \file htdocs/accountancy/journal/bankjournal.php + * \ingroup Advanced accountancy + * \brief Page with bank journal */ require '../../main.inc.php'; @@ -72,7 +72,7 @@ $now = dol_now(); if ($user->societe_id > 0 && empty($id_bank_account)) accessforbidden(); - /* +/* * View */ $year_current = strftime("%Y", dol_now()); @@ -127,7 +127,7 @@ $journal = $bank_code_journal->ref; dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG); $result = $db->query($sql); if ($result) { - + $num = $db->num_rows($result); // Variables $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef")); @@ -135,22 +135,22 @@ if ($result) { $accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef")); $accountancy_account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef")); $accountancy_account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef")); - + $tabpay = array (); $tabbq = array (); $tabtp = array (); $tabtype = array (); - + $i = 0; while ( $i < $num ) { $obj = $db->fetch_object($result); - + $tabcompany[$obj->rowid] = array ( 'id' => $obj->socid, 'name' => $obj->name, 'code_client' => $obj->code_compta ); - + // Controls $compta_bank = $obj->account_number; if ($obj->label == '(SupplierInvoicePayment)') @@ -159,8 +159,8 @@ if ($result) { $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli); if ($obj->typeop == '(BankTransfert)') $compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH; - - // Variable bookkeeping + + // Variable bookkeeping $tabpay[$obj->rowid]["date"] = $obj->do; $tabpay[$obj->rowid]["type_payment"] = $obj->fk_type; $tabpay[$obj->rowid]["ref"] = $obj->label; @@ -171,12 +171,12 @@ if ($result) { $tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60); } $links = $object->get_url($obj->rowid); - + // get_url may return -1 which is not traversable if (is_array($links)) { foreach ( $links as $key => $val ) { $tabtype[$obj->rowid] = $links[$key]['type']; - + if ($links[$key]['type'] == 'payment') { $paymentstatic->id = $links[$key]['url_id']; $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2); @@ -197,7 +197,7 @@ if ($result) { } else if ($links[$key]['type'] == 'sc') { $chargestatic->id = $links[$key]['url_id']; $chargestatic->ref = $links[$key]['url_id']; - + $tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2); if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { if ($reg[1] == 'socialcontribution') @@ -208,14 +208,14 @@ if ($result) { } $chargestatic->ref = $chargestatic->lib; $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); - + $sqlmid = 'SELECT cchgsoc.accountancy_code'; $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc "; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid"; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid"; $sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid; - + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); $resultmid = $db->query($sqlmid); if ($resultmid) { @@ -247,9 +247,9 @@ if ($result) { }*/ } } - + $tabbq[$obj->rowid][$compta_bank] += $obj->amount; - + // if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount; $i ++; @@ -265,7 +265,7 @@ if ($result) { // Write bookkeeping if ($action == 'writebookkeeping') { $now = dol_now(); - + $error = 0; foreach ( $tabpay as $key => $val ) { // Bank @@ -286,9 +286,9 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->fk_user_author = $user->id; $bookkeeping->date_create = $now; - + if ($tabtype[$key] == 'payment') { - + $sqlmid = 'SELECT fac.facnumber'; $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac "; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; @@ -301,7 +301,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->doc_ref = $objmid->facnumber; } } else if ($tabtype[$key] == 'payment_supplier') { - + $sqlmid = 'SELECT facf.ref_supplier,facf.ref'; $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf "; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid"; @@ -315,7 +315,7 @@ if ($action == 'writebookkeeping') { ; } } - + $result = $bookkeeping->create($user); if ($result < 0) { $error ++; @@ -338,12 +338,12 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->fk_user_author = $user->id; $bookkeeping->date_create = $now; - + if ($tabtype[$key] == 'sc') { $bookkeeping->code_tiers = ''; $bookkeeping->numero_compte = $k; } else if ($tabtype[$key] == 'payment') { - + $sqlmid = 'SELECT fac.facnumber'; $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac "; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; @@ -358,7 +358,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_tiers = $k; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; } else if ($tabtype[$key] == 'payment_supplier') { - + $sqlmid = 'SELECT facf.ref_supplier,facf.ref'; $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf "; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid"; @@ -373,7 +373,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_tiers = $k; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; } else if ($tabtype[$key] == 'company') { - + $sqlmid = 'SELECT fac.facnumber'; $sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac "; $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid"; @@ -392,7 +392,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->doc_ref = $k; $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; } - + $result = $bookkeeping->create($user); if ($result < 0) { $error ++; @@ -400,7 +400,7 @@ if ($action == 'writebookkeeping') { } } } - + if (empty($error)) { setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs'); } @@ -408,25 +408,25 @@ if ($action == 'writebookkeeping') { // Export if ($action == 'export_csv') { $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; - + include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; - + $companystatic = new Client($db); - + // Model Cegid Expert Export if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) { $sep = ";"; - + foreach ( $tabpay as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); - + $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; $companystatic->client = $tabcompany[$key]['code_client']; - + $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); - + // Bank foreach ( $tabbq[$key] as $k => $mt ) { print $date . $sep; @@ -439,7 +439,7 @@ if ($action == 'export_csv') { print $val["ref"] . $sep; print "\n"; } - + // Third party if (is_array($tabtp[$key])) { foreach ( $tabtp[$key] as $k => $mt ) { @@ -477,10 +477,10 @@ if ($action == 'export_csv') { // Model Classic Export foreach ( $tabpay as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), 'day'); - + $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; - + // Bank foreach ( $tabbq[$key] as $k => $mt ) { print '"' . $date . '"' . $sep; @@ -491,7 +491,7 @@ if ($action == 'export_csv') { print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; print "\n"; } - + // Third party if (is_array($tabtp[$key])) { foreach ( $tabtp[$key] as $k => $mt ) { @@ -521,23 +521,23 @@ if ($action == 'export_csv') { } else { $form = new Form($db); - + llxHeader('', $langs->trans("FinanceJournal")); $nom = $langs->trans("FinanceJournal") . ' - ' . $bank_code_journal->getNomUrl(1); $builddate = time(); $description = $langs->trans("DescFinanceJournal") . '
'; $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); - + $varlink = 'id_account=' . $id_bank_account; report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array ( 'action' => '' ), '', $varlink); - + print ''; - + print ''; - + print ' '; - + /* * Show result array */ print '

'; - + $i = 0; print ""; print ""; @@ -567,10 +567,10 @@ else { print ""; print ""; print "\n"; - + $var = true; $r = ''; - + foreach ( $tabpay as $key => $val ) { $date = dol_print_date($db->jdate($val["date"]), 'day'); @@ -580,8 +580,8 @@ else { if ($val["lib"] == '(CustomerInvoicePayment)') { $reflabel = $langs->trans('CustomerInvoicePayment'); } - - // Bank + + // Bank foreach ( $tabbq[$key] as $k => $mt ) { print ""; print ""; @@ -593,7 +593,7 @@ else { print ""; print ""; } - + // Third party if (is_array($tabtp[$key])) { foreach ( $tabtp[$key] as $k => $mt ) { @@ -624,9 +624,9 @@ else { } $var = ! $var; } - + print "
" . $langs->trans("PaymentMode") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
" . $date . "" . ($mt < 0 ? price(- $mt) : '') . "
"; - + llxFooter(); } $db->close(); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 4678a677597..5166d503b06 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -4,9 +4,9 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2015 Alexandre Spangaro - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2014 Raphaël Doursenaud * * This program is free software; you can redistribute it and/or modify @@ -24,9 +24,9 @@ */ /** - * \file htdocs/accountancy/journal/sellsjournal.php - * \ingroup Accounting Expert - * \brief Page with sells journal + * \file htdocs/accountancy/journal/sellsjournal.php + * \ingroup Advanced accountancy + * \brief Page with sells journal */ require '../../main.inc.php'; @@ -40,10 +40,10 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; // Langs +$langs->load("commercial"); $langs->load("compta"); $langs->load("bills"); $langs->load("other"); -$langs->load("main"); $langs->load("accountancy"); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 17a0c7f1cd5..ce5abc27416 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1337,18 +1337,19 @@ if ($id) } // Can an entry be erased or disabled ? - $iserasable=1;$isdisable=1; // true by default - + $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default if (isset($obj->code) && $id != 10) { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $isdisable = 0; } - else if ($obj->code == 'RECEP') { $iserasable = 0; $isdisable = 0; } - else if ($obj->code == 'EF0') { $iserasable = 0; $isdisable = 0; } + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } + else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } + else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; } - if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $isdisable=0; $isdisable = 0; } - + if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; } + $canbemodified=$iserasable; + if ($obj->code == 'RECEP') $canbemodified=1; + $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&id='.$id.'&'; // Favorite @@ -1363,7 +1364,7 @@ if ($id) // Active print ''; - if ($isdisable) print ''.$actl[$obj->active].''; + if ($canbedisabled) print ''.$actl[$obj->active].''; else { if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); @@ -1374,7 +1375,7 @@ if ($id) print ""; // Modify link - if ($iserasable) print ''.img_edit().''; + if ($canbemodified) print ''.img_edit().''; else print ' '; // Delete link diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 1bd3c9cf655..3406876e54e 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1287,7 +1287,7 @@ class Categorie extends CommonObject $sql = "SELECT ct.fk_categorie, c.label, c.rowid"; $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c"; - $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . $id . " AND c.type = " . $this->MAP_ID[$type]; + $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type]; $sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")"; $res = $this->db->query($sql); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index c5630d8c6c1..3988a986f67 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -556,7 +556,7 @@ if ($id > 0) if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) { print " ".img_warning(); } - print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; + print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; print ''.price($objp->total_ht).''; print ''.$propal_static->LibStatut($objp->fk_statut,5).''; $i++; @@ -637,7 +637,7 @@ if ($id > 0) $commande_static->total_tva = $objp->total_tva; $commande_static->total_ttc = $objp->total_ttc; print $commande_static->getNomUrl(1); - print ''.dol_print_date($db->jdate($objp->dc),'day')."\n"; + print ''.dol_print_date($db->jdate($objp->dc),'day')."\n"; print ''.price($objp->total_ht).''; print ''.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).''; $i++; @@ -700,7 +700,7 @@ if ($id > 0) print $sendingstatic->getNomUrl(1); print ''; if ($objp->date_creation > 0) { - print ''.dol_print_date($db->jdate($objp->date_creation),'day').''; + print ''.dol_print_date($db->jdate($objp->date_creation),'day').''; } else { print '!!!'; } @@ -760,8 +760,8 @@ if ($id > 0) print $contrat->getNomUrl(1,12); print "\n"; print ''.dol_trunc($objp->refsup,12)."\n"; - print ''.dol_print_date($db->jdate($objp->dc),'day')."\n"; - print ''.dol_print_date($db->jdate($objp->dcon),'day')."\n"; + print ''.dol_print_date($db->jdate($objp->dc),'day')."\n"; + print ''.dol_print_date($db->jdate($objp->dcon),'day')."\n"; print ' '; print ''; $contrat->fetch_lines(); @@ -818,9 +818,9 @@ if ($id > 0) print ""; print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; - //print ''.dol_print_date($db->jdate($objp->startdate)).''."\n"; - print ''.convertSecondToTime($objp->duration).''."\n"; - print ''.$fichinter_static->getLibStatut(5).''."\n"; + //print ''.dol_print_date($db->jdate($objp->startdate)).''."\n"; + print ''.convertSecondToTime($objp->duration).''."\n"; + print ''.$fichinter_static->getLibStatut(5).''."\n"; print ''; $var=!$var; $i++; @@ -869,7 +869,7 @@ if ($id > 0) print ''; print ''; - print ''; +print ''; +print ''; +print "\n"; +print "
'; + print ''; print ''; @@ -891,15 +891,24 @@ if ($id > 0) print ''; if ($objp->df > 0) { - print ''; + print ''; } else { print ''; } - print ''; + print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES)) + { + print ''; + } + + print ''; print "\n"; $i++; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4ab4eec2aef..e5f8a62acb5 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -9,6 +9,7 @@ * Copyright (C) 2015 Frederic France * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -46,8 +47,10 @@ $langs->load('bills'); $orderyear=GETPOST("orderyear","int"); $ordermonth=GETPOST("ordermonth","int"); +$orderday=GETPOST("orderday","int"); $deliveryyear=GETPOST("deliveryyear","int"); $deliverymonth=GETPOST("deliverymonth","int"); +$deliveryday=GETPOST("deliveryday","int"); $search_product_category=GETPOST('search_product_category','int'); $search_ref=GETPOST('search_ref','alpha')!=''?GETPOST('search_ref','alpha'):GETPOST('sref','alpha'); $search_ref_customer=GETPOST('search_ref_customer','alpha'); @@ -122,7 +125,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_total_ht=''; $orderyear=''; $ordermonth=''; - $deliverymonth=''; + $orderday=''; + $deliveryday=''; + $deliverymonth=''; $deliveryyear=''; $viewstatut=''; $billed=''; @@ -195,10 +200,10 @@ if ($viewstatut <> '') } if ($ordermonth > 0) { - if ($orderyear > 0 && empty($day)) + if ($orderyear > 0 && empty($orderday)) $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,$ordermonth,false))."' AND '".$db->idate(dol_get_last_day($orderyear,$ordermonth,false))."'"; - else if ($orderyear > 0 && ! empty($day)) - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $day, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $day, $orderyear))."'"; + else if ($orderyear > 0 && ! empty($orderday)) + $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $orderday, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $orderday, $orderyear))."'"; else $sql.= " AND date_format(c.date_commande, '%m') = '".$ordermonth."'"; } @@ -208,10 +213,10 @@ else if ($orderyear > 0) } if ($deliverymonth > 0) { - if ($deliveryyear > 0 && empty($day)) + if ($deliveryyear > 0 && empty($deliveryday)) $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,$deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,$deliverymonth,false))."'"; - else if ($deliveryyear > 0 && ! empty($day)) - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $deliverymonth, $day, $deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $deliverymonth, $day, $deliveryyear))."'"; + else if ($deliveryyear > 0 && ! empty($deliveryday)) + $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $deliverymonth, $deliveryday, $deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $deliverymonth, $deliveryday, $deliveryyear))."'"; else $sql.= " AND date_format(c.date_livraison, '%m') = '".$deliverymonth."'"; } @@ -270,8 +275,10 @@ if ($resql) if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($socid > 0) $param.='&socid='.$socid; if ($viewstatut != '') $param.='&viewstatut='.$viewstatut; + if ($orderday) $param.='&orderday='.$orderday; if ($ordermonth) $param.='&ordermonth='.$ordermonth; if ($orderyear) $param.='&orderyear='.$orderyear; + if ($deliveryday) $param.='&deliveryday='.$deliveryday; if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth; if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear; if ($search_ref) $param.='&search_ref='.$search_ref; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 1288278c32d..ec12242b4e4 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1882,14 +1882,7 @@ $now = dol_now(); llxHeader('', $langs->trans('Bill'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); - -/** - * ******************************************************************* - * - * Mode creation - * - * ******************************************************************** - */ +// Mode creation if ($action == 'create') { @@ -2046,7 +2039,7 @@ if ($action == 'create') else { print ''; } // Firstname if (! empty($arrayfields['p.firstname']['checked'])) { - print ''; + print ''; } // Zip if (! empty($arrayfields['p.zip']['checked'])) { - print ''; + print ''; } // Town if (! empty($arrayfields['p.town']['checked'])) { - print ''; + print ''; } // Function if (! empty($arrayfields['p.poste']['checked'])) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index c8504a186d4..c44c1fc36bb 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1426,9 +1426,9 @@ else print ''; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; // Area with common detail of line print '
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' '.$num.''; print ''; print '
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'.dol_print_date($db->jdate($objp->df),'day').''.dol_print_date($db->jdate($objp->df),'day').'!!!'.price($objp->total_ht).''; + print price($objp->total_ht); + print ''.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).''; + print price($objp->total_ttc); + print ''.($facturestatic->LibStatut($objp->paye,$objp->statut,5,$objp->am)).'
'; - print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1); + print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty'); // Option to reload page to retrieve customer informations. Note, this clear other input if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 5a20364bd44..c7bc789c6f4 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -10,7 +10,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2015-2016 Ferran Marcet * * 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 @@ -83,6 +83,7 @@ if ($page == -1) { $page = 0; } $offset = $limit * $page; +if (! $sortorder && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER; if (! $sortorder) $sortorder='DESC'; if (! $sortfield) $sortfield='f.datef'; $pageprev = $page - 1; @@ -542,7 +543,6 @@ if (empty($reshook)) // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { - $search_categ=''; $search_user=''; $search_sale=''; $search_product_category=''; @@ -559,6 +559,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $toselect=''; $option=''; $filter=''; + $day_lim=''; + $year_lim=''; + $month_lim=''; } @@ -695,13 +698,18 @@ if ($resql) $param='&socid='.$socid; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($day) $param.='&day='.$day; if ($month) $param.='&month='.$month; if ($year) $param.='&year=' .$year; + if ($day_lim) $param.='&day_lim='.$day_lim; + if ($month_lim) $param.='&month_lim='.$month_lim; + if ($year_lim) $param.='&year_lim=' .$year_lim; if ($search_ref) $param.='&search_ref=' .$search_ref; if ($search_refcustomer) $param.='&search_refcustomer=' .$search_refcustomer; if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_sale > 0) $param.='&search_sale=' .$search_sale; if ($search_user > 0) $param.='&search_user=' .$search_user; + if ($search_product_category > 0) $param.='$search_product_category=' .$search_product_category; if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; if ($search_status != '') $param.='&search_status='.$search_status; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 70e2564829e..c39b585d7b1 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -628,7 +628,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) /* * Customers orders to be billed */ -if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire) +if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { $commandestatic=new Commande($db); $langs->load("orders"); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 38f83c5ac54..2043516564c 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1260,26 +1260,24 @@ class BonPrelevement extends CommonObject $fileDebiteurSection = ''; $fileEmetteurSection = ''; $i = 0; - $j = 0; $this->total = 0; /* * section Debiteur (sepa Debiteurs bloc lines) */ + $tmp_invoices = array(); + $sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1"; $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - while ($j < $num) - { - $objfac = $this->db->fetch_object($resql); - $ListOfFactures = $ListOfFactures . $objfac->fac . ","; - $j++; + if ($resql) { + while ($objfac = $this->db->fetch_object($resql)) { + $tmp_invoices[] = $objfac->fac; } } + $ListOfFactures = implode($tmp_invoices); + $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 8db9b90ff49..20e1a0bd2cb 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -620,23 +620,23 @@ if ($result) if (! empty($arrayfields['p.lastname']['checked'])) { print ''; - print $contactstatic->getNomUrl(1,'',20); + print $contactstatic->getNomUrl(1,'',0); print ''.dol_trunc($obj->firstname,20).''.$obj->firstname.''.dol_trunc($obj->zip,20).''.$obj->zip.''.dol_trunc($obj->town,20).''.$obj->town.'
'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1f18d1ac26c..c5ee5301210 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -895,7 +895,7 @@ class Form * @param string $selected Preselected type * @param string $htmlname Name of field in form * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)') - * @param string $showempty Add an empty field (Can be '1' or text to use on empty line) + * @param string $showempty Add an empty field (Can be '1' or text to use on empty line like 'SelectThirdParty') * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to use combo box * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) @@ -950,7 +950,7 @@ class Form * @param string $selected Preselected type * @param string $htmlname Name of field in form * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client in (1,3)') - * @param string $showempty Add an empty field (Can be '1' or text to use on empty line) + * @param string $showempty Add an empty field (Can be '1' or text to use on empty line like 'SelectThirdParty') * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to use combo box * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 7823b3534ad..2661919722d 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -593,7 +593,7 @@ function listOfSessions() //$sessValues = 'newtoken|s:32:"1239f7a0c4b899200fe9ca5ea394f307";dol_loginmesg|s:0:"";newtoken|s:32:"1236457104f7ae0f328c2928973f3cb5";dol_loginmesg|s:0:"";token|s:32:"123615ad8d650c5cc4199b9a1a76783f";dol_login|s:5:"admin";dol_authmode|s:8:"dolibarr";dol_tz|s:1:"1";dol_tz_string|s:13:"Europe/Berlin";dol_dst|i:0;dol_dst_observed|s:1:"1";dol_dst_first|s:0:"";dol_dst_second|s:0:"";dol_screenwidth|s:4:"1920";dol_screenheight|s:3:"971";dol_company|s:12:"MyBigCompany";dol_entity|i:1;mainmenu|s:4:"home";leftmenuopened|s:10:"admintools";idmenu|s:0:"";leftmenu|s:10:"admintools";'; if (preg_match('/dol_login/i',$sessValues) && // limit to dolibarr session - (preg_match('/dol_entity\|i:'.$conf->entity.';/i',$sessValues) || preg_match('/dol_entity\|s:([0-9]+):"'.$conf->entity.'"/i',$sessValues)) && // limit to current entity + (preg_match('/dol_entity\|i:'.$conf->entity.';/i',$sessValues) || preg_match('/dol_entity\|s:([0-9]+):"'.$conf->entity.'"/i',$sessValues)) && // limit to current entity preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i',$sessValues)) // limit to company name { $tmp=explode('_', $file); @@ -909,27 +909,24 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql if (! empty($objMod->dictionaries)) { //var_dump($objMod->dictionaries['tabname']); - $taborder[] = 0; - $tabfieldcheck[] = array(); $tabhelp[] = array(); - foreach($objMod->dictionaries['tabname'] as $val) + $nbtabname=$nbtablib=$nbtabsql=$nbtabsqlsort=$nbtabfield=$nbtabfieldvalue=$nbtabfieldinsert=$nbtabrowid=$nbtabcond=$nbtabfieldcheck=$nbtabhelp=0; + foreach($objMod->dictionaries['tabname'] as $val) { $nbtabname++; $taborder[] = count($tabname)+1; $tabname[] = $val; } + foreach($objMod->dictionaries['tablib'] as $val) { $nbtablib++; $tablib[] = $val; } + foreach($objMod->dictionaries['tabsql'] as $val) { $nbtabsql++; $tabsql[] = $val; } + foreach($objMod->dictionaries['tabsqlsort'] as $val) { $nbtabsqlsort++; $tabsqlsort[] = $val; } + foreach($objMod->dictionaries['tabfield'] as $val) { $nbtabfield++; $tabfield[] = $val; } + foreach($objMod->dictionaries['tabfieldvalue'] as $val) { $nbtabfieldvalue++; $tabfieldvalue[] = $val; } + foreach($objMod->dictionaries['tabfieldinsert'] as $val) { $nbtabfieldinsert++; $tabfieldinsert[] = $val; } + foreach($objMod->dictionaries['tabrowid'] as $val) { $nbtabrowid++; $tabrowid[] = $val; } + foreach($objMod->dictionaries['tabcond'] as $val) { $nbtabcond++; $tabcond[] = $val; } + if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) { $nbtabhelp++; $tabhelp[] = $val; } + if (! empty($objMod->dictionaries['tabfieldcheck'])) foreach($objMod->dictionaries['tabfieldcheck'] as $val) { $nbtabfieldcheck++; $tabfieldcheck[] = $val; } + + if ($nbtabname != $nbtablib || $nbtablib != $nbtabsql || $nbtabsql != $nbtabsqlsort) { - $taborder[] = count($tabname)+1; - $tabname[] = $val; + print 'Error in descriptor of module '.$const_name.'. Array ->dictionaries has not same number of record for key "tabname", "tablib", "tabsql" and "tabsqlsort"'; + //print "$const_name: $nbtabname=$nbtablib=$nbtabsql=$nbtabsqlsort=$nbtabfield=$nbtabfieldvalue=$nbtabfieldinsert=$nbtabrowid=$nbtabcond=$nbtabfieldcheck=$nbtabhelp\n"; } - foreach($objMod->dictionaries['tablib'] as $val) $tablib[] = $val; - foreach($objMod->dictionaries['tabsql'] as $val) $tabsql[] = $val; - foreach($objMod->dictionaries['tabsqlsort'] as $val) $tabsqlsort[] = $val; - foreach($objMod->dictionaries['tabfield'] as $val) $tabfield[] = $val; - foreach($objMod->dictionaries['tabfieldvalue'] as $val) $tabfieldvalue[] = $val; - foreach($objMod->dictionaries['tabfieldinsert'] as $val) $tabfieldinsert[] = $val; - foreach($objMod->dictionaries['tabrowid'] as $val) $tabrowid[] = $val; - foreach($objMod->dictionaries['tabcond'] as $val) $tabcond[] = $val; - if (! empty($objMod->dictionaries['tabfieldcheck'])) foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val; - if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) $tabhelp[] = $val; - //foreach($objMod->dictionaries['tabsqlsort'] as $val) $tablib[] = $val; - //$tabname = array_merge ($tabname, $objMod->dictionaries['tabname']); - //var_dump($tabcond); - //exit; } $j++; @@ -1031,7 +1028,6 @@ function complete_elementList_with_modules(&$elementList) if (! empty($objMod->module_parts['contactelement'])) { $elementList[$objMod->name] = $langs->trans($objMod->name); - //exit; } $j++; diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 071a927712c..8c7f5b987be 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -79,6 +79,7 @@ $fieldstosearchall = array( * View */ +$form=new Form($db); if (! empty($conf->projet->enabled)) $projectstatic=new Project($db); llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones'); diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 5e7fe3b6a1e..288a1b92f37 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -88,6 +88,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * View */ +$form=new Form($db); $companystatic=new Societe($db); $shipment=new Expedition($db); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 3deb2dc1c45..61c2d3862af 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -139,7 +139,7 @@ if ($object->id > 0) print '
'; // Alias names (commercial, trademark or alias names) - print '"; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 14e28b9fe9f..b2d6668266f 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -93,6 +93,7 @@ if (empty($user->socid)) $fieldstosearchall["cf.note_private"]="NotePrivate"; * View */ +$form=new Form($db); $thirdpartytmp = new Fournisseur($db); $commandestatic=new CommandeFournisseur($db); $formfile = new FormFile($db); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1409cb94266..e23f8cf8dbc 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1361,7 +1361,7 @@ if ($action == 'create') print '
'.$langs->trans('AliasNameShort').''; + print '
'.$langs->trans('AliasNameShort').''; print $object->name_alias; print "
'; // Ref - print ''; + print ''; // Third party print ''; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 5a8760eafa8..dafe95e419d 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -8,7 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 juanjo Menent * Copyright (C) 2015 Abbes Bahfir - * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2015-2016 Ferran Marcet * * 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 @@ -97,6 +97,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_status=""; $year=""; $month=""; + $day=""; + $year_lim=""; + $month_lim=""; + $day_lim=""; } // List of fields to search into when doing a "search in all" @@ -248,8 +252,12 @@ if ($resql) } $param='&socid='.$socid; + if ($day) $param.='&day='.urlencode($day); if ($month) $param.='&month='.urlencode($month); if ($year) $param.='&year=' .urlencode($year); + if ($day_lim) $param.='&day_lim='.urlencode($day_lim); + if ($month_lim) $param.='&month_lim='.urlencode($month_lim); + if ($year_lim) $param.='&year_lim=' .urlencode($year_lim); if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_ref_supplier) $param.='&search_ref_supplier'.urlencode($search_ref_supplier); if ($search_label) $param.='&search_label='.urlencode($search_label); diff --git a/htdocs/includes/jquery/plugins/select2/select2.css b/htdocs/includes/jquery/plugins/select2/select2.css index 2d07a0343b0..16da8373f6f 100644 --- a/htdocs/includes/jquery/plugins/select2/select2.css +++ b/htdocs/includes/jquery/plugins/select2/select2.css @@ -28,7 +28,7 @@ Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014 .select2-container .select2-choice { display: block; height: 26px; - padding: 0 0 0 8px; + padding: 0 0 0 5px; overflow: hidden; position: relative; diff --git a/htdocs/index.php b/htdocs/index.php index 3050758b7d1..9f186ec1bf7 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -66,6 +66,8 @@ if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax dis * View */ +if (! is_object($form)) $form=new Form($db); + // Title $title=$langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION; if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$langs->trans("HomeArea").' - '.$conf->global->MAIN_APPLICATION_TITLE; diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index 90785b52fc3..5b766d2006d 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -69,6 +69,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EUR' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FKP', '[163]', 1, 'Falkland Islands (Malvinas) Pound'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FJD', '[36]', 1, 'Fiji Dollar'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GHC', '[162]', 1, 'Ghana Cedis'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GNF', '[70,71]', 1, 'Franc Guinéen'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GIP', '[163]', 1, 'Gibraltar Pound'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GTQ', '[81]', 1, 'Guatemala Quetzal'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'GGP', '[163]', 1, 'Guernsey Pound'); diff --git a/htdocs/install/mysql/data/llx_c_payment_term.sql b/htdocs/install/mysql/data/llx_c_payment_term.sql index 1e61b31a2b8..68aae57ff4f 100644 --- a/htdocs/install/mysql/data/llx_c_payment_term.sql +++ b/htdocs/install/mysql/data/llx_c_payment_term.sql @@ -27,11 +27,11 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (1,'RECEP', 1,1, 'A réception de facture','Réception de facture',0,0); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (1,'RECEP', 1,1, 'A réception de facture','Réception de facture',0,1); insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (2,'30D', 2,1, '30 jours','Réglement à 30 jours',0,30); insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (3,'30DENDMONTH', 3,1, '30 jours fin de mois','Réglement à 30 jours fin de mois',1,30); insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (4,'60D', 4,1, '60 jours','Réglement à 60 jours',0,60); insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (5,'60DENDMONTH', 5,1, '60 jours fin de mois','Réglement à 60 jours fin de mois',1,60); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (6,'PT_ORDER', 6,1, 'A réception de commande','A réception de commande',0,0); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (7,'PT_DELIVERY', 7,1, 'Livraison','Règlement à la livraison',0,0); -insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (8,'PT_5050', 8,1, '50 et 50','Règlement 50% à la commande, 50% à la livraison',0,0); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (6,'PT_ORDER', 6,1, 'A réception de commande','A réception de commande',0,1); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (7,'PT_DELIVERY', 7,1, 'Livraison','Règlement à la livraison',0,1); +insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (8,'PT_5050', 8,1, '50 et 50','Règlement 50% à la commande, 50% à la livraison',0,1); diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 7eb1fd46269..b6be65f725c 100644 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -597,3 +597,9 @@ ALTER TABLE llx_holiday ADD COLUMN entity integer DEFAULT 1 NOT NULL; -- Fix Argentina provences INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2326', 2305, '', 0, 'MISIONES', 'Misiones', 1); UPDATE llx_c_departements SET ncc = "FORMOSA", nom = "Formosa" WHERE nom = "Formosa Misiones"; + +-- MALTA VATS (id country=148) +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (1481, 148, '18','0','VAT standard rate',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (1482, 148, '7','0','VAT reduced rate',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (1483, 148, '5','0','VAT super-reduced rate', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (1484, 148, '0','0','VAT Rate 0', 1); diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 5470374b5e4..168d47bd60b 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -201,3 +201,4 @@ OppStatusNEGO=Negociation OppStatusPENDING=Pending OppStatusWIN=Won OppStatusLOST=Lost +Budget=Budget \ No newline at end of file diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 64a71bfaf52..3223320d657 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -1091,7 +1091,7 @@ SendmailOptionMayHurtBuggedMTA=La funcionalidad de enviar correo electrónico a TranslationSetup=Configuración traducción TranslationDesc=La elección del idioma mostrado en pantalla se modifica:
* A nivel global desde el menú Inicio - Configuración - Entorno
* De manera específica al usuario desde la pestaña Interfaz usuario de su ficha de usuario (hacer clic en su login en la parte superior izquierda de la pantalla). TranslationOverwriteDesc=También puede sobreescribir algún valor completando/editando la tabla siguiente. Debe utilizar "%s" para el código de idioma, "%s" para la clave que encuentra en el archivo langs/xx_XX/somefile.lang y "%s" para el nuevo valor que desea utilizar como nueva traducción. -TotalNumberOfActivatedModules=Total number of activated feature modules: %s / %s +TotalNumberOfActivatedModules=Número total de módulos activados: %s / %s YouMustEnableOneModule=Debe activar al menos un módulo. ClassNotFoundIntoPathWarning=No se ha encontrado la clase %s en su path PHP YesInSummer=Sí en verano diff --git a/htdocs/langs/es_ES/boxes.lang b/htdocs/langs/es_ES/boxes.lang index bedacd37bb5..28241fdb79a 100644 --- a/htdocs/langs/es_ES/boxes.lang +++ b/htdocs/langs/es_ES/boxes.lang @@ -45,13 +45,13 @@ BoxTitleLastModifiedProspects=Los %s últimos clientes potenciales modificados BoxTitleLastProductsInContract=Los %s últimos productos/servicios contratados BoxTitleLastModifiedMembers=Últimos %s miembros BoxTitleLastFicheInter=Las %s últimas intervenciones modificadas -BoxTitleOldestUnpaidCustomerBills=%s facturas a clientes más antiguras pendientes de cobro -BoxTitleOldestUnpaidSupplierBills=%s facturas de proveedores más antiguas pendientes de pago +BoxTitleOldestUnpaidCustomerBills=Las %s facturas a clientes más antiguras pendientes de cobro +BoxTitleOldestUnpaidSupplierBills=Las %s facturas de proveedores más antiguas pendientes de pago BoxTitleCurrentAccounts=Balance de cuentas abiertas BoxTitleSalesTurnover=Volumen de ventas realizado BoxTitleTotalUnpaidCustomerBills=Facturas a clientes pendientes de cobro BoxTitleTotalUnpaidSuppliersBills=Facturas de proveedores pendientes de pago -BoxTitleLastModifiedContacts=Los %s últimos contactos/direcciones modificadas +BoxTitleLastModifiedContacts=Los %s últimos contactos/direcciones modificados BoxMyLastBookmarks=Mis %s últimos marcadores BoxOldestExpiredServices=Servicios antiguos expirados BoxLastExpiredServices=Los %s contratos más antiguos con servicios activos expirados diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 22f46c2c4dc..7e2fea3d2af 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -266,8 +266,8 @@ CustomerRelativeDiscountShort=Descuento relativo CustomerAbsoluteDiscountShort=Descuento fijo CompanyHasRelativeDiscount=Este cliente tiene un descuento por defecto de %s%% CompanyHasNoRelativeDiscount=Este cliente no tiene descuentos relativos por defecto -CompanyHasAbsoluteDiscount=Este cliente tiene %s %s descuentos disponibles (descuentos, anticipos...) -CompanyHasCreditNote=Este cliente tiene %s %s anticipos disponibles +CompanyHasAbsoluteDiscount=Este cliente tiene %s %s en descuentos o anticipos disponibles +CompanyHasCreditNote=Este cliente tiene %s %s en anticipos disponibles CompanyHasNoAbsoluteDiscount=Este cliente no tiene más descuentos fijos disponibles CustomerAbsoluteDiscountAllUsers=Descuentos fijos en curso (acordado por todos los usuarios) CustomerAbsoluteDiscountMy=Descuentos fijos en curso (acordados personalmente) diff --git a/htdocs/langs/es_ES/cron.lang b/htdocs/langs/es_ES/cron.lang index eef866fdbea..1997727d542 100644 --- a/htdocs/langs/es_ES/cron.lang +++ b/htdocs/langs/es_ES/cron.lang @@ -40,8 +40,8 @@ CronNone=Ninguna CronDtStart=No antes de CronDtEnd=No después de CronDtNextLaunch=Sig. ejec. -CronDtLastLaunch=Start date of last execution -CronDtLastResult=End date of last execution +CronDtLastLaunch=Fecha inicio última ejec. +CronDtLastResult=Fecha finalización última ejec. CronFrequency=Frecuencia CronClass=Clase CronMethod=Metodo diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index c1fdad6cb99..0c68fbd1cf5 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -198,3 +198,4 @@ OppStatusNEGO=Negociación OppStatusPENDING=Pendiente OppStatusWIN=Ganado OppStatusLOST=Perdido +Budget=Presupuesto diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index d9e0c374dda..13bc1fc4765 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -198,3 +198,4 @@ OppStatusNEGO=Négociation OppStatusPENDING=En attente OppStatusWIN=Gagné OppStatusLOST=Perdu +Budget=Budget \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 43080065aec..c70b48aaf32 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1447,7 +1447,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Show menu entries print '
'."\n"; $menumanager->atarget=$target; - $menumanager->showmenu('top'); // This contains a \n + $menumanager->showmenu('top', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // This contains a \n print "
\n"; //$form=new Form($db); @@ -1611,7 +1611,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra print "\n"; - if ($conf->use_javascript_ajax && $conf->browser->layout != 'phone') + if ($conf->use_javascript_ajax && $conf->browser->layout != 'phone' && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) { if (! is_object($form)) $form=new Form($db); $selected=-1; @@ -1657,7 +1657,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user')); } } - + // Execute hook printSearchForm $parameters=array('searchform'=>$searchform); $reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 4a142e909fe..25e52079dc4 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -61,7 +61,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) } // Clean param -if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) $conf->global->PRODUIT_MULTIPRICES_LIMIT = 5; +if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) { + dolibarr_set_const($db, 'PRODUIT_MULTIPRICES_LIMIT', 5, 'chaine', 0, '', $conf->entity); +} diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 1944ee0cf11..91792e91f48 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -46,10 +46,15 @@ $langs->load("projects"); */ $now = dol_now(); +$tmp=dol_getdate($now); +$day=$tmp['mday']; +$month=$tmp['mon']; +$year=$tmp['year']; $projectstatic=new Project($db); $taskstatic=new Task($db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); // Return all projects I have permission on because I want my tasks and some of my task may be on a public projet that is not my project +$taskstatic=new Task($db); $tasktmp=new Task($db); $title=$langs->trans("Activities"); @@ -104,7 +109,7 @@ print '
'; print ''; print "\n"; -$sql = "SELECT p.rowid, p.ref, p.title, SUM(tt.task_duration) as nb"; +$sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; $sql.= ", ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -112,9 +117,9 @@ $sql.= " WHERE t.fk_projet = p.rowid"; $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND tt.fk_task = t.rowid"; $sql.= " AND tt.fk_user = ".$user->id; -$sql.= " AND date_format(task_date,'%y-%m-%d') = '".strftime("%y-%m-%d",$now)."'"; +$sql.= " AND task_date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; $sql.= " AND p.rowid in (".$projectsListId.")"; -$sql.= " GROUP BY p.rowid, p.ref, p.title"; +$sql.= " GROUP BY p.rowid, p.ref, p.title, p.public"; $resql = $db->query($sql); if ( $resql ) @@ -130,9 +135,10 @@ if ( $resql ) $projectstatic->id=$row->rowid; $projectstatic->ref=$row->ref; $projectstatic->title=$row->title; + $projectstatic->public=$row->public; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''; + print ''; print "\n"; $total += $row->nb; } @@ -145,80 +151,79 @@ else } print ''; print ''; -print ''; +print ''; print "\n"; print "
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Ref').''.$langs->trans('Draft').'
'.$langs->trans('Supplier').''.$langs->trans('ActivityOnProjectToday').''.$langs->trans("Time").'
'.convertSecondToTime($row->nb).''.convertSecondToTime($row->nb, 'allhourmin').'
'.$langs->trans('Total').''.convertSecondToTime($total).''.convertSecondToTime($total, 'allhourmin').'
"; -// TODO Do not use date_add function to be compatible with all database -if ($db->type != 'pgsql') + +/* Affichage de la liste des projets d'hier */ +print '
'; +print ''; +print ''; +print ''; +print "\n"; + +$sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; +$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; +$sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; +$sql.= ", ".MAIN_DB_PREFIX."projet_task_time as tt"; +$sql.= " WHERE t.fk_projet = p.rowid"; +$sql.= " AND p.entity = ".$conf->entity; +$sql.= " AND tt.fk_task = t.rowid"; +$sql.= " AND tt.fk_user = ".$user->id; +$sql.= " AND task_date BETWEEN '".$db->idate(dol_time_plus_duree(dol_mktime(0, 0, 0, $month, $day, $year), -1, 'd'))."' AND '".$db->idate(dol_time_plus_duree(dol_mktime(23, 59, 59, $month, $day, $year), -1, 'd'))."'"; +$sql.= " AND p.rowid in (".$projectsListId.")"; +$sql.= " GROUP BY p.rowid, p.ref, p.title, p.public"; + +$resql = $db->query($sql); +if ( $resql ) { - /* Affichage de la liste des projets d'hier */ - print '
'.$langs->trans('ActivityOnProjectYesterday').''.$langs->trans("Time").'
'; - print ''; - print ''; - print ''; - print "\n"; + $var=true; + $total=0; - $sql = "SELECT p.rowid, p.ref, p.title, sum(tt.task_duration) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; - $sql.= ", ".MAIN_DB_PREFIX."projet_task_time as tt"; - $sql.= " WHERE t.fk_projet = p.rowid"; - $sql.= " AND p.entity = ".$conf->entity; - $sql.= " AND tt.fk_task = t.rowid"; - $sql.= " AND tt.fk_user = ".$user->id; - $sql.= " AND date_format(date_add(task_date, INTERVAL 1 DAY),'%y-%m-%d') = '".strftime("%y-%m-%d",$now)."'"; - $sql.= " AND p.rowid in (".$projectsListId.")"; - $sql.= " GROUP BY p.rowid, p.ref, p.title"; - - $resql = $db->query($sql); - if ( $resql ) + while ($row = $db->fetch_object($resql)) { - $var=true; - $total=0; - - while ($row = $db->fetch_object($resql)) - { - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - $total += $row->nb; - } - - $db->free($resql); + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + $total += $row->nb; } - else - { - dol_print_error($db); - } - print ''; - print ''; - print ''; - print "\n"; - print "
'.$langs->trans('ActivityOnProjectYesterday').''.$langs->trans("Time").'
'; - $projectstatic->id=$row->rowid; - $projectstatic->ref=$row->ref; - $projectstatic->title=$row->title; - print $projectstatic->getNomUrl(1, '', 1); - print ''.convertSecondToTime($row->nb).'
'; + $projectstatic->id=$row->rowid; + $projectstatic->ref=$row->ref; + $projectstatic->title=$row->title; + $projectstatic->public=$row->public; + print $projectstatic->getNomUrl(1, '', 1); + print ''.convertSecondToTime($row->nb, 'allhourmin').'
'.$langs->trans('Total').''.convertSecondToTime($total).'
"; + + $db->free($resql); } +else +{ + dol_print_error($db); +} +print '
'.$langs->trans('Total').''.convertSecondToTime($total, 'allhourmin').'
"; -// TODO Do not use week function to be compatible with all database + +/* if ($db->type != 'pgsql') { print '
'; - /* Affichage de la liste des projets de la semaine */ + // Affichage de la liste des projets de la semaine print ''; print ''; print ''; print ''; print "\n"; - $sql = "SELECT p.rowid, p.ref, p.title, SUM(tt.task_duration) as nb"; + $sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " , ".MAIN_DB_PREFIX."projet_task as t"; $sql.= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -226,7 +231,7 @@ if ($db->type != 'pgsql') $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND tt.fk_task = t.rowid"; $sql.= " AND tt.fk_user = ".$user->id; - $sql.= " AND week(task_date) = '".strftime("%W",time())."'"; + $sql.= " AND task_date >= '".$db->idate(dol_get_first_day($year, $month)).'" AND ..."; $sql.= " AND p.rowid in (".$projectsListId.")"; $sql.= " GROUP BY p.rowid, p.ref, p.title"; @@ -244,9 +249,10 @@ if ($db->type != 'pgsql') $projectstatic->id=$row->rowid; $projectstatic->ref=$row->ref; $projectstatic->title=$row->title; + $projectstatic->public=$row->public; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''; + print ''; print "\n"; $total += $row->nb; } @@ -259,10 +265,12 @@ if ($db->type != 'pgsql') } print ''; print ''; - print ''; + print ''; print "\n"; print "
'.$langs->trans("ActivityOnProjectThisWeek").''.$langs->trans("Time").'
'.convertSecondToTime($row->nb).''.convertSecondToTime($row->nb, 'allhourmin').'
'.$langs->trans('Total').''.convertSecondToTime($total).''.convertSecondToTime($total, 'allhourmin').'

"; + } +*/ /* Affichage de la liste des projets du mois */ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) @@ -273,7 +281,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) print ''.$langs->trans("Time").''; print "\n"; - $sql = "SELECT p.rowid, p.ref, p.title, SUM(tt.task_duration) as nb"; + $sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; $sql.= ", ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -281,9 +289,9 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND tt.fk_task = t.rowid"; $sql.= " AND tt.fk_user = ".$user->id; - $sql.= " AND date_format(task_date,'%y-%m') = '".strftime("%y-%m",$now)."'"; + $sql.= " AND task_date BETWEEN '".$db->idate(dol_get_first_day($year, $month))."' AND '".$db->idate(dol_get_last_day($year, $month))."'"; $sql.= " AND p.rowid in (".$projectsListId.")"; - $sql.= " GROUP BY p.rowid, p.ref, p.title"; + $sql.= " GROUP BY p.rowid, p.ref, p.title, p.public"; $resql = $db->query($sql); if ( $resql ) @@ -299,7 +307,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) $projectstatic->title=$row->title; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''.convertSecondToTime($row->nb).''; + print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; $var=!$var; } @@ -311,7 +319,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) } print ''; print ''.$langs->trans('Total').''; - print ''.convertSecondToTime($total).''; + print ''.convertSecondToTime($total, 'allhourmin').''; print "\n"; print ""; } @@ -325,7 +333,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR)) print ''.$langs->trans("Time").''; print "\n"; - $sql = "SELECT p.rowid, p.ref, p.title, SUM(tt.task_duration) as nb"; + $sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= ", ".MAIN_DB_PREFIX."projet_task as t"; $sql.= ", ".MAIN_DB_PREFIX."projet_task_time as tt"; @@ -335,7 +343,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR)) $sql.= " AND tt.fk_user = ".$user->id; $sql.= " AND YEAR(task_date) = '".strftime("%Y",$now)."'"; $sql.= " AND p.rowid in (".$projectsListId.")"; - $sql.= " GROUP BY p.rowid, p.ref, p.title"; + $sql.= " GROUP BY p.rowid, p.ref, p.title, p.public"; $var=false; $resql = $db->query($sql); @@ -348,9 +356,10 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR)) $projectstatic->id=$row->rowid; $projectstatic->ref=$row->ref; $projectstatic->title=$row->title; + $projectstatic->public=$row->public; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''.convertSecondToTime($row->nb).''; + print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; $var=!$var; } @@ -362,31 +371,71 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR)) } print ''; print ''.$langs->trans('Total').''; - print ''.convertSecondToTime($total).''; + print ''.convertSecondToTime($total, 'allhourmin').''; print "\n"; print ""; } if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA)) { + // Get id of types of contacts for projects (This list never contains a lot of elements) + $listofprojectcontacttype=array(); + $sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc"; + $sql.= " WHERE ctc.element = '" . $projectstatic->element . "'"; + $sql.= " AND ctc.source = 'internal'"; + $resql = $db->query($sql); + if ($resql) + { + while($obj = $db->fetch_object($resql)) + { + $listofprojectcontacttype[$obj->rowid]=$obj->code; + } + } + else dol_print_error($db); + if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; // To avoid sql syntax error if not found + // Get id of types of contacts for tasks (This list never contains a lot of elements) + $listoftaskcontacttype=array(); + $sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc"; + $sql.= " WHERE ctc.element = '" . $taskstatic->element . "'"; + $sql.= " AND ctc.source = 'internal'"; + $resql = $db->query($sql); + if ($resql) + { + while($obj = $db->fetch_object($resql)) + { + $listoftaskcontacttype[$obj->rowid]=$obj->code; + } + } + else dol_print_error($db); + if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0]='0'; // To avoid sql syntax error if not found + + // Tasks for all resources of all opened projects and time spent for each task/resource // This list can be very long, so we don't show it by default on task area. We prefer to use the list page. // Add constant PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA to show this list $max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA); - $sql = "SELECT p.ref, p.title, p.rowid as projectid, p.fk_statut as status, p.fk_opp_status as opp_status, p.dateo as projdateo, p.datee as projdatee,"; + $sql = "SELECT p.ref, p.title, p.rowid as projectid, p.fk_statut as status, p.fk_opp_status as opp_status, p.public, p.dateo as projdateo, p.datee as projdatee,"; $sql.= " t.label, t.rowid as taskid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee, SUM(tasktime.task_duration) as timespent"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid"; + if ($mine) + { + $sql.= ", " . MAIN_DB_PREFIX . "element_contact as ect"; + } $sql.= " WHERE p.entity = ".$conf->entity; - if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; - if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; // project i have permission on + if ($mine) // this may duplicate record if we are contact twice + { + $sql.= " AND ect.fk_c_type_contact IN (".join(',',array_keys($listoftaskcontacttype)).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".$user->id; + } + if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; $sql.= " AND p.fk_statut=1"; - $sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee"; + $sql.= " GROUP BY p.ref, p.title, p.rowid, p.fk_statut, p.fk_opp_status, p.public, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee"; $sql.= " ORDER BY t.dateo desc, t.rowid desc, t.datee"; $sql.= $db->plimit($max+1); // We want more to know if we have more than limit @@ -435,6 +484,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S $projectstatic->ref=$obj->ref; $projectstatic->title=$obj->title; $projectstatic->statut = $obj->status; + $projectstatic->public = $obj->public; $projectstatic->dateo = $db->jdate($obj->projdateo); $projectstatic->datee = $db->jdate($obj->projdatee); @@ -468,10 +518,10 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S if ($taskstatic->hasDelay()) print img_warning($langs->trans("Late")); print ''; print ''; - print convertSecondToTime($obj->planned_workload, 'all'); + print convertSecondToTime($obj->planned_workload, 'allhourmin'); print ''; print ''; - print convertSecondToTime($obj->timespent, 'all'); + print convertSecondToTime($obj->timespent, 'allhourmin'); print ''; print ''; if (! empty($obj->taskid)) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e862f0be5ec..950e5fae595 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -465,7 +465,7 @@ if ($action == 'create' && $user->rights->projet->creer) print ''.$langs->trans("ThirdParty").''; $filteronlist=''; if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; - $text=$form->select_thirdparty_list(GETPOST('socid','int'),'socid',$filteronlist,1,1); + $text=$form->select_thirdparty_list(GETPOST('socid','int'),'socid',$filteronlist,'SelectThirdParty',1); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index b35e7096ef3..92ce3c614ce 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -126,7 +126,7 @@ if ($socid) print ''; print ''; - print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; + print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; print $object->code_client; if ($object->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); print ''; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 4f1f9fb05d6..2ac6d3cbd7d 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -124,7 +124,7 @@ print '
'; print '
'.$langs->trans('CustomerCode').''.$langs->trans('CustomerCode').'
'; // Alias names (commercial, trademark or alias names) -print ''; +print ''; print ''; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 2c951ed8670..d37310ab269 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -91,7 +91,7 @@ llxHeader('',$title,$help_url); if ($object->id) { /* - * Affichage onglets + * Show tabs */ if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = societe_prepare_head($object); @@ -117,7 +117,7 @@ if ($object->id) print '
'.$object->name_alias.'
'; // Alias names (commercial, trademark or alias names) - print '"; @@ -145,10 +145,10 @@ if ($object->id) print ''; } - // Nbre fichiers + // Number of files print ''; - //Total taille + // Total size print ''; print '
'.$langs->trans('AliasNames').''; + print '
'.$langs->trans('AliasNames').''; print $object->name_alias; print "
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index ceb5fa6eac5..acd7f32d375 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -1,10 +1,10 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Marcos García * * 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 @@ -83,7 +83,7 @@ if ($id > 0) print ''; // Alias names (commercial, trademark or alias names) - print '"; diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 1d0fccfe33d..c7f087daf72 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -247,7 +247,7 @@ if ($socid && $action != 'edit' && $action != "create") print '
'; print '
'.$langs->trans('AliasNames').''; + print '
'.$langs->trans('AliasNames').''; print $object->name_alias; print "
'; - print ''; + print ''; print ''; print ''; @@ -466,7 +466,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) print '
'; print '
'.$langs->trans("LabelRIB").'
'.$langs->trans("LabelRIB").''.$account->label.'
'.$langs->trans("BankName").'
'; - print ''; + print ''; print ''; print ''; @@ -600,7 +600,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) print '
'; print '
'.$langs->trans("LabelRIB").'
'.$langs->trans("LabelRIB").'
'.$langs->trans("BankName").'
'; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 3ec3a635919..613348ed044 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -757,7 +757,7 @@ else * Creation */ $private=GETPOST("private","int"); - if (! empty($conf->global->MAIN_THIRPARTY_CREATION_INDIVIDUAL) && ! isset($_GET['private']) && ! isset($_POST['private'])) $private=1; + if (! empty($conf->global->MAIN_THIRDPARTY_CREATION_INDIVIDUAL) && ! isset($_GET['private']) && ! isset($_POST['private'])) $private=1; if (empty($private)) $private=0; // Load object modCodeTiers @@ -987,6 +987,10 @@ else print ''; } + // Alias names (commercial, trademark or alias names) + print ''; + print ''; + // Prospect/Customer print ''; print ''; } - // Alias names (commercial, trademark or alias names) - print ''; - print ''; - // Address print ''; print '
'.$langs->trans("LabelRIB").'
'.$langs->trans("LabelRIB").'
'.$langs->trans("Bank").' 
'.fieldLabel('ProspectCustomer','customerprospect',1).'
'.fieldLabel('Address','address').'