This commit is contained in:
Maxime Kohlhaas 2017-06-27 12:19:10 +02:00
commit 8eba418715
22 changed files with 279 additions and 209 deletions

View File

@ -10,7 +10,7 @@ php:
- '5.3' - '5.3'
- '5.4' - '5.4'
- '5.5' - '5.5'
- '5.6' - '5.6.29'
- '7.0' - '7.0'
- '7.1' - '7.1'
- nightly - nightly

View File

@ -2,10 +2,17 @@
English Dolibarr ChangeLog English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** ChangeLog for 5.0.4 compared to 5.0.3 ***** ***** ChangeLog for 5.0.4 compared to 5.0.3 *****
FIX: #6880 FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
FIX: #6925 FIX: #6541 since 4.0.4 to 5.0.0 autofill zip/town not working
FIX: #6880 #6925
FIX: #6885
FIX: #6926 FIX: #6926
FIX: #7003
FIX: #7012
FIX: #7040
FIX: #7048 #6075
FIX: Can set supplier invoice to billed. FIX: Can set supplier invoice to billed.
FIX: Can't create invoice if PO disapproved FIX: Can't create invoice if PO disapproved
FIX: contratligne update FIX: contratligne update
@ -17,6 +24,7 @@ FIX: Redirect to payment page from member subscription page failed if a unique s
FIX: REST api to get project when user has permission to read all. FIX: REST api to get project when user has permission to read all.
FIX: situation_progress param default value must be 100 and not 0 FIX: situation_progress param default value must be 100 and not 0
FIX: SQL injection on user/index.php parameter search_statut. FIX: SQL injection on user/index.php parameter search_statut.
FIX: vat code not saved during product creation.
FIX: Warnings FIX: Warnings
***** ChangeLog for 5.0.3 compared to 5.0.2 ***** ***** ChangeLog for 5.0.3 compared to 5.0.2 *****

View File

@ -5,7 +5,7 @@
// during install process to be used. // during install process to be used.
// //
// //
$force_install_noedit=2; $force_install_noedit=2; // 1=To block vars specific to distrib, 2 to block all technical parameters
$force_install_message='KeepDefaultValuesWamp'; $force_install_message='KeepDefaultValuesWamp';
$force_install_main_data_root='WAMPROOT/dolibarr_documents'; $force_install_main_data_root='WAMPROOT/dolibarr_documents';
$force_install_type='mysqli'; $force_install_type='mysqli';

View File

@ -1,7 +1,7 @@
<?php <?php
$force_install_packager='rpmfedora'; $force_install_packager='rpmfedora';
$force_install_noedit=1; # 1 to block var specific to distrib, 2 to block every technical parameters $force_install_noedit=1; // 1 to block var specific to distrib, 2 to block every technical parameters
$force_install_message='KeepDefaultValuesDeb'; $force_install_message='KeepDefaultValuesDeb';
$force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_main_data_root='/var/lib/dolibarr/documents';
$force_install_type='mysqli'; $force_install_type='mysqli';

View File

@ -1,7 +1,7 @@
<?php <?php
$force_install_packager='rpmgeneric'; $force_install_packager='rpmgeneric';
$force_install_noedit=1; # 1 to block var specific to distrib, 2 to block every technical parameters $force_install_noedit=1; // 1 to block var specific to distrib, 2 to block every technical parameters
$force_install_message='KeepDefaultValuesDeb'; $force_install_message='KeepDefaultValuesDeb';
$force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_main_data_root='/var/lib/dolibarr/documents';
$force_install_type='mysqli'; $force_install_type='mysqli';

View File

@ -1,7 +1,7 @@
<?php <?php
$force_install_packager='rpmmandriva'; $force_install_packager='rpmmandriva';
$force_install_noedit=1; # 1 to block var specific to distrib, 2 to block every technical parameters $force_install_noedit=1; // 1 to block var specific to distrib, 2 to block every technical parameters
$force_install_message='KeepDefaultValuesDeb'; $force_install_message='KeepDefaultValuesDeb';
$force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_main_data_root='/var/lib/dolibarr/documents';
$force_install_type='mysqli'; $force_install_type='mysqli';

View File

@ -1,7 +1,7 @@
<?php <?php
$force_install_packager='rpmopensuse'; $force_install_packager='rpmopensuse';
$force_install_noedit=1; # 1 to block var specific to distrib, 2 to block every technical parameters $force_install_noedit=1; // 1 to block var specific to distrib, 2 to block every technical parameters
$force_install_message='KeepDefaultValuesDeb'; $force_install_message='KeepDefaultValuesDeb';
$force_install_main_data_root='/var/lib/dolibarr/documents'; $force_install_main_data_root='/var/lib/dolibarr/documents';
$force_install_type='mysqli'; $force_install_type='mysqli';

View File

@ -88,6 +88,7 @@ if (!empty($ExecTimeLimit))
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64 @set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
error_reporting($err); error_reporting($err);
} }
$MemoryLimit=0;
if (!empty($MemoryLimit)) if (!empty($MemoryLimit))
{ {
@ini_set('memory_limit', $MemoryLimit); @ini_set('memory_limit', $MemoryLimit);

View File

@ -107,7 +107,7 @@ $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! $sortorder) $sortorder='ASC'; if (! $sortorder) $sortorder='ASC';
if (! $sortfield) $sortfield='b.datev'; if (! $sortfield) $sortfield='b.datev, b.dateo, b.rowid';
$mode_balance_ok=false; $mode_balance_ok=false;
//if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid')) // TODO Manage balance when account not selected //if (($sortfield == 'b.datev' || $sortfield == 'b.datev, b.dateo, b.rowid')) // TODO Manage balance when account not selected
@ -902,7 +902,7 @@ if ($resql)
exit; exit;
} }
//Loop on each record // Loop on each record before
$sign = 1; $sign = 1;
$i = 0; $i = 0;
$sqlforbalance='SELECT SUM(b.amount) as balance'; $sqlforbalance='SELECT SUM(b.amount) as balance';
@ -912,7 +912,8 @@ if ($resql)
$sqlforbalance.= " WHERE b.fk_account = ba.rowid"; $sqlforbalance.= " WHERE b.fk_account = ba.rowid";
$sqlforbalance.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; $sqlforbalance.= " AND ba.entity IN (".getEntity('bank_account', 1).")";
$sqlforbalance.= " AND b.fk_account = ".$account; $sqlforbalance.= " AND b.fk_account = ".$account;
$sqlforbalance.= " AND b.datev < '" . $db->idate($db->jdate($objp->dv)) . "'"; //$sqlforbalance.= " AND (b.datev < '" . $db->idate($db->jdate($objp->dv)) . "')";
$sqlforbalance.= " AND (b.datev < '" . $db->idate($db->jdate($objp->dv)) . "' OR (b.datev = '" . $db->idate($db->jdate($objp->dv)) . "' AND (b.dateo < '".$db->idate($db->jdate($objp->do))."' OR (b.dateo = '".$db->idate($db->jdate($objp->do))."' AND b.rowid < ".$objp->rowid."))))";
$resqlforbalance = $db->query($sqlforbalance); $resqlforbalance = $db->query($sqlforbalance);
//print $sqlforbalance; //print $sqlforbalance;
if ($resqlforbalance) if ($resqlforbalance)

View File

@ -2630,9 +2630,9 @@ if ($action == 'create')
if (!empty($conf->multicurrency->enabled)) if (!empty($conf->multicurrency->enabled))
{ {
print '<tr><td>' . $langs->trans('MulticurrencyTotalHT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ht) . '</td></tr>'; print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
print '<tr><td>' . $langs->trans('MulticurrencyTotalVAT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_tva) . "</td></tr>"; print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
print '<tr><td>' . $langs->trans('MulticurrencyTotalTTC') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>"; print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td colspan="2">' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
} }
} }

View File

@ -4332,7 +4332,7 @@ class Form
* Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle. * Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle.
* Sinon la TVA proposee par defaut=0. Fin de regle. * Sinon la TVA proposee par defaut=0. Fin de regle.
* @param bool $options_only Return HTML options lines only (for ajax treatment) * @param bool $options_only Return HTML options lines only (for ajax treatment)
* @param int $mode 1=Add code into key in select list * @param int $mode 0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key
* @return string * @return string
*/ */
function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0) function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0)

View File

@ -3891,7 +3891,7 @@ function getTaxesFromId($vatrowid)
* @param Societe $buyer Company object * @param Societe $buyer Company object
* @param Societe $seller Company object * @param Societe $seller Company object
* @param int $firstparamisid 1 if first param is id into table (use this if you can) * @param int $firstparamisid 1 if first param is id into table (use this if you can)
* @return array array(localtax_type1(1-6 / 0 if not found), rate of localtax1, ...) * @return array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type1, rate localtax2, accountancycodecust, accountancycodesupp)
*/ */
function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0) function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0)
{ {

View File

@ -1039,10 +1039,10 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
// Show page nb only on iso languages (so default Helvetica font) // Show page nb only on iso languages (so default Helvetica font)
if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica')
{ {
$pdf->SetXY(-20,-$posy); $pdf->SetXY($dims['wk']-$dims['rm']-15, -$posy);
//print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit; //print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(13, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0); if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(15, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
else $pdf->MultiCell(13, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0); else $pdf->MultiCell(15, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
} }
return $marginwithfooter; return $marginwithfooter;

View File

@ -220,6 +220,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__);
-- Accounting period
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__);
-- Binding -- Binding
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__);
@ -245,8 +247,6 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', '', 2440__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__);
-- Accounting period
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2400__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=setup', 'FiscalPeriod', 1, 'admin', '', '', 2, 4, __ENTITY__);
-- Rapports compta simple -- Rapports compta simple
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&amp;mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&amp;mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);

View File

@ -966,7 +966,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{ {
if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/don/admin/donation.php?from=accountancy&mainmenu=accountancy&amp;leftmenu=accountancy_admin", $langs->trans("MenuDonationAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_donation', 47); if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/don/admin/donation.php?from=accountancy&mainmenu=accountancy&amp;leftmenu=accountancy_admin", $langs->trans("MenuDonationAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_donation', 47);
}*/ }*/
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&amp;leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 50); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 50);
// Fiscal year
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // Not yet used. In a future will lock some periods.
{
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"), 2, $user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
}
// Binding // Binding
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&amp;mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&amp;mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer');
@ -1039,12 +1045,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report",$langs->trans("ByCompanies"),3,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report",$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report",$langs->trans("ByUsers"),3,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"),3,$user->rights->accounting->comptarapport->lire);
// Fiscal year
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // Not yet used. In a future will lock some periods.
{
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("FiscalPeriod"),1,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
}
} }
// Accountancy (simple) // Accountancy (simple)

View File

@ -1316,7 +1316,8 @@ class Expedition extends CommonObject
$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type"; $sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked, cd.product_type";
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva"; $sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht"; $sql.= ", cd.vat_src_code, cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
$sql.= ", cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc";
$sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot"; $sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type"; $sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
$sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch"; $sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch";
@ -1389,8 +1390,10 @@ class Expedition extends CommonObject
$line->pa_ht = $obj->pa_ht; $line->pa_ht = $obj->pa_ht;
$localtax_array=array(0=>$obj->localtax1_type, 1=>$obj->localtax1_tx, 2=>$obj->localtax2_type, 3=>$obj->localtax2_tx);
// For invoicing // For invoicing
$tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc); // We force type to 0 $tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc, $localtax_array); // We force type to 0
$line->desc = $obj->description; // We need ->desc because some code into CommonObject use desc (property defined for other elements) $line->desc = $obj->description; // We need ->desc because some code into CommonObject use desc (property defined for other elements)
$line->qty = $line->qty_shipped; $line->qty = $line->qty_shipped;
$line->total_ht = $tabprice[0]; $line->total_ht = $tabprice[0];
@ -1398,6 +1401,7 @@ class Expedition extends CommonObject
$line->total_localtax2 = $tabprice[10]; $line->total_localtax2 = $tabprice[10];
$line->total_ttc = $tabprice[2]; $line->total_ttc = $tabprice[2];
$line->total_tva = $tabprice[1]; $line->total_tva = $tabprice[1];
$line->vat_src_code = $obj->vat_src_code;
$line->tva_tx = $obj->tva_tx; $line->tva_tx = $obj->tva_tx;
$line->localtax1_tx = $obj->localtax1_tx; $line->localtax1_tx = $obj->localtax1_tx;
$line->localtax2_tx = $obj->localtax2_tx; $line->localtax2_tx = $obj->localtax2_tx;
@ -1411,6 +1415,14 @@ class Expedition extends CommonObject
$this->total_localtax1+= $tabprice[9]; $this->total_localtax1+= $tabprice[9];
$this->total_localtax2+= $tabprice[10]; $this->total_localtax2+= $tabprice[10];
// Multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency;
$this->multicurrency_code = $obj->multicurrency_code;
$this->multicurrency_subprice = $obj->multicurrency_subprice;
$this->multicurrency_total_ht = $obj->multicurrency_total_ht;
$this->multicurrency_total_tva = $obj->multicurrency_total_tva;
$this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
if ($originline != $obj->fk_origin_line) if ($originline != $obj->fk_origin_line)
{ {
$line->detail_batch = array(); $line->detail_batch = array();

View File

@ -66,6 +66,7 @@ if (@file_exists($forcedfile)) {
} }
/* /*
* View * View
*/ */
@ -426,8 +427,8 @@ if (! empty($force_install_message))
<input type="password" id="db_pass" autocomplete="off" <input type="password" id="db_pass" autocomplete="off"
name="db_pass" name="db_pass"
value="<?php value="<?php
// We don't want to set password. It will be extracted from the forced install file at step1. // If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1.
$autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : ''); $autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : str_pad('', strlen($force_install_databasepass), '*'));
if (!empty($dolibarr_main_prod)) { if (!empty($dolibarr_main_prod)) {
$autofill = ''; $autofill = '';
} }
@ -479,7 +480,7 @@ if (! empty($force_install_message))
name="db_user_root" name="db_user_root"
class="needroot" class="needroot"
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>" value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>"
<?php if ($force_install_noedit == 2 && $force_install_databaserootlogin !== null) { <?php if ($force_install_noedit > 0 && ! empty($force_install_databaserootlogin)) {
print ' disabled'; print ' disabled';
} ?> } ?>
> >
@ -499,26 +500,28 @@ if (! empty($force_install_message))
<td class="label" valign="top"><b><?php echo $langs->trans("Password"); ?></b> <td class="label" valign="top"><b><?php echo $langs->trans("Password"); ?></b>
</td> </td>
<td class="label" valign="top"> <td class="label" valign="top">
<input type="password" <input type="password"
autocomplete="off" autocomplete="off"
id="db_pass_root" id="db_pass_root"
name="db_pass_root" name="db_pass_root"
class="needroot" class="needroot"
value="<?php value="<?php
// We don't want to set password. It will be extracted from the forced install file at step1. // If $force_install_databaserootpass is on, we don't want to set password here, we just show '***'. Real value will be extracted from the forced install file at step1.
$autofill = ((!empty($force_install_database_rootpass)) ? '' : @$db_pass_root); $autofill = ((!empty($force_install_databaserootpass)) ? str_pad('', strlen($force_install_databaserootpass), '*') : @$db_pass_root);
if (!empty($dolibarr_main_prod)) { if (!empty($dolibarr_main_prod)) {
$autofill = ''; $autofill = '';
} // Do not autofill password if instance is a production instance }
// Do not autofill password if instance is a production instance
if (!empty($_SERVER["SERVER_NAME"]) && !in_array($_SERVER["SERVER_NAME"], if (!empty($_SERVER["SERVER_NAME"]) && !in_array($_SERVER["SERVER_NAME"],
array('127.0.0.1', 'localhost')) array('127.0.0.1', 'localhost', 'localhostgit'))
) { ) {
$autofill = ''; $autofill = '';
} // Do not autofill password for remote access } // Do not autofill password for remote access
print dol_escape_htmltag($autofill); print dol_escape_htmltag($autofill);
?>" ?>"
<?php if ($force_install_noedit == 2 && $force_install_databaserootpass !== null) { <?php if ($force_install_noedit > 0 && ! empty($force_install_databaserootpass)) {
print ' disabled'; print ' disabled'; // May be removed by javascript
} ?> } ?>
> >
</td> </td>
@ -561,7 +564,10 @@ jQuery(document).ready(function() {
if (jQuery("#db_create_database").is(":checked") || jQuery("#db_create_user").is(":checked")) if (jQuery("#db_create_database").is(":checked") || jQuery("#db_create_user").is(":checked"))
{ {
jQuery(".hideroot").show(); jQuery(".hideroot").show();
<?php
if ($force_install_noedit == 0) { ?>
jQuery(".needroot").removeAttr('disabled'); jQuery(".needroot").removeAttr('disabled');
<?php } ?>
} }
else else
{ {

View File

@ -270,3 +270,8 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10
ALTER TABLE llx_events MODIFY COLUMN ip varchar(250); ALTER TABLE llx_events MODIFY COLUMN ip varchar(250);
UPDATE llx_bank SET label= '(SupplierInvoicePayment)' WHERE label= 'Règlement fournisseur';
UPDATE llx_bank SET label= '(CustomerInvoicePayment)' WHERE label= 'Règlement client';

View File

@ -88,6 +88,7 @@ if (@file_exists($forcedfile)) {
$main_data_dir = detect_dolibarr_main_data_root($main_dir); $main_data_dir = detect_dolibarr_main_data_root($main_dir);
} }
$main_url = detect_dolibarr_main_url_root(); $main_url = detect_dolibarr_main_url_root();
if (!empty($force_install_databaserootlogin)) { if (!empty($force_install_databaserootlogin)) {
$userroot = parse_database_login($force_install_databaserootlogin); $userroot = parse_database_login($force_install_databaserootlogin);
} }

View File

@ -239,12 +239,43 @@ if (empty($reshook))
else else
$object->price_min = GETPOST('price_min'); $object->price_min = GETPOST('price_min');
$object->tva_tx = str_replace('*','',GETPOST('tva_tx')); $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)'
$object->tva_npr = preg_match('/\*/',GETPOST('tva_tx'))?1:0;
// local taxes. // We must define tva_tx, npr and local taxes
$object->localtax1_tx = get_localtax($object->tva_tx,1); $vatratecode = '';
$object->localtax2_tx = get_localtax($object->tva_tx,2); $tva_tx = preg_replace('/[^0-9\.].*$/', '', $tva_tx_txt); // keep remove all after the numbers and dot
$npr = preg_match('/\*/', $tva_tx_txt) ? 1 : 0;
$localtax1 = 0; $localtax2 = 0; $localtax1_type = '0'; $localtax2_type = '0';
// If value contains the unique code of vat line (new recommanded method), we use it to find npr and local taxes
if (preg_match('/\((.*)\)/', $tva_tx_txt, $reg))
{
// We look into database using code (we can't use get_localtax() because it depends on buyer that is not known). Same in update price.
$vatratecode=$reg[1];
// Get record from code
$sql = "SELECT t.rowid, t.code, t.recuperableonly, t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$mysoc->country_code."'";
$sql.= " AND t.taux = ".((float) $tva_tx)." AND t.active = 1";
$sql.= " AND t.code ='".$vatratecode."'";
$resql=$db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
$npr = $obj->recuperableonly;
$localtax1 = $obj->localtax1;
$localtax2 = $obj->localtax2;
$localtax1_type = $obj->localtax1_type;
$localtax2_type = $obj->localtax2_type;
}
}
$object->default_vat_code = $vatratecode;
$object->tva_tx = $tva_tx;
$object->tva_npr = $npr;
$object->localtax1_tx = $localtax1;
$object->localtax2_tx = $localtax2;
$object->localtax1_type = $localtax1_type;
$object->localtax2_type = $localtax2_type;
$object->type = $type; $object->type = $type;
$object->status = GETPOST('statut'); $object->status = GETPOST('statut');
@ -1109,7 +1140,8 @@ else
// VAT // VAT
print '<tr><td>'.$langs->trans("VATRate").'</td><td>'; print '<tr><td>'.$langs->trans("VATRate").'</td><td>';
print $form->load_tva("tva_tx",-1,$mysoc,''); $defaultva=get_default_tva($mysoc, $mysoc);
print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1);
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';

View File

@ -396,7 +396,7 @@ class Product extends CommonObject
$sql = "SELECT count(*) as nb"; $sql = "SELECT count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= " FROM ".MAIN_DB_PREFIX."product";
$sql.= " WHERE entity IN (".getEntity('product', 1).")"; $sql.= " WHERE entity IN (".getEntity('product', 1).")";
$sql.= " AND ref = '" .$this->ref."'"; $sql.= " AND ref = '" .$this->db->escape($this->ref)."'";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
@ -1721,6 +1721,7 @@ class Product extends CommonObject
$this->tva_tx = $obj->tva_tx; $this->tva_tx = $obj->tva_tx;
//! French VAT NPR //! French VAT NPR
$this->tva_npr = $obj->tva_npr; $this->tva_npr = $obj->tva_npr;
$this->recuperableonly = $obj->tva_npr; // For backward compatibility
//! Local taxes //! Local taxes
$this->localtax1_tx = $obj->localtax1_tx; $this->localtax1_tx = $obj->localtax1_tx;
$this->localtax2_tx = $obj->localtax2_tx; $this->localtax2_tx = $obj->localtax2_tx;

View File

@ -113,7 +113,7 @@ if (empty($reshook))
// If value contains the unique code of vat line (new recommanded method), we use it to find npr and local taxes // If value contains the unique code of vat line (new recommanded method), we use it to find npr and local taxes
if (preg_match('/\((.*)\)/', $tva_tx_txt, $reg)) if (preg_match('/\((.*)\)/', $tva_tx_txt, $reg))
{ {
// We look into database using code // We look into database using code (we can't use get_localtax() because it depends on buyer that is not known). Same in create product.
$vatratecode=$reg[1]; $vatratecode=$reg[1];
// Get record from code // Get record from code
$sql = "SELECT t.rowid, t.code, t.recuperableonly, t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; $sql = "SELECT t.rowid, t.code, t.recuperableonly, t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
@ -1819,7 +1819,10 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print "<td>" . "</td>"; print "<td>" . "</td>";
print '<td align="center">' . $langs->trans($object->price_base_type) . "</td>"; print '<td align="center">' . $langs->trans($object->price_base_type) . "</td>";
print '<td align="right">' . vatrate($object->tva_tx, true, $object->recuperableonly) . "</td>"; print '<td align="right">';
print vatrate($object->tva_tx, true, $object->recuperableonly);
print $object->default_vat_code?' ('.$object->default_vat_code.')':'';
print "</td>";
print '<td align="right">' . price($object->price) . "</td>"; print '<td align="right">' . price($object->price) . "</td>";
print '<td align="right">' . price($object->price_ttc) . "</td>"; print '<td align="right">' . price($object->price_ttc) . "</td>";
print '<td align="right">' . price($object->price_min) . '</td>'; print '<td align="right">' . price($object->price_min) . '</td>';