Uniformize look and feel

This commit is contained in:
Laurent Destailleur 2016-09-19 13:57:50 +02:00
parent 5602bcd440
commit 4f842fd2cb
15 changed files with 506 additions and 227 deletions

View File

@ -245,9 +245,13 @@ if (empty($reshook))
}
// Positionne ref client
else if ($action == 'set_ref_client' && $user->rights->propal->creer)
else if ($action == 'setref_client' && $user->rights->propal->creer)
{
$object->set_ref_client($user, $_POST['ref_client']);
$result = $object->set_ref_client($user, GETPOST('ref_client'));
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
}
}
// Set incoterm
@ -1667,28 +1671,11 @@ if ($action == 'create')
$morehtmlref='<div class="refidno">';
// Ref customer
$morehtmlref.=$langs->trans('RefCustomer').' ';
if ($action != 'refclient' && ! empty($object->brouillon))
{
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=refclient&amp;id=' . $object->id . '">' . img_edit($langs->trans('Modify')) . '</a> ';
}
$morehtmlref.=' : ';
if ($user->rights->propal->creer && $action == 'refclient') {
$morehtmlref.='<form action="'.$_SERVER["PHP_SELF"].'?id=' . $object->id . '" method="post">';
$morehtmlref.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
$morehtmlref.='<input type="hidden" name="action" value="set_ref_client">';
$morehtmlref.='<input type="text" class="flat" size="20" name="ref_client" value="' . $object->ref_client . '">';
$morehtmlref.=' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$object->ref_client;
}
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('Company') . ' : ' . $soc->getNomUrl(1);
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
@ -1721,7 +1708,6 @@ if ($action == 'create')
}
}
}
$morehtmlref.='</div>';
@ -1770,7 +1756,7 @@ if ($action == 'create')
print '</tr>';*/
// Lin for thirdparty discounts
print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="5">';
print '<tr><td class="titlefield">' . $langs->trans('Discounts') . '</td><td>';
if ($soc->remise_percent)
print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
else
@ -1806,7 +1792,7 @@ if ($action == 'create')
if ($action != 'editdate' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdate&amp;id=' . $object->id . '">' . img_edit($langs->trans('SetDate'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if (! empty($object->brouillon) && $action == 'editdate') {
print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
@ -1832,7 +1818,7 @@ if ($action == 'create')
if ($action != 'editecheance' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&amp;id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if (! empty($object->brouillon) && $action == 'editecheance') {
print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
@ -1860,7 +1846,7 @@ if ($action == 'create')
if ($action != 'editconditions' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id');
} else {
@ -1873,7 +1859,7 @@ if ($action == 'create')
$langs->load('deliveries');
print '<tr><td>';
print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $user->rights->propal->creer, 'datepicker');
print '</td><td colspan="5">';
print '</td><td>';
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $user->rights->propal->creer, 'datepicker');
print '</td>';
print '</tr>';
@ -1888,7 +1874,7 @@ if ($action == 'create')
if ($action != 'editavailability' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editavailability') {
$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->availability_id, 'availability_id', 1);
} else {
@ -1907,7 +1893,7 @@ if ($action == 'create')
if ($action != 'editshippingmethod' && $user->rights->propal->creer)
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&amp;id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editshippingmethod') {
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1);
} else {
@ -1925,7 +1911,7 @@ if ($action == 'create')
if ($action != 'editdemandreason' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editdemandreason') {
$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->demand_reason_id, 'demand_reason_id', 1);
} else {
@ -1943,7 +1929,7 @@ if ($action == 'create')
if ($action != 'editmode' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmode&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
} else {
@ -1963,7 +1949,7 @@ if ($action == 'create')
if ($action != 'editmulticurrencycode' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editmulticurrencycode') {
$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'multicurrency_code');
} else {
@ -1980,7 +1966,7 @@ if ($action == 'create')
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editmulticurrencyrate') {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
@ -2031,7 +2017,7 @@ if ($action == 'create')
// Outstanding Bill
print '<tr><td>';
print $langs->trans('OutstandingBill');
print '</td><td align="right" colspan="5">';
print '</td><td align="right">';
print price($soc->get_OutstandingBill()) . ' / ';
print price($soc->outstanding_limit, 0, $langs, 1, - 1, - 1, $conf->currency);
print '</td>';
@ -2048,7 +2034,7 @@ if ($action == 'create')
if ($action != 'editbankaccount' && $user->rights->propal->creer)
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editbankaccount') {
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
} else {
@ -2069,7 +2055,7 @@ if ($action == 'create')
else print '&nbsp;';
print '</td></tr></table>';
print '</td>';
print '<td colspan="5">';
print '<td>';
if ($action != 'editincoterm')
{
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
@ -2095,48 +2081,48 @@ if ($action == 'create')
print '<table class="border centpercent">';
// Amount HT
print '<tr><td height="10">' . $langs->trans('AmountHT') . '</td>';
print '<tr><td class="titlefield">' . $langs->trans('AmountHT') . '</td>';
print '<td class="nowrap">' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
// Amount VAT
print '<tr><td height="10">' . $langs->trans('AmountVAT') . '</td>';
print '<tr><td>' . $langs->trans('AmountVAT') . '</td>';
print '<td class="nowrap">' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
// Amount Local Taxes
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
{
print '<tr><td height="10">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td class="nowrap">' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
}
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2
{
print '<tr><td height="10">' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td class="nowrap">' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
}
// Amount TTC
print '<tr><td height="10">' . $langs->trans('AmountTTC') . '</td>';
print '<tr><td>' . $langs->trans('AmountTTC') . '</td>';
print '<td class="nowrap">' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
if (!empty($conf->multicurrency->enabled))
{
// Multicurrency Amount HT
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
// Multicurrency Amount VAT
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
// Multicurrency Amount TTC
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
}

View File

@ -474,19 +474,26 @@ if (empty($reshook))
else if ($action == 'classifyunbilled' && $user->rights->commande->creer)
{
$ret=$object->classifyUnBilled();
if ($ret < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// Positionne ref commande client
else if ($action == 'set_ref_client' && $user->rights->commande->creer) {
$object->set_ref_client($user, GETPOST('ref_client'));
else if ($action == 'setref_client' && $user->rights->commande->creer) {
$result = $object->set_ref_client($user, GETPOST('ref_client'));
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
}
}
else if ($action == 'setremise' && $user->rights->commande->creer) {
$object->set_remise($user, GETPOST('remise'));
$result = $object->set_remise($user, GETPOST('remise'));
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
}
}
else if ($action == 'setabsolutediscount' && $user->rights->commande->creer) {
@ -1917,28 +1924,11 @@ if ($action == 'create' && $user->rights->commande->creer)
$morehtmlref='<div class="refidno">';
// Ref customer
$morehtmlref.=$langs->trans('RefCustomer').' ';
if ($action != 'refclient' && ! empty($object->brouillon))
{
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=refclient&amp;id=' . $object->id . '">' . img_edit($langs->trans('Modify')) . '</a> ';
}
$morehtmlref.=' : ';
if ($user->rights->commande->creer && $action == 'refclient') {
$morehtmlref.='<form action="'.$_SERVER["PHP_SELF"].'?id=' . $object->id . '" method="post">';
$morehtmlref.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
$morehtmlref.='<input type="hidden" name="action" value="set_ref_client">';
$morehtmlref.='<input type="text" class="flat" size="20" name="ref_client" value="' . $object->ref_client . '">';
$morehtmlref.=' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$object->ref_client;
}
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('Company') . ' : ' . $soc->getNomUrl(1);
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
@ -1971,7 +1961,6 @@ if ($action == 'create' && $user->rights->commande->creer)
}
}
}
$morehtmlref.='</div>';
@ -2286,10 +2275,12 @@ if ($action == 'create' && $user->rights->commande->creer)
$totalVolume=$tmparray['volume'];
if ($totalWeight || $totalVolume)
{
print '<tr><td>'.$langs->trans("CalculatedWeight").' / '.$langs->trans("CalculatedVolume").'</td>';
print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
print '<td>';
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no');
print ' / ';
print '</td></tr>';
print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
print '<td>';
print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
print '</td></tr>';
}
@ -2376,7 +2367,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<table class="border centpercent">';
// Total HT
print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
print '<tr><td class="titlefield">' . $langs->trans('AmountHT') . '</td>';
print '<td>' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>';
// Total VAT
@ -2400,17 +2391,17 @@ if ($action == 'create' && $user->rights->commande->creer)
if (!empty($conf->multicurrency->enabled))
{
// Multicurrency Amount HT
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
// Multicurrency Amount VAT
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
// Multicurrency Amount TTC
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
}

View File

@ -2558,7 +2558,6 @@ class Commande extends CommonOrder
if ($result < 0) $error++;
// End call triggers
}
if (! $error)
{
$this->db->commit();

View File

@ -53,7 +53,8 @@ class Facture extends CommonInvoice
public $table_element_line = 'facturedet';
public $fk_element = 'fk_facture';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='bill';
/**
* {@inheritdoc}
*/

View File

@ -2780,6 +2780,7 @@ abstract class CommonObject
$trigkey='';
if ($this->element == 'supplier_proposal' && $status == 2) $trigkey='SUPPLIER_PROPOSAL_CLOSE';
if ($this->element == 'fichinter' && $status == 3) $trigkey='FICHINTER_CLASSIFY_DONE';
if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED';
if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED';

View File

@ -79,10 +79,11 @@ class Form
* @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field.
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
* @param string $moreparam More param to add on a href URL*
* @param int $fieldrequired 1 if we want to show field as mandatory using the fieldrequired CSS.
* @param int $fieldrequired 1 if we want to show field as mandatory using the "fieldrequired" CSS.
* @param int $notabletag Do no output table tags
* @return string HTML edit field
*/
function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0)
function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0, $notabletag=0)
{
global $conf,$langs;
@ -109,13 +110,17 @@ class Form
}
else
{
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
if ($fieldrequired) $ret.='<span class="fieldrequired">';
$ret.=$langs->trans($text);
if ($fieldrequired) $ret.='</span>';
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</td>';
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&amp;id='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</tr></table>';
if (! empty($notabletag)) $ret.=' ';
if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</td>';
if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right">';
if ($htmlname && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&amp;id='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>';
if (! empty($notabletag)) $ret.=' : ';
if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</td>';
if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</tr></table>';
}
return $ret;
@ -134,9 +139,10 @@ class Form
* @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
* @param string $moreparam More param to add on a href URL
* @param int $notabletag Do no output table tags
* @return string HTML edit field
*/
function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='')
function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='', $notabletag=0)
{
global $conf,$langs,$db;
@ -159,8 +165,8 @@ class Form
$ret.='<input type="hidden" name="action" value="set'.$htmlname.'">';
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$ret.='<input type="hidden" name="id" value="'.$object->id.'">';
$ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
$ret.='<tr><td>';
if (empty($notabletag)) $ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
if (empty($notabletag)) $ret.='<tr><td>';
if (preg_match('/^(string|email)/',$typeofdata))
{
$tmp=explode(':',$typeofdata);
@ -202,15 +208,15 @@ class Form
$doleditor=new DolEditor($htmlname, ($editvalue?$editvalue:$value), ($tmp[2]?$tmp[2]:''), ($tmp[3]?$tmp[3]:'100'), ($tmp[1]?$tmp[1]:'dolibarr_notes'), 'In', ($tmp[5]?$tmp[5]:0), true, true, ($tmp[6]?$tmp[6]:'20'), ($tmp[7]?$tmp[7]:'100'));
$ret.=$doleditor->Create(1);
}
$ret.='</td>';
if (empty($notabletag)) $ret.='</td>';
$ret.='<td align="left">';
if (empty($notabletag)) $ret.='<td align="left">';
$ret.='<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">';
if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='<br>'."\n";
$ret.='<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
$ret.='</td>';
if (empty($notabletag)) $ret.='</td>';
$ret.='</tr></table>'."\n";
if (empty($notabletag)) $ret.='</tr></table>'."\n";
$ret.='</form>'."\n";
}
else

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
@ -39,12 +39,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
if (! empty($conf->productbatch->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
$langs->load("sendings");
$langs->load("companies");
@ -562,6 +566,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
$product_static = new Product($db);
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
if ($action == 'create2')
{
@ -1224,18 +1229,19 @@ else if ($id || $ref)
$head=shipping_prepare_head($object);
dol_fiche_head($head, 'shipping', $langs->trans("Shipment"), 0, 'sending');
$formconfirm='';
/*
* Confirmation de la suppression
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1);
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1);
}
/*
* Confirmation de la validation
*/
*/
if ($action == 'valid')
{
$objectref = substr($object->ref, 1, 4);
@ -1258,7 +1264,7 @@ else if ($id || $ref)
$text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid, $object);
}
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
}
/*
@ -1266,10 +1272,20 @@ else if ($id || $ref)
*/
if ($action == 'annuler')
{
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
}
if (! $formconfirm) {
$parameters = array();
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
}
// Print form confirm
print $formconfirm;
// Calculate totalWeight and totalVolume for all products
// by adding weight and volume of each product line.
@ -1277,11 +1293,62 @@ else if ($id || $ref)
$totalWeight=$tmparray['weight'];
$totalVolume=$tmparray['volume'];
// Warehouse card
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">';
// Ref customer shipment
$morehtmlref.=$form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
/*
if (! empty($conf->projet->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>' . $langs->trans('Project') . ' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
$morehtmlref .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
$morehtmlref .= '</form>';
} else {
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref .= '<a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref .= $proj->ref;
$morehtmlref .= '</a>';
} else {
$morehtmlref .= '';
}
}
}*/
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/expedition/list.php">'.$langs->trans("BackToList").'</a>';
// Ref
/*
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
@ -1290,7 +1357,7 @@ else if ($id || $ref)
// Customer
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
print '<td colspan="3">'.$soc->getNomUrl(1).'</td>';
print "</tr>";
print "</tr>";*/
// Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
@ -1316,13 +1383,8 @@ else if ($id || $ref)
print '</tr>';
}
// Ref customer
print '<tr><td>'.$langs->trans("RefCustomer").'</td>';
print '<td colspan="3">'.$object->ref_customer."</a></td>\n";
print '</tr>';
// Date creation
print '<tr><td>'.$langs->trans("DateCreation").'</td>';
print '<tr><td class="titlefield">'.$langs->trans("DateCreation").'</td>';
print '<td colspan="3">'.dol_print_date($object->date_creation,"day")."</td>\n";
print '</tr>';
@ -1455,9 +1517,22 @@ else if ($id || $ref)
print '</tr>';
// Status
print '<tr><td>'.$langs->trans("Status").'</td>';
/*print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td colspan="3">'.$object->getLibStatut(4)."</td>\n";
print '</tr>';
print '</tr>';*/
// Other attributes
$cols = 2;
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
print '</table>';
print '</div>';
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
// Sending method
print '<tr><td height="10">';
@ -1490,9 +1565,9 @@ else if ($id || $ref)
}
print '</td>';
print '</tr>';
// Tracking Number
print '<tr><td>'.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
print '<tr><td class="titlefield">'.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
print $form->editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number);
print '</td></tr>';
@ -1519,11 +1594,14 @@ else if ($id || $ref)
print '</td></tr>';
}
// Other attributes
$cols = 3;
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
print "</table>";
print "</table>\n";
print '</div>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div>';
/*
* Lines of products
@ -1719,11 +1797,12 @@ else if ($id || $ref)
$var=!$var;
}
print "</table>\n";
}
print "</table>\n";
print "\n</div>\n";
dol_fiche_end();
$object->fetchObjectLinked($object->id,$object->element);

View File

@ -48,7 +48,8 @@ class Expedition extends CommonObject
public $table_element="expedition";
public $table_element_line="expeditiondet";
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'sending';
var $socid;
var $ref_customer;
var $ref_int;

View File

@ -44,7 +44,8 @@ class CommandeFournisseur extends CommonOrder
public $table_element_line = 'commande_fournisseurdet';
public $fk_element = 'fk_commande';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='order';
/**
* {@inheritdoc}
*/

View File

@ -44,7 +44,8 @@ class FactureFournisseur extends CommonInvoice
public $table_element_line='facture_fourn_det';
public $fk_element='fk_facture_fourn';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='bill';
/**
* {@inheritdoc}
*/

View File

@ -1311,6 +1311,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$formorder = new FormOrder($db);
$productstatic = new Product($db);
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
/* *************************************************************************** */
@ -1739,50 +1740,96 @@ elseif (! empty($object->id))
// Print form confirm
print $formconfirm;
/*
* Commande
*/
$nbrow=8;
if (! empty($conf->projet->enabled)) $nbrow++;
//Local taxes
if($mysoc->localtax1_assuj=="1") $nbrow++;
if($mysoc->localtax2_assuj=="1") $nbrow++;
print '<table class="border" width="100%">';
// Supplier order card
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/commande/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">';
// Ref supplier
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->fournisseur->commande->creer)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Ref
/*
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
print '<td colspan="2">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
print '</td>';
print '</tr>';
print '</tr>';*/
// Ref supplier
/*
print '<tr><td>';
print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
print '</td><td colspan="2">';
print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
print '</td></tr>';
// Fournisseur
print '<tr><td>'.$langs->trans("Supplier")."</td>";
print '<td colspan="2">'.$object->thirdparty->getNomUrl(1,'supplier').'</td>';
print '</tr>';
*/
// Statut
/*
print '<tr>';
print '<td>'.$langs->trans("Status").'</td>';
print '<td colspan="2">';
print $object->getLibStatut(4);
print "</td></tr>";
*/
// Date
if ($object->methode_commande_id > 0)
{
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>';
if ($object->date_commande)
{
print dol_print_date($object->date_commande,"dayhourtext")."\n";
@ -1791,13 +1838,13 @@ elseif (! empty($object->id))
if ($object->methode_commande)
{
print '<tr><td>'.$langs->trans("Method").'</td><td colspan="2">'.$object->getInputMethod().'</td></tr>';
print '<tr><td>'.$langs->trans("Method").'</td><td>'.$object->getInputMethod().'</td></tr>';
}
}
// Author
print '<tr><td>'.$langs->trans("AuthorRequest").'</td>';
print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
print '<tr><td class="titlefield">'.$langs->trans("AuthorRequest").'</td>';
print '<td>'.$author->getNomUrl(1).'</td>';
print '</tr>';
// Conditions de reglement par defaut
@ -1808,7 +1855,7 @@ elseif (! empty($object->id))
print '<td>';
if ($action != 'editconditions') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editconditions&amp;id='.$object->id.'">'.img_edit($langs->trans('SetConditions'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td>';
if ($action == 'editconditions')
{
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id,'cond_reglement_id');
@ -1828,7 +1875,7 @@ elseif (! empty($object->id))
print '</td>';
if ($action != 'editmode') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$object->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td>';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
@ -1844,14 +1891,14 @@ elseif (! empty($object->id))
{
// Multicurrency code
print '<tr>';
print '<td width="25%">';
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print fieldLabel('Currency','multicurrency_code');
print '</td>';
if ($action != 'editmulticurrencycode' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editmulticurrencycode') {
$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'multicurrency_code');
} else {
@ -1861,14 +1908,14 @@ elseif (! empty($object->id))
// Multicurrency rate
print '<tr>';
print '<td width="25%">';
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print fieldLabel('CurrencyRate','multicurrency_tx');
print '</td>';
if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon))
print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>';
print '</tr></table>';
print '</td><td colspan="5">';
print '</td><td>';
if ($action == 'editmulticurrencyrate') {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
@ -1887,7 +1934,7 @@ elseif (! empty($object->id))
if ($action != 'editbankaccount' && $user->rights->fournisseur->commande->creer)
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&amp;id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
print '</td><td>';
if ($action == 'editbankaccount') {
$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1);
} else {
@ -1904,7 +1951,7 @@ elseif (! empty($object->id))
print '</td>';
if ($action != 'editdate_livraison') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td>';
if ($action == 'editdate_livraison')
{
print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
@ -1927,7 +1974,6 @@ elseif (! empty($object->id))
}
print '</td></tr>';
// Delivery delay (in days)
print '<tr>';
print '<td>'.$langs->trans('NbDaysToDelivery').'&nbsp;'.img_picto($langs->trans('DescNbDaysToDelivery'), 'info', 'style="cursor:help"').'</td>';
@ -1935,6 +1981,7 @@ elseif (! empty($object->id))
print '</tr>';
// Project
/*
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
@ -1944,7 +1991,7 @@ elseif (! empty($object->id))
print '</td>';
if ($action != 'classify') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>';
print '</tr></table>';
print '</td><td colspan="2">';
print '</td><td>';
//print "$object->id, $object->socid, $object->fk_project";
if ($action == 'classify')
{
@ -1956,7 +2003,7 @@ elseif (! empty($object->id))
}
print '</td>';
print '</tr>';
}
}*/
// Incoterms
if (!empty($conf->incoterm->enabled))
@ -1969,7 +2016,7 @@ elseif (! empty($object->id))
else print '&nbsp;';
print '</td></tr></table>';
print '</td>';
print '<td colspan="3">';
print '<td>';
if ($action != 'editincoterm')
{
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
@ -1982,56 +2029,77 @@ elseif (! empty($object->id))
}
// Other attributes
$cols = 3;
$cols = 2;
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
print '</table>';
print '</div>';
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
// Total
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
print '<td colspan="2">'.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<tr><td class="titlefield">'.$langs->trans("AmountHT").'</td>';
print '<td>'.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '</tr>';
// Total VAT
print '<tr><td>'.$langs->trans("AmountVAT").'</td><td colspan="2">'.price($object->total_tva,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '</tr>';
// Amount Local Taxes
if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->country_code).'</td>';
print '<td colspan="2">'.price($object->total_localtax1,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<td>'.price($object->total_localtax1,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '</tr>';
}
if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->country_code).'</td>';
print '<td colspan="2">'.price($object->total_localtax2,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<td>'.price($object->total_localtax2,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '</tr>';
}
// Total TTC
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="2">'.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).'</td>';
print '</tr>';
if (!empty($conf->multicurrency->enabled))
{
// Multicurrency Amount HT
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
// Multicurrency Amount VAT
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
// Multicurrency Amount TTC
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '<tr><td>' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
}
print "</table><br>";
print '</table>';
// Margin Infos
/*if (! empty($conf->margin->enabled)) {
$formmargin->displayMarginInfos($object);
}*/
print '</div>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div><br>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$blocname = 'contacts';

View File

@ -175,7 +175,7 @@ if ($action == 'create')
{
print load_fiche_titre($langs->trans("NewWarehouse"));
print "<form action=\"card.php\" method=\"post\">\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
@ -263,66 +263,141 @@ else
dol_fiche_head($head, 'card', $langs->trans("Warehouse"), 0, 'stock');
$formconfirm = '';
// Confirm delete third party
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2);
}
print '<table class="border" width="100%">';
if (! $formconfirm) {
$parameters = array();
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
}
// Print form confirm
print $formconfirm;
// Warehouse card
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">';
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
/*
// Ref supplier
//$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
//$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
//$morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->supplier_proposal->creer)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}*/
$morehtmlref.='</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Ref
/*
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle');
print '</td>';
print '</td>';*/
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$object->lieu.'</td></tr>';
//print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$object->lieu.'</td></tr>';
// Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($object->description).'</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'.nl2br($object->description).'</td></tr>';
// Address
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3">';
/*
print '<tr><td>'.$langs->trans('Address').'</td><td>';
print $object->address;
print '</td></tr>';
// Town
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$object->zip.'</td>';
print '<td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$object->town.'</td></tr>';
print '<tr><td>'.$langs->trans('Zip').'</td><td>'.$object->zip.'</td></tr>';
print '<tr><td>'.$langs->trans('Town').'</td><td>'.$object->town.'</td></tr>';
// Country
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
print '<tr><td>'.$langs->trans('Country').'</td><td>';
if (! empty($object->country_code))
{
$img=picto_from_langcode($object->country_code);
print ($img?$img.' ':'');
}
print $object->country;
print '</td></tr>';
print '</td></tr>';*/
// Status
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4).'</td></tr>';
//print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4).'</td></tr>';
$calcproductsunique=$object->nb_different_products();
$calcproductsunique=$object->nb_different_products();
$calcproducts=$object->nb_products();
// Total nb of different products
print '<tr><td>'.$langs->trans("NumberOfDifferentProducts").'</td><td colspan="3">';
print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb'];
print "</td></tr>";
// Total nb of different products
print '<tr><td>'.$langs->trans("NumberOfDifferentProducts").'</td><td>';
print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb'];
print "</td></tr>";
// Nb of products
print '<tr><td>'.$langs->trans("NumberOfProducts").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("NumberOfProducts").'</td><td>';
print empty($calcproducts['nb'])?'0':$calcproducts['nb'];
print "</td></tr>";
print '</table>';
print '</div>';
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
// Value
print '<tr><td>'.$langs->trans("EstimatedStockValueShort").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("EstimatedStockValueShort").'</td><td>';
print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency);
print "</td></tr>";
// Last movement
$sql = "SELECT max(m.datem) as datem";
$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m";
@ -330,14 +405,14 @@ else
$resqlbis = $db->query($sql);
if ($resqlbis)
{
$obj = $db->fetch_object($resqlbis);
$lastmovementdate=$db->jdate($obj->datem);
$obj = $db->fetch_object($resqlbis);
$lastmovementdate=$db->jdate($obj->datem);
}
else
{
dol_print_error($db);
dol_print_error($db);
}
print '<tr><td>'.$langs->trans("LastMovement").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("LastMovement").'</td><td>';
if ($lastmovementdate)
{
print dol_print_date($lastmovementdate,'dayhour').' ';
@ -345,13 +420,19 @@ else
}
else
{
print $langs->trans("None");
print $langs->trans("None");
}
print "</td></tr>";
print "</table>";
print '</div>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div>';
dol_fiche_end();
/* ************************************************************************** */

View File

@ -35,6 +35,7 @@ class Entrepot extends CommonObject
{
public $element='stock';
public $table_element='entrepot';
public $picto='stock';
/**
* Warehouse closed, inactive

View File

@ -999,6 +999,7 @@ $formfile = new FormFile($db);
$formsupplier_proposal = new FormSupplierProposal($db);
$formmargin = new FormMargin($db);
$companystatic = new Societe($db);
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
$now = dol_now();
@ -1353,11 +1354,63 @@ if ($action == 'create')
// Print form confirm
print $formconfirm;
// Supplier proposal card
$linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
// Ref supplier
//$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
//$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.=$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->supplier_proposal->creer)
{
if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
$linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
// Ref
/*
print '<tr><td class="titlefield">' . $langs->trans('Ref') . '</td><td colspan="5">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';
@ -1365,9 +1418,10 @@ if ($action == 'create')
// Company
print '<tr><td>' . $langs->trans('Supplier') . '</td><td colspan="5">' . $soc->getNomUrl(1) . '</td>';
print '</tr>';
*/
// Payment term
print '<tr><td>';
print '<tr><td class="titlefield">';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort');
print '</td>';
@ -1424,6 +1478,7 @@ if ($action == 'create')
print '</td></tr>';
// Project
/*
if (! empty($conf->projet->enabled)) {
$langs->load("projects");
print '<tr><td>';
@ -1455,7 +1510,7 @@ if ($action == 'create')
}
}
print '</tr>';
}
}*/
// Multicurrency
if (! empty($conf->multicurrency->enabled))
@ -1529,73 +1584,80 @@ if ($action == 'create')
// Other attributes
$cols = 2;
if (empty($conf->margin->enabled)) $cols++;
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
print '</table>';
print '</div>';
print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
// Amount HT
print '<tr><td height="10">' . $langs->trans('AmountHT') . '</td>';
print '<td class="nowrap" colspan="'.$colspan.'"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
// Margin Infos
if (! empty($conf->margin->enabled)) {
$rowspan=4;
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) $rowspan++;
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) $rowspan++;
if (!empty($conf->multicurrency->enabled)) $rowspan+=3;
print '<td valign="top" rowspan="'.$rowspan.'">';
$formmargin->displayMarginInfos($object);
print '</td>';
}
print '<tr><td class="titlefield">' . $langs->trans('AmountHT') . '</td>';
print '<td class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
print '</tr>';
// Amount VAT
print '<tr><td height="10">' . $langs->trans('AmountVAT') . '</td>';
print '<td class="nowrap" colspan="'.$colspan.'">' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<tr><td>' . $langs->trans('AmountVAT') . '</td>';
print '<td class="nowrap">' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
// Amount Local Taxes
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
{
print '<tr><td height="10">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td class="nowrap" colspan="'.$colspan.'">' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td class="nowrap">' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
}
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2
{
print '<tr><td height="10">' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td class="nowrap" colspan="'.$colspan.'">' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<td class="nowrap">' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
}
// Amount TTC
print '<tr><td height="10">' . $langs->trans('AmountTTC') . '</td>';
print '<td class="nowrap" colspan="'.$colspan.'">' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '<td class="nowrap">' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
print '</tr>';
if (!empty($conf->multicurrency->enabled))
{
// Multicurrency Amount HT
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
print '<td class="nowrap" colspan="'.$colspan.'">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
// Multicurrency Amount VAT
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '</td>';
print '<td class="nowrap" colspan="'.$colspan.'">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
// Multicurrency Amount TTC
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
print '<td class="nowrap" colspan="'.$colspan.'">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '<td class="nowrap">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
print '</tr>';
}
// Statut
print '<tr><td height="10">' . $langs->trans('Status') . '</td><td align="left">' . $object->getLibStatut(4) . '</td></tr>';
//print '<tr><td height="10">' . $langs->trans('Status') . '</td><td align="left">' . $object->getLibStatut(4) . '</td></tr>';
print '</table><br>';
print '</table>';
// Margin Infos
/*if (! empty($conf->margin->enabled)) {
$formmargin->displayMarginInfos($object);
}*/
print '</div>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div><br>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
$blocname = 'contacts';
$title = $langs->trans('ContactsAddresses');

View File

@ -48,7 +48,8 @@ class SupplierProposal extends CommonObject
public $table_element_line='supplier_proposaldet';
public $fk_element='fk_supplier_proposal';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='propal';
/**
* {@inheritdoc}
*/