diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index b0ea8a9f4ba..379cca8c9b8 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -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='
';
-
// Ref customer
- $morehtmlref.=$langs->trans('RefCustomer').' ';
- if ($action != 'refclient' && ! empty($object->brouillon))
- {
- $morehtmlref.='
' . img_edit($langs->trans('Modify')) . ' ';
- }
- $morehtmlref.=' : ';
- if ($user->rights->propal->creer && $action == 'refclient') {
- $morehtmlref.='
';
- } 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.='
'.$langs->trans('Company') . ' : ' . $soc->getNomUrl(1);
-
+ $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
@@ -1721,7 +1708,6 @@ if ($action == 'create')
}
}
}
-
$morehtmlref.='
';
@@ -1770,7 +1756,7 @@ if ($action == 'create')
print '';*/
// Lin for thirdparty discounts
- print '' . $langs->trans('Discounts') . ' ';
+ print ' ' . $langs->trans('Discounts') . ' ';
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 ' id . '">' . img_edit($langs->trans('SetDate'), 1) . ' ';
print ' ';
- print '';
+ print ' ';
if (! empty($object->brouillon) && $action == 'editdate') {
print ' ';
+ print ' ';
if (! empty($object->brouillon) && $action == 'editecheance') {
print ' ';
+ print ' ';
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 ' ';
print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $user->rights->propal->creer, 'datepicker');
- print ' ';
+ print ' ';
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $user->rights->propal->creer, 'datepicker');
print ' ';
print ' ';
@@ -1888,7 +1874,7 @@ if ($action == 'create')
if ($action != 'editavailability' && ! empty($object->brouillon))
print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . ' ';
print '';
- print '';
+ print ' ';
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 ' id.'">'.img_edit($langs->trans('SetShippingMode'),1).' ';
print '';
- print '';
+ print ' ';
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 ' id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . ' ';
print '';
- print '';
+ print ' ';
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 ' id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . ' ';
print '';
- print '';
+ print ' ';
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 ' id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . ' ';
print '';
- print '';
+ print ' ';
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 ' id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . ' ';
print '';
- print '';
+ print ' ';
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 ' ';
print $langs->trans('OutstandingBill');
- print ' ';
+ print ' ';
print price($soc->get_OutstandingBill()) . ' / ';
print price($soc->outstanding_limit, 0, $langs, 1, - 1, - 1, $conf->currency);
print ' ';
@@ -2048,7 +2034,7 @@ if ($action == 'create')
if ($action != 'editbankaccount' && $user->rights->propal->creer)
print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).' ';
print ' ';
- print '';
+ print ' ';
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 ' ';
print ' ';
print '';
- print '';
+ print ' ';
if ($action != 'editincoterm')
{
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
@@ -2095,48 +2081,48 @@ if ($action == 'create')
print '';
// Amount HT
- print '' . $langs->trans('AmountHT') . ' ';
+ print '' . $langs->trans('AmountHT') . ' ';
print '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
print ' ';
// Amount VAT
- print '' . $langs->trans('AmountVAT') . ' ';
+ print '' . $langs->trans('AmountVAT') . ' ';
print '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
print ' ';
// Amount Local Taxes
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
{
- print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ' ';
+ print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ' ';
print '' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
print ' ';
}
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2
{
- print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ' ';
+ print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ' ';
print '' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
print ' ';
}
// Amount TTC
- print '' . $langs->trans('AmountTTC') . ' ';
+ print '' . $langs->trans('AmountTTC') . ' ';
print '' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . ' ';
print ' ';
if (!empty($conf->multicurrency->enabled))
{
// Multicurrency Amount HT
- print '' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ' ';
+ print '' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ' ';
print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
// Multicurrency Amount VAT
- print '' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ' ';
+ print '' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ' ';
print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
// Multicurrency Amount TTC
- print '' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ' ';
+ print '' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ' ';
print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
}
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 7431ee9ca79..bc59eff4079 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -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='';
-
// Ref customer
- $morehtmlref.=$langs->trans('RefCustomer').' ';
- if ($action != 'refclient' && ! empty($object->brouillon))
- {
- $morehtmlref.='
' . img_edit($langs->trans('Modify')) . ' ';
- }
- $morehtmlref.=' : ';
- if ($user->rights->commande->creer && $action == 'refclient') {
- $morehtmlref.='
';
- } 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.='
'.$langs->trans('Company') . ' : ' . $soc->getNomUrl(1);
-
+ $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
@@ -1971,7 +1961,6 @@ if ($action == 'create' && $user->rights->commande->creer)
}
}
}
-
$morehtmlref.='
';
@@ -2286,10 +2275,12 @@ if ($action == 'create' && $user->rights->commande->creer)
$totalVolume=$tmparray['volume'];
if ($totalWeight || $totalVolume)
{
- print ''.$langs->trans("CalculatedWeight").' / '.$langs->trans("CalculatedVolume").' ';
+ print ''.$langs->trans("CalculatedWeight").' ';
print '';
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 ' ';
+ print ''.$langs->trans("CalculatedVolume").' ';
+ print '';
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 ' ';
}
@@ -2376,7 +2367,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '';
// Total HT
- print '' . $langs->trans('AmountHT') . ' ';
+ print '' . $langs->trans('AmountHT') . ' ';
print '' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . ' ';
// Total VAT
@@ -2400,17 +2391,17 @@ if ($action == 'create' && $user->rights->commande->creer)
if (!empty($conf->multicurrency->enabled))
{
// Multicurrency Amount HT
- print '' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ' ';
+ print '' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ' ';
print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
// Multicurrency Amount VAT
- print '' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ' ';
+ print '' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ' ';
print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
// Multicurrency Amount TTC
- print '' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ' ';
+ print '' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ' ';
print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
}
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index f30318d2fb8..108fcf90d84 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -2558,7 +2558,6 @@ class Commande extends CommonOrder
if ($result < 0) $error++;
// End call triggers
}
-
if (! $error)
{
$this->db->commit();
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index a0cd4de90e8..32e6ca242ca 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -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}
*/
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 8f1e40db48f..5731ba7c63d 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -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';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c8ae8dd8b6b..da198027936 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -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.='';
+ if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='';
if ($fieldrequired) $ret.='';
$ret.=$langs->trans($text);
if ($fieldrequired) $ret.=' ';
- if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=' ';
- if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).' ';
- if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='
';
+ if (! empty($notabletag)) $ret.=' ';
+ if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=' ';
+ if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='';
+ if ($htmlname && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).' ';
+ if (! empty($notabletag)) $ret.=' : ';
+ if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=' ';
+ if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='
';
}
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.=' ';
$ret.=' ';
$ret.=' ';
- $ret.='';
- $ret.='';
+ if (empty($notabletag)) $ret.='';
+ if (empty($notabletag)) $ret.='';
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.=' ';
+ if (empty($notabletag)) $ret.='';
- $ret.='';
+ if (empty($notabletag)) $ret.=' ';
$ret.=' ';
if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.=' '."\n";
$ret.=' ';
- $ret.=' ';
+ if (empty($notabletag)) $ret.='';
- $ret.='
'."\n";
+ if (empty($notabletag)) $ret.='
'."\n";
$ret.=''."\n";
}
else
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 0fd78495ddd..53bd4f469f0 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2005-2013 Laurent Destailleur
+ * Copyright (C) 2005-2016 Laurent Destailleur
* Copyright (C) 2005 Simon TOSSER
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2011-2012 Juanjo Menent
@@ -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 = ''.$langs->trans("BackToList").' ';
+
+ $morehtmlref='';
+ // 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.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+ // Project
+ /*
+ if (! empty($conf->projet->enabled)) {
+ $langs->load("projects");
+ $morehtmlref .= '
' . $langs->trans('Project') . ' ';
+ if ($user->rights->supplier_proposal->creer) {
+ if ($action != 'classify') {
+ $morehtmlref .= '
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ }
+ if ($action == 'classify') {
+ // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref .= '
';
+ } 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 .= '
';
+ $morehtmlref .= $proj->ref;
+ $morehtmlref .= ' ';
+ } else {
+ $morehtmlref .= '';
+ }
+ }
+ }*/
+ $morehtmlref.='
';
+
+
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+
+ print '';
+ print '
';
+ print '
';
+
print '
';
- $linkback = ''.$langs->trans("BackToList").' ';
-
// Ref
+ /*
print ''.$langs->trans("Ref").' ';
print '';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
@@ -1290,7 +1357,7 @@ else if ($id || $ref)
// Customer
print ' '.$langs->trans("Customer").' ';
print ''.$soc->getNomUrl(1).' ';
- print " ";
+ print "";*/
// Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
@@ -1316,13 +1383,8 @@ else if ($id || $ref)
print '';
}
- // Ref customer
- print ''.$langs->trans("RefCustomer").' ';
- print ''.$object->ref_customer." \n";
- print ' ';
-
// Date creation
- print ''.$langs->trans("DateCreation").' ';
+ print ''.$langs->trans("DateCreation").' ';
print ''.dol_print_date($object->date_creation,"day")." \n";
print ' ';
@@ -1455,9 +1517,22 @@ else if ($id || $ref)
print '';
// Status
- print ''.$langs->trans("Status").' ';
+ /*print ''.$langs->trans("Status").' ';
print ''.$object->getLibStatut(4)." \n";
- print ' ';
+ print '';*/
+
+ // Other attributes
+ $cols = 2;
+ include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
+
+ print '
';
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
// Sending method
print '';
@@ -1490,9 +1565,9 @@ else if ($id || $ref)
}
print ' ';
print ' ';
-
+
// Tracking Number
- print ''.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).' ';
+ print ' '.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).' ';
print $form->editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number);
print ' ';
@@ -1519,11 +1594,14 @@ else if ($id || $ref)
print '';
}
- // Other attributes
- $cols = 3;
- include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+ print "
";
- print "
\n";
+ print '';
+ print '';
+ print '';
+
+ print '
';
+
/*
* Lines of products
@@ -1719,11 +1797,12 @@ else if ($id || $ref)
$var=!$var;
}
+
+ print "
\n";
}
- print "\n";
- print "\n\n";
+ dol_fiche_end();
$object->fetchObjectLinked($object->id,$object->element);
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index d6aa7f89b15..3341befe89a 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -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;
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index ff2665ece46..a8a7c6e930f 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -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}
*/
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 8a814c492d0..4a9960d49a4 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -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}
*/
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 3c710461b06..135aaebb706 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -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 '';
+
+ // Supplier order card
$linkback = ''.$langs->trans("BackToList").' ';
+
+ $morehtmlref='';
+ // 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.='
'.$langs->trans('Project') . ' ';
+ if ($user->rights->fournisseur->commande->creer)
+ {
+ if ($action != 'classify')
+ $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.='
';
+ } 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.='
';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.=' ';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+ }
+ $morehtmlref.='
';
+
+
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+
+ print '';
+ print '
';
+ print '
';
+
+ print '
';
// Ref
+ /*
print ''.$langs->trans("Ref").' ';
print '';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
print ' ';
- print ' ';
+ print '';*/
// Ref supplier
+ /*
print '';
print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
print ' ';
print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
print ' ';
-
+
// Fournisseur
print ''.$langs->trans("Supplier")." ";
print ''.$object->thirdparty->getNomUrl(1,'supplier').' ';
print ' ';
-
+ */
+
// Statut
+ /*
print '';
print ''.$langs->trans("Status").' ';
print '';
print $object->getLibStatut(4);
print " ";
+ */
// Date
if ($object->methode_commande_id > 0)
{
- print ''.$langs->trans("Date").' ';
+ print ' '.$langs->trans("Date").' ';
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 ' '.$langs->trans("Method").' '.$object->getInputMethod().' ';
+ print ''.$langs->trans("Method").' '.$object->getInputMethod().' ';
}
}
// Author
- print ''.$langs->trans("AuthorRequest").' ';
- print ''.$author->getNomUrl(1).' ';
+ print ''.$langs->trans("AuthorRequest").' ';
+ print ''.$author->getNomUrl(1).' ';
print ' ';
// Conditions de reglement par defaut
@@ -1808,7 +1855,7 @@ elseif (! empty($object->id))
print '';
if ($action != 'editconditions') print ' id.'">'.img_edit($langs->trans('SetConditions'),1).' ';
print '
';
- print '
';
+ print ' ';
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 ' ';
if ($action != 'editmode') print '
id.'">'.img_edit($langs->trans('SetMode'),1).' ';
print '
';
- print ' ';
+ print ' ';
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 ' ';
- print '';
+ print ' ';
print '';
- print ' ';
+ print ' ';
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 ' ';
- print '';
+ print ' ';
print '';
- print ' ';
+ print ' ';
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 ' id.'">'.img_edit($langs->trans('SetBankAccount'),1).' ';
print ' ';
- print '';
+ print ' ';
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 ' ';
if ($action != 'editdate_livraison') print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).' ';
print '';
- print '';
+ print ' ';
if ($action == 'editdate_livraison')
{
print ' ';
-
// Delivery delay (in days)
print '';
print ''.$langs->trans('NbDaysToDelivery').' '.img_picto($langs->trans('DescNbDaysToDelivery'), 'info', 'style="cursor:help"').' ';
@@ -1935,6 +1981,7 @@ elseif (! empty($object->id))
print ' ';
// Project
+ /*
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
@@ -1944,7 +1991,7 @@ elseif (! empty($object->id))
print '';
if ($action != 'classify') print ''.img_edit($langs->trans('SetProject')).' ';
print '';
- print '';
+ print ' ';
//print "$object->id, $object->socid, $object->fk_project";
if ($action == 'classify')
{
@@ -1956,7 +2003,7 @@ elseif (! empty($object->id))
}
print ' ';
print '';
- }
+ }*/
// Incoterms
if (!empty($conf->incoterm->enabled))
@@ -1969,7 +2016,7 @@ elseif (! empty($object->id))
else print ' ';
print '';
print '';
- print '';
+ print ' ';
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 '';
+
+ print '';
+ print '';
+ print '
';
+ print '
';
+
+ print '
';
+
// Total
- print ''.$langs->trans("AmountHT").' ';
- print ''.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).' ';
+ print ''.$langs->trans("AmountHT").' ';
+ print ''.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).' ';
print ' ';
// Total VAT
- print ''.$langs->trans("AmountVAT").' '.price($object->total_tva,'',$langs,1,-1,-1,$conf->currency).' ';
+ print ''.$langs->trans("AmountVAT").' '.price($object->total_tva,'',$langs,1,-1,-1,$conf->currency).' ';
print ' ';
// Amount Local Taxes
if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1
{
print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).' ';
- print ''.price($object->total_localtax1,'',$langs,1,-1,-1,$conf->currency).' ';
+ print ''.price($object->total_localtax1,'',$langs,1,-1,-1,$conf->currency).' ';
print ' ';
}
if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2
{
print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).' ';
- print ''.price($object->total_localtax2,'',$langs,1,-1,-1,$conf->currency).' ';
+ print ''.price($object->total_localtax2,'',$langs,1,-1,-1,$conf->currency).' ';
print ' ';
}
// Total TTC
- print ''.$langs->trans("AmountTTC").' '.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).' ';
+ print ''.$langs->trans("AmountTTC").' '.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).' ';
print ' ';
if (!empty($conf->multicurrency->enabled))
{
// Multicurrency Amount HT
- print '' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ' ';
- print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
+ print '' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ' ';
+ print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
// Multicurrency Amount VAT
- print '' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ' ';
- print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
+ print '' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ' ';
+ print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
// Multicurrency Amount TTC
- print '' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ' ';
- print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
+ print '' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ' ';
+ print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ' ';
print ' ';
}
- print "
";
-
+ print '';
+
+ // Margin Infos
+ /*if (! empty($conf->margin->enabled)) {
+ $formmargin->displayMarginInfos($object);
+ }*/
+
+
+ print '
';
+ print '
';
+ print '';
+
+ print '
';
+
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$blocname = 'contacts';
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index d9381af9b5e..1c5fd795d15 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -175,7 +175,7 @@ if ($action == 'create')
{
print load_fiche_titre($langs->trans("NewWarehouse"));
- print "