Status and amount of object should always be visible.

This commit is contained in:
Laurent Destailleur 2015-04-06 16:13:23 +02:00
parent 683f27f6b1
commit b49705d5d0
7 changed files with 97 additions and 24 deletions

View File

@ -3004,7 +3004,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
$cursymbolafter.=($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur); $cursymbolafter.=($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur);
} }
} }
$output=$cursymbolbefore.$output.$end.$cursymbolafter; $output=$cursymbolbefore.$output.$end.($cursymbolafter?' ':'').$cursymbolafter;
return $output; return $output;
} }

View File

@ -1434,7 +1434,7 @@ class FactureFournisseur extends CommonInvoice
} }
$this->date_creation = $obj->datec; $this->date_creation = $obj->datec;
$this->date_modification = $obj->datem; $this->date_modification = $obj->datem;
//$this->date_validation = $obj->datev; Should be stored in log table //$this->date_validation = $obj->datev; // This field is not available. Should be store into log table and using this function should be replaced with showing content of log (like for supplier orders)
} }
$this->db->free($result); $this->db->free($result);
} }

View File

@ -1964,8 +1964,9 @@ else
$alreadypaid=$object->getSommePaiement(); $alreadypaid=$object->getSommePaiement();
print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">'.$object->getLibStatut(4,$alreadypaid).'</td></tr>'; print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">'.$object->getLibStatut(4,$alreadypaid).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountHT').'</td><td align="right">'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">&nbsp;</td></tr>'; // Amount
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">'; 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>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">';
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha'); if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal'); else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
if ($calculationrule == 'totalofround') $calculationrulenum=1; if ($calculationrule == 'totalofround') $calculationrulenum=1;
@ -1982,16 +1983,16 @@ else
if ($societe->localtax1_assuj=="1") //Localtax1 if ($societe->localtax1_assuj=="1") //Localtax1
{ {
print '<tr><td>'.$langs->transcountry("AmountLT1",$societe->country_code).'</td>'; 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="3">'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>';
print '<td colspan="2">&nbsp;</td></tr>'; print '</tr>';
} }
if ($societe->localtax2_assuj=="1") //Localtax2 if ($societe->localtax2_assuj=="1") //Localtax2
{ {
print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>'; print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>';
print '<td align="right">'.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'</td>'; print '<td colspan="3">'.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).'</td>';
print '<td colspan="2">&nbsp;</td></tr>'; print '</tr>';
} }
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="3">'.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
// Project // Project
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled))

View File

@ -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-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2015 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
@ -200,6 +200,30 @@ 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 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 colspan="3">'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>';
print '</tr>';
}
if ($societe->localtax2_assuj=="1") //Localtax2
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>';
print '<td 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>"; print "</table>";
dol_fiche_end(); dol_fiche_end();

View File

@ -168,6 +168,30 @@ 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 colspan="3">'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>';
print '</tr>';
}
if ($societe->localtax2_assuj=="1") //Localtax2
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>';
print '<td 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><br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -31,11 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
$langs->load('bills'); $langs->load('bills');
$facid = isset($_GET["facid"])?$_GET["facid"]:''; $id = GETPOST("facid",'int');
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $facid, 'facture_fourn', 'facture'); $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
@ -45,22 +45,22 @@ $result = restrictedArea($user, 'fournisseur', $facid, 'facture_fourn', 'facture
llxHeader(); llxHeader();
$fac = new FactureFournisseur($db); $object = new FactureFournisseur($db);
$fac->fetch($_GET["facid"]); $object->fetch($id);
$fac->info($_GET["facid"]); $object->info($id);
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($fac->socid); $soc->fetch($object->socid);
$head = facturefourn_prepare_head($fac); $head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice'); $titre=$langs->trans('SupplierInvoice');
dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), 0, 'bill'); dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), 0, 'bill');
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';
dol_print_object_info($fac); dol_print_object_info($object);
print '</td></tr></table>'; print '</td></tr></table>';
print '</div>'; print '</div>';
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -139,6 +139,30 @@ if ($object->id > 0)
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 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 colspan="3">'.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).'</td>';
print '</tr>';
}
if ($societe->localtax2_assuj=="1") //Localtax2
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$societe->country_code).'</td>';
print '<td 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>"; print "</table>";
print '<br>'; print '<br>';