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.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=' '; - $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 ''; @@ -1832,7 +1818,7 @@ if ($action == 'create') if ($action != 'editecheance' && ! empty($object->brouillon)) print 'id . '">' . img_edit($langs->trans('SetConditions'), 1) . ''; print ''; - print ''; + print ''; if (! empty($object->brouillon) && $action == 'editecheance') { print ''; print ''; @@ -1860,7 +1846,7 @@ if ($action == 'create') if ($action != 'editconditions' && ! empty($object->brouillon)) print 'id . '">' . img_edit($langs->transnoentitiesnoconv('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'); } 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 ''; + print ''; print ''; print ''; // Amount VAT - print ''; + print ''; print ''; print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1 { - print ''; + print ''; print ''; print ''; } if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2 { - print ''; + print ''; print ''; print ''; } // Amount TTC - print ''; + print ''; print ''; print ''; if (!empty($conf->multicurrency->enabled)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; 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.=''; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=' '; - $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 ''; + print ''; print ''; + print ''; + print ''; } @@ -2376,7 +2367,7 @@ if ($action == 'create' && $user->rights->commande->creer) print '
' . $langs->trans('AmountHT') . '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountVAT') . '
' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountTTC') . '
' . $langs->trans('AmountTTC') . '' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
'.$langs->trans("CalculatedWeight").' / '.$langs->trans("CalculatedVolume").'
'.$langs->trans("CalculatedWeight").''; 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 '
'.$langs->trans("CalculatedVolume").''; 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 '
'; // Total HT - print ''; + print ''; print ''; // Total VAT @@ -2400,17 +2391,17 @@ if ($action == 'create' && $user->rights->commande->creer) if (!empty($conf->multicurrency->enabled)) { // Multicurrency Amount HT - print ''; + print ''; print ''; print ''; // Multicurrency Amount VAT - print ''; + print ''; print ''; print ''; // Multicurrency Amount TTC - print ''; + print ''; print ''; 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.='
' . $langs->trans('AmountHT') . '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
'; + if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; + if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='
'; + if (empty($notabletag) && GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; - if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.=''; - if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='
'; if ($fieldrequired) $ret.=''; $ret.=$langs->trans($text); if ($fieldrequired) $ret.=''; - if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).'
'; + if (! empty($notabletag)) $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.='
'; } 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 (empty($notabletag)) $ret.=''; - $ret.=''; + if (empty($notabletag)) $ret.=''; - $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 (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='
'."\n"; $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 .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= ''; + $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 ''; print ''; print ''; - 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 ''; - print '\n"; - print ''; - // Date creation - print ''; + print ''; print '\n"; print ''; @@ -1455,9 +1517,22 @@ else if ($id || $ref) print ''; // Status - print ''; + /*print ''; print '\n"; - print ''; + print '';*/ + + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); @@ -1290,7 +1357,7 @@ else if ($id || $ref) // Customer print '
'.$langs->trans("Customer").''.$soc->getNomUrl(1).'
'.$langs->trans("RefCustomer").''.$object->ref_customer."
'.$langs->trans("DateCreation").'
'.$langs->trans("DateCreation").''.dol_print_date($object->date_creation,"day")."
'.$langs->trans("Status").'
'.$langs->trans("Status").''.$object->getLibStatut(4)."
'; + + print '
'; + print '
'; + print '
'; + print '
'; + + print ''; // Sending method print ''; print ''; - + // 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 "
'; @@ -1490,9 +1565,9 @@ else if ($id || $ref) } 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 '
"; - 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.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $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 ''; print ''; - print ''; + print '';*/ // Ref supplier + /* print ''; - + // Fournisseur print '"; print ''; print ''; - + */ + // Statut + /* print ''; print ''; print '"; + */ // Date if ($object->methode_commande_id > 0) { - print ''; + print ''; } } // Author - print ''; - print ''; + print ''; + print ''; print ''; // Conditions de reglement par defaut @@ -1808,7 +1855,7 @@ elseif (! empty($object->id)) print ''; print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); 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 '
'.$langs->trans("Supplier")."'.$object->thirdparty->getNomUrl(1,'supplier').'
'.$langs->trans("Status").''; print $object->getLibStatut(4); 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().'
'.$langs->trans("Method").''.$object->getInputMethod().'
'.$langs->trans("AuthorRequest").''.$author->getNomUrl(1).'
'.$langs->trans("AuthorRequest").''.$author->getNomUrl(1).'
'; if ($action != 'editconditions') print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; - 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 ''; if ($action != 'editmulticurrencycode' && ! empty($object->brouillon)) print ''; print '
'; print fieldLabel('Currency','multicurrency_code'); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; - 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 ''; if ($action != 'editmulticurrencyrate' && ! empty($object->brouillon)) print ''; print '
'; print fieldLabel('CurrencyRate','multicurrency_tx'); print 'id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
'; - 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 '
'; @@ -1927,7 +1974,6 @@ elseif (! empty($object->id)) } 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 ''; - print ''; + print ''; + print ''; print ''; // Total VAT - print ''; + print ''; print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1 { print ''; - print ''; + print ''; print ''; } if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2 { print ''; - print ''; + print ''; print ''; } // Total TTC - print ''; + print ''; print ''; if (!empty($conf->multicurrency->enabled)) { // Multicurrency Amount HT - print ''; - print ''; + print ''; + print ''; print ''; // Multicurrency Amount VAT - print ''; - print ''; + print ''; + print ''; print ''; // Multicurrency Amount TTC - print ''; - print ''; + print ''; + print ''; print ''; } - print "
'.$langs->trans("AmountHT").''.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).'
'.$langs->trans("AmountHT").''.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).'
'.$langs->trans("AmountVAT").''.price($object->total_tva,'',$langs,1,-1,-1,$conf->currency).'
'.$langs->trans("AmountVAT").''.price($object->total_tva,'',$langs,1,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1,'',$langs,1,-1,-1,$conf->currency).''.price($object->total_localtax1,'',$langs,1,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2,'',$langs,1,-1,-1,$conf->currency).''.price($object->total_localtax2,'',$langs,1,-1,-1,$conf->currency).'
'.$langs->trans("AmountTTC").''.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).'
'.$langs->trans("AmountTTC").''.price($object->total_ttc,'',$langs,1,-1,-1,$conf->currency).'
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '

"; - + 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 "\n"; + print ''."\n"; print ''; print ''; print ''; @@ -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 ''; - + 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 = ''.$langs->trans("BackToList").''; + + + $morehtmlref='
'; + $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.='
'.$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.=''; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $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, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + + print '
'; + // Ref + /* print ''; + print '';*/ - print ''; + //print ''; // Description - print ''; + print ''; // Address - print ''; // Town - print ''; - print ''; + print ''; + print ''; // Country - print ''; + print '';*/ // Status - print ''; + //print ''; - $calcproductsunique=$object->nb_different_products(); + $calcproductsunique=$object->nb_different_products(); $calcproducts=$object->nb_products(); - - // Total nb of different products - print '"; - + + // Total nb of different products + print '"; + // Nb of products - print '"; - + + print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle'); - print '
'.$langs->trans("LocationSummary").''.$object->lieu.'
'.$langs->trans("LocationSummary").''.$object->lieu.'
'.$langs->trans("Description").''.nl2br($object->description).'
'.$langs->trans("Description").''.nl2br($object->description).'
'.$langs->trans('Address').''; + /* + print '
'.$langs->trans('Address').''; print $object->address; print '
'.$langs->trans('Zip').''.$object->zip.''.$langs->trans('Town').''.$object->town.'
'.$langs->trans('Zip').''.$object->zip.'
'.$langs->trans('Town').''.$object->town.'
'.$langs->trans('Country').''; + print '
'.$langs->trans('Country').''; if (! empty($object->country_code)) { $img=picto_from_langcode($object->country_code); print ($img?$img.' ':''); } print $object->country; - print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("NumberOfDifferentProducts").''; - print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb']; - print "
'.$langs->trans("NumberOfDifferentProducts").''; + print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb']; + print "
'.$langs->trans("NumberOfProducts").''; + print '
'.$langs->trans("NumberOfProducts").''; print empty($calcproducts['nb'])?'0':$calcproducts['nb']; print "
'; + + print ''; + print '
'; + print '
'; + print '
'; + + print ''; + // Value - print '"; - + // 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 '"; - + print "
'.$langs->trans("EstimatedStockValueShort").''; + print '
'.$langs->trans("EstimatedStockValueShort").''; print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); print "
'.$langs->trans("LastMovement").''; + print '
'.$langs->trans("LastMovement").''; if ($lastmovementdate) { print dol_print_date($lastmovementdate,'dayhour').' '; @@ -345,13 +420,19 @@ else } else { - print $langs->trans("None"); + print $langs->trans("None"); } print "
"; print '
'; + print '
'; + print ''; + + print '
'; + + dol_fiche_end(); /* ************************************************************************** */ diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index dce8620d182..d01d1709335 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -35,6 +35,7 @@ class Entrepot extends CommonObject { public $element='stock'; public $table_element='entrepot'; + public $picto='stock'; /** * Warehouse closed, inactive diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index a06cb497777..91a4ca81855 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -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 = '' . $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->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.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $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 ''; @@ -1365,9 +1418,10 @@ if ($action == 'create') // Company print ''; print ''; - + */ + // Payment term - print '
' . $langs->trans('Ref') . ''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '
' . $langs->trans('Supplier') . '' . $soc->getNomUrl(1) . '
'; + print '
'; print ''; @@ -1424,6 +1478,7 @@ if ($action == 'create') print ''; // Project + /* if (! empty($conf->projet->enabled)) { $langs->load("projects"); print ''; - } + }*/ // 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 '
'; print $langs->trans('PaymentConditionsShort'); print '
'; @@ -1455,7 +1510,7 @@ if ($action == 'create') } } print '
'; + + print ''; + print '
'; + print '
'; + print '
'; + + print ''; + // Amount HT - print ''; - print ''; - - // 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 ''; - } + print ''; + print ''; print ''; // Amount VAT - print ''; - print ''; + print ''; + print ''; print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1 { - print ''; - print ''; + print ''; + print ''; print ''; } if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2 { print ''; - print ''; + print ''; print ''; } // Amount TTC print ''; - print ''; + print ''; print ''; if (!empty($conf->multicurrency->enabled)) { // Multicurrency Amount HT print ''; - print ''; + print ''; print ''; // Multicurrency Amount VAT print ''; - print ''; + print ''; print ''; // Multicurrency Amount TTC print ''; - print ''; + print ''; print ''; } // Statut - print ''; + //print ''; - print '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . ''; - $formmargin->displayMarginInfos($object); - print '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '' . price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . $langs->trans('AmountTTC') . '' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . $langs->trans('Status') . '' . $object->getLibStatut(4) . '
' . $langs->trans('Status') . '' . $object->getLibStatut(4) . '

'; + 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'; $title = $langs->trans('ContactsAddresses'); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 09fa2dc69e9..14fbcb3110a 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -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} */