diff --git a/ChangeLog b/ChangeLog
index 66e4a8cfd89..db9fc3b9f8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.4 compared to 3.3 *****
For users:
+- New: Support revenue stamp onto invoices.
- New: Add a tab "consumption" on thirdparties to list products bought/sells.
- New: Some performance enhancements.
- New: Can attach files onto trip and expenses modules.
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 55ad5902e13..55a8a8b8b60 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -547,7 +547,7 @@ if ($action == 'edit' || $action == 'updateedit')
/*
* Local Taxes
*/
- if ($mysoc->hasLocalTax(1))
+ if ($mysoc->useLocalTax(1))
{
// Local Tax 1
print '
';
@@ -579,7 +579,7 @@ if ($action == 'edit' || $action == 'updateedit')
print "\n";
print "";
}
- if ($mysoc->hasLocalTax(2))
+ if ($mysoc->useLocalTax(2))
{
// Local Tax 2
print '
';
@@ -927,7 +927,7 @@ else
/*
* Local Taxes
*/
- if ($mysoc->hasLocalTax(1))
+ if ($mysoc->useLocalTax(1))
{
// Local Tax 1
print '
';
@@ -960,7 +960,7 @@ else
print "";
}
- if ($mysoc->hasLocalTax(2))
+ if ($mysoc->useLocalTax(2))
{
// Local Tax 2
print '
';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index aa6f3cfec07..f792d7c6e20 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -377,22 +377,22 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
$object->fetch_thirdparty();
// Check parameters
-
+
// Check for mandatory prof id
for ($i = 1; $i < 5; $i++)
{
-
+
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_INVOICE_MANDATORY';
$idprof='idprof'.$i;
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory))
{
if (! $error) $langs->load("errors");
$error++;
-
+
setEventMessage($langs->trans('ErrorProdIdIsMandatory',$langs->transcountry('ProfId'.$i, $object->thirdparty->country_code)),'errors');
}
- }
-
+ }
+
//Check for warehouse
if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1))
{
@@ -403,7 +403,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
$action='';
}
}
-
+
if (! $error)
{
$result = $object->validate($user,'',$idwarehouse);
@@ -625,7 +625,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
$db->begin();
$error=0;
-
+
// Get extra fields
foreach($_POST as $key => $value)
{
@@ -1638,7 +1638,7 @@ else if ($action == 'builddoc') // En get ou en post
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model'));
if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank');
-
+
// Define output language
$outputlangs = $langs;
$newlang='';
@@ -2280,10 +2280,10 @@ else if ($id > 0 || ! empty($ref))
*/
$result=$object->fetch($id,$ref);
-
+
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('facture');
-
+
if ($result > 0)
{
if ($user->societe_id>0 && $user->societe_id!=$object->socid) accessforbidden('',0);
@@ -2292,11 +2292,12 @@ else if ($id > 0 || ! empty($ref))
$soc = new Societe($db);
$soc->fetch($object->socid);
+ $selleruserevenustamp=$mysoc->useRevenueStamp();
$totalpaye = $object->getSommePaiement();
$totalcreditnotes = $object->getSumCreditNotesUsed();
$totaldeposits = $object->getSumDepositsUsed();
- //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits;
+ //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits." selleruserrevenuestamp=".$selleruserevenustamp;
// We can also use bcadd to avoid pb with floating points
// For example print 239.2 - 229.3 - 9.9; does not return 0.
@@ -2753,7 +2754,6 @@ else if ($id > 0 || ! empty($ref))
/*
* List of payments
*/
- $selleruserevenustamp=empty($conf->global->MAIN_USE_REVENUE_STAMP)?0:1; // TODO Add method societe->useRevenueStamp() to look into table llx_c_revenue_stamp if there is one line for country
$sign=1;
if ($object->type == 2) $sign=-1;
@@ -2764,7 +2764,7 @@ else if ($id > 0 || ! empty($ref))
if($mysoc->localtax1_assuj=="1") $nbrows++;
if($mysoc->localtax2_assuj=="1") $nbrows++;
if ($selleruserevenustamp) $nbrows++;
-
+
print '
| '.$langs->transcountry("AmountLT1",$mysoc->country_code).' | '; print ''.price($object->total_localtax1,1,'',1,-1,-1,$conf->currency).' | ||
| '.$langs->transcountry("AmountLT2",$mysoc->country_code).' | '; print ''.price($object->total_localtax2,1,'',1,-1,-1,$conf->currency).' | ||
| '.$langs->trans('AmountTTC').' | '.price($object->total_ttc,1,'',1,-1,-1,$conf->currency).' | ||