diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 225bffdfcb8..0d00a0a9127 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -112,8 +112,9 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number"; +$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation = 0"; - +$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL)"; if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; } @@ -219,7 +220,7 @@ if ($result) { // Colonne choix ligne a ventiler print '
| '.$langs->trans("Ref").' | '; + print ''.$langs->trans("Ref").' | '; print ''.$langs->trans("Date").' | '; print ''.$langs->trans("ThirdParty").' | '; if (empty($value['disableamount'])) print ''.$langs->trans("AmountHT").' | '; @@ -276,7 +285,9 @@ foreach ($listofreferent as $key => $value) $var=!$var; print "||
| '; + print 'id . '">' . img_picto($langs->trans('Unlink'), 'editdelete') . ''; + print " | \n"; // Ref print ''; print $element->getNomUrl(1); @@ -326,7 +337,7 @@ foreach ($listofreferent as $key => $value) } } - print ' | |||||
| '.$langs->trans("Number").': '.$i.' | '; + print '||||||
| '.$langs->trans("Number").': '.$i.' | '; if (empty($value['disableamount'])) print ''.$langs->trans("TotalHT").' : '.price($total_ht).' | '; if (empty($value['disableamount'])) print ''.$langs->trans("TotalTTC").' : '.price($total_ttc).' | '; print ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 8461321e071..6b5cc453cbf 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -300,7 +300,8 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ' | |||
| '.$langs->trans("AffectedTo").' | '; - print $form->select_dolusers($user->id,'userid',1); + $contactsofproject=$object->getListContactId('internal'); + $form->select_users($user->id,'userid',0,'',0,'',$contactsofproject); print ' | |||||
| '.$langs->trans("Label").' | '.$projectstatic->title.' | |||||
| '.$langs->trans("ThirdParty").' | '; - if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1); + if (! empty($projectstatic->thridparty->id)) print $projectstatic->thridparty->getNomUrl(1); else print ' '; print ' | '; print '|||||
| '.$langs->trans('Ref').' | '; if (! GETPOST('withproject') || empty($projectstatic->id)) { - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1); + $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; @@ -259,7 +259,7 @@ if ($id > 0 || ! empty($ref)) // Customer print " | |||||
| ".$langs->trans("ThirdParty")." | "; print ''; - if ($projectstatic->societe->id > 0) print $projectstatic->societe->getNomUrl(1); + if ($projectstatic->thridparty->id > 0) print $projectstatic->thridparty->getNomUrl(1); else print ' '; print ' | |||||
| '.$langs->trans("Label").' | '.$projectstatic->title.' | |||||
| '.$langs->trans("ThirdParty").' | '; - if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1); + if (! empty($projectstatic->thirdparty->id)) print $projectstatic->thirdparty->getNomUrl(1); else print ' '; print ' | '; print '|||||
| '.$langs->trans("ThirdParty").' | '; - if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1); + if (! empty($projectstatic->thirdparty->id)) print $projectstatic->thirdparty->getNomUrl(1); else print ' '; print ' | '; print ''.$langs->trans("ThirdParty").' | '; - if ($projectstatic->societe->id) print $projectstatic->societe->getNomUrl(1); + if ($projectstatic->thirdparty->id) print $projectstatic->thirdparty->getNomUrl(1); else print ' '; print ' | '; } @@ -345,13 +345,14 @@ if ($id > 0 || ! empty($ref)) // Contributor print ''; - $restrictaddtimetocontactoftask=0; - if (empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJECTS)) - { - $restrictaddtimetocontactoftask=$object->getListContactId('internal'); - } print img_object('','user'); - print $form->select_dolusers($_POST["userid"]?$_POST["userid"]:$user->id,'userid',0,'',0,'',$restrictaddtimetocontactoftask); // Note: If user is not allowed it will be disabled into combo list and userid not posted + $contactsoftask=$object->getListContactId('internal'); + if (count($contactsoftask)>0) { + $userid=$contactsoftask[0]; + $form->select_users($userid,'userid',0,'',0,'',$contactsoftask); + }else { + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); + } print ' | '; // Note @@ -440,7 +441,15 @@ if ($id > 0 || ! empty($ref)) print ''; if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print $form->select_dolusers($task_time->fk_user,'userid_line'); + $contactsoftask=$object->getListContactId('internal'); + if (!in_array($task_time->fk_user,$contactsoftask)) { + $contactsoftask[]=$task_time->fk_user; + } + if (count($contactsoftask)>0) { + $form->select_users($task_time->fk_user,'userid_line',0,'',0,'',$contactsoftask); + }else { + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); + } } else { diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php index a8a554ca25d..eb3c1a56abb 100644 --- a/test/phpunit/AllTests.php +++ b/test/phpunit/AllTests.php @@ -126,7 +126,7 @@ class AllTests require_once dirname(__FILE__).'/ContratTest.php'; $suite->addTestSuite('ContratTest'); - require_once dirname(__FILE__).'/FichinterTest.php'; + require_once dirname(__FILE__).'/FichInterTest.php'; $suite->addTestSuite('FichinterTest'); require_once dirname(__FILE__).'/PropalTest.php'; | |