';
print '| ';
diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php
index 4e49b7bbbbd..54fdaef111b 100644
--- a/htdocs/comm/mailing/list.php
+++ b/htdocs/comm/mailing/list.php
@@ -156,7 +156,7 @@ if ($result)
$newcardbutton='';
if ($user->rights->mailing->creer)
{
- $newcardbutton=''.$langs->trans('NewMailing').'';
+ $newcardbutton=''.$langs->trans('NewMailing').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 75fa9117230..4a0a9afce95 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1039,7 +1039,8 @@ if (empty($reshook))
$desc = $prod->description;
}
- $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
+ if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc;
+ else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
// Add dimensions into product description
/*if (empty($conf->global->MAIN_PRODUCT_DISABLE_AUTOADD_DIM))
@@ -1590,7 +1591,7 @@ if ($action == 'create')
});
';
}
- print ' '.$langs->trans("AddThirdParty").' ';
+ print ' '.$langs->trans("AddThirdParty").'';
print ' | ';
}
print ' ' . "\n";
@@ -1677,7 +1678,7 @@ if ($action == 'create')
print '';
print '| ' . $langs->trans("Project") . ' | ';
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
- print ' id).'">' . $langs->trans("AddProject") . ' ';
+ print ' id).'">' . $langs->trans("AddProject") . '';
print ' | ';
print ' ';
}
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 0b3179bd239..2a1d1b5b577 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -438,7 +438,7 @@ if ($resql)
$newcardbutton='';
if ($user->rights->propal->creer)
{
- $newcardbutton=''.$langs->trans('NewPropal').'';
+ $newcardbutton=''.$langs->trans('NewPropal').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
old mode 100644
new mode 100755
index f85870bd6f1..bdd17ad217f
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -5,7 +5,7 @@
* Copyright (C) 2005-2015 Regis Houssin
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2010-2013 Juanjo Menent
- * Copyright (C) 2011-2018 Philippe Grand
+ * Copyright (C) 2011-2019 Philippe Grand
* Copyright (C) 2012-2013 Christophe Battarel
* Copyright (C) 2012-2016 Marcos GarcĂa
* Copyright (C) 2012 Cedric Salvador
@@ -868,7 +868,8 @@ if (empty($reshook))
$desc = $prod->description;
}
- $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
+ if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc;
+ else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
@@ -1636,7 +1637,7 @@ if ($action == 'create' && $user->rights->commande->creer)
});
';
}
- print ' '.$langs->trans("AddThirdParty").' ';
+ print ' '.$langs->trans("AddThirdParty").'';
print '';
}
print '' . "\n";
@@ -1674,7 +1675,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print $form->selectDate($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1);
print "";
- // Conditions de reglement
+ // terms of the settlement
print '| ' . $langs->trans('PaymentConditionsShort') . ' | ';
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1);
print ' | ';
@@ -1727,7 +1728,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '';
print '| ' . $langs->trans("Project") . ' | ';
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0);
- print ' id).'">' . $langs->trans("AddProject") . ' ';
+ print ' id).'">' . $langs->trans("AddProject") . '';
print ' | ';
print ' ';
}
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index c20abf44fe2..f42289c1c4b 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2016 Laurent Destailleur
+ * Copyright (C) 2004-2019 Laurent Destailleur
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2012 Juanjo Menent
@@ -441,7 +441,7 @@ if ($resql)
$newcardbutton='';
if ($contextpage == 'orderlist' && $user->rights->commande->creer)
{
- $newcardbutton=''.$langs->trans('NewOrder').'';
+ $newcardbutton=''.$langs->trans('NewOrder').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index 68354d1961f..1304c3ce75d 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -757,11 +757,11 @@ if ($resql)
if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments
{
if ($user->rights->banque->modifier) {
- $newcardbutton = ''.$langs->trans("AddBankRecord").'';
+ $newcardbutton = ''.$langs->trans("AddBankRecord").'';
$newcardbutton.= '';
$newcardbutton.= '';
} else {
- $newcardbutton = ''.$langs->trans("AddBankRecord");
+ $newcardbutton = ''.$langs->trans("AddBankRecord").'';
$newcardbutton.= '';
$newcardbutton.= '';
}
@@ -769,11 +769,11 @@ if ($resql)
else // If direct entries is not done using miscellaneous payments
{
if ($user->rights->banque->modifier) {
- $newcardbutton = ''.$langs->trans("AddBankRecord");
+ $newcardbutton = ''.$langs->trans("AddBankRecord").'';
$newcardbutton.= '';
$newcardbutton.= '';
} else {
- $newcardbutton = ''.$langs->trans("AddBankRecord");
+ $newcardbutton = ''.$langs->trans("AddBankRecord").'';
$newcardbutton.= '';
$newcardbutton.= '';
}
@@ -781,7 +781,7 @@ if ($resql)
}
else
{
- $newcardbutton = ''.$langs->trans("AddBankRecord");
+ $newcardbutton = ''.$langs->trans("AddBankRecord").'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php
index b0a7f546297..8cc396f3bc1 100644
--- a/htdocs/compta/bank/list.php
+++ b/htdocs/compta/bank/list.php
@@ -227,7 +227,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->banque->configurer)
{
- $newcardbutton.=''.$langs->trans("NewFinancialAccount").'';
+ $newcardbutton.=''.$langs->trans("NewFinancialAccount").'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php
index b3624e274f2..8be0b075e40 100644
--- a/htdocs/compta/bank/various_payment/list.php
+++ b/htdocs/compta/bank/various_payment/list.php
@@ -157,7 +157,7 @@ if ($result)
$newcardbutton='';
if ($user->rights->banque->modifier)
{
- $newcardbutton=''.$langs->trans('MenuNewVariousPayment').'';
+ $newcardbutton=''.$langs->trans('MenuNewVariousPayment').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php
index 89b66531eec..71be539f974 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_list.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_list.php
@@ -337,7 +337,7 @@ print '';
$newcardbutton='';
//if ($user->rights->monmodule->creer)
//{
-$newcardbutton=''.$langs->trans('New').'';
+$newcardbutton=''.$langs->trans('New').'';
$newcardbutton.= '';
$newcardbutton.= '';
//}
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
old mode 100644
new mode 100755
index ce6a8610a1f..2f4116e938f
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -1844,7 +1844,8 @@ if (empty($reshook))
$desc = $prod->description;
}
- $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
+ if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc= $product_desc;
+ else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
@@ -2697,7 +2698,7 @@ if ($action == 'create')
});
';
}
- print ' '.$langs->trans("AddThirdParty").' ';
+ print ' '.$langs->trans("AddThirdParty").'';
print '';
}
print '' . "\n";
@@ -3093,7 +3094,7 @@ if ($action == 'create')
$langs->load('projects');
print '| ' . $langs->trans('Project') . ' | ';
$numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1);
- print ' id.($fac_rec?'&fac_rec='.$fac_rec:'')).'">' . $langs->trans("AddProject") . ' ';
+ print ' id.($fac_rec?'&fac_rec='.$fac_rec:'')).'">' . $langs->trans("AddProject") . '';
print ' | ';
}
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 39978cd82d1..749a0b28cfb 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -594,7 +594,7 @@ if ($resql)
$newcardbutton='';
if($user->rights->facture->creer)
{
- $newcardbutton=''.$langs->trans('NewBill').'';
+ $newcardbutton=''.$langs->trans('NewBill').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php
index 8d02d8390dd..184c9600926 100644
--- a/htdocs/compta/localtax/list.php
+++ b/htdocs/compta/localtax/list.php
@@ -45,7 +45,7 @@ $localtax_static = new Localtax($db);
$newcardbutton='';
if ($user->rights->tax->charges->creer)
{
- $newcardbutton=''.$langs->trans('NewLocalTaxPayment', ($ltt+1)).'';
+ $newcardbutton=''.$langs->trans('NewLocalTaxPayment', ($ltt+1)).'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index 6e86ecf14b6..0107ba60383 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -138,7 +138,7 @@ if ($resql)
$newcardbutton='';
if ($user->rights->banque->cheque)
{
- $newcardbutton = ''.$langs->trans('NewCheckDeposit').'';
+ $newcardbutton = ''.$langs->trans('NewCheckDeposit').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php
index fcd48a6a305..49f44af1702 100644
--- a/htdocs/compta/prelevement/bons.php
+++ b/htdocs/compta/prelevement/bons.php
@@ -108,7 +108,7 @@ if ($result)
$newcardbutton='';
if ($user->rights->prelevement->bons->creer)
{
- $newcardbutton = ''.$langs->trans('NewStandingOrder').'';
+ $newcardbutton = ''.$langs->trans('NewStandingOrder').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/salaries/list.php b/htdocs/compta/salaries/list.php
index e0fb1b38636..6ce49536d20 100644
--- a/htdocs/compta/salaries/list.php
+++ b/htdocs/compta/salaries/list.php
@@ -150,7 +150,7 @@ if ($result)
$newcardbutton='';
if (! empty($user->rights->salaries->write))
{
- $newcardbutton=''.$langs->trans('NewSalaryPayment').'';
+ $newcardbutton=''.$langs->trans('NewSalaryPayment').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php
index 8a8cc1f61b8..f5e88c7fb29 100644
--- a/htdocs/compta/sociales/list.php
+++ b/htdocs/compta/sociales/list.php
@@ -152,7 +152,7 @@ if ($resql)
$newcardbutton='';
if($user->rights->tax->charges->creer)
{
- $newcardbutton=''.$langs->trans('MenuNewSocialContribution');
+ $newcardbutton=''.$langs->trans('MenuNewSocialContribution').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php
index e3539620351..e0775313dd3 100644
--- a/htdocs/compta/tva/clients.php
+++ b/htdocs/compta/tva/clients.php
@@ -47,36 +47,36 @@ $langs->loadLangs(array("other","compta","banks","bills","companies","product","
$year=GETPOST("year", "int");
if (empty($year))
{
- $year_current = strftime("%Y", dol_now());
- $year_start = $year_current;
+ $year_current = strftime("%Y", dol_now());
+ $year_start = $year_current;
} else {
- $year_current = $year;
- $year_start = $year;
+ $year_current = $year;
+ $year_start = $year;
}
$date_start=dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"));
$date_end=dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"));
// Quarter
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
{
- $q=GETPOST("q");
- if (empty($q))
- {
- if (GETPOST("month")) { $date_start=dol_get_first_day($year_start, GETPOST("month"), false); $date_end=dol_get_last_day($year_start, GETPOST("month"), false); }
- else
- {
- $date_start=dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START, false);
- if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1;
- elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
- elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
- }
- }
- else
- {
- if ($q==1) { $date_start=dol_get_first_day($year_start, 1, false); $date_end=dol_get_last_day($year_start, 3, false); }
- if ($q==2) { $date_start=dol_get_first_day($year_start, 4, false); $date_end=dol_get_last_day($year_start, 6, false); }
- if ($q==3) { $date_start=dol_get_first_day($year_start, 7, false); $date_end=dol_get_last_day($year_start, 9, false); }
- if ($q==4) { $date_start=dol_get_first_day($year_start, 10, false); $date_end=dol_get_last_day($year_start, 12, false); }
- }
+ $q=GETPOST("q");
+ if (empty($q))
+ {
+ if (GETPOST("month", 'int')) { $date_start=dol_get_first_day($year_start, GETPOST("month", 'int'), false); $date_end=dol_get_last_day($year_start, GETPOST("month", 'int'), false); }
+ else
+ {
+ $date_start=dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START, false);
+ if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
+ }
+ }
+ else
+ {
+ if ($q==1) { $date_start=dol_get_first_day($year_start, 1, false); $date_end=dol_get_last_day($year_start, 3, false); }
+ if ($q==2) { $date_start=dol_get_first_day($year_start, 4, false); $date_end=dol_get_last_day($year_start, 6, false); }
+ if ($q==3) { $date_start=dol_get_first_day($year_start, 7, false); $date_end=dol_get_last_day($year_start, 9, false); }
+ if ($q==4) { $date_start=dol_get_first_day($year_start, 10, false); $date_end=dol_get_last_day($year_start, 12, false); }
+ }
}
$min = price2num(GETPOST("min", "alpha"));
@@ -113,12 +113,12 @@ $morequerystring='';
$listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday');
foreach ($listofparams as $param)
{
- if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
+ if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
}
$special_report = false;
if (isset($_REQUEST['extra_report']) && $_REQUEST['extra_report'] == 1) {
- $special_report = true;
+ $special_report = true;
}
llxHeader('', $langs->trans("VATReport"), '', '', 0, 0, '', '', $morequerystring);
@@ -141,7 +141,7 @@ $period=$form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$f
$prevyear=$year_start;
$prevquarter=$q;
if ($prevquarter > 1) {
- $prevquarter--;
+ $prevquarter--;
} else {
$prevquarter=4;
$prevyear--;
@@ -149,7 +149,7 @@ if ($prevquarter > 1) {
$nextyear=$year_start;
$nextquarter=$q;
if ($nextquarter < 4) {
- $nextquarter++;
+ $nextquarter++;
} else {
$nextquarter=1;
$nextyear++;
@@ -161,7 +161,7 @@ if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->tra
if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') $description.=' '.$langs->trans("RulesVATDueServices");
if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.=' '.$langs->trans("RulesVATInServices");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
- $description.=' '.$langs->trans("DepositsAreNotIncluded");
+ $description.=' '.$langs->trans("DepositsAreNotIncluded");
}
if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.=' '.$langs->trans("ThisIsAnEstimatedValue");
@@ -169,15 +169,15 @@ if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.=' '.$langs-
$description.=$fsearch;
if (! empty($conf->global->TAX_REPORT_EXTRA_REPORT))
{
- $description.=' '
- . ' '
- . $langs->trans('SimpleReport')
- . ''
- . ' '
- . ' '
- . $langs->trans('AddExtraReport')
- . ''
- . ' ';
+ $description.=' '
+ . ' '
+ . $langs->trans('SimpleReport')
+ . ''
+ . ' '
+ . ' '
+ . $langs->trans('AddExtraReport')
+ . ''
+ . ' ';
}
$elementcust=$langs->trans("CustomersInvoices");
@@ -185,13 +185,13 @@ $productcust=$langs->trans("Description");
$namerate=$langs->trans("VATRate");
$amountcust=$langs->trans("AmountHT");
if ($mysoc->tva_assuj) {
- $vatcust.=' ('.$langs->trans("ToPay").')';
+ $vatcust.=' ('.$langs->trans("ToPay").')';
}
$elementsup=$langs->trans("SuppliersInvoices");
$productsup=$langs->trans("Description");
$amountsup=$langs->trans("AmountHT");
if ($mysoc->tva_assuj) {
- $vatsup.=' ('.$langs->trans("ToGetBack").')';
+ $vatsup.=' ('.$langs->trans("ToGetBack").')';
}
report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
@@ -214,546 +214,536 @@ $x_paye = tax_by_thirdparty('vat', $db, 0, $date_start, $date_end, $modetax, 'bu
if (! is_array($x_coll) || ! is_array($x_paye))
{
- $langs->load("errors");
- if ($x_coll == -1) {
- print '| ' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ' | ';
- } elseif ($x_coll == -2) {
- print '| ' . $langs->trans("FeatureNotYetAvailable") . ' | ';
- } else {
- print '| ' . $langs->trans("Error") . ' | ';
- }
+ $langs->load("errors");
+ if ($x_coll == -1) {
+ print '| ' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ' | ';
+ } elseif ($x_coll == -2) {
+ print '| ' . $langs->trans("FeatureNotYetAvailable") . ' | ';
+ } else {
+ print '| ' . $langs->trans("Error") . ' | ';
+ }
} else {
- $x_both = array();
- //now, from these two arrays, get another array with one rate per line
- foreach(array_keys($x_coll) as $my_coll_thirdpartyid)
- {
- $x_both[$my_coll_thirdpartyid]['coll']['totalht'] = $x_coll[$my_coll_thirdpartyid]['totalht'];
- $x_both[$my_coll_thirdpartyid]['coll']['vat'] = $x_coll[$my_coll_thirdpartyid]['vat'];
- $x_both[$my_coll_thirdpartyid]['paye']['totalht'] = 0;
- $x_both[$my_coll_thirdpartyid]['paye']['vat'] = 0;
- $x_both[$my_coll_thirdpartyid]['coll']['links'] = '';
- $x_both[$my_coll_thirdpartyid]['coll']['detail'] = array();
- foreach($x_coll[$my_coll_thirdpartyid]['facid'] as $id=>$dummy) {
- $invoice_customer->id=$x_coll[$my_coll_thirdpartyid]['facid'][$id];
- $invoice_customer->ref=$x_coll[$my_coll_thirdpartyid]['facnum'][$id];
- $invoice_customer->type=$x_coll[$my_coll_thirdpartyid]['type'][$id];
- $company_static->fetch($x_coll[$my_coll_thirdpartyid]['company_id'][$id]);
- $x_both[$my_coll_thirdpartyid]['coll']['detail'][] = array(
- 'id' =>$x_coll[$my_coll_thirdpartyid]['facid'][$id],
- 'descr' =>$x_coll[$my_coll_thirdpartyid]['descr'][$id],
- 'pid' =>$x_coll[$my_coll_thirdpartyid]['pid'][$id],
- 'pref' =>$x_coll[$my_coll_thirdpartyid]['pref'][$id],
- 'ptype' =>$x_coll[$my_coll_thirdpartyid]['ptype'][$id],
- 'payment_id'=>$x_coll[$my_coll_thirdpartyid]['payment_id'][$id],
- 'payment_amount'=>$x_coll[$my_coll_thirdpartyid]['payment_amount'][$id],
- 'ftotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['ftotal_ttc'][$id],
- 'dtotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['dtotal_ttc'][$id],
- 'dtype' =>$x_coll[$my_coll_thirdpartyid]['dtype'][$id],
- 'drate' =>$x_coll[$my_coll_thirdpartyid]['drate'][$id],
- 'datef' =>$x_coll[$my_coll_thirdpartyid]['datef'][$id],
- 'datep' =>$x_coll[$my_coll_thirdpartyid]['datep'][$id],
- 'company_link'=>$company_static->getNomUrl(1, '', 20),
- 'ddate_start'=>$x_coll[$my_coll_thirdpartyid]['ddate_start'][$id],
- 'ddate_end' =>$x_coll[$my_coll_thirdpartyid]['ddate_end'][$id],
- 'totalht' =>$x_coll[$my_coll_thirdpartyid]['totalht_list'][$id],
- 'vat' =>$x_coll[$my_coll_thirdpartyid]['vat_list'][$id],
- 'link' =>$invoice_customer->getNomUrl(1, '', 12)
- );
- }
- }
- // tva paid
- foreach (array_keys($x_paye) as $my_paye_thirdpartyid) {
- $x_both[$my_paye_thirdpartyid]['paye']['totalht'] = $x_paye[$my_paye_thirdpartyid]['totalht'];
- $x_both[$my_paye_thirdpartyid]['paye']['vat'] = $x_paye[$my_paye_thirdpartyid]['vat'];
- if (!isset($x_both[$my_paye_thirdpartyid]['coll']['totalht'])) {
- $x_both[$my_paye_thirdpartyid]['coll']['totalht'] = 0;
- $x_both[$my_paye_thirdpartyid]['coll']['vat'] = 0;
- }
- $x_both[$my_paye_thirdpartyid]['paye']['links'] = '';
- $x_both[$my_paye_thirdpartyid]['paye']['detail'] = array();
+ $x_both = array();
+ //now, from these two arrays, get another array with one rate per line
+ foreach(array_keys($x_coll) as $my_coll_thirdpartyid)
+ {
+ $x_both[$my_coll_thirdpartyid]['coll']['totalht'] = $x_coll[$my_coll_thirdpartyid]['totalht'];
+ $x_both[$my_coll_thirdpartyid]['coll']['vat'] = $x_coll[$my_coll_thirdpartyid]['vat'];
+ $x_both[$my_coll_thirdpartyid]['paye']['totalht'] = 0;
+ $x_both[$my_coll_thirdpartyid]['paye']['vat'] = 0;
+ $x_both[$my_coll_thirdpartyid]['coll']['links'] = '';
+ $x_both[$my_coll_thirdpartyid]['coll']['detail'] = array();
+ foreach($x_coll[$my_coll_thirdpartyid]['facid'] as $id=>$dummy) {
+ $invoice_customer->id=$x_coll[$my_coll_thirdpartyid]['facid'][$id];
+ $invoice_customer->ref=$x_coll[$my_coll_thirdpartyid]['facnum'][$id];
+ $invoice_customer->type=$x_coll[$my_coll_thirdpartyid]['type'][$id];
+ $company_static->fetch($x_coll[$my_coll_thirdpartyid]['company_id'][$id]);
+ $x_both[$my_coll_thirdpartyid]['coll']['detail'][] = array(
+ 'id' =>$x_coll[$my_coll_thirdpartyid]['facid'][$id],
+ 'descr' =>$x_coll[$my_coll_thirdpartyid]['descr'][$id],
+ 'pid' =>$x_coll[$my_coll_thirdpartyid]['pid'][$id],
+ 'pref' =>$x_coll[$my_coll_thirdpartyid]['pref'][$id],
+ 'ptype' =>$x_coll[$my_coll_thirdpartyid]['ptype'][$id],
+ 'payment_id'=>$x_coll[$my_coll_thirdpartyid]['payment_id'][$id],
+ 'payment_amount'=>$x_coll[$my_coll_thirdpartyid]['payment_amount'][$id],
+ 'ftotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['ftotal_ttc'][$id],
+ 'dtotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['dtotal_ttc'][$id],
+ 'dtype' =>$x_coll[$my_coll_thirdpartyid]['dtype'][$id],
+ 'drate' =>$x_coll[$my_coll_thirdpartyid]['drate'][$id],
+ 'datef' =>$x_coll[$my_coll_thirdpartyid]['datef'][$id],
+ 'datep' =>$x_coll[$my_coll_thirdpartyid]['datep'][$id],
+ 'company_link'=>$company_static->getNomUrl(1, '', 20),
+ 'ddate_start'=>$x_coll[$my_coll_thirdpartyid]['ddate_start'][$id],
+ 'ddate_end' =>$x_coll[$my_coll_thirdpartyid]['ddate_end'][$id],
+ 'totalht' =>$x_coll[$my_coll_thirdpartyid]['totalht_list'][$id],
+ 'vat' =>$x_coll[$my_coll_thirdpartyid]['vat_list'][$id],
+ 'link' =>$invoice_customer->getNomUrl(1, '', 12)
+ );
+ }
+ }
+ // tva paid
+ foreach (array_keys($x_paye) as $my_paye_thirdpartyid) {
+ $x_both[$my_paye_thirdpartyid]['paye']['totalht'] = $x_paye[$my_paye_thirdpartyid]['totalht'];
+ $x_both[$my_paye_thirdpartyid]['paye']['vat'] = $x_paye[$my_paye_thirdpartyid]['vat'];
+ if (!isset($x_both[$my_paye_thirdpartyid]['coll']['totalht'])) {
+ $x_both[$my_paye_thirdpartyid]['coll']['totalht'] = 0;
+ $x_both[$my_paye_thirdpartyid]['coll']['vat'] = 0;
+ }
+ $x_both[$my_paye_thirdpartyid]['paye']['links'] = '';
+ $x_both[$my_paye_thirdpartyid]['paye']['detail'] = array();
- foreach ($x_paye[$my_paye_thirdpartyid]['facid'] as $id=>$dummy)
- {
- // ExpenseReport
- if ($x_paye[$my_paye_thirdpartyid]['ptype'][$id] == 'ExpenseReportPayment')
- {
- $expensereport->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id];
- $expensereport->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id];
- $expensereport->type=$x_paye[$my_paye_thirdpartyid]['type'][$id];
+ foreach ($x_paye[$my_paye_thirdpartyid]['facid'] as $id=>$dummy)
+ {
+ // ExpenseReport
+ if ($x_paye[$my_paye_thirdpartyid]['ptype'][$id] == 'ExpenseReportPayment')
+ {
+ $expensereport->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id];
+ $expensereport->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id];
+ $expensereport->type=$x_paye[$my_paye_thirdpartyid]['type'][$id];
- $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array(
- 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id],
- 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id],
- 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id],
- 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id],
- 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id],
- 'payment_id' =>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id],
- 'payment_amount' =>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id],
- 'ftotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]),
- 'dtotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]),
- 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id],
- 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id],
- 'ddate_start' =>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id],
- 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id],
- 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]),
- 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id],
- 'link' =>$expensereport->getNomUrl(1)
- );
- }
- else
- {
- $invoice_supplier->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id];
- $invoice_supplier->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id];
- $invoice_supplier->type=$x_paye[$my_paye_thirdpartyid]['type'][$id];
- $company_static->fetch($x_paye[$my_paye_thirdpartyid]['company_id'][$id]);
- $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array(
- 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id],
- 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id],
- 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id],
- 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id],
- 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id],
- 'payment_id'=>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id],
- 'payment_amount'=>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id],
- 'ftotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]),
- 'dtotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]),
- 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id],
- 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id],
- 'datef' =>$x_paye[$my_paye_thirdpartyid]['datef'][$id],
- 'datep' =>$x_paye[$my_paye_thirdpartyid]['datep'][$id],
- 'company_link'=>$company_static->getNomUrl(1, '', 20),
- 'ddate_start'=>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id],
- 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id],
- 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]),
- 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id],
- 'link' =>$invoice_supplier->getNomUrl(1, '', 12)
- );
- }
- }
- }
- //now we have an array (x_both) indexed by rates for coll and paye
+ $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array(
+ 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id],
+ 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id],
+ 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id],
+ 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id],
+ 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id],
+ 'payment_id' =>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id],
+ 'payment_amount' =>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id],
+ 'ftotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]),
+ 'dtotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]),
+ 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id],
+ 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id],
+ 'ddate_start' =>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id],
+ 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id],
+ 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]),
+ 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id],
+ 'link' =>$expensereport->getNomUrl(1)
+ );
+ }
+ else
+ {
+ $invoice_supplier->id=$x_paye[$my_paye_thirdpartyid]['facid'][$id];
+ $invoice_supplier->ref=$x_paye[$my_paye_thirdpartyid]['facnum'][$id];
+ $invoice_supplier->type=$x_paye[$my_paye_thirdpartyid]['type'][$id];
+ $company_static->fetch($x_paye[$my_paye_thirdpartyid]['company_id'][$id]);
+ $x_both[$my_paye_thirdpartyid]['paye']['detail'][] = array(
+ 'id' =>$x_paye[$my_paye_thirdpartyid]['facid'][$id],
+ 'descr' =>$x_paye[$my_paye_thirdpartyid]['descr'][$id],
+ 'pid' =>$x_paye[$my_paye_thirdpartyid]['pid'][$id],
+ 'pref' =>$x_paye[$my_paye_thirdpartyid]['pref'][$id],
+ 'ptype' =>$x_paye[$my_paye_thirdpartyid]['ptype'][$id],
+ 'payment_id'=>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id],
+ 'payment_amount'=>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id],
+ 'ftotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]),
+ 'dtotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]),
+ 'dtype' =>$x_paye[$my_paye_thirdpartyid]['dtype'][$id],
+ 'drate' =>$x_paye[$my_coll_thirdpartyid]['drate'][$id],
+ 'datef' =>$x_paye[$my_paye_thirdpartyid]['datef'][$id],
+ 'datep' =>$x_paye[$my_paye_thirdpartyid]['datep'][$id],
+ 'company_link'=>$company_static->getNomUrl(1, '', 20),
+ 'ddate_start'=>$x_paye[$my_paye_thirdpartyid]['ddate_start'][$id],
+ 'ddate_end' =>$x_paye[$my_paye_thirdpartyid]['ddate_end'][$id],
+ 'totalht' =>price2num($x_paye[$my_paye_thirdpartyid]['totalht_list'][$id]),
+ 'vat' =>$x_paye[$my_paye_thirdpartyid]['vat_list'][$id],
+ 'link' =>$invoice_supplier->getNomUrl(1, '', 12)
+ );
+ }
+ }
+ }
+ //now we have an array (x_both) indexed by rates for coll and paye
- //print table headers for this quadri - incomes first
+ //print table headers for this quadri - incomes first
- $x_coll_sum = 0;
- $x_coll_ht = 0;
- $x_paye_sum = 0;
- $x_paye_ht = 0;
+ $x_coll_sum = 0;
+ $x_coll_ht = 0;
+ $x_paye_sum = 0;
+ $x_paye_ht = 0;
- $span=$columns;
- if ($modetax != 1) $span+=2;
+ $span=$columns;
+ if ($modetax != 1) $span+=2;
- //print '| '..') | ';
+ //print '| '..') | ';
- // Customers invoices
- print '';
- print '| '.$elementcust.' | ';
- print ''.$langs->trans("DateInvoice").' | ';
- if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print ''.$langs->trans("DatePayment").' | ';
- else print ' | ';
- print ''.$namerate.' | ';
- print ''.$productcust.' | ';
- if ($modetax != 1)
- {
- print ''.$amountcust.' | ';
- print ''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").') | ';
- }
- print ''.$langs->trans("AmountHTVATRealReceived").' | ';
- print ''.$vatcust.' | ';
- print ' ';
+ // Customers invoices
+ print '';
+ print '| '.$elementcust.' | ';
+ print ''.$langs->trans("DateInvoice").' | ';
+ if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print ''.$langs->trans("DatePayment").' | ';
+ else print ' | ';
+ print ''.$namerate.' | ';
+ print ''.$productcust.' | ';
+ if ($modetax != 1)
+ {
+ print ''.$amountcust.' | ';
+ print ''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").') | ';
+ }
+ print ''.$langs->trans("AmountHTVATRealReceived").' | ';
+ print ''.$vatcust.' | ';
+ print ' ';
- $action = "tvadetail";
- $parameters["mode"] = $modetax;
- $parameters["start"] = $date_start;
- $parameters["end"] = $date_end;
- $parameters["type"] = 'vat';
+ $action = "tvadetail";
+ $parameters["mode"] = $modetax;
+ $parameters["start"] = $date_start;
+ $parameters["end"] = $date_end;
+ $parameters["type"] = 'vat';
- $object = array(&$x_coll, &$x_paye, &$x_both);
- // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
- $hookmanager->initHooks(array('externalbalance'));
- $reshook=$hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+ $object = array(&$x_coll, &$x_paye, &$x_both);
+ // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
+ $hookmanager->initHooks(array('externalbalance'));
+ $reshook=$hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
- foreach (array_keys($x_coll) as $thirdparty_id) {
- $subtot_coll_total_ht = 0;
- $subtot_coll_vat = 0;
+ foreach (array_keys($x_coll) as $thirdparty_id) {
+ $subtot_coll_total_ht = 0;
+ $subtot_coll_vat = 0;
- if (is_array($x_both[$thirdparty_id]['coll']['detail']))
- {
+ if ($min == 0 || ($min > 0 && $x_both[$thirdparty_id]['coll']['totalht'] > $min))
+ {
+ if (is_array($x_both[$thirdparty_id]['coll']['detail']))
+ {
+ // VAT Rate
+ print "";
+ print '| ';
+ if (is_numeric($thirdparty_id)) {
+ $company_static->fetch($thirdparty_id);
+ print $langs->trans("ThirdParty") . ': ' . $company_static->getNomUrl(1);
+ } else {
+ $tmpid = preg_replace('/userid_/', '', $thirdparty_id);
+ $user_static->fetch($tmpid);
+ print $langs->trans("User") . ': ' . $user_static->getNomUrl(1);
+ }
+ print ' | | ';
+ print ' ' . "\n";
- // VAT Rate
- print "";
- print '| ';
- if (is_numeric($thirdparty_id))
- {
- $company_static->fetch($thirdparty_id);
- print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1);
- }
- else
- {
- $tmpid = preg_replace('/userid_/', '', $thirdparty_id);
- $user_static->fetch($tmpid);
- print $langs->trans("User").': '.$user_static->getNomUrl(1);
- }
- print ' | | ';
- print ' '."\n";
+ foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) {
+ // Define type
+ // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
+ $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
+ // Try to enhance type detection using date_start and date_end for free lines where type
+ // was not saved.
+ if (!empty($fields['ddate_start'])) {
+ $type = 1;
+ }
+ if (!empty($fields['ddate_end'])) {
+ $type = 1;
+ }
- foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) {
- // Define type
- // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
- $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']);
- // Try to enhance type detection using date_start and date_end for free lines where type
- // was not saved.
- if (!empty($fields['ddate_start'])) {
- $type=1;
- }
- if (!empty($fields['ddate_end'])) {
- $type=1;
- }
+ print '';
+
+ // Ref
+ print '| ' . $fields['link'] . ' | ';
+
+ // Invoice date
+ print '' . dol_print_date($fields['datef'], 'day') . ' | ';
+
+ // Payment date
+ if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') {
+ print '' . dol_print_date($fields['datep'], 'day') . ' | ';
+ } else {
+ print ' | ';
+ }
+
+ // Rate
+ print '' . $fields['drate'] . ' | ';
+
+ // Description
+ print '';
+ if ($fields['pid']) {
+ $product_static->id = $fields['pid'];
+ $product_static->ref = $fields['pref'];
+ $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
+ print $product_static->getNomUrl(1);
+ if (dol_string_nohtmltag($fields['descr'])) {
+ print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
+ }
+ } else {
+ if ($type) {
+ $text = img_object($langs->trans('Service'), 'service');
+ } else {
+ $text = img_object($langs->trans('Product'), 'product');
+ }
+ if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) {
+ if ($reg[1] == 'DEPOSIT') {
+ $fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
+ } elseif ($reg[1] == 'CREDIT_NOTE') {
+ $fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
+ } else {
+ $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
+ }
+ }
+ print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
+
+ // Show range
+ print_date_range($fields['ddate_start'], $fields['ddate_end']);
+ }
+ print ' | ';
+
+ // Total HT
+ if ($modetax != 1) {
+ print '';
+ print price($fields['totalht']);
+ if (price2num($fields['ftotal_ttc'])) {
+ //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
+ $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']);
+ //print ' ('.round($ratiolineinvoice*100,2).'%)';
+ }
+ print ' | ';
+ }
+
+ // Payment
+ $ratiopaymentinvoice = 1;
+ if ($modetax != 1) {
+ print '';
+ //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
+ if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
+ $payment_static->id = $fields['payment_id'];
+ print $payment_static->getNomUrl(2);
+ }
+ if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice')
+ || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) {
+ print $langs->trans("NA");
+ } else {
+ if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
+ $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
+ }
+ print price(price2num($fields['payment_amount'], 'MT'));
+ if (isset($fields['payment_amount'])) {
+ print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
+ }
+ }
+ print ' | ';
+ }
+
+ // Total collected
+ print '';
+ $temp_ht = $fields['totalht'] * $ratiopaymentinvoice;
+ print price(price2num($temp_ht, 'MT'), 1);
+ print ' | ';
+
+ // VAT
+ print '';
+ $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
+ print price(price2num($temp_vat, 'MT'), 1);
+ //print price($fields['vat']);
+ print ' | ';
+ print ' ';
+
+ $subtot_coll_total_ht += $temp_ht;
+ $subtot_coll_vat += $temp_vat;
+ $x_coll_sum += $temp_vat;
+ }
+ }
+ // Total customers for this vat rate
+ print '';
+ print ' | ';
+ print '' . $langs->trans("Total") . ': | ';
+ if ($modetax != 1) {
+ print ' | ';
+ print ' | ';
+ }
+ print '' . price(price2num($subtot_coll_total_ht, 'MT')) . ' | ';
+ print '' . price(price2num($subtot_coll_vat, 'MT')) . ' | ';
+ print ' ';
+ }
+ }
+
+ if (count($x_coll) == 0) // Show a total ine if nothing shown
+ {
+ print '';
+ print ' | ';
+ print ''.$langs->trans("Total").': | ';
+ if ($modetax != 1) {
+ print ' | ';
+ print ' | ';
+ }
+ print ''.price(price2num(0, 'MT')).' | ';
+ print ''.price(price2num(0, 'MT')).' | ';
+ print ' ';
+ }
+
+ // Blank line
+ print '| | ';
+
+ // Print table headers for this quadri - expenses now
+ print '';
+ print '| '.$elementsup.' | ';
+ print ''.$langs->trans("DateInvoice").' | ';
+ if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print ''.$langs->trans("DatePayment").' | ';
+ else print ' | ';
+ print ''.$namesup.' | ';
+ print ''.$productsup.' | ';
+ if ($modetax != 1) {
+ print ''.$amountsup.' | ';
+ print ''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").') | ';
+ }
+ print ''.$langs->trans("AmountHTVATRealPaid").' | ';
+ print ''.$vatsup.' | ';
+ print ' '."\n";
+
+ foreach (array_keys($x_paye) as $thirdparty_id)
+ {
+ $subtot_paye_total_ht = 0;
+ $subtot_paye_vat = 0;
+
+ if ($min == 0 || ($min > 0 && $x_both[$thirdparty_id]['paye']['totalht'] > $min)) {
+
+ if (is_array($x_both[$thirdparty_id]['paye']['detail'])) {
+ print "";
+ print '| ';
+ if (is_numeric($thirdparty_id)) {
+ $company_static->fetch($thirdparty_id);
+ print $langs->trans("ThirdParty") . ': ' . $company_static->getNomUrl(1);
+ } else {
+ $tmpid = preg_replace('/userid_/', '', $thirdparty_id);
+ $user_static->fetch($tmpid);
+ print $langs->trans("User") . ': ' . $user_static->getNomUrl(1);
+ }
+ print ' | | ';
+ print ' ' . "\n";
+
+ foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index => $fields) {
+ // Define type
+ // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
+ $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
+ // Try to enhance type detection using date_start and date_end for free lines where type
+ // was not saved.
+ if (!empty($fields['ddate_start'])) {
+ $type = 1;
+ }
+ if (!empty($fields['ddate_end'])) {
+ $type = 1;
+ }
- print '';
+ print ' ';
- // Ref
- print '| '.$fields['link'].' | ';
+ // Ref
+ print '' . $fields['link'] . ' | ';
- // Invoice date
- print '' . dol_print_date($fields['datef'], 'day') . ' | ';
+ // Invoice date
+ print '' . dol_print_date($fields['datef'], 'day') . ' | ';
- // Payment date
- if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print '' . dol_print_date($fields['datep'], 'day') . ' | ';
- else print ' | ';
+ // Payment date
+ if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') {
+ print '' . dol_print_date($fields['datep'], 'day') . ' | ';
+ } else {
+ print ' | ';
+ }
- // Rate
- print '' . $fields['drate'] . ' | ';
+ // Company name
+ print '' . $fields['company_link'] . ' | ';
- // Description
- print '';
- if ($fields['pid'])
- {
- $product_static->id=$fields['pid'];
- $product_static->ref=$fields['pref'];
- $product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered
- print $product_static->getNomUrl(1);
- if (dol_string_nohtmltag($fields['descr'])) {
- print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
- }
- }
- else
- {
- if ($type) {
- $text = img_object($langs->trans('Service'), 'service');
- } else {
- $text = img_object($langs->trans('Product'), 'product');
- }
- if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) {
- if ($reg[1]=='DEPOSIT') {
- $fields['descr']=$langs->transnoentitiesnoconv('Deposit');
- } elseif ($reg[1]=='CREDIT_NOTE') {
- $fields['descr']=$langs->transnoentitiesnoconv('CreditNote');
- } else {
- $fields['descr']=$langs->transnoentitiesnoconv($reg[1]);
- }
- }
- print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
+ // Description
+ print ' | ';
+ if ($fields['pid']) {
+ $product_static->id = $fields['pid'];
+ $product_static->ref = $fields['pref'];
+ $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
+ print $product_static->getNomUrl(1);
+ if (dol_string_nohtmltag($fields['descr'])) {
+ print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
+ }
+ } else {
+ if ($type) {
+ $text = img_object($langs->trans('Service'), 'service');
+ } else {
+ $text = img_object($langs->trans('Product'), 'product');
+ }
+ if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) {
+ if ($reg[1] == 'DEPOSIT') {
+ $fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
+ } elseif ($reg[1] == 'CREDIT_NOTE') {
+ $fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
+ } else {
+ $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
+ }
+ }
+ print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
- // Show range
- print_date_range($fields['ddate_start'], $fields['ddate_end']);
- }
- print ' | ';
+ // Show range
+ print_date_range($fields['ddate_start'], $fields['ddate_end']);
+ }
+ print '';
- // Total HT
- if ($modetax != 1)
- {
- print '';
- print price($fields['totalht']);
- if (price2num($fields['ftotal_ttc']))
- {
- //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
- $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
- //print ' ('.round($ratiolineinvoice*100,2).'%)';
- }
- print ' | ';
- }
+ // Total HT
+ if ($modetax != 1) {
+ print '';
+ print price($fields['totalht']);
+ if (price2num($fields['ftotal_ttc'])) {
+ //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
+ $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']);
+ //print ' ('.round($ratiolineinvoice*100,2).'%)';
+ }
+ print ' | ';
+ }
- // Payment
- $ratiopaymentinvoice=1;
- if ($modetax != 1)
- {
- print '';
- //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
- if ($fields['payment_amount'] && $fields['ftotal_ttc'])
- {
- $payment_static->id=$fields['payment_id'];
- print $payment_static->getNomUrl(2);
- }
- if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice')
- || ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice'))
- {
- print $langs->trans("NA");
- } else {
- if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
- $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
- }
- print price(price2num($fields['payment_amount'], 'MT'));
- if (isset($fields['payment_amount'])) {
- print ' ('.round($ratiopaymentinvoice*100, 2).'%)';
- }
- }
- print ' | ';
- }
+ // Payment
+ $ratiopaymentinvoice = 1;
+ if ($modetax != 1)
+ {
+ print '';
+ if ($fields['payment_amount'] && $fields['ftotal_ttc'])
+ {
+ $paymentfourn_static->id = $fields['payment_id'];
+ print $paymentfourn_static->getNomUrl(2);
+ }
- // Total collected
- print ' | ';
- $temp_ht=$fields['totalht']*$ratiopaymentinvoice;
- print price(price2num($temp_ht, 'MT'), 1);
- print ' | ';
+ if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice')
+ || ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice'))
+ {
+ print $langs->trans("NA");
+ }
+ else
+ {
+ if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
+ $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
+ }
+ print price(price2num($fields['payment_amount'], 'MT'));
+ if (isset($fields['payment_amount'])) {
+ print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
+ }
+ }
+ print '';
+ }
- // VAT
- print '';
- $temp_vat=$fields['vat']*$ratiopaymentinvoice;
- print price(price2num($temp_vat, 'MT'), 1);
- //print price($fields['vat']);
- print ' | ';
- print ' ';
+ // VAT paid
+ print '';
+ $temp_ht = $fields['totalht'] * $ratiopaymentinvoice;
+ print price(price2num($temp_ht, 'MT'), 1);
+ print ' | ';
- $subtot_coll_total_ht += $temp_ht;
- $subtot_coll_vat += $temp_vat;
- $x_coll_sum += $temp_vat;
- }
- }
- // Total customers for this vat rate
- print '';
- print ' | ';
- print ''.$langs->trans("Total").': | ';
- if ($modetax != 1) {
- print ' | ';
- print ' | ';
- }
- print ''.price(price2num($subtot_coll_total_ht, 'MT')).' | ';
- print ''.price(price2num($subtot_coll_vat, 'MT')).' | ';
- print ' ';
- }
+ // VAT
+ print '';
+ $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
+ print price(price2num($temp_vat, 'MT'), 1);
+ //print price($fields['vat']);
+ print ' | ';
+ print '';
- if (count($x_coll) == 0) // Show a total ine if nothing shown
- {
- print '';
- print ' | ';
- print ''.$langs->trans("Total").': | ';
- if ($modetax != 1) {
- print ' | ';
- print ' | ';
- }
- print ''.price(price2num(0, 'MT')).' | ';
- print ''.price(price2num(0, 'MT')).' | ';
- print ' ';
- }
+ $subtot_paye_total_ht += $temp_ht;
+ $subtot_paye_vat += $temp_vat;
+ $x_paye_sum += $temp_vat;
+ }
+ }
+ // Total suppliers for this vat rate
+ print '';
+ print ' | ';
+ print '' . $langs->trans("Total") . ': | ';
+ if ($modetax != 1) {
+ print ' | ';
+ print ' | ';
+ }
+ print '' . price(price2num($subtot_paye_total_ht, 'MT')) . ' | ';
+ print '' . price(price2num($subtot_paye_vat, 'MT')) . ' | ';
+ print ' ';
+ }
+ }
- // Blank line
- print '| | ';
+ if (count($x_paye) == 0) { // Show a total line if nothing shown
+ print '';
+ print ' | ';
+ print ''.$langs->trans("Total").': | ';
+ if ($modetax != 1) {
+ print ' | ';
+ print ' | ';
+ }
+ print ''.price(price2num(0, 'MT')).' | ';
+ print ''.price(price2num(0, 'MT')).' | ';
+ print ' ';
+ }
- // Print table headers for this quadri - expenses now
- print '';
- print '| '.$elementsup.' | ';
- print ''.$langs->trans("DateInvoice").' | ';
- if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print ''.$langs->trans("DatePayment").' | ';
- else print ' | ';
- print ''.$namesup.' | ';
- print ''.$productsup.' | ';
- if ($modetax != 1) {
- print ''.$amountsup.' | ';
- print ''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").') | ';
- }
- print ''.$langs->trans("AmountHTVATRealPaid").' | ';
- print ''.$vatsup.' | ';
- print ' '."\n";
+ print ' ';
- foreach (array_keys($x_paye) as $thirdparty_id)
- {
- $subtot_paye_total_ht = 0;
- $subtot_paye_vat = 0;
+ // Total to pay
+ print '
';
+ print '';
+ $diff = $x_coll_sum - $x_paye_sum;
+ print '';
+ print '| '.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').' | ';
+ print ''.price(price2num($diff, 'MT'))." | \n";
+ print " \n";
- if (is_array($x_both[$thirdparty_id]['paye']['detail']))
- {
- print "";
- print '| ';
- if (is_numeric($thirdparty_id))
- {
- $company_static->fetch($thirdparty_id);
- print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1);
- }
- else
- {
- $tmpid = preg_replace('/userid_/', '', $thirdparty_id);
- $user_static->fetch($tmpid);
- print $langs->trans("User").': '.$user_static->getNomUrl(1);
- }
- print ' | | ';
- print ' '."\n";
-
- foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index=>$fields) {
- // Define type
- // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
- $type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']);
- // Try to enhance type detection using date_start and date_end for free lines where type
- // was not saved.
- if (!empty($fields['ddate_start'])) {
- $type=1;
- }
- if (!empty($fields['ddate_end'])) {
- $type=1;
- }
-
-
- print '';
-
- // Ref
- print '| '.$fields['link'].' | ';
-
- // Invoice date
- print '' . dol_print_date($fields['datef'], 'day') . ' | ';
-
- // Payment date
- if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print '' . dol_print_date($fields['datep'], 'day') . ' | ';
- else print ' | ';
-
- // Company name
- print '' . $fields['company_link'] . ' | ';
-
- // Description
- print '';
- if ($fields['pid'])
- {
- $product_static->id=$fields['pid'];
- $product_static->ref=$fields['pref'];
- $product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered
- print $product_static->getNomUrl(1);
- if (dol_string_nohtmltag($fields['descr'])) {
- print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
- }
- }
- else
- {
- if ($type) {
- $text = img_object($langs->trans('Service'), 'service');
- } else {
- $text = img_object($langs->trans('Product'), 'product');
- }
- if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) {
- if ($reg[1]=='DEPOSIT') {
- $fields['descr']=$langs->transnoentitiesnoconv('Deposit');
- } elseif ($reg[1]=='CREDIT_NOTE') {
- $fields['descr']=$langs->transnoentitiesnoconv('CreditNote');
- } else {
- $fields['descr']=$langs->transnoentitiesnoconv($reg[1]);
- }
- }
- print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
-
- // Show range
- print_date_range($fields['ddate_start'], $fields['ddate_end']);
- }
- print ' | ';
-
- // Total HT
- if ($modetax != 1)
- {
- print '';
- print price($fields['totalht']);
- if (price2num($fields['ftotal_ttc']))
- {
- //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
- $ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
- //print ' ('.round($ratiolineinvoice*100,2).'%)';
- }
- print ' | ';
- }
-
- // Payment
- $ratiopaymentinvoice=1;
- if ($modetax != 1)
- {
- print '';
- if ($fields['payment_amount'] && $fields['ftotal_ttc'])
- {
- $paymentfourn_static->id=$fields['payment_id'];
- print $paymentfourn_static->getNomUrl(2);
- }
-
- if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice')
- || ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice'))
- {
- print $langs->trans("NA");
- }
- else
- {
- if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
- $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
- }
- print price(price2num($fields['payment_amount'], 'MT'));
- if (isset($fields['payment_amount'])) {
- print ' ('.round($ratiopaymentinvoice*100, 2).'%)';
- }
- }
- print ' | ';
- }
-
- // VAT paid
- print '';
- $temp_ht=$fields['totalht']*$ratiopaymentinvoice;
- print price(price2num($temp_ht, 'MT'), 1);
- print ' | ';
-
- // VAT
- print '';
- $temp_vat=$fields['vat']*$ratiopaymentinvoice;
- print price(price2num($temp_vat, 'MT'), 1);
- //print price($fields['vat']);
- print ' | ';
- print ' ';
-
- $subtot_paye_total_ht += $temp_ht;
- $subtot_paye_vat += $temp_vat;
- $x_paye_sum += $temp_vat;
- }
- }
- // Total suppliers for this vat rate
- print '';
- print ' | ';
- print ''.$langs->trans("Total").': | ';
- if ($modetax != 1) {
- print ' | ';
- print ' | ';
- }
- print ''.price(price2num($subtot_paye_total_ht, 'MT')).' | ';
- print ''.price(price2num($subtot_paye_vat, 'MT')).' | ';
- print ' ';
- }
-
- if (count($x_paye) == 0) { // Show a total line if nothing shown
- print '';
- print ' | ';
- print ''.$langs->trans("Total").': | ';
- if ($modetax != 1) {
- print ' | ';
- print ' | ';
- }
- print ''.price(price2num(0, 'MT')).' | ';
- print ''.price(price2num(0, 'MT')).' | ';
- print ' ';
- }
-
- print ' ';
-
- // Total to pay
- print '
';
- print '';
- $diff = $x_coll_sum - $x_paye_sum;
- print '';
- print '| '.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').' | ';
- print ''.price(price2num($diff, 'MT'))." | \n";
- print " \n";
-
- $i++;
+ $i++;
}
print ' ';
diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php
index 6d5f5ffbc13..061008f42a8 100644
--- a/htdocs/compta/tva/list.php
+++ b/htdocs/compta/tva/list.php
@@ -150,7 +150,7 @@ if ($result)
$newcardbutton='';
if ($user->rights->tax->charges->creer)
{
- $newcardbutton=''.$langs->trans('NewVATPayment');
+ $newcardbutton=''.$langs->trans('NewVATPayment').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php
index cf2c198d36e..5b9e84f2d16 100644
--- a/htdocs/contact/agenda.php
+++ b/htdocs/contact/agenda.php
@@ -261,7 +261,7 @@ else
{
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
{
- $newcardbutton.=''.$langs->trans("AddAction").'';
+ $newcardbutton.=''.$langs->trans("AddAction").'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 4419c087a3c..a5fe555151f 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -453,7 +453,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton='';
if ($user->rights->societe->contact->creer)
{
- $newcardbutton=''.$langs->trans('NewContactAddress').'';
+ $newcardbutton=''.$langs->trans('NewContactAddress').'';
$newcardbutton.= '';
$newcardbutton.= '';
}
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 1b638849538..c61e2e6177a 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -540,7 +540,7 @@ if (empty($reshook))
}
$desc=$prod->description;
- $desc=dol_concatdesc($desc, $product_desc, '', !empty($conf->global->CHANGE_ORDER_CONCAT_DESCRIPTION));
+ $desc=dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
$fk_unit = $prod->fk_unit;
}
else
@@ -1212,7 +1212,7 @@ if ($action == 'create')
{
print ' | ';
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300');
- print ' '.$langs->trans("AddThirdParty").' ';
+ print ' '.$langs->trans("AddThirdParty").'';
print ' | ';
}
print '
'."\n";
@@ -1254,7 +1254,7 @@ if ($action == 'create')
print '