From d4c325838596406ecf70b13a057accaadb298887 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Feb 2016 07:36:45 +0100 Subject: [PATCH] Fix missing field Fix bad value for default value of next date --- htdocs/compta/facture/fiche-rec.php | 10 +++++----- htdocs/contrat/list.php | 8 +++++++- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 6 ++++++ htdocs/install/mysql/tables/llx_contratdet.sql | 8 +++++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 0d462d25066..dbaec026b68 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -218,7 +218,7 @@ if ($action == 'create') dol_fiche_head(); $rowspan=4; - if (! empty($conf->projet->enabled) && $object->fk_project > 0) $rowspan++; + if (! empty($conf->projet->enabled)) $rowspan++; if ($object->fk_account > 0) $rowspan++; print ''; @@ -255,7 +255,7 @@ if ($action == 'create') print ""; // Project - if (! empty($conf->projet->enabled) && $object->fk_project > 0) + if (! empty($conf->projet->enabled)) { print ""; } - // Project + // Bank account if ($object->fk_account > 0) { print ""; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index b374e7d59b9..df6e0007023 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -291,8 +291,14 @@ if ($resql) print '
".$langs->trans("Project").""; if ($object->fk_project > 0) @@ -267,7 +267,7 @@ if ($action == 'create') print "
".$langs->trans('BankAccount').""; @@ -280,7 +280,7 @@ if ($action == 'create') print '
'; - // Recurrence + // Autogeneration $title = $langs->trans("Recurrence"); print load_fiche_titre($title); @@ -293,7 +293,7 @@ if ($action == 'create') // First date of execution for cron print "
".$langs->trans('NextDateToExecution').""; - $date_next_execution = isset($date_next_execution) ? $date_next_execution : dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); print $form->select_date($date_next_execution, '', 0, 0, '', "add", 1, 1, 1); print "
'; if($obj->socid) { - $socstatic->fetch($obj->socid); + $result=$socstatic->fetch($obj->socid); + if ($result < 0) + { + dol_print_error($db); + exit; + } $listsalesrepresentatives=$socstatic->getSalesRepresentatives($user); + if ($listsalesrepresentatives < 0) dol_print_error($db); $nbofsalesrepresentative=count($listsalesrepresentatives); if ($nbofsalesrepresentative > 3) // We print only number { diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 482a21470a6..86bb4fdb238 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -232,3 +232,9 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN multicurrency_total_ht double(24,8) DE ALTER TABLE llx_facturedet_rec ADD COLUMN multicurrency_total_tva double(24,8) DEFAULT 0; ALTER TABLE llx_facturedet_rec ADD COLUMN multicurrency_total_ttc double(24,8) DEFAULT 0; +ALTER TABLE llx_contratdet ADD COLUMN fk_multicurrency integer; +ALTER TABLE llx_contratdet ADD COLUMN multicurrency_code varchar(255); +ALTER TABLE llx_contratdet ADD COLUMN multicurrency_subprice double(24,8) DEFAULT 0; +ALTER TABLE llx_contratdet ADD COLUMN multicurrency_total_ht double(24,8) DEFAULT 0; +ALTER TABLE llx_contratdet ADD COLUMN multicurrency_total_tva double(24,8) DEFAULT 0; +ALTER TABLE llx_contratdet ADD COLUMN multicurrency_total_ttc double(24,8) DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_contratdet.sql b/htdocs/install/mysql/tables/llx_contratdet.sql index b4e13fb99c2..a8d4fdff6ba 100644 --- a/htdocs/install/mysql/tables/llx_contratdet.sql +++ b/htdocs/install/mysql/tables/llx_contratdet.sql @@ -62,6 +62,12 @@ create table llx_contratdet fk_user_ouverture integer, fk_user_cloture integer, commentaire text, - fk_unit integer DEFAULT NULL + fk_unit integer DEFAULT NULL, + fk_multicurrency integer, + multicurrency_code varchar(255), + multicurrency_subprice double(24,8) DEFAULT 0, + multicurrency_total_ht double(24,8) DEFAULT 0, + multicurrency_total_tva double(24,8) DEFAULT 0, + multicurrency_total_ttc double(24,8) DEFAULT 0 )ENGINE=innodb;