diff --git a/htdocs/don/card.php b/htdocs/don/card.php index a8ad2008a93..6f90eb7bcc3 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; -if (! empty($conf->projet->enabled)) +if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -327,85 +327,89 @@ if ($action == 'create') print '
| ' . $langs->trans('Ref') . ' | ' . $langs->trans('Draft') . ' | ' . $langs->trans('Customer') . ' | '; - if ($soc->id > 0 && ! GETPOST('fac_rec','alpha')) + + // Company + if (! empty($conf->societe->enabled)) { - print ''; - print $soc->getNomUrl(1); - print ''; - // Outstanding Bill - $outstandingBills = $soc->get_OutstandingBill(); - print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; - print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); - if ($soc->outstanding_limit != '') + // Thirdparty + print ' | ' . $langs->trans('Customer') . ' | '; + if ($soc->id > 0 && ! GETPOST('fac_rec','alpha')) { - if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); - print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + print ''; + print $soc->getNomUrl(1); + print ''; + // Outstanding Bill + $outstandingBills = $soc->get_OutstandingBill(); + print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; + print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); + if ($soc->outstanding_limit != '') + { + if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); + print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + } + print ')'; + print ' | '; } - print ')'; - print ''; + else + { + print ''; + print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + // Option to reload page to retrieve customer informations. Note, this clear other input + if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) + { + print ''; + } + print ' '.$langs->trans("AddThirdParty").''; + print ' | '; + } + print '' . "\n"; + } else { - print ''; - print $form->select_company($soc->id, 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); - // Option to reload page to retrieve customer informations. Note, this clear other input - if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) - { - print ''; - } - print ' '.$langs->trans("AddThirdParty").''; - print ' | '; + print "
| '.$langs->trans("Company").' | ||
| '.$langs->trans("Lastname").' | ||
| '.$langs->trans("Firstname").' | ||
| '.$langs->trans("Address").' | '; + print ' | |
| '.$langs->trans("Zip").' / '.$langs->trans("Town").' | '; + print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); + print ' '; + print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); + print ' | |
| '; + print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + print ' | ||
| '.$langs->trans("EMail").' | ||
| '.$langs->trans("Company").' | ||
| '.$langs->trans("Lastname").' | ||
| '.$langs->trans("Firstname").' | ||
| '.$langs->trans("Address").' | '; - print ' | |
| '.$langs->trans("Zip").' / '.$langs->trans("Town").' | '; - print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6); - print ' '; - print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); - print ' | |
| '; - print $form->select_country(GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - print ' | ||
| '.$langs->trans("EMail").' | ||
| '.$langs->trans("Date").' | '; $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1); print ' | '; - // Amount - print "|
| '.$langs->trans("Amount").' | '.$langs->trans("Currency".$conf->currency).' | |
| '.$langs->trans("Amount").' | '.$langs->trans("Currency".$conf->currency).' | |
| '.$langs->trans("PublicDonation")." | "; print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1); print " | |