diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index f2d207e1983..f2fc5183668 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -132,13 +132,15 @@ class modReceiptPrinter extends DolibarrModules */ public function init($options = '') { - global $conf; + global $conf, $langs; // Clean before activation $this->remove($options); $sql = array( "CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."printer_receipt (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), fk_type integer, fk_profile integer, parameter varchar(128), entity integer) ENGINE=innodb;", "CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."printer_receipt_template (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), template text, entity integer) ENGINE=innodb;", - ); + "DELETE FROM ".MAIN_DB_PREFIX."printer_receipt_template WHERE name = '".$langs->trans('Example')."';", + "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt_template (name,template,entity) VALUES ('".$langs->trans('Example')."', '\r\n\r\n\r\n\r\n\r\nFacture \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n', 1);", + ); return $this->_init($sql, $options); } } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 50942b8b363..8ae94aa536b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -826,6 +826,14 @@ foreach ($listofreferent as $key => $value) elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'payment_salary'))) print $langs->trans("User"); else print $langs->trans("ThirdParty"); print ''; + // Duration of intervention + if($tablename == 'fichinter') + { + print ''; + print $langs->trans("TotalDuration"); + $total_duration = 0; + print ''; + } // Amount HT //if (empty($value['disableamount']) && ! in_array($tablename, array('projet_task'))) print ''.$langs->trans("AmountHT").''; //elseif (empty($value['disableamount']) && in_array($tablename, array('projet_task'))) print ''.$langs->trans("Amount").''; @@ -1024,6 +1032,15 @@ foreach ($listofreferent as $key => $value) } print ''; + // Add duration and store it in counter for fichinter + if($tablename == 'fichinter') + { + print ''; + print convertSecondToTime($element->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); + $total_duration += $element->duration; + print ''; + } + // Amount without tax $warning = ''; if (empty($value['disableamount'])) @@ -1201,6 +1218,8 @@ foreach ($listofreferent as $key => $value) } //if (empty($value['disableamount']) && ! in_array($tablename, array('projet_task'))) print ''.$langs->trans("TotalHT").' : '.price($total_ht).''; //elseif (empty($value['disableamount']) && in_array($tablename, array('projet_task'))) print ''.$langs->trans("Total").' : '.price($total_ht).''; + // If fichinter add the total_duration + if($tablename == 'fichinter') print ''.convertSecondToTime($total_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).''; print ''; if (empty($value['disableamount'])) {