diff --git a/.travis.yml b/.travis.yml index 69f43183cfc..57781d47e44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,12 +53,14 @@ before_script: - sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi" - sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi" - cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - echo Mysql version + - mysql --version - echo Init database - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi" - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi" - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.4.0.sql; fi" + - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi" - echo Create config file htdocs/conf/conf.php - echo ' htdocs/conf/conf.php - sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi" @@ -88,12 +90,12 @@ before_script: script: - cd htdocs/install - date - - php upgrade.php 3.4.0 3.5.0 > upgrade.log - - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log +# - php upgrade.php 3.4.0 3.5.0 > upgrade.log +# - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log - php upgrade.php 3.5.0 3.6.0 >> upgrade.log - php upgrade2.php 3.5.0 3.6.0 >> upgrade2.log - - php upgrade.php 3.6.0 3.7.0 >> upgrade360370.log - - cat upgrade360370.log + - php upgrade.php 3.6.0 3.7.0 >> upgrade.log +# - cat upgrade360370.log - php upgrade2.php 3.6.0 3.7.0 >> upgrade2.log # - cat upgrade2.log - cd ../.. diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 2a4af64f5fe..370c04591a9 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -446,6 +446,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 9bb3af6dcbd..82d88089684 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -277,20 +277,14 @@ if ($object->id > 0) print ''.$langs->trans("NbOfAttachedFiles").''.count($filearray).''; print ''.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").''; - print ''; + print ''; - print ''; + dol_fiche_end(); - $modulepart = 'actions'; - $permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create; - $param = '&id=' . $object->id; - include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; if ($action != 'edit') { - print "
"; - // Link to agenda views print '
'; print '
'; @@ -330,13 +324,23 @@ if ($object->id > 0) print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' '; print '
'."\n"; print '
'; + + print '
'; + print "

"; } + + + $modulepart = 'actions'; + $permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else { print $langs->trans("ErrorUnknown"); } -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index c330540cb03..53243d0c165 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -99,6 +99,13 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi $filterd=$user->id; } +// Purge search criteria +if (GETPOST("button_removefilter")) +{ + $datestart=''; + $dateend=''; +} + // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('agendalist')); @@ -278,8 +285,7 @@ if ($resql) //print ''; print ''; print ''; - //print '  '; - //print ''; + print ''; print ''; print "\n"; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 2b8e478d37d..96d633bd834 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -323,10 +323,9 @@ if ($result) $formpropal->selectProposalStatus($viewstatut,1); print ''; print ''; - print ''; - print ' '; - print ''; - print ''; + print ''; + print ''; + print ''; print "\n"; $var=true; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 84f8e455d11..ea17d895b95 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -43,9 +43,9 @@ $orderyear=GETPOST("orderyear","int"); $ordermonth=GETPOST("ordermonth","int"); $deliveryyear=GETPOST("deliveryyear","int"); $deliverymonth=GETPOST("deliverymonth","int"); -$sref=GETPOST('sref','alpha'); -$sref_client=GETPOST('sref_client','alpha'); -$snom=GETPOST('snom','alpha'); +$search_ref=GETPOST('search_ref','alpha'); +$search_ref_customer=GETPOST('search_ref_customer','alpha'); +$search_company=GETPOST('search_company','alpha'); $sall=GETPOST('sall'); $socid=GETPOST('socid','int'); $search_user=GETPOST('search_user','int'); @@ -69,6 +69,20 @@ $limit = $conf->liste_limit; $viewstatut=GETPOST('viewstatut'); +// Purge search criteria +if (GETPOST("button_removefilter")) +{ + $search_categ=''; + $search_user=''; + $search_sale=''; + $search_ref=''; + $search_ref_customer=''; + $search_company=''; + $orderyear=''; + $ordermonth=''; + $deliverymonth=''; + $deliveryyear=''; +} // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('orderlist')); @@ -81,24 +95,6 @@ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -// Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x")) -{ - $search_categ=''; - $search_user=''; - $search_sale=''; - $search_ref=''; - $search_refcustomer=''; - $search_societe=''; - $search_montant_ht=''; - $orderyear=''; - $ordermonth=''; - $deliverymonth=''; - $deliveryyear=''; -} - - - /* * View */ @@ -128,8 +124,8 @@ $sql.= ' WHERE c.fk_soc = s.rowid'; $sql.= ' AND c.entity = '.$conf->entity; if ($socid) $sql.= ' AND s.rowid = '.$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($sref) { - $sql .= natural_search('c.ref', $sref); +if ($search_ref) { + $sql .= natural_search('c.ref', $search_ref); } if ($sall) { @@ -188,13 +184,13 @@ else if ($deliveryyear > 0) { $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,12,false))."'"; } -if (!empty($snom)) +if (!empty($search_company)) { - $sql .= natural_search('s.nom', $snom); + $sql .= natural_search('s.nom', $search_company); } -if (!empty($sref_client)) +if (!empty($search_ref_customer)) { - $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\''; + $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($search_ref_customer).'%\''; } if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; if ($search_user > 0) @@ -246,15 +242,15 @@ if ($resql) $title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); $param='&socid='.$socid.'&viewstatut='.$viewstatut; - if ($ordermonth) $param.='&ordermonth='.$ordermonth; - if ($orderyear) $param.='&orderyear='.$orderyear; - if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth; - if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear; - if ($sref) $param.='&sref='.$sref; - if ($snom) $param.='&snom='.$snom; - if ($sref_client) $param.='&sref_client='.$sref_client; - if ($search_user > 0) $param.='&search_user='.$search_user; - if ($search_sale > 0) $param.='&search_sale='.$search_sale; + if ($ordermonth) $param.='&ordermonth='.$ordermonth; + if ($orderyear) $param.='&orderyear='.$orderyear; + if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth; + if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear; + if ($search_ref) $param.='&search_ref='.$search_ref; + if ($search_company) $param.='&search_company='.$search_company; + if ($search_ref_customer) $param.='&search_ref_customer='.$search_ref_customer; + if ($search_user > 0) $param.='&search_user='.$search_user; + if ($search_sale > 0) $param.='&search_sale='.$search_sale; $num = $db->num_rows($resql); print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); @@ -294,33 +290,35 @@ if ($resql) print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','',$param,'width="25%"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'c.fk_statut','',$param,'align="right"',$sortfield,$sortorder); print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5); - print ''; + print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5); - print ' '; - print ''; - print ''; - print ''; + print ''; + print ' '; + print ''; + print ''; + print "\n"; $var=true; $total=0; @@ -443,12 +441,12 @@ if ($resql) print ''; // Order date - print ''; + print ''; print dol_print_date($db->jdate($objp->date_commande), 'day'); print ''; // Delivery date - print ''; + print ''; print dol_print_date($db->jdate($objp->date_livraison), 'day'); print ''; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index da0e3e21dcd..42a6713c1ce 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -115,7 +115,7 @@ if ($month > 0) } else if ($year > 0) { - $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } $sql.= $db->order($sortfield,$sortorder); diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 1fecc0e1c28..b586241c11e 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -560,7 +560,7 @@ print ' '; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''; + print ''; print ''; print $annee; if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1); @@ -571,7 +571,7 @@ print ''.$langs->trans("Month"). for ($annee = $year_start ; $annee <= $year_end ; $annee++) { print ''.$langs->trans("Outcome").''; - print ''.$langs->trans("Income").''; + print ''.$langs->trans("Income").''; } print ''; @@ -601,7 +601,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) } print ""; - print ' '; + print ' '; //if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0) if (isset($encaiss_ttc[$case])) { @@ -623,7 +623,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) { $nbcols+=2; print ''.(isset($totsorties[$annee])?price(price2num($totsorties[$annee],'MT')):' ').''; - print ''.(isset($totentrees[$annee])?price(price2num($totentrees[$annee],'MT')):' ').''; + print ''.(isset($totentrees[$annee])?price(price2num($totentrees[$annee],'MT')):' ').''; } print "\n"; @@ -637,7 +637,7 @@ $var=!$var; print ''.$langs->trans("Profit").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ' '; + print ' '; if (isset($totentrees[$annee]) || isset($totsorties[$annee])) { $in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 69fdeff849c..b3fb130e185 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -184,7 +184,7 @@ print ' '; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { if ($modecompta == 'CREANCES-DETTES') print ''; - else print ''; + else print ''; print ''; print $annee; if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1); @@ -198,7 +198,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) { if ($modecompta == 'CREANCES-DETTES') print ''.$langs->trans("AmountHT").''; print ''.$langs->trans("AmountTTC").''; - print ''.$langs->trans("Delta").''; + print ''.$langs->trans("Delta").''; if ($annee != $year_end) print ' '; } print ''; @@ -244,7 +244,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) } print ""; } - + // Valeur CA du mois print ''; if ($cum[$case]) @@ -266,29 +266,29 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) { $percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100); //print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X"; - print ''.($percent>=0?"+$percent":"$percent").'%'; + print ''.($percent>=0?"+$percent":"$percent").'%'; } if ($cum[$caseprev] && ! $cum[$case]) { - print '-100%'; + print '-100%'; } if (! $cum[$caseprev] && $cum[$case]) { //print '+Inf%'; - print '-'; + print '-'; } if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case]) { - print '+0%'; + print '+0%'; } if (! isset($cum[$caseprev]) && ! $cum[$case]) { - print '-'; + print '-'; } } else { - print ''; + print ''; if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; } print ''; @@ -382,7 +382,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) print ' '; } } - + // Montant total if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear))) { @@ -398,24 +398,24 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) { if ($total[$annee-1] && $total[$annee]) { $percent=(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100); - print ''.($percent>=0?"+$percent":"$percent").'%'; + print ''.($percent>=0?"+$percent":"$percent").'%'; } if ($total[$annee-1] && ! $total[$annee]) { - print '-100%'; + print '-100%'; } if (! $total[$annee-1] && $total[$annee]) { - print '+Inf%'; + print '+Inf%'; } if (! $total[$annee-1] && ! $total[$annee]) { - print '+0%'; + print '+0%'; } } else { - print ''; + print ''; if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear,$maxyear))) { print '-'; } else { print ' '; } print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a311c87cffc..2e28328085a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -357,7 +357,6 @@ if ($result) print ''; print ''; print ''; - print ' '; print ''; print ''; print ''; diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php index c3bc217e100..a16844dd715 100644 --- a/htdocs/core/antispamimage.php +++ b/htdocs/core/antispamimage.php @@ -51,8 +51,6 @@ for($i = 0; $i < $length; $i++) $sessionkey='dol_antispam_value'; $_SESSION[$sessionkey]=$string; -header("Content-type: image/png"); - $img = imagecreate(80,32); if (empty($img)) { @@ -60,6 +58,8 @@ if (empty($img)) exit; } +header("Content-type: image/png"); + $background_color = imagecolorallocate($img, 250, 250, 250); $ecriture_color = imagecolorallocate($img, 0, 0, 0); imagestring($img, 4, 24, 8, $string, $ecriture_color); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a9c39fa790f..e85d3dbed71 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1825,7 +1825,7 @@ abstract class CommonObject if (empty($sourceid) && empty($targetid)) { - dol_print_error('','Bad usage of function. No parameter defined and no id defined'); + dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERROR); return -1; } @@ -2525,14 +2525,14 @@ abstract class CommonObject if (! empty($conf->margin->enabled) && empty($user->societe_id)) { if ($conf->global->MARGIN_TYPE == "1") - print ''.$langs->trans('BuyingPrice').''; + print ''.$langs->trans('BuyingPrice').''; else - print ''.$langs->trans('CostPrice').''; + print ''.$langs->trans('CostPrice').''; if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) - print ''.$langs->trans('MarginRate').''; + print ''.$langs->trans('MarginRate').''; if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) - print ''.$langs->trans('MarkRate').''; + print ''.$langs->trans('MarkRate').''; } // Total HT @@ -3012,11 +3012,16 @@ abstract class CommonObject $marginInfo = $this->getMarginInfos($force_price); - if (! empty($conf->global->MARGININFO_HIDE_SHOW)) - { - print ""; - if ($conf->global->MARGININFO_HIDE_SHOW == 2) print ''; // hide by default - } + print $langs->trans('ShowMarginInfos').' : '; + $hidemargininfos = $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + + print ''; + if (!empty($hidemargininfos)) print ''; print ''; print ''; diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index 40b1473698e..962e4c39f47 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -631,7 +631,7 @@ function hideMessage(fieldId,message) { /* - * TODO Used by admin page only ? + * Used by button to set on/off */ function setConstant(url, code, input, entity, strict) { $.get( url, { @@ -689,7 +689,7 @@ function setConstant(url, code, input, entity, strict) { } /* - * TODO Used by admin page only ? + * Used by button to set on/off */ function delConstant(url, code, input, entity, strict) { $.get( url, { @@ -743,7 +743,7 @@ function delConstant(url, code, input, entity, strict) { } /* - * TODO Used by admin page only ? + * Used by button to set on/off */ function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) { var boxConfirm = box; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a94a77f1454..09c38435c0a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -44,14 +44,31 @@ include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php'; * @param string $class Class name * @param string $member Name of property * @return mixed Return value of static property - * @deprecated PHP 5.3 is now the minimum requirement, this is no longer necessary */ function getStaticMember($class, $member) { - if (isset($class::$member)) { - return $class::$member; - } + // This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member + /*if (version_compare(phpversion(), '5.3.0', '<')) + { + if (is_object($class)) $class = get_class($class); + $classObj = new ReflectionClass($class); + $result = null; + $found=0; + foreach($classObj->getStaticProperties() as $prop => $value) + { + if ($prop == $member) + { + $result = $value; + $found++; + break; + } + } + + if ($found) return $result; + }*/ + + if (isset($class::$member)) return $class::$member; dol_print_error('','Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.'); return null; } @@ -2862,7 +2879,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou $listofcurrenciesbefore=array('USD'); if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); - else + else { $tmpcur=$outlangs->getCurrencySymbol($currency_code); $cursymbolafter.=($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 984bc809a75..87c88ac028c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -770,15 +770,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-3", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); // if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); } - + // Supplier Orders if (! empty($conf->fournisseur->enabled)) { - $langs->load("supplier"); - $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); - // if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); + if (! empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE)) + { + $langs->load("supplier"); + $newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders'); + // if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire); + } } - + // Donations if (! empty($conf->don->enabled)) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index bdced511867..56cca5af04f 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -87,8 +87,8 @@ diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index ee2a8695f3a..ad2fa068757 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * * Need to have following variables defined: * $object (invoice, order, ...) * $conf @@ -49,21 +49,30 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print '
-
- +
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?> textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?>
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index dcf1af56ed1..493634c84a5 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -98,8 +98,8 @@ if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($typ
-
- +
+ textwithpicto('', $langs->trans("ExtrafieldParamHelp".$type),1,0)?>
attribute_required [$key])) print ' class="fieldrequired"'; print '>' . $label . ''; - + //TODO Improve element and rights detection - if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && ($object->element=='order_supplier'?$user->rights->fournisseur>commande:($object->element=='invoice_supplier'?$user->rights->fournisseur>facture:$user->rights->{$object->element}->creer)) && ($action != 'edit_extras' || GETPOST('attribute') != $key)) + //var_dump($user->rights); + $permok=false; + $keyforperm=$object->element; + if ($object->element == 'fichinter') $keyforperm='ficheinter'; + if (isset($user->rights->$keyforperm)) $permok=$user->rights->$keyforperm->creer||$user->rights->$keyforperm->create||$user->rights->$keyforperm->write; + if ($object->element=='order_supplier') $permok=$user->rights->fournisseur->commande->creer; + if ($object->element=='invoice_supplier') $permok=$user->rights->fournisseur->facture->creer; + + if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) + && $permok && ($action != 'edit_extras' || GETPOST('attribute') != $key)) print ''; - + print '
' . img_edit().'
'; print ''; - + // Convert date into timestamp format if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); } - + //TODO Improve element and rights detection - if ($action == 'edit_extras' && ($object->element=='order_supplier'?$user->rights->fournisseur>commande:($object->element=='invoice_supplier'?$user->rights->fournisseur>facture:$user->rights->{$object->element}->creer)) && GETPOST('attribute') == $key) + if ($action == 'edit_extras' && $permok && GETPOST('attribute') == $key) { print '
'; print ''; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 6af092c7e92..86ef648bf94 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -61,7 +61,7 @@ if (in_array($object->element,array('propal','facture','invoice','commande','ord if (! empty($usemargins)) { ?> - + '; if ($conf->global->MARGIN_TYPE == "1") @@ -72,8 +72,8 @@ if (in_array($object->element,array('propal','facture','invoice','commande','ord ?> rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''.$langs->trans('MarginRate').''; - if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo ''.$langs->trans('MarkRate').''; + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''.$langs->trans('MarginRate').''; + if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo ''.$langs->trans('MarkRate').''; } ?>   @@ -217,7 +217,7 @@ else { if (! empty($usemargins)) { ?> - + product->enabled) || ! empty($conf->service->enabled)) { ?> @@ -232,12 +232,12 @@ else { { if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { - echo '%'; + echo '%'; $coldisplay++; } if (! empty($conf->global->DISPLAY_MARK_RATES)) { - echo '%'; + echo '%'; $coldisplay++; } } diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 68a19c0bb73..fbe2870a6a4 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -125,7 +125,7 @@ $coldisplay=-1; // We remove first td if (! empty($usemargins)) { ?> - + product->enabled) || ! empty($conf->service->enabled)) { ?> @@ -139,9 +139,9 @@ $coldisplay=-1; // We remove first td $margin_rate = (isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:(($line->pa_ht == 0)?'':price($line->marge_tx))); // if credit note, dont allow to modify margin if ($line->subprice < 0) - echo ''.$margin_rate.'%'; + echo ''.$margin_rate.'%'; else - echo '%'; + echo '%'; $coldisplay++; } elseif (! empty($conf->global->DISPLAY_MARK_RATES)) @@ -149,9 +149,9 @@ $coldisplay=-1; // We remove first td $mark_rate = (isset($_POST["np_markRate"])?$_POST["np_markRate"]:price($line->marque_tx)); // if credit note, dont allow to modify margin if ($line->subprice < 0) - echo ''.$mark_rate.'%'; + echo ''.$mark_rate.'%'; else - echo '%'; + echo '%'; $coldisplay++; } } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 777732aa192..1c8bb07f560 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -141,13 +141,13 @@ if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; if (! empty($conf->margin->enabled) && empty($user->societe_id)) { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> -
pa_ht); ?>
+ pa_ht); ?> global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {?> - pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?> + pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?> global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> - marque_tx, null, null, null, null, $rounding).'%'; ?> + marque_tx, null, null, null, null, $rounding).'%'; ?> special_code == 3) { ?> diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php index cab0886f5ff..8cb95a30f63 100644 --- a/htdocs/fichinter/admin/fichinter_extrafields.php +++ b/htdocs/fichinter/admin/fichinter_extrafields.php @@ -92,6 +92,7 @@ print ''.$langs->trans("Type").''; print ''.$langs->trans("Size").''; print ''.$langs->trans("Unique").''; print ''.$langs->trans("Required").''; +print ''.$langs->trans("AlwaysEditable").''; print ' '; print "\n"; @@ -107,6 +108,7 @@ foreach($extrafields->attribute_type as $key => $value) print ''.$extrafields->attribute_size[$key]."\n"; print ''.yn($extrafields->attribute_unique[$key])."\n"; print ''.yn($extrafields->attribute_required[$key])."\n"; + print ''.yn($extrafields->attribute_alwayseditable[$key])."\n"; // TODO This must be generalised into all page to admin extrafield. Mutualize code here is easy and will save a lot of code print '
'.img_edit().''; print "  ".img_delete()."\n"; print ""; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 0d6bebada72..db4212308de 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -146,7 +146,7 @@ class FactureFournisseur extends CommonInvoice */ function create($user) { - global $langs,$conf; + global $langs,$conf,$hookmanager; $error=0; $now=dol_now(); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 58abe457831..ab0fd08d3f0 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -39,12 +39,11 @@ $langs->load("sendings"); $search_ref=GETPOST('search_ref'); $search_refsupp=GETPOST('search_refsupp'); -$search_nom=GETPOST('search_nom'); +$search_company=GETPOST('search_company'); $search_user=GETPOST('search_user'); $search_ttc=GETPOST('search_ttc'); $sall=GETPOST('search_all'); $search_status=GETPOST('search_status','int'); -if ($search_status == '') $search_status=-1; $page = GETPOST('page','int'); $socid = GETPOST('socid','int'); @@ -58,6 +57,18 @@ $orderid = GETPOST('orderid'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande'); +// Purge search criteria +if (GETPOST("button_removefilter")) +{ + $search_ref=''; + $search_refsupp=''; + $search_company=''; + $search_user=''; + $search_ttc=''; + $search_status=''; +} + +if ($search_status == '') $search_status=-1; /* * View @@ -102,9 +113,9 @@ if ($search_ref) { $sql .= natural_search('cf.ref', $search_ref); } -if ($search_nom) +if ($search_company) { - $sql .= natural_search('s.nom', $search_nom); + $sql .= natural_search('s.nom', $search_company); } if ($search_user) { @@ -154,13 +165,14 @@ if ($resql) $i = 0; $param=""; - if ($search_ref) $param.="&search_ref=".$search_ref; - if ($search_nom) $param.="&search_nom=".$search_nom; - if ($search_user) $param.="&search_user=".$search_user; - if ($search_ttc) $param.="&search_ttc=".$search_ttc; - if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp; - if ($socid) $param.="&socid=".$socid; - if ($search_status >= 0) $param.="&search_status=".$search_status; + if ($search_ref) $param.="&search_ref=".$search_ref; + if ($search_company) $param.="&search_company=".$search_company; + if ($search_user) $param.="&search_user=".$search_user; + if ($search_ttc) $param.="&search_ttc=".$search_ttc; + if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp; + if ($socid) $param.="&socid=".$socid; + if ($search_status >= 0) $param.="&search_status=".$search_status; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); print ''; print ''; @@ -180,7 +192,7 @@ if ($resql) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -188,10 +200,9 @@ if ($resql) print ''; - print ''; - print ''; + print '\n"; $var=true; diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 06b77e2daa2..95158c60a4f 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -56,7 +56,7 @@ ALTER TABLE llx_user ADD COLUMN fk_user_creat integer AFTER tms; ALTER TABLE llx_user ADD COLUMN fk_user_modif integer AFTER fk_user_creat; -- Add module accounting Expert -ALTER TABLE llx_bookkeeping RENAME TO llx_accounting_bookkeeping; -- To update old user of module Accounting Expert +--ALTER TABLE llx_bookkeeping RENAME TO llx_accounting_bookkeeping; -- To update old user of module Accounting Expert -> Line should be added into file sql/x.y.z-a.b.c.sql of module. CREATE TABLE llx_accounting_bookkeeping @@ -182,7 +182,7 @@ ALTER TABLE llx_product MODIFY COLUMN fk_barcode_type INTEGER NULL DEFAULT NULL; UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type = 0; ALTER TABLE llx_product ADD INDEX idx_product_fk_barcode_type (fk_barcode_type); UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type NOT IN (SELECT rowid from llx_c_barcode_type); -ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid); +--ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid); -- Added missing relations of llx_product_price diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang index 38b6482a4f3..0cf9bc34410 100644 --- a/htdocs/langs/en_US/margins.lang +++ b/htdocs/langs/en_US/margins.lang @@ -41,3 +41,4 @@ AgentContactType=Commercial agent contact type AgentContactTypeDetails=Define what contact type (linked on invoices) will be used for margin report per sale representative rateMustBeNumeric=Rate must be a numeric value markRateShouldBeLesserThan100=Mark rate should be lower than 100 +ShowMarginInfos=Show margin infos \ No newline at end of file diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index 2ae43f39766..f6111bac684 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -61,6 +61,8 @@ ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is do RelatedShippings=Related shippings ShipmentLine=Shipment line CarrierList=List of transporters +SendingRunning=Product from customer order already sent +SuppliersReceiptRunning=Product from supplier order already received # Sending methods SendingMethodCATCH=Catch by customer diff --git a/htdocs/langs/fr_FR/deliveries.lang b/htdocs/langs/fr_FR/deliveries.lang index 4f61426e83c..02dd54275f6 100644 --- a/htdocs/langs/fr_FR/deliveries.lang +++ b/htdocs/langs/fr_FR/deliveries.lang @@ -24,3 +24,5 @@ Deliverer=Livreur(s) : Sender=Expéditeur Recipient=Destinataire ErrorStockIsNotEnough=Le stock est insuffisant +Shippable=Expédiable +NonShippable=Non Expédiable diff --git a/htdocs/langs/fr_FR/margins.lang b/htdocs/langs/fr_FR/margins.lang index dabd381ab1a..42951e5979e 100644 --- a/htdocs/langs/fr_FR/margins.lang +++ b/htdocs/langs/fr_FR/margins.lang @@ -48,3 +48,5 @@ Charges=Charges AgentContactType=Type de contact agent commercial AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera utilisé pour le rapport de marges par agent commercial + +ShowMarginInfos=Afficher les infos liées aux marges \ No newline at end of file diff --git a/htdocs/langs/fr_FR/sendings.lang b/htdocs/langs/fr_FR/sendings.lang index 47b359318e4..3f839ba9416 100644 --- a/htdocs/langs/fr_FR/sendings.lang +++ b/htdocs/langs/fr_FR/sendings.lang @@ -61,6 +61,8 @@ ShipmentCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle exp RelatedShippings=Expédition(s) associée(s) ShipmentLine=Ligne d'expédition CarrierList=Liste des transporteurs +SendingRunning=Produits de commandes clients déjà expédiés +SuppliersReceiptRunning=Produits de commandes fournisseurs déjà réceptionnés # Sending methods SendingMethodCATCH=Enlèvement par le client diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 226a3501652..98b5d155ba7 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3032,42 +3032,56 @@ class Product extends CommonObject * * @return int < 0 if KO, > 0 if OK */ - function load_virtual_stock() - { - global $conf; + function load_virtual_stock() + { + global $conf; - if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) - { - $stock_commande_client=$stock_commande_fournisseur=0; - $stock_sending_client=$stock_reception_fournisseur=0; + $stock_commande_client=0; + $stock_commande_fournisseur=0; + $stock_sending_client=0; + $stock_reception_fournisseur=0; - if (! empty($conf->commande->enabled)) - { - $result=$this->load_stats_commande(0,'1,2'); - if ($result < 0) dol_print_error($db,$this->error); - $stock_commande_client=$this->stats_commande['qty']; - } - if (! empty($conf->expedition->enabled)) - { - $result=$this->load_stats_sending(0,'1,2'); - if ($result < 0) dol_print_error($db,$this->error); - $stock_sending_client=$this->stats_expedition['qty']; - } - if (! empty($conf->fournisseur->enabled)) - { - $result=$this->load_stats_commande_fournisseur(0,'3'); - if ($result < 0) dol_print_error($db,$this->error); - $stock_commande_fournisseur=$this->stats_commande_fournisseur['qty']; + if (! empty($conf->commande->enabled)) { + $result=$this->load_stats_commande(0,'1,2'); + if ($result < 0) dol_print_error($db,$this->error); + $stock_commande_client=$this->stats_commande['qty']; + } + if (! empty($conf->expedition->enabled)) { + $result=$this->load_stats_sending(0,'1,2'); + if ($result < 0) dol_print_error($db,$this->error); + $stock_sending_client=$this->stats_expedition['qty']; + } + if (! empty($conf->fournisseur->enabled)) { + $result=$this->load_stats_commande_fournisseur(0,'3,4'); + if ($result < 0) dol_print_error($db,$this->error); + $stock_commande_fournisseur=$this->stats_commande_fournisseur['qty']; - $result=$this->load_stats_reception(0,'3'); - if ($result < 0) dol_print_error($db,$this->error); - $stock_reception_fournisseur=$this->stats_reception['qty']; - } + $result=$this->load_stats_reception(0,'4'); + if ($result < 0) dol_print_error($db,$this->error); + $stock_reception_fournisseur=$this->stats_reception['qty']; + } - $this->stock_theorique=$this->stock_reel-($stock_commande_client-$stock_sending_client)+($stock_commande_fournisseur-$stock_reception_fournisseur); - //echo $this->stock_theorique.' = '.$this->stock_reel.' - ('.$stock_commande_client.' - '.$stock_sending_client.') + ('.$stock_commande_fournisseur.' - '.$stock_reception_fournisseur.')'; - } - } + // Stock decrease mode + if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { + $this->stock_theorique=$this->stock_reel-$stock_commande_client+$stock_sending_client; + } + if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) { + $this->stock_theorique=$this->stock_reel; + } + if (! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { + $this->stock_theorique=$this->stock_reel-$stock_commande_client; + } + // Stock Increase mode + if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { + $this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur; + } + if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { + $this->stock_theorique-=$stock_reception_fournisseur; + } + if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { + $this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur; + } + } /** * Move an uploaded file described into $file array into target directory $sdir. diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 55b9beb259c..ebf8b77f722 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -510,7 +510,7 @@ else $product_static->status_buy = $objp->tobuy; $product_static->status = $objp->tosell; // Status (to sell) - print ''; // Status (to buy) - print ''; print ''; print "\n"; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 7885553095e..22dc080d6e2 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -39,6 +39,7 @@ $langs->load("products"); $langs->load("orders"); $langs->load("bills"); $langs->load("stocks"); +$langs->load("sendings"); if (! empty($conf->productbatch->enabled)) $langs->load("productbatch"); @@ -331,58 +332,62 @@ if ($id > 0 || $ref) print ''; print ''; - // Calculating a theorical value + // Calculating a theorical value + print ''; + print "'; + print ''; - // If stock if stock increment is done on real sending - if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) - { - // Stock theorique - print ''; - print "'; - print ''; + print ''; + print ''; - print ''; - } + // Number of supplier order running + if (! empty($conf->fournisseur->enabled)) { + if ($found) print '
'; else $found=1; + $result=$product->load_stats_commande_fournisseur(0,'3,4'); + print $langs->trans("SuppliersOrdersRunning").': '.$product->stats_commande_fournisseur['qty']; + $result=$product->load_stats_commande_fournisseur(0,'0,1,2'); + if ($result < 0) dol_print_error($db,$product->error); + print ' ('.$langs->trans("DraftOrWaitingApproved").': '.$product->stats_commande_fournisseur['qty'].')'; + } - // If stock if stock increment is done on - // TODO Add information when stock increment is done on other option - - // TODO Add also information on possible decrease stock accroding to stock decrease option + // Number of product from supplier order already received (partial receipt) + if (! empty($conf->fournisseur->enabled)) { + if ($found) print '
'; else $found=1; + print $langs->trans("SuppliersReceiptRunning").': '.$product->stats_reception['qty']; + } + print ''; // Last movement $sql = "SELECT max(m.datem) as datem"; diff --git a/htdocs/theme/.gitignore b/htdocs/theme/.gitignore index fab0672d598..bad6db7e4d2 100644 --- a/htdocs/theme/.gitignore +++ b/htdocs/theme/.gitignore @@ -1 +1,2 @@ /bootstrap +/oblyon diff --git a/htdocs/theme/eldy/.gitignore b/htdocs/theme/eldy/.gitignore new file mode 100644 index 00000000000..134509791a9 --- /dev/null +++ b/htdocs/theme/eldy/.gitignore @@ -0,0 +1 @@ +/*.new diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 0f5644dc406..3eb64ad5c2e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -424,6 +424,10 @@ th .button { border-radius: 10px; } +.borderrightlight +{ + border-right: 1px solid #DDD; +} /* ============================================================================== */ /* Styles to hide objects */ @@ -862,7 +866,7 @@ form#login { max-width: 540px; background-color: #FFFFFF; - + -moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); -webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); @@ -872,7 +876,7 @@ form#login { border-radius: 8px; border:solid 1px rgba(80,80,80,.4); - + border-top:solid 1px f8f8f8; /* background-color: #f8f8f8;
 '; $formorder->selectSupplierOrderStatus($search_status,1,'search_status'); print ''; - print ''; - print '
'; + print ''; + print "
'; + print ''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { @@ -519,7 +519,7 @@ else print ''; + print ''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 50b46c7003f..06e089c5209 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -461,7 +461,6 @@ if ($resql) print ''; print ''; - print '  '; print ''; print '
'.$langs->trans("VirtualStock").'".$product->stock_theorique; + if ($product->stock_theorique < $product->seuil_stock_alerte) { + print ' '.img_warning($langs->trans("StockLowerThanLimit")); + } + print '
'.$langs->trans("VirtualStock").'".$product->stock_theorique; - if ($product->stock_theorique < $product->seuil_stock_alerte) - { - print ' '.img_warning($langs->trans("StockLowerThanLimit")); - } - print '
'; + $text_stock_options = (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'
':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'
':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'
':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'
':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'
':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'
':''); + print $form->textwithtooltip($langs->trans("StockDiffPhysicTeoric"),$text_stock_options,2,1,img_picto('', 'info'),'',0);; + print '
'; - print '
'; - if ($product->stock_theorique != $product->stock_reel) print $langs->trans("StockDiffPhysicTeoric"); - else print $langs->trans("RunningOrders"); - print ''; + $found=0; - $found=0; + // Number of customer orders running + if (! empty($conf->commande->enabled)) + { + if ($found) print '
'; else $found=1; + print $langs->trans("CustomersOrdersRunning").': '.$product->stats_commande['qty']; + $result=$product->load_stats_commande(0,'0'); + if ($result < 0) dol_print_error($db,$product->error); + print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')'; + } - // Nbre de commande clients en cours - if (! empty($conf->commande->enabled)) - { - if ($found) print '
'; else $found=1; - print $langs->trans("CustomersOrdersRunning").': '.($product->stats_commande['qty']-$product->stats_sendings['qty']); - $result=$product->load_stats_commande(0,'0'); - if ($result < 0) dol_print_error($db,$product->error); - print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')'; - //print '
'; - //print $langs->trans("CustomersSendingRunning").': '.$stock_sending_client; - } + // Number of product from customer order already sent (partial shipping) + if (! empty($conf->expedition->enabled)) { + if ($found) print '
'; else $found=1; + $result=$product->load_stats_sending(0,'2'); + print $langs->trans("SendingRunning").': '.$product->stats_expedition['qty']; + } - // Nbre de commande fournisseurs en cours - if (! empty($conf->fournisseur->enabled)) - { - if ($found) print '
'; else $found=1; - print $langs->trans("SuppliersOrdersRunning").': '.($product->stats_commande_fournisseur['qty']-$product->stats_reception['qty']); - $result=$product->load_stats_commande_fournisseur(0,'0,1,2'); - if ($result < 0) dol_print_error($db,$product->error); - print ' ('.$langs->trans("DraftOrWaitingApproved").': '.$product->stats_commande_fournisseur['qty'].')'; - } - print '