diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index 20a713ce220..ae7d839919c 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -216,6 +216,21 @@ function updateTotal(days,mode) if (total.getHours() || total.getMinutes()) jQuery('.totalDay'+days).addClass("bold"); else jQuery('.totalDay'+days).removeClass("bold"); jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes())); + + var total = new Date(0); + total.setHours(0); + total.setMinutes(0); + for (var i=0; i<7; i++) + { + var taskTime= new Date(0); + result=parseTime(jQuery('.totalDay'+i).text(),taskTime); + if (result >= 0) + { + total.setHours(total.getHours()+taskTime.getHours()); + total.setMinutes(total.getMinutes()+taskTime.getMinutes()); + } + } + jQuery('.totalDayAll').text(pad(total.getHours())+':'+pad(total.getMinutes())); } else { @@ -260,7 +275,6 @@ function updateTotal(days,mode) else jQuery('.totalDay'+days).removeClass("bold"); jQuery('.totalDay'+days).text(total); } - } \ No newline at end of file diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e13e08acd7b..cf007659487 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2964,12 +2964,12 @@ class CommandeFournisseur extends CommonOrder } }elseif(! empty($conf->global->SUPPLIER_ORDER_MORE_THAN_WISHED) ) {//set livraison to 'tot' if more products received than wished. (and if $closeopenorder is set to 1 of course...) - + $close=0; - + if( count($diff_array) > 0 ) {//there are some difference between the two arrays - + //scan the array of results foreach($diff_array as $key => $value) {//if the quantity delivered is greater or equal to wish quantity @@ -2977,11 +2977,11 @@ class CommandeFournisseur extends CommonOrder { $close++; } - + } } - + if($close == count($diff_array)) {//all the products are received equal or more than the wished quantity if ($closeopenorder) @@ -3001,8 +3001,8 @@ class CommandeFournisseur extends CommonOrder } return 4; } - - + + } else {//all the products are not received @@ -3012,7 +3012,7 @@ class CommandeFournisseur extends CommonOrder } return 4; } - + } else { @@ -3157,40 +3157,6 @@ class CommandeFournisseurLigne extends CommonOrderLine } } - /** - * Mise a jour de l'objet ligne de commande en base - * - * @return int <0 si ko, >0 si ok - */ - public function updateTotal() - { - $this->db->begin(); - - // Mise a jour ligne en base - $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseurdet SET"; - $sql.= " total_ht='".price2num($this->total_ht)."'"; - $sql.= ",total_tva='".price2num($this->total_tva)."'"; - $sql.= ",total_localtax1='".price2num($this->total_localtax1)."'"; - $sql.= ",total_localtax2='".price2num($this->total_localtax2)."'"; - $sql.= ",total_ttc='".price2num($this->total_ttc)."'"; - $sql.= " WHERE rowid = ".$this->rowid; - - dol_syslog(get_class($this)."::updateTotal", LOG_DEBUG); - - $resql=$this->db->query($sql); - if ($resql) - { - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -2; - } - } - /** * Insert line into database * diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 85848eefedc..b61c5aff922 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -595,10 +595,15 @@ if (count($tasksarray) > 0) if ($isdiff) { print '