diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index 3bd93555d76..0a4aa9989ff 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -90,24 +90,20 @@ function pad(n) { /* function from http://www.timlabonne.com/2013/07/parsing-a-time-string-with-javascript/ */ +/* timeStr must be a duration with format XX:YY (AM/PM not supported) */ function parseTime(timeStr, dt) { if (!dt) { dt = new Date(); } - var time = timeStr.match(/(\d+)(?::(\d\d))?\s*(p?)/i); + //var time = timeStr.match(/(\d+)(?::(\d\d))?\s*(p?)/i); + var time = timeStr.match(/(\d+)(?::(\d\d))?/i); if (!time) { return -1; } var hours = parseInt(time[1], 10); - if (hours == 12 && !time[3]) { - hours = 0; - } - else { - hours += (hours < 12 && time[3]) ? 12 : 0; - } - + dt.setHours(hours); dt.setMinutes(parseInt(time[2], 10) || 0); dt.setSeconds(0, 0); diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 6e3a30507dc..4b9511ce0df 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -216,7 +216,7 @@ if (($action == 'create' || $action == 'add') && ! $error) { $fk_parent_line = 0; } // FIXME Missing $lines[$i]->ref_supplier and $lines[$i]->label into addline and updateline methods. They are filled when coming from order for example. - $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->qty, $lines[$i]->fk_product, $lines[$i]->remise_percent, $date_start, $date_end, 0, $lines[$i]->info_bits, 'HT', $product_type, -1, false, 0, $lines[$i]->fk_unit); + $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->qty, $lines[$i]->fk_product, $lines[$i]->remise_percent, $date_start, $date_end, 0, $lines[$i]->info_bits, 'HT', $product_type, -1, false, 0, $lines[$i]->fk_unit, $line[$i]->id); if ($result > 0) { $lineid = $result; diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index cee3a17e061..380c64c28fc 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -560,3 +560,5 @@ UPDATE llx_advtargetemailing SET fk_element = fk_mailing, type_element='mailing' ALTER TABLE llx_advtargetemailing DROP COLUMN fk_mailing; DROP TABLE llx_ticket_logs; + +ALTER TABLE llx_actioncomm MODIFY COLUMN code varchar(50); diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 9bd74119d34..c0ab1631d8c 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -52,6 +52,9 @@ ALTER TABLE llx_actioncomm ADD COLUMN email_subject varchar(255) after email_msg ALTER TABLE llx_actioncomm ADD COLUMN email_tocc varchar(255) after email_to; ALTER TABLE llx_actioncomm ADD COLUMN email_tobcc varchar(255) after email_tocc; +ALTER TABLE llx_actioncomm MODIFY COLUMN code varchar(50); + + -- For 9.0 ALTER TABLE llx_extrafields ADD COLUMN help text NULL; ALTER TABLE llx_extrafields ADD COLUMN totalizable boolean DEFAULT FALSE after list; diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql index 6fe3430966b..046b8c155bd 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.sql @@ -29,7 +29,7 @@ create table llx_actioncomm datep2 datetime, -- date end fk_action integer, -- type of action (optional link with id in llx_c_actioncomm or null) - code varchar(32) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...) + code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...) datec datetime, -- date creation tms timestamp, -- date modification