| '.$langs->trans('AmountVAT').' | '.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).' ';
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index 1da6e0699fc..6f58239c150 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -138,28 +138,60 @@ if ($id > 0 || ! empty($ref))
dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), 0, 'bill');
- /*
- * Facture synthese pour rappel
- */
+ $linkback = ' ' . $langs->trans("BackToList") . '';
+
+ $morehtmlref=' ';
+ // Ref supplier
+ $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
+ $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
+ // Thirdparty
+ $morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $langs->load("projects");
+ $morehtmlref.=' '.$langs->trans('Project') . ' ';
+ if ($user->rights->facture->creer)
+ {
+ if ($action != 'classify')
+ //$morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.=' ';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.=' ';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+ }
+ $morehtmlref.=' ';
+
+ $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);
+
+ print ' ';
+ print ' ';
+
print ' ';
- $linkback = ''.$langs->trans("BackToList").'';
-
- // Reference du facture
- print '| '.$langs->trans("Ref").' | ';
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
- print " | ";
-
- // Ref supplier
- print '| '.$langs->trans("RefSupplier").' | '.$object->ref_supplier.' | ';
- print " \n";
-
- // Third party
- print "| ".$langs->trans("Supplier")." | ";
- print ''.$object->thirdparty->getNomUrl(1,'supplier').' | ';
-
// Type
- print '| '.$langs->trans('Type').' | ';
+ print ' | | '.$langs->trans('Type').' | ';
print $object->getLibType();
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT)
{
@@ -198,33 +230,33 @@ if ($id > 0 || ! empty($ref))
print ' | ';
// Label
- print '| '.$form->editfieldkey("Label",'label',$object->label,$object,0).' | ';
+ print ' | | '.$form->editfieldkey("Label",'label',$object->label,$object,0).' | ';
print $form->editfieldval("Label",'label',$object->label,$object,0);
print ' | ';
// Status
$alreadypaid=$object->getSommePaiement();
- print '| '.$langs->trans('Status').' | '.$object->getLibStatut(4,$alreadypaid).' | ';
+ print '| '.$langs->trans('Status').' | '.$object->getLibStatut(4,$alreadypaid).' | ';
// Amount
- print '| '.$langs->trans('AmountHT').' | '.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).' | ';
- print '| '.$langs->trans('AmountVAT').' | '.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print '| '.$langs->trans('AmountHT').' | '.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print '| '.$langs->trans('AmountVAT').' | '.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).' | ';
// Amount Local Taxes
//TODO: Place into a function to control showing by country or study better option
if ($societe->localtax1_assuj=="1") //Localtax1
{
print '| '.$langs->transcountry("AmountLT1",$societe->country_code).' | ';
- print ''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).' | ';
print ' ';
}
if ($societe->localtax2_assuj=="1") //Localtax2
{
print '| '.$langs->transcountry("AmountLT2",$societe->country_code).' | ';
- print ''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).' | ';
print ' ';
}
- print '| '.$langs->trans('AmountTTC').' | '.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print '| '.$langs->trans('AmountTTC').' | '.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).' | ';
print " ";
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index c9a40f9b590..5b95056e0dc 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2013 Cédric Salvador
+ * Copyright (C) 2016 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -89,6 +90,57 @@ if ($object->id > 0)
{
$head = facturefourn_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), 0, 'bill');
+ $totalpaye = $object->getSommePaiement();
+
+ $linkback = '' . $langs->trans("BackToList") . '';
+
+ $morehtmlref='';
+ // Ref supplier
+ $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
+ $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
+ // Thirdparty
+ $morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $langs->load("projects");
+ $morehtmlref.=' '.$langs->trans('Project') . ' ';
+ if ($user->rights->facture->creer)
+ {
+ if ($action != 'classify')
+ //$morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.=' ';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.=' ';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+ }
+ $morehtmlref.=' ';
+
+ $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);
+
+ print '';
+ print ' ';
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
@@ -109,23 +161,8 @@ if ($object->id > 0)
print ' ';
- $linkback = ''.$langs->trans("BackToList").'';
-
- // Ref
- print '| '.$langs->trans("Ref").' | ';
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
- print ' | ';
- print " \n";
-
- // Ref supplier
- print '| '.$langs->trans("RefSupplier").' | '.$object->ref_supplier.' | ';
- print " \n";
-
- // Thirdparty
- print '| '.$langs->trans('Supplier').' | '.$object->thirdparty->getNomUrl(1,'supplier').' | ';
-
// Type
- print '| '.$langs->trans('Type').' | ';
+ print ' | | '.$langs->trans('Type').' | ';
print $object->getLibType();
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT)
{
@@ -166,42 +203,38 @@ if ($object->id > 0)
print ' | ';
// Label
- print '| '.$form->editfieldkey("Label",'label',$object->label,$object,0).' | ';
+ print ' | | '.$form->editfieldkey("Label",'label',$object->label,$object,0).' | ';
print $form->editfieldval("Label",'label',$object->label,$object,0);
print ' | ';
- // Status
- $alreadypaid=$object->getSommePaiement();
- print ' | '.$langs->trans('Status').' | '.$object->getLibStatut(4,$alreadypaid).' | ';
-
// Amount
- print '| '.$langs->trans('AmountHT').' | '.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).' | ';
- print '| '.$langs->trans('AmountVAT').' | '.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print '| '.$langs->trans('AmountHT').' | '.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print '| '.$langs->trans('AmountVAT').' | '.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).' | ';
// Amount Local Taxes
//TODO: Place into a function to control showing by country or study better option
if ($societe->localtax1_assuj=="1") //Localtax1
{
print '| '.$langs->transcountry("AmountLT1",$societe->country_code).' | ';
- print ''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).' | ';
print ' ';
}
if ($societe->localtax2_assuj=="1") //Localtax2
{
print '| '.$langs->transcountry("AmountLT2",$societe->country_code).' | ';
- print ''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).' | ';
print ' ';
}
- print '| '.$langs->trans('AmountTTC').' | '.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print '| '.$langs->trans('AmountTTC').' | '.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).' | ';
print ' ';
print ' ';
// Nb of files
- print '| '.$langs->trans('NbOfAttachedFiles').' | '.count($filearray).' | ';
+ print '| '.$langs->trans('NbOfAttachedFiles').' | '.count($filearray).' | ';
- print '| '.$langs->trans('TotalSizeOfAttachedFiles').' | '.$totalsize.' '.$langs->trans('bytes').' | ';
+ print '| '.$langs->trans('TotalSizeOfAttachedFiles').' | '.$totalsize.' '.$langs->trans('bytes').' | ';
print ' ';
print ' ';
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index 590d5ea75bd..db89ff22a50 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville
* Copyright (C) 2004-2006 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
+ * Copyright (C) 2016 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,8 +27,8 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load('bills');
@@ -57,6 +58,58 @@ $head = facturefourn_prepare_head($object);
$titre=$langs->trans('SupplierInvoice');
dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), 0, 'bill');
+$linkback = '' . $langs->trans("BackToList") . '';
+
+$morehtmlref='';
+// Ref supplier
+$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
+$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
+// Thirdparty
+// $morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+// Project
+if (! empty($conf->projet->enabled))
+{
+ $langs->load("projects");
+ $morehtmlref.=' '.$langs->trans('Project') . ' ';
+ if ($user->rights->facture->creer)
+ {
+ if ($action != 'classify')
+ //$morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.=' ';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.=' ';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+}
+$morehtmlref.=' ';
+
+$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);
+
+print '';
+print ' ';
+
+print ' ';
+
print ' | ';
dol_print_object_info($object);
print ' |
';
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index eeb9d37f2fd..0ec9d519e06 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -82,23 +82,59 @@ if ($object->id > 0)
print ' ';
- $linkback = ''.$langs->trans("BackToList").'';
+ // Supplier invoice card
+ $linkback = ''.$langs->trans("BackToList").'';
- // Ref
- print '| '.$langs->trans("Ref").' | ';
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
- print ' | ';
- print " \n";
+ $morehtmlref='';
+ // Ref supplier
+ $morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
+ $morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', null, null, '', 1);
+ // Thirdparty
+ $morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $langs->load("projects");
+ $morehtmlref.=' '.$langs->trans('Project') . ' ';
+ if ($user->rights->fournisseur->commande->creer)
+ {
+ if ($action != 'classify')
+ // $morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.=' : ';
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref.=' ';
+ } else {
+ $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (! empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref.=' ';
+ $morehtmlref.=$proj->ref;
+ $morehtmlref.='';
+ } else {
+ $morehtmlref.='';
+ }
+ }
+ }
+ $morehtmlref.=' ';
- // Ref supplier
- print '| '.$langs->trans("RefSupplier").' | '.$object->ref_supplier.' | ';
- print " \n";
+ $object->totalpaye = $alreadypaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
- // Company
- print '| '.$langs->trans('Supplier').' | '.$object->thirdparty->getNomUrl(1,'supplier').' | ';
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+ print '';
+ print ' ';
// Type
- print ' | '.$langs->trans('Type').' | ';
+ print ' | | '.$langs->trans('Type').' | ';
print $object->getLibType();
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT)
{
@@ -137,38 +173,35 @@ if ($object->id > 0)
print ' | ';
// Label
- print ' | '.$form->editfieldkey("Label",'label',$object->label,$object,0).' | ';
+ print ' | | '.$form->editfieldkey("Label",'label',$object->label,$object,0).' | ';
print $form->editfieldval("Label",'label',$object->label,$object,0);
print ' | ';
- // Status
- $alreadypaid=$object->getSommePaiement();
- print ' | '.$langs->trans('Status').' | '.$object->getLibStatut(4,$alreadypaid).' | ';
-
// Amount
- print ' | '.$langs->trans('AmountHT').' | '.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).' | ';
- print ' | '.$langs->trans('AmountVAT').' | '.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ' | '.$langs->trans('AmountHT').' | '.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ' | '.$langs->trans('AmountVAT').' | '.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).' | ';
// Amount Local Taxes
//TODO: Place into a function to control showing by country or study better option
if ($societe->localtax1_assuj=="1") //Localtax1
{
print ' | '.$langs->transcountry("AmountLT1",$societe->country_code).' | ';
- print ''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).' | ';
print ' ';
}
if ($societe->localtax2_assuj=="1") //Localtax2
{
print ' | '.$langs->transcountry("AmountLT2",$societe->country_code).' | ';
- print ''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).' | ';
print ' ';
}
- print ' | '.$langs->trans('AmountTTC').' | '.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).' | ';
+ print ' | '.$langs->trans('AmountTTC').' | '.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).' | ';
print " ";
print ' ';
+ $cssclass="titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
dol_fiche_end();
diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php
index 55f2c2257bb..87bd25fbe3b 100644
--- a/htdocs/loan/info.php
+++ b/htdocs/loan/info.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2014-2016 Alexandre Spangaro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -70,6 +70,8 @@ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0,
print '';
print ' ';
+print ' ';
+
print ' | ';
dol_print_object_info($object);
print ' |
';
diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php
index e88f94e4287..9ca7f1fcd2a 100644
--- a/htdocs/societe/note.php
+++ b/htdocs/societe/note.php
@@ -58,7 +58,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
$form = new Form($db);
$title=$langs->trans("ThirdParty").' - '.$langs->trans("Notes");
-if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Files");
+if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Notes");
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$title,$help_url);
|