Fix dol_banner usage
This commit is contained in:
parent
97679a7309
commit
ec503d08f6
@ -134,6 +134,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
$alreadypaid=$object->getSommePaiement();
|
||||||
|
|
||||||
$head = facturefourn_prepare_head($object);
|
$head = facturefourn_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), 0, 'bill');
|
dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), 0, 'bill');
|
||||||
@ -181,9 +183,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$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);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
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 $form->editfieldval("Label",'label',$object->label,$object,0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Status
|
|
||||||
$alreadypaid=$object->getSommePaiement();
|
|
||||||
print '<tr><td>'.$langs->trans('Status').'</td><td>'.$object->getLibStatut(4,$alreadypaid).'</td></tr>';
|
|
||||||
|
|
||||||
// Amount
|
// 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('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>';
|
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
|
||||||
|
|||||||
@ -90,7 +90,8 @@ if ($object->id > 0)
|
|||||||
{
|
{
|
||||||
$head = facturefourn_prepare_head($object);
|
$head = facturefourn_prepare_head($object);
|
||||||
dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), 0, 'bill');
|
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>';
|
$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
|
$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="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|||||||
@ -32,12 +32,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
|
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
|
|
||||||
$id = GETPOST("facid",'int');
|
$id = GETPOST("facid",'int')?GETPOST("facid",'int'):GETPOST("id",'int');
|
||||||
|
$ref = GETPOST("ref",'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
|
$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";
|
$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores";
|
||||||
llxHeader('', $title, $helpurl);
|
llxHeader('', $title, $helpurl);
|
||||||
|
|
||||||
$object = new FactureFournisseur($db);
|
$object->fetch($id, $ref);
|
||||||
$object->fetch($id);
|
$object->fetch_thirdparty();
|
||||||
$object->info($id);
|
|
||||||
$soc = new Societe($db);
|
$object->info($object->id);
|
||||||
$soc->fetch($object->socid);
|
|
||||||
|
$alreadypaid=$object->getSommePaiement();
|
||||||
|
|
||||||
$head = facturefourn_prepare_head($object);
|
$head = facturefourn_prepare_head($object);
|
||||||
$titre=$langs->trans('SupplierInvoice');
|
$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.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
$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.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
$morehtmlref.='</form>';
|
$morehtmlref.='</form>';
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
@ -101,9 +104,9 @@ if (! empty($conf->projet->enabled))
|
|||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$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="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|||||||
@ -75,6 +75,8 @@ if ($object->id > 0)
|
|||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
$alreadypaid=$object->getSommePaiement();
|
||||||
|
|
||||||
$head = facturefourn_prepare_head($object);
|
$head = facturefourn_prepare_head($object);
|
||||||
$titre=$langs->trans('SupplierInvoice');
|
$titre=$langs->trans('SupplierInvoice');
|
||||||
dol_fiche_head($head, 'note', $titre, 0, 'bill');
|
dol_fiche_head($head, 'note', $titre, 0, 'bill');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user