Fix customer and supplier code name

Fix bill time flag must be visible only if option on
This commit is contained in:
Laurent Destailleur 2018-10-26 23:27:29 +02:00
parent 622f31fd1e
commit 461bd76f70
5 changed files with 54 additions and 26 deletions

View File

@ -240,6 +240,14 @@ if ($id > 0 || ! empty($ref))
print nl2br($object->description);
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->bill_time);
print '</td></tr>';
}
// Categories
if ($conf->categorie->enabled) {
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td>';

View File

@ -217,6 +217,14 @@ print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
print nl2br($object->description);
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->bill_time);
print '</td></tr>';
}
// Categories
if($conf->categorie->enabled) {
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td>';
@ -686,8 +694,8 @@ foreach ($listofreferent as $key => $value)
// and the final balance
print '<tr class="liste_total">';
print '<td align="right" colspan=2 >'.$langs->trans("Profit").'</td>';
print '<td align="right" >'.price($balance_ht).'</td>';
print '<td align="right" >'.price($balance_ttc).'</td>';
print '<td align="right" >'.price(price2num($balance_ht, 'MT')).'</td>';
print '<td align="right" >'.price(price2num($balance_ttc, 'MT')).'</td>';
print '</tr>';
print "</table>";

View File

@ -91,13 +91,14 @@ $planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60;
$userAccess=0;
$parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/*
* Actions
*/
$parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
@ -404,6 +405,14 @@ if ($id > 0 || ! empty($ref))
print nl2br($object->description);
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->bill_time);
print '</td></tr>';
}
// Categories
if($conf->categorie->enabled) {
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td>';

View File

@ -399,13 +399,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print nl2br($projectstatic->description);
print '</td></tr>';
// Bill time ?
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($projectstatic->bill_time);
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($projectstatic->bill_time);
print '</td></tr>';
}
// Categories
if($conf->categorie->enabled) {
if ($conf->categorie->enabled) {
print '<tr><td valign="middle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($projectstatic->id,'project',1);
print "</td></tr>";

View File

@ -304,13 +304,13 @@ if (empty($reshook))
if (GETPOST('getcustomercode'))
{
// We defined value code_client
$_POST["code_client"]="Acompleter";
$_POST["customer_code"]="Acompleter";
}
if (GETPOST('getsuppliercode'))
{
// We defined value code_fournisseur
$_POST["code_fournisseur"]="Acompleter";
$_POST["supplier_code"]="Acompleter";
}
if($action=='set_localtax1')
@ -417,8 +417,8 @@ if (empty($reshook))
$object->idprof5 = trim(GETPOST('idprof5', 'alpha'));
$object->idprof6 = trim(GETPOST('idprof6', 'alpha'));
$object->prefix_comm = GETPOST('prefix_comm', 'alpha');
$object->code_client = GETPOST('code_client', 'alpha');
$object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
$object->code_client = GETPOST('customer_code', 'alpha');
$object->code_fournisseur = GETPOST('supplier_code', 'alpha');
$object->capital = GETPOST('capital', 'alpha');
$object->barcode = GETPOST('barcode', 'alpha');
@ -947,14 +947,14 @@ else
$object->client = GETPOST('client')?GETPOST('client'):$object->client;
if(empty($duplicate_code_error)) {
$object->code_client = GETPOST('code_client', 'alpha');
$object->code_client = GETPOST('customer_code', 'alpha');
$object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur;
}
else {
setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'),'', 'warnings');
}
$object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
$object->code_fournisseur = GETPOST('supplier_code', 'alpha');
$object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'alpha');
@ -1190,7 +1190,7 @@ else
print '<table class="nobordernopadding"><tr><td>';
$tmpcode=$object->code_client;
if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0);
print '<input type="text" name="code_client" id="customer_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
print '<input type="text" name="customer_code" id="customer_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
print '</td><td>';
$s=$modCodeClient->getToolTip($langs,$object,0);
print $form->textwithpicto('',$s,1);
@ -1218,7 +1218,7 @@ else
print '<table class="nobordernopadding"><tr><td>';
$tmpcode=$object->code_fournisseur;
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
print '<input type="text" name="code_fournisseur" id="supplier_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
print '<input type="text" name="supplier_code" id="supplier_code" class="maxwidthonsmartphone" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
print '</td><td>';
$s=$modCodeFournisseur->getToolTip($langs,$object,1);
print $form->textwithpicto('',$s,1);
@ -1570,9 +1570,9 @@ else
$object->name = GETPOST('name', 'alpha');
$object->prefix_comm = GETPOST('prefix_comm', 'alpha');
$object->client = GETPOST('client', 'int');
$object->code_client = GETPOST('code_client', 'alpha');
$object->code_client = GETPOST('customer_code', 'alpha');
$object->fournisseur = GETPOST('fournisseur', 'int');
$object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
$object->code_fournisseur = GETPOST('supplier_code', 'alpha');
$object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'alpha');
@ -1776,16 +1776,16 @@ else
$tmpcode=$object->code_client;
if (empty($tmpcode) && ! empty($object->oldcopy->code_client)) $tmpcode=$object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0);
print '<input type="text" name="code_client" id="customer_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
}
else if ($object->codeclient_modifiable())
{
print '<input type="text" name="code_client" id="customer_code" size="16" value="'.dol_escape_htmltag($object->code_client).'" maxlength="15">';
print '<input type="text" name="customer_code" id="customer_code" size="16" value="'.dol_escape_htmltag($object->code_client).'" maxlength="15">';
}
else
{
print $object->code_client;
print '<input type="hidden" name="code_client" value="'.dol_escape_htmltag($object->code_client).'">';
print '<input type="hidden" name="customer_code" value="'.dol_escape_htmltag($object->code_client).'">';
}
print '</td><td>';
$s=$modCodeClient->getToolTip($langs,$object,0);
@ -1816,16 +1816,16 @@ else
$tmpcode=$object->code_fournisseur;
if (empty($tmpcode) && ! empty($object->oldcopy->code_fournisseur)) $tmpcode=$object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
print '<input type="text" name="code_fournisseur" id="supplier_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
}
else if ($object->codefournisseur_modifiable())
{
print '<input type="text" name="code_fournisseur" id="supplier_code" size="16" value="'.$object->code_fournisseur.'" maxlength="15">';
print '<input type="text" name="supplier_code" id="supplier_code" size="16" value="'.$object->code_fournisseur.'" maxlength="15">';
}
else
{
print $object->code_fournisseur;
print '<input type="hidden" name="code_fournisseur" value="'.$object->code_fournisseur.'">';
print '<input type="hidden" name="supplier_code" value="'.$object->code_fournisseur.'">';
}
print '</td><td>';
$s=$modCodeFournisseur->getToolTip($langs,$object,1);