Fix dol_banner usage

This commit is contained in:
Laurent Destailleur 2016-12-31 17:01:31 +01:00
parent 97679a7309
commit ec503d08f6
4 changed files with 23 additions and 19 deletions

View File

@ -134,6 +134,8 @@ if ($id > 0 || ! empty($ref))
{
$object->fetch_thirdparty();
$alreadypaid=$object->getSommePaiement();
$head = facturefourn_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), 0, 'bill');
@ -181,10 +183,10 @@ if ($id > 0 || ! empty($ref))
}
$morehtmlref.='</div>';
$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);
$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 '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
@ -234,10 +236,6 @@ if ($id > 0 || ! empty($ref))
print $form->editfieldval("Label",'label',$object->label,$object,0);
print '</td></tr>';
// Status
$alreadypaid=$object->getSommePaiement();
print '<tr><td>'.$langs->trans('Status').'</td><td>'.$object->getLibStatut(4,$alreadypaid).'</td></tr>';
// Amount
print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';

View File

@ -90,7 +90,8 @@ if ($object->id > 0)
{
$head = facturefourn_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), 0, 'bill');
$totalpaye = $object->getSommePaiement();
$totalpaye = $object->getSommePaiement();
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
@ -137,7 +138,7 @@ if ($object->id > 0)
$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);
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View File

@ -32,12 +32,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load('bills');
$id = GETPOST("facid",'int');
$id = GETPOST("facid",'int')?GETPOST("facid",'int'):GETPOST("id",'int');
$ref = GETPOST("ref",'alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);
/*
@ -48,11 +50,12 @@ $title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Info');
$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores";
llxHeader('', $title, $helpurl);
$object = new FactureFournisseur($db);
$object->fetch($id);
$object->info($id);
$soc = new Societe($db);
$soc->fetch($object->socid);
$object->fetch($id, $ref);
$object->fetch_thirdparty();
$object->info($object->id);
$alreadypaid=$object->getSommePaiement();
$head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
@ -81,11 +84,11 @@ if (! empty($conf->projet->enabled))
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
@ -101,9 +104,9 @@ if (! empty($conf->projet->enabled))
}
$morehtmlref.='</div>';
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
$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, 'facnumber', 'ref', $morehtmlref, '', 0);
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';

View File

@ -75,6 +75,8 @@ if ($object->id > 0)
{
$object->fetch_thirdparty();
$alreadypaid=$object->getSommePaiement();
$head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
dol_fiche_head($head, 'note', $titre, 0, 'bill');