diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 80cfce40c32..60b3083d0f7 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -765,9 +765,9 @@ if ($action == 'create') $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); //For external user force the company to user company if (!empty($user->societe_id)) { - print $form->select_thirdparty_list($user->societe_id,'socid','',1,1,0,$events); + print $form->select_thirdparty_list($user->societe_id, 'socid', '', 1, 1, 0, $events); } else { - print $form->select_thirdparty_list('','socid','',1,1,0,$events); + print $form->select_thirdparty_list('', 'socid', '', 'SelectThirdParty', 1, 0, $events); } } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 379cca8c9b8..2d21c0049a1 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1691,7 +1691,7 @@ if ($action == 'create') $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; + $morehtmlref.=''; $morehtmlref.=''; } else { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index bc59eff4079..30a6d839ba8 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1944,7 +1944,7 @@ if ($action == 'create' && $user->rights->commande->creer) $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; + $morehtmlref.=''; $morehtmlref.=''; } else { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); @@ -2022,7 +2022,7 @@ if ($action == 'create' && $user->rights->commande->creer) if ($soc->outstanding_limit) { // Outstanding Bill - print ''; + print ''; print $langs->trans('OutstandingBill'); print ''; print price($soc->get_OutstandingBill()) . ' / '; @@ -2045,7 +2045,7 @@ if ($action == 'create' && $user->rights->commande->creer) $addabsolutediscount = '' . $langs->trans("EditGlobalDiscounts") . ''; $addcreditnote = '' . $langs->trans("AddCreditNote") . ''; - print '' . $langs->trans('Discounts') . ''; + print '' . $langs->trans('Discounts') . ''; if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent); else diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 961d133e88e..9aaadcea3f2 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2908,7 +2908,7 @@ else if ($id > 0 || ! empty($ref)) $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; + $morehtmlref.=''; $morehtmlref.=''; } else { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); @@ -2927,7 +2927,7 @@ else if ($id > 0 || ! empty($ref)) } $morehtmlref.=''; - $object->totalpaye = $totalpaye; // To give a change to dol_banner_tab to use already paid amount to show correct status + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', $morehtmlright); @@ -3739,7 +3739,7 @@ else if ($id > 0 || ! empty($ref)) else print $langs->trans('ExcessReceived'); print ' :'; - print '' . price($resteapayeraffiche) . ''; + print '' . price($resteapayeraffiche) . ''; print ' '; } else // Credit note diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cc51df1f90f..f50803fa451 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -737,7 +737,7 @@ class Form if (!empty($page)) { - $out .= ''; + $out .= ''; } } else @@ -1570,7 +1570,7 @@ class Form $out.=''; $out.=''; $out.=$this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); - $out.=' '; + $out.=' '; } $assignedtouser=array(); if (!empty($_SESSION['assignedtouser'])) @@ -1580,6 +1580,7 @@ class Form $nbassignetouser=count($assignedtouser); if ($nbassignetouser && $action != 'view') $out.='
'; + if ($nbassignetouser) $out.='
'; $i=0; $ownerid=0; foreach($assignedtouser as $key => $value) { @@ -1593,7 +1594,8 @@ class Form $out.='
'; $i++; } - + if ($nbassignetouser) $out.='
'; + //$out.=''; return $out; } @@ -2967,12 +2969,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; $this->selectShippingMethod($selected, $htmlname, '', $addempty); - print '
'; + print ''; + print ''; } else { if ($selected) { $code=$langs->getLabelFromKey($db, $selected, 'c_shipment_mode', 'rowid', 'code'); @@ -3159,12 +3158,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; $this->select_comptes($selected, $htmlname, 0, '', $addempty); - print '
'; + print ''; + print ''; } else { if ($selected) { require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; @@ -3521,7 +3517,7 @@ class Form $formconfirm.= ''; $formconfirm.= $this->selectyesno("confirm",$newselectedchoice); $formconfirm.= ''; - $formconfirm.= ''; + $formconfirm.= ''; $formconfirm.= ''."\n"; $formconfirm.= ''."\n"; @@ -3567,12 +3563,9 @@ class Form $out.='
'; $out.=''; $out.=''; - $out.=''; - $out.=''; - $out.=''; - $out.='
'; $out.=$formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1); - $out.='
'; + $out.=''; + $out.=''; } else { @@ -3614,12 +3607,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; $this->select_conditions_paiements($selected,$htmlname,-1,$addempty); - print '
'; + print ''; + print ''; } else { @@ -3650,12 +3640,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; $this->selectAvailabilityDelay($selected,$htmlname,-1,$addempty); - print '
'; + print ''; + print ''; } else { @@ -3687,12 +3674,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; $this->selectInputReason($selected,$htmlname,-1,$addempty); - print '
'; + print ''; + print ''; } else { @@ -3773,12 +3757,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; print $this->select_dolusers($selected,$htmlname,1,$exclude,0,$include); - print '
'; + print ''; + print ''; } else { @@ -3813,12 +3794,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; $this->select_types_paiements($selected,$htmlname,$filtertype,0,0,0,0,$active); - print '
'; + print ''; + print ''; } else { @@ -3848,12 +3826,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; print $this->selectMultiCurrency($selected, $htmlname, 0); - print '
'; + print ''; + print ''; } else { @@ -3880,12 +3855,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; print ''; - print '
'; + print ''; + print ''; } else { @@ -3988,7 +3960,6 @@ class Form if ($num==0) { $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); - print 'Cette societe n\'a pas de contact, veuillez en cr�er un avant de faire votre proposition commerciale
'; print ''.$addcontact.''; } print ''; @@ -4031,12 +4002,9 @@ class Form print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; print $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events); - print '
'; + print ''; + print ''; } else { @@ -5362,7 +5330,7 @@ class Form $i++; } print ''; - print '
     
'; + print '
     
'; print ''; $this->db->free($resqllist); diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 70dc0e253c4..ef9141dbc94 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -143,8 +143,6 @@ class FormCompany print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; dol_syslog(get_class($this).'::form_prospect_level',LOG_DEBUG); $sql = "SELECT code, label"; @@ -174,9 +172,8 @@ class FormCompany } else dol_print_error($this->db); - print '
'; + print ''; + print ''; } /** diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 80b618b8804..ace00b77caa 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -157,12 +157,9 @@ class FormContract print '
'; print ''; print ''; - print ''; - print ''; - print ''; - print '
'; $this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty); - print '
'; + print ''; + print ''; } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index c92229cf036..76736bcdd6f 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -642,7 +642,7 @@ class FormMail extends Form if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) $out.= ''; else $out.= ''; $out.= ' '; - $out.= ''; + $out.= ''; } } else diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 26ddd33f0a2..7adbe5fad42 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -948,14 +948,11 @@ class FormOther print '
'; print ''; print ''; - print ''; - print ''; - print '
'; $form->select_address($selected, $socid, $htmlname, 1); - print ''; + print ''; $langs->load("companies"); print '   '.$langs->trans("AddAddress").''; - print '
'; + print ''; } else { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7c4a19d729b..abe1a797706 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -923,7 +923,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element == 'member') $modulepart='memberphoto'; if ($object->element == 'user') $modulepart='userphoto'; if ($object->element == 'product') $modulepart='product'; - + print '
'; if ($object->element == 'product') { @@ -986,7 +986,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $morehtmlright.=$object->getLibStatut(5,1); } } - elseif ($object->element == 'facture') + elseif ($object->element == 'facture' || $object->element == 'invoice' || $object->element == 'invoice_supplier') { $tmptxt=$object->getLibStatut(6, $object->totalpaye); if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) $tmptxt=$object->getLibStatut(5, $object->totalpaye); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index b8b9b4fe6a6..b2c7a779d32 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1211,7 +1211,7 @@ else if ($id > 0 || ! empty($ref)) $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; + $morehtmlref.=''; $morehtmlref.=''; } else { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 135aaebb706..41df1e4f311 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -274,6 +274,8 @@ if (empty($reshook)) // Add a product line if ($action == 'addline' && $user->rights->fournisseur->commande->creer) { + $db->begin(); + $langs->load('errors'); $error = 0; @@ -408,7 +410,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); } } - else if((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error)) + else if ((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error)) { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); @@ -445,6 +447,8 @@ if (empty($reshook)) //print "xx".$tva_tx; exit; if (! $error && $result > 0) { + $db->commit(); + $ret=$object->fetch($object->id); // Reload to get new records // Define output language @@ -498,8 +502,11 @@ if (empty($reshook)) } else { + $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } + + $action = ''; } /* @@ -1304,8 +1311,6 @@ if (empty($reshook)) /* * View */ -$help_url='EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; -llxHeader('',$langs->trans("Order"),$help_url); $form = new Form($db); $formfile = new FormFile($db); @@ -1313,6 +1318,8 @@ $formorder = new FormOrder($db); $productstatic = new Product($db); if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } +$help_url='EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; +llxHeader('',$langs->trans("Order"),$help_url); /* *************************************************************************** */ /* */ @@ -1766,7 +1773,7 @@ elseif (! empty($object->id)) $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; + $morehtmlref.=''; $morehtmlref.=''; } else { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a64d4115186..b3fc5995031 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -85,7 +85,9 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); if ($id > 0 || ! empty($ref)) { $ret=$object->fetch($id, $ref); - $object->fetch_thirdparty(); + if ($ret < 0) dol_print_error($db,$object->error); + $ret=$object->fetch_thirdparty(); + if ($ret < 0) dol_print_error($db,$object->error); } $permissionnote=$user->rights->fournisseur->facture->creer; // Used by the include of actions_setnotes.inc.php @@ -774,7 +776,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors'); } } - else if( GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='' ) + else if (GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); @@ -1112,6 +1114,9 @@ $form = new Form($db); $formfile = new FormFile($db); $bankaccountstatic=new Account($db); $paymentstatic=new PaiementFourn($db); +if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } + +$now = dol_now(); $title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Card'); $helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; @@ -1240,9 +1245,9 @@ if ($action == 'create') print ''.$langs->trans('RefSupplier').''; print ''; + // Type print ''.$langs->trans('Type').''; print ''."\n"; - // Standard invoice print ''."\n"; - /* - // Deposit + // Deposit print ''."\n"; - // Proforma if (! empty($conf->global->FACTURE_USE_PROFORMAT)) { @@ -1270,7 +1273,6 @@ if ($action == 'create') print $desc; print ''."\n"; } - // Replacement print ''; - // Credit note print '
'; print ''; @@ -1250,16 +1255,14 @@ if ($action == 'create') $desc=$form->textwithpicto($langs->trans("InvoiceStandardAsk"),$langs->transnoentities("InvoiceStandardDesc"),1); print $desc; print '
'; print ''; print ''; $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); print $desc; print '
'; print 'textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1); print $desc; print '
'; print 'fetch_name_optionals_label($object->table_element); + $alreadypaid=$object->getSommePaiement(); + /* * View card */ @@ -1611,7 +1614,8 @@ else $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); } - if (!$formconfirm) { + if (!$formconfirm) + { $parameters=array('lineid'=>$lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; @@ -1622,14 +1626,64 @@ else print $formconfirm; - /** - * Invoice - */ - print ''; + // Supplier invoice 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.='
'; + + $object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + + print '
'; + // Ref + /* print ''; @@ -1644,9 +1698,10 @@ else print ''; print ''; - + */ + // Type - print ''; - print ''; - - /* - * List of payments - */ - $nbrows=9; $nbcols=3; - if (! empty($conf->projet->enabled)) $nbrows++; - if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; } - if (! empty($conf->incoterm->enabled)) $nbrows++; - - // Local taxes - if ($societe->localtax1_assuj=="1") $nbrows++; - if ($societe->localtax2_assuj=="1") $nbrows++; - - print ''; - + print ''; print ''; $form_permission = $object->statutrights->fournisseur->facture->creer && $object->getSommePaiement() <= 0; @@ -1907,58 +1854,10 @@ else print ''; // Status - $alreadypaid=$object->getSommePaiement(); - print ''; - - // Amount - print ''; - print ''; - - // Amount Local Taxes - //TODO: Place into a function to control showing by country or study better option - if ($societe->localtax1_assuj=="1") //Localtax1 - { - print ''; - print ''; - print ''; - } - if ($societe->localtax2_assuj=="1") //Localtax2 - { - print ''; - print ''; - print ''; - } - print ''; - - if (!empty($conf->multicurrency->enabled)) - { - // Multicurrency Amount HT - print ''; - print ''; - print ''; - - // Multicurrency Amount VAT - print ''; - print ''; - print ''; - - // Multicurrency Amount TTC - print ''; - print ''; - print ''; - } + //print ''; // Project + /* if (! empty($conf->projet->enabled)) { $langs->load('projects'); @@ -1988,7 +1887,8 @@ else print ''; print ''; } - + */ + // Incoterms if (!empty($conf->incoterm->enabled)) { @@ -2012,12 +1912,180 @@ else print ''; } - // Other attributes - $cols = 4; - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - - print '
'.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); print '
'.$langs->trans('Supplier').''.$societe->getNomUrl(1,'supplier'); print '   ('.$langs->trans('OtherBills').')
'.$langs->trans('Type').''; + print '
'.$langs->trans('Type').''; print $object->getLibType(); if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) { @@ -1686,115 +1741,7 @@ else // Label print '
'.$form->editfieldkey("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).''.$form->editfieldval("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).''; - - $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; - $sql.= ' c.id as paiement_type,'; - $sql.= ' pf.amount,'; - $sql.= ' ba.rowid as baid, ba.ref as baref, ba.label'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid'; - $sql.= ' WHERE pf.fk_facturefourn = '.$object->id; - $sql.= ' ORDER BY p.datep, p.tms'; - - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; $totalpaye = 0; - print ''; - print ''; - print ''; - print ''; - print ''; - if (! empty($conf->banque->enabled)) print ''; - print ''; - print ''; - print ''; - - $var=true; - if ($num > 0) - { - while ($i < $num) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ''; - print ''; - print ''; - if (! empty($conf->banque->enabled)) - { - $bankaccountstatic->id=$objp->baid; - $bankaccountstatic->ref=$objp->baref; - $bankaccountstatic->label=$objp->baref; - print ''; - } - print ''; - print ''; - print ''; - $totalpaye += $objp->amount; - $i++; - } - } - else - { - print ''; - } - - if ($object->paye == 0) - { - print ''; - print ''; - - $resteapayer = $object->total_ttc - $totalpaye; - - print ''; - print ''; - } - print '
'.$langs->trans('Payments').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
'; - $paymentstatic->id=$objp->rowid; - $paymentstatic->datepaye=$db->jdate($objp->dp); - $paymentstatic->ref=$objp->ref; - $paymentstatic->num_paiement=$objp->num_paiement; - $paymentstatic->payment_code=$objp->payment_code; - print $paymentstatic->getNomUrl(1); - print ''.dol_print_date($db->jdate($objp->dp), 'day') . ''; - print $form->form_modes_reglement(null, $objp->paiement_type,'none').' '.$objp->num_paiement; - print ''; - if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions'); - print ''.price($objp->amount).''; - if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) - { - print 'rowid.'">'; - print img_delete(); - print ''; - } - print '
'.$langs->trans("None").'
'.$langs->trans('AlreadyPaid').' :'.price($totalpaye).'
'.$langs->trans("Billed").' :'.price($object->total_ttc).'
'.$langs->trans('RemainderToPay').' :'.price($resteapayer).'
'; - $db->free($result); - } - else - { - dol_print_error($db); - } - print '
'.$form->editfieldval("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).'
'.$langs->trans('Status').''.$object->getLibStatut(4,$alreadypaid).'
'.$langs->trans('AmountHT').''.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).''; - if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha'); - else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal'); - if ($calculationrule == 'totalofround') $calculationrulenum=1; - else $calculationrulenum=2; - $s=$langs->trans("ReCalculate").' '; - $s.=''.$langs->trans("Mode1").''; - $s.=' / '; - $s.=''.$langs->trans("Mode2").''; - print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); - print '
'.$langs->transcountry("AmountLT1",$societe->country_code).''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT2",$societe->country_code).''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc,1,$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)) . '
' . 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)) . '
'.$langs->trans('Status').''.$object->getLibStatut(4,$alreadypaid).'

'; + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
'; + + print '
'; + print '
'; + print '
'; + print '
'; + + print ''; + + // Amount + print ''; + print ''; + + // Amount Local Taxes + //TODO: Place into a function to control showing by country or study better option + if ($societe->localtax1_assuj=="1") //Localtax1 + { + print ''; + print ''; + print ''; + } + if ($societe->localtax2_assuj=="1") //Localtax2 + { + print ''; + print ''; + print ''; + } + print ''; + + if (!empty($conf->multicurrency->enabled)) + { + // Multicurrency Amount HT + print ''; + print ''; + print ''; + + // Multicurrency Amount VAT + print ''; + print ''; + print ''; + + // Multicurrency Amount TTC + print ''; + print ''; + print ''; + } + + print '
'.$langs->trans('AmountHT').''.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'
        '; + if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha'); + else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal'); + if ($calculationrule == 'totalofround') $calculationrulenum=1; + else $calculationrulenum=2; + $s=$langs->trans("ReCalculate").' '; + $s.=''.$langs->trans("Mode1").''; + $s.=' / '; + $s.=''.$langs->trans("Mode2").''; + print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); + print '
'.$langs->transcountry("AmountLT1",$societe->country_code).''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT2",$societe->country_code).''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc,1,$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)) . '
' . 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)) . '
'; + + /* + * List of payments + */ + $nbrows=9; $nbcols=3; + if (! empty($conf->projet->enabled)) $nbrows++; + if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; } + if (! empty($conf->incoterm->enabled)) $nbrows++; + + // Local taxes + if ($societe->localtax1_assuj=="1") $nbrows++; + if ($societe->localtax2_assuj=="1") $nbrows++; + + $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,'; + $sql.= ' c.id as paiement_type,'; + $sql.= ' pf.amount,'; + $sql.= ' ba.rowid as baid, ba.ref as baref, ba.label'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'paiementfourn as p'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_paiementfourn = p.rowid'; + $sql.= ' WHERE pf.fk_facturefourn = '.$object->id; + $sql.= ' ORDER BY p.datep, p.tms'; + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; $totalpaye = 0; + print ''; + print ''; + print ''; + print ''; + print ''; + if (! empty($conf->banque->enabled)) print ''; + print ''; + print ''; + print ''; + + $var=false; + if ($num > 0) + { + while ($i < $num) + { + $objp = $db->fetch_object($result); + $var=!$var; + print ''; + print ''; + print ''; + if (! empty($conf->banque->enabled)) + { + $bankaccountstatic->id=$objp->baid; + $bankaccountstatic->ref=$objp->baref; + $bankaccountstatic->label=$objp->baref; + print ''; + } + print ''; + print ''; + print ''; + $totalpaye += $objp->amount; + $i++; + } + } + else + { + print ''; + } + + if ($object->paye == 0) + { + print ''; + print ''; + + $resteapayer = $object->total_ttc - $totalpaye; + + print ''; + print ''; + } + print '
'.$langs->trans('Payments').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
'; + $paymentstatic->id=$objp->rowid; + $paymentstatic->datepaye=$db->jdate($objp->dp); + $paymentstatic->ref=$objp->ref; + $paymentstatic->num_paiement=$objp->num_paiement; + $paymentstatic->payment_code=$objp->payment_code; + print $paymentstatic->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->dp), 'day') . ''; + print $form->form_modes_reglement(null, $objp->paiement_type,'none').' '.$objp->num_paiement; + print ''; + if ($objp->baid > 0) print $bankaccountstatic->getNomUrl(1,'transactions'); + print ''.price($objp->amount).''; + if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) + { + print 'rowid.'">'; + print img_delete(); + print ''; + } + print '
'.$langs->trans("None").'
'.$langs->trans('AlreadyPaid').' :'.price($totalpaye).'
'.$langs->trans("Billed").' :'.price($object->total_ttc).'
'.$langs->trans('RemainderToPay').' :'.price($resteapayer).'
'; + $db->free($result); + } + else + { + dol_print_error($db); + } + + 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 1c5fd795d15..4edcbd8728d 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -308,7 +308,7 @@ else $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; + $morehtmlref.=''; $morehtmlref.=''; } else { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 91a4ca81855..2f3d7e7201c 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1380,7 +1380,7 @@ if ($action == 'create') $morehtmlref.=''; $morehtmlref.=''; $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; + $morehtmlref.=''; $morehtmlref.=''; } else { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 8eb7e277a00..c6968bebdd1 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3973,6 +3973,9 @@ div.dataTables_length select { /* Select2 */ /* ============================================================================== */ +.select2-container .select2-choice .select2-arrow { + border-radius: 0; +} .select2-container-multi .select2-choices { background-image: none; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a08f2475436..4ba92966498 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3840,6 +3840,9 @@ div.dataTables_length select { /* Select2 */ /* ============================================================================== */ +.select2-container .select2-choice .select2-arrow { + border-radius: 0; +} .select2-container .select2-choice { color: #000; }