New: Show amount and status of supplier invoice also on document tab.
This commit is contained in:
parent
8bc655b44f
commit
7ac4a6f43c
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -155,9 +155,54 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Third party
|
// Third party
|
||||||
print "<tr><td>".$langs->trans("Supplier")."</td>";
|
print "<tr><td>".$langs->trans("Supplier")."</td>";
|
||||||
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1,'supplier').'</td></tr>';
|
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1,'supplier').'</td></tr>';
|
||||||
|
|
||||||
|
// Type
|
||||||
|
print '<tr><td>'.$langs->trans('Type').'</td><td colspan="4">';
|
||||||
|
print $object->getLibType();
|
||||||
|
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT)
|
||||||
|
{
|
||||||
|
$facreplaced=new FactureFournisseur($db);
|
||||||
|
$facreplaced->fetch($object->fk_facture_source);
|
||||||
|
print ' ('.$langs->transnoentities("ReplaceInvoice",$facreplaced->getNomUrl(1)).')';
|
||||||
|
}
|
||||||
|
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE)
|
||||||
|
{
|
||||||
|
$facusing=new FactureFournisseur($db);
|
||||||
|
$facusing->fetch($object->fk_facture_source);
|
||||||
|
print ' ('.$langs->transnoentities("CorrectInvoice",$facusing->getNomUrl(1)).')';
|
||||||
|
}
|
||||||
|
|
||||||
|
$facidavoir=$object->getListIdAvoirFromInvoice();
|
||||||
|
if (count($facidavoir) > 0)
|
||||||
|
{
|
||||||
|
print ' ('.$langs->transnoentities("InvoiceHasAvoir");
|
||||||
|
$i=0;
|
||||||
|
foreach($facidavoir as $fid)
|
||||||
|
{
|
||||||
|
if ($i==0) print ' ';
|
||||||
|
else print ',';
|
||||||
|
$facavoir=new FactureFournisseur($db);
|
||||||
|
$facavoir->fetch($fid);
|
||||||
|
print $facavoir->getNomUrl(1);
|
||||||
|
}
|
||||||
|
print ')';
|
||||||
|
}
|
||||||
|
if ($facidnext > 0)
|
||||||
|
{
|
||||||
|
$facthatreplace=new FactureFournisseur($db);
|
||||||
|
$facthatreplace->fetch($facidnext);
|
||||||
|
print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')';
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Label
|
||||||
|
print '<tr><td>'.$form->editfieldkey("Label",'label',$object->label,$object,0).'</td><td colspan="3">';
|
||||||
|
print $form->editfieldval("Label",'label',$object->label,$object,0);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print '</div>';
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -168,8 +168,36 @@ if ($object->id > 0)
|
|||||||
print $form->editfieldval("Label",'label',$object->label,$object,0);
|
print $form->editfieldval("Label",'label',$object->label,$object,0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// Status
|
||||||
|
$alreadypaid=$object->getSommePaiement();
|
||||||
|
print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">'.$object->getLibStatut(4,$alreadypaid).'</td></tr>';
|
||||||
|
|
||||||
|
// Amount
|
||||||
|
print '<tr><td>'.$langs->trans('AmountHT').'</td><td colspan="3">'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td colspan="3">'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
|
||||||
|
|
||||||
|
// Amount Local Taxes
|
||||||
|
//TODO: Place into a function to control showing by country or study better option
|
||||||
|
if ($societe->localtax1_assuj=="1") //Localtax1
|
||||||
|
{
|
||||||
|
print '<tr><td>'.$langs->transcountry("AmountLT1",$societe->country_code).'</td>';
|
||||||
|
print '<td align="right">'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>';
|
||||||
|
print '<td colspan="2"> </td></tr>';
|
||||||
|
}
|
||||||
|
if ($societe->localtax2_assuj=="1") //Localtax2
|
||||||
|
{
|
||||||
|
print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>';
|
||||||
|
print '<td align="right" colspan="3">'.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
|
||||||
|
|
||||||
|
print '</table><br>';
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Nb of files
|
// Nb of files
|
||||||
print '<tr><td>'.$langs->trans('NbOfAttachedFiles').'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
print '<tr><td width="30%" class="nowrap">'.$langs->trans('NbOfAttachedFiles').'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('TotalSizeOfAttachedFiles').'</td><td colspan="3">'.$totalsize.' '.$langs->trans('bytes').'</td></tr>';
|
print '<tr><td>'.$langs->trans('TotalSizeOfAttachedFiles').'</td><td colspan="3">'.$totalsize.' '.$langs->trans('bytes').'</td></tr>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user