diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index f4ea09966fc..cf4c250a678 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -255,7 +255,7 @@ if ($action == 'update') { $_SESSION["mainmenu"] = ""; // Le gestionnaire de menu a pu changer - header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".(GETPOSTISSET('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : '')); exit; } @@ -281,6 +281,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; print '
'; print ''; print ''; +print ''; clearstatcache(); @@ -292,8 +293,9 @@ print ''; // Default language print ''.$langs->trans("DefaultLanguage").''; +print img_picto('', 'language', 'class="pictofixedwidth"'); print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2); -print ''; +//print ''; print ''; print ''; @@ -303,12 +305,24 @@ print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0); print ''; print ''; -print '
'."\n"; +print ''."\n"; print ''; +print '
'; +print '
'; +print ''; +print '
'; + +print '

'; + // Themes and themes options showSkins(null, 1); print '
'; +print '
'; +print ''; +print '
'; + +print '

'; // Other print '
'; @@ -440,6 +454,12 @@ print '
'; print '
'; +print '
'; +print ''; +print '
'; + +print '

'; + // Other print '
'; print ''; @@ -497,7 +517,7 @@ print ''; print '
'; print '
'; -print ''; +print ''; print '
'; print ''; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index d9b54ad1c3d..98a51947c0e 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -98,44 +98,6 @@ if (GETPOST("account") || GETPOST("ref")) { print dol_get_fiche_end(); - print '
'; - - $solde = $object->solde(0); - if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { - $colspan = 6; - } else { - $colspan = 5; - } - - // Show next coming entries - print '
'; - print '
'; - - // Ligne de titre tableau des ecritures - print ''; - print ''; - print ''; - if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - - // Current balance - print ''; - print ''; - print ''; - print ''; - - - print ''; - print ''; - print ''; - print ''; - // Remainder to pay in future $sqls = array(); @@ -183,10 +145,12 @@ if (GETPOST("account") || GETPOST("ref")) { $error = 0; $tab_sqlobjOrder = array(); $tab_sqlobj = array(); + $nbtotalofrecords = 0; foreach ($sqls as $sql) { $resql = $db->query($sql); if ($resql) { + $nbtotalofrecords += $db->num_rows($resql); while ($sqlobj = $db->fetch_object($resql)) { $tmpobj = new stdClass(); $tmpobj->family = $sqlobj->family; @@ -194,7 +158,7 @@ if (GETPOST("account") || GETPOST("ref")) { $tmpobj->ref = $sqlobj->ref; $tmpobj->total_ttc = $sqlobj->total_ttc; $tmpobj->type = $sqlobj->type; - $tmpobj->dlt = $sqlobj->dlr; + $tmpobj->dlr = $db->jdate($sqlobj->dlr); $tmpobj->socid = $sqlobj->socid; $tmpobj->name = $sqlobj->name; $tmpobj->fournisseur = $sqlobj->fournisseur; @@ -208,6 +172,48 @@ if (GETPOST("account") || GETPOST("ref")) { } } + $param = ''; + $sortfield = ''; + $sortorder = ''; + $massactionbutton = ''; + $num = 0; + $picto = ''; + $morehtml = ''; + $limit = 0; + + print_barre_liste($langs->trans("RemainderToPay"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit, 0, 0, 1); + + + $solde = $object->solde(0); + if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { + $colspan = 6; + } else { + $colspan = 5; + } + + // Show next coming entries + print '
'; + print '
'.$langs->trans("DateDue").''.$langs->trans("Description").''.$langs->trans("Entity").''.$langs->trans("ThirdParty").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("BankBalance").'
'.$langs->trans("CurrentBalance").''.price($solde).'
'.$langs->trans("RemainderToPay").' 
'; + + // Ligne de titre tableau des ecritures + print ''; + print ''; + print ''; + if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print ''; + + // Current balance + print ''; + print ''; + print ''; + print ''; + // Sort array if (!$error) { array_multisort($tab_sqlobjOrder, $tab_sqlobj); @@ -220,60 +226,60 @@ if (GETPOST("account") || GETPOST("ref")) { $refcomp = ''; $totalpayment = ''; - $obj = array_shift($tab_sqlobj); + $tmpobj = array_shift($tab_sqlobj); - if ($obj->family == 'invoice_supplier') { + if ($tmpobj->family == 'invoice_supplier') { $showline = 1; // Uncomment this line to avoid to count suppliers credit note (ff.type = 2) - //$showline=(($obj->total_ttc < 0 && $obj->type != 2) || ($obj->total_ttc > 0 && $obj->type == 2)) + //$showline=(($tmpobj->total_ttc < 0 && $tmpobj->type != 2) || ($tmpobj->total_ttc > 0 && $tmpobj->type == 2)) if ($showline) { - $ref = $obj->ref; + $ref = $tmpobj->ref; $facturefournstatic->ref = $ref; - $facturefournstatic->id = $obj->objid; - $facturefournstatic->type = $obj->type; + $facturefournstatic->id = $tmpobj->objid; + $facturefournstatic->type = $tmpobj->type; $ref = $facturefournstatic->getNomUrl(1, ''); - $societestatic->id = $obj->socid; - $societestatic->name = $obj->name; + $societestatic->id = $tmpobj->socid; + $societestatic->name = $tmpobj->name; $refcomp = $societestatic->getNomUrl(1, '', 24); $totalpayment = -1 * $facturefournstatic->getSommePaiement(); // Payment already done } } - if ($obj->family == 'invoice') { - $facturestatic->ref = $obj->ref; - $facturestatic->id = $obj->objid; - $facturestatic->type = $obj->type; + if ($tmpobj->family == 'invoice') { + $facturestatic->ref = $tmpobj->ref; + $facturestatic->id = $tmpobj->objid; + $facturestatic->type = $tmpobj->type; $ref = $facturestatic->getNomUrl(1, ''); - $societestatic->id = $obj->socid; - $societestatic->name = $obj->name; + $societestatic->id = $tmpobj->socid; + $societestatic->name = $tmpobj->name; $refcomp = $societestatic->getNomUrl(1, '', 24); $totalpayment = $facturestatic->getSommePaiement(); // Payment already done $totalpayment += $facturestatic->getSumDepositsUsed(); $totalpayment += $facturestatic->getSumCreditNotesUsed(); } - if ($obj->family == 'social_contribution') { - $socialcontribstatic->ref = $obj->ref; - $socialcontribstatic->id = $obj->objid; - $socialcontribstatic->label = $obj->type; + if ($tmpobj->family == 'social_contribution') { + $socialcontribstatic->ref = $tmpobj->ref; + $socialcontribstatic->id = $tmpobj->objid; + $socialcontribstatic->label = $tmpobj->type; $ref = $socialcontribstatic->getNomUrl(1, 24); $totalpayment = -1 * $socialcontribstatic->getSommePaiement(); // Payment already done } - $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment); - $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + $parameters = array('obj' => $tmpobj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment); + $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $tmpobject, $action); // Note that $action and $tmpobject may have been modified by hook if (empty($reshook)) { $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; $totalpayment = isset($hookmanager->resArray['totalpayment']) ? $hookmanager->resArray['totalpayment'] : $totalpayment; } - $total_ttc = $obj->total_ttc; + $total_ttc = $tmpobj->total_ttc; if ($totalpayment) { - $total_ttc = $obj->total_ttc - $totalpayment; + $total_ttc = $tmpobj->total_ttc - $totalpayment; } $solde += $total_ttc; @@ -282,26 +288,26 @@ if (GETPOST("account") || GETPOST("ref")) { // Show line print ''; print '"; print ""; if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { - if ($obj->family == 'invoice') { - $mc->getInfo($obj->entity); + if ($tmpobj->family == 'invoice') { + $mc->getInfo($tmpobj->entity); print ""; } else { print ""; } } print ""; - if ($obj->total_ttc < 0) { + if ($tmpobj->total_ttc < 0) { print '"; }; - if ($obj->total_ttc >= 0) { + if ($tmpobj->total_ttc >= 0) { print '"; }; print ''; diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index e0cd9beff0c..889484cec44 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -43,7 +43,7 @@ $idprod = GETPOST('idprod', 'int'); $prices = array(); // Load translation files required by the page -$langs->loadLangs(array("stocks", "margins")); +$langs->loadLangs(array("stocks", "margins", "products")); /* diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 7d8d29b307c..6b67d0a2dcf 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2739,14 +2739,17 @@ if ($action == 'create') { // Label print ''; - print ''; - print ''; + print ''; + print ''; print ''; $form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0); + $form_permission2 = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate; // Date - print ''; @@ -2756,11 +2759,11 @@ if ($action == 'create') { print '
'.$langs->trans("DateDue").''.$langs->trans("Description").''.$langs->trans("Entity").''.$langs->trans("ThirdParty").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("BankBalance").'
'.$langs->trans("CurrentBalance").''.price($solde).'
'; - if ($obj->dlr) { - print dol_print_date($db->jdate($obj->dlr), "day"); + if ($tmpobj->dlr) { + print dol_print_date($tmpobj->dlr, "day"); } else { print $langs->trans("NotDefined"); } print "".$ref."".$mc->label."".$refcomp."'.price(abs($total_ttc))."  '.price($total_ttc)."'.price($solde).'
'.$form->editfieldkey("Label", 'label', $object->label, $object, ($usercancreate)).''.$form->editfieldval("Label", 'label', $object->label, $object, ($usercancreate)).''.$form->editfieldkey("Label", 'label', $object->label, $object, $usercancreate).''.$form->editfieldval("Label", 'label', $object->label, $object, $usercancreate).'
'.$form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker').''; + print '
'; + print $form->editfieldkey("DateInvoice", 'datef', $object->datep, $object, $form_permission, 'datepicker'); + print ''; print $form->editfieldval("Date", 'datef', $object->datep, $object, $form_permission, 'datepicker'); print '
'; } print '
'; print $langs->trans('PaymentConditions'); print ''; - if ($action != 'editconditions' && $usercancreate) { + if ($action != 'editconditions' && $form_permission) { 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'); } else { @@ -2770,8 +2773,10 @@ if ($action == 'create') { print ''; // Due date - print ''.$form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker').''; - print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker'); + print ''; + print $form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker'); + print ''; + print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker'); if ($action != 'editdate_lim_reglement' && $object->hasDelay()) { print img_warning($langs->trans('Late')); } @@ -2783,11 +2788,11 @@ if ($action == 'create') { print ''; - if ($action != 'editmode' && $usercancreate) { + if ($action != 'editmode' && $form_permission2) { print ''; } print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; - print ''; + print ''; if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'DBIT', 1, 1); } else { @@ -2807,7 +2812,7 @@ if ($action == 'create') { 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 { @@ -2819,14 +2824,14 @@ if ($action == 'create') { if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { print ''; print ''; - print ''; } print '
'; + print ''; if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { print ''; } print '
'; print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'
'; - print '
'; + print ''; if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') { if ($action == 'actualizemulticurrencyrate') { list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); @@ -2854,7 +2859,7 @@ if ($action == 'create') { print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'
'; - print ''; + print ''; if ($action == 'editbankaccount') { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } else { @@ -2877,7 +2882,7 @@ if ($action == 'create') { } print ''; print ''; - print ''; + print ''; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } else { @@ -2898,7 +2903,6 @@ if ($action == 'create') { } print ''; print ''; - print ''; if ($action == 'editmode') { $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?id='.$object->id, $object->transport_mode_id, 'transport_mode_id', 1, 1); @@ -2913,8 +2917,8 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print ''; - print '
'; + print '
'; print '
'; print '
'; @@ -2933,7 +2937,7 @@ if ($action == 'create') { print ''; // Multicurrency Amount TTC - print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; + print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } @@ -2977,9 +2981,8 @@ if ($action == 'create') { print ''; - /* - * List of payments - */ + + // List of payments $totalpaye = 0;