Skip to content

Commit

Permalink
Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/websites/index.php
  • Loading branch information
eldy committed Jul 22, 2017
2 parents 437d620 + 5834521 commit 764c7ac
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 61 deletions.
62 changes: 31 additions & 31 deletions dev/translation/sanity_check_en_langfiles.php
Expand Up @@ -25,7 +25,7 @@
$web=0;

// Test if batch mode
if (substr($sapi_type, 0, 3) == 'cgi')
if (substr($sapi_type, 0, 3) == 'cgi')
{
$web=1;
}
Expand All @@ -35,9 +35,9 @@
{
echo "<html>";
echo "<head>";

echo "<STYLE type=\"text/css\">
table {
background: #f5f5f5;
border-collapse: separate;
Expand All @@ -48,7 +48,7 @@
text-align: left;
width: 800px;
}
th {
background-color: #777;
border-left: 1px solid #555;
Expand All @@ -61,7 +61,7 @@
position: relative;
text-shadow: 0 1px 0 #000;
}
td {
border-right: 1px solid #fff;
border-left: 1px solid #e8e8e8;
Expand All @@ -70,19 +70,19 @@
padding: 10px 15px;
position: relative;
}
tr {
background-color: #f1f1f1;
}
tr:nth-child(odd) td {
background-color: #f1f1f1;
}
</STYLE>";

echo "<body>";
}

Expand Down Expand Up @@ -142,9 +142,9 @@
}
}

foreach ($langstrings_3d AS $filename => $file)
foreach ($langstrings_3d AS $filename => $file)
{
foreach ($file AS $linenum => $value)
foreach ($file AS $linenum => $value)
{
$keys = array_keys($langstrings_full, $value);
if (count($keys)>1)
Expand Down Expand Up @@ -173,11 +173,11 @@
$sother='';

$count = 0;
foreach ($dups as $string => $pages)
foreach ($dups as $string => $pages)
{
$count++;
$s='';

// Keyword $string
if ($web) $s.="<tr>";
if ($web) $s.="<td align=\"center\">";
Expand All @@ -188,32 +188,32 @@
if ($web) $s.="</td>";
if ($web) $s.="<td>";
if (! $web) $s.= ' : ';

// Loop on each files keyword was found
$duplicateinsamefile=0;
$inmain=0;
$inadmin=0;
foreach ($pages AS $file => $lines)
foreach ($pages AS $file => $lines)
{
if ($file == 'main.lang') { $inmain=1; $inadmin=0; }
if ($file == 'admin.lang' && ! $inmain) { $inadmin=1; }

$s.=$file." ";

// Loop on each line keword was found into file.
$listoffilesforthisentry=array();
foreach ($lines as $line => $translatedvalue)
foreach ($lines as $line => $translatedvalue)
{
if (! empty($listoffilesforthisentry[$file])) $duplicateinsamefile=1;
$listoffilesforthisentry[$file]=1;

$s.= "(".$line." - ".htmlentities($translatedvalue).") ";
}
if ($web) $s.="<br>";
}
if ($web) $s.="</td></tr>";
$s.="\n";

if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
else if ($inmain) $sinmainandother .= $s;
else if ($inadmin) $sininstallandadmin .= $s;
Expand Down Expand Up @@ -252,7 +252,7 @@
if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true'))
{
print "***** Strings in en_US that are never used:\n";

$unused=array();
foreach ($langstrings_dist AS $value => $line)
{
Expand Down Expand Up @@ -288,7 +288,7 @@
if (preg_match('/^JuridicalStatus/', $value)) $qualifiedforclean=0;
if (preg_match('/^CalcMode/', $value)) $qualifiedforclean=0;
if (preg_match('/^newLT/', $value)) $qualifiedforclean=0;
if (preg_match('/^LT\d/', $value)) $qualifiedforclean=0;
if (preg_match('/^LT[0-9]/', $value)) $qualifiedforclean=0;
if (preg_match('/^TypeContact_contrat_/', $value)) $qualifiedforclean=0;
if (preg_match('/^ErrorPriceExpression/', $value)) $qualifiedforclean=0;
if (preg_match('/^Language_/', $value)) $qualifiedforclean=0;
Expand All @@ -315,7 +315,7 @@
// orders
if (preg_match('/^OrderSource/', $value)) $qualifiedforclean=0;
if (preg_match('/^TypeContact_/', $value)) $qualifiedforclean=0;
// other.lang
// other.lang
if (preg_match('/^Notify_/', $value)) $qualifiedforclean=0;
if (preg_match('/^PredefinedMail/', $value)) $qualifiedforclean=0;
if (preg_match('/^DemoCompany/', $value)) $qualifiedforclean=0;
Expand All @@ -336,17 +336,17 @@
if (preg_match('/OppStatus/', $value)) $qualifiedforclean=0;
if (preg_match('/AvailabilityType/', $value)) $qualifiedforclean=0;
if (preg_match('/CardProduct/', $value)) $qualifiedforclean=0;

if (preg_match('/sms/i', $value)) $qualifiedforclean=0;
if (preg_match('/TF_/i', $value)) $qualifiedforclean=0;
if (preg_match('/WithBankUsing/i', $value)) $qualifiedforclean=0;
if (preg_match('/descWORKFLOW_/i', $value)) $qualifiedforclean=0;

if (! $qualifiedforclean)
{
continue;
continue;
}

//$search = '\'trans("'.$value.'")\'';
$search = '-e "\''.$value.'\'" -e \'"'.$value.'"\' -e "('.$value.')" -e "('.$value.',"';
$string = 'grep -R -m 1 -F --exclude=includes/* --include=*.php '.$search.' '.$htdocs.'* '.$scripts.'*';
Expand All @@ -356,15 +356,15 @@
$unused[$value] = $line;
echo $line; // $trad contains the \n
}
else
else
{
unset($output);
//print 'X'.$output.'Y';
}
}

if (empty($unused)) print "No string not used found.\n";
else
else
{
$filetosave='/tmp/'.($argv[2]?$argv[2]:"").'notused.lang';
print "Strings in en_US that are never used are saved into file ".$filetosave.":\n";
Expand Down
8 changes: 4 additions & 4 deletions htdocs/compta/tva/index.php
Expand Up @@ -117,7 +117,7 @@ function pt ($db, $sql, $date)
$textnextyear=" <a href=\"index.php?year=" . ($year_current+1) . "\">".img_next($langs->trans("Next"), 'class="valignbottom"')."</a>";

print $conf->dol_optimize_smallscreen;
print load_fiche_titre($langs->trans("VAT"), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png');
print load_fiche_titre($langs->transcountry("VAT", $mysoc->country_code), $textprevyear." ".$langs->trans("Year")." ".$year_start." ".$textnextyear, 'title_accountancy.png');

print $langs->trans("VATReportBuildWithOptionDefinedInModule").'<br>';
print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')<br>';
Expand Down Expand Up @@ -263,18 +263,18 @@ function pt ($db, $sql, $date)

print "<tr>";
print '<td align="right">' . $langs->trans("VATDue") . '</td>'; // need to add translation
print '<td class="nowrap" align="right">' . price(price2num($total, 1)) . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($total, 'MT')) . '</td>';
print "</tr>\n";

print "<tr>";
print '<td align="right">' . $langs->trans("VATPaid") . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 1)) . "</td>\n";
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 'MT')) . "</td>\n";
print "</tr>\n";

$restopay = $total - $obj->mm;
print "<tr>";
print '<td align="right">' . $langs->trans("VATRestopay") . '</td>'; // need to add translation
print '<td class="nowrap" align="right">' . price(price2num($restopay, 1)) . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($restopay, 'MT')) . '</td>';
print "</tr>\n";

print '</table>';
Expand Down
27 changes: 24 additions & 3 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -4417,7 +4417,7 @@ function load_cache_vatrates($country_code)

dol_syslog(__METHOD__, LOG_DEBUG);

$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.recuperableonly";
$sql = "SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = c.rowid";
$sql.= " AND t.active > 0";
Expand All @@ -4436,8 +4436,20 @@ function load_cache_vatrates($country_code)
$this->cache_vatrates[$i]['rowid'] = $obj->rowid;
$this->cache_vatrates[$i]['code'] = $obj->code;
$this->cache_vatrates[$i]['txtva'] = $obj->taux;
$this->cache_vatrates[$i]['libtva'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or *
$this->cache_vatrates[$i]['nprtva'] = $obj->recuperableonly;
$this->cache_vatrates[$i]['localtax1'] = $obj->localtax1;
$this->cache_vatrates[$i]['localtax1_type'] = $obj->localtax1_type;
$this->cache_vatrates[$i]['localtax2'] = $obj->localtax2;
$this->cache_vatrates[$i]['localtax2_type'] = $obj->localtax1_type;

$this->cache_vatrates[$i]['label'] = $obj->taux.'%'.($obj->code?' ('.$obj->code.')':''); // Label must contains only 0-9 , . % or *
$this->cache_vatrates[$i]['labelallrates'] = $obj->taux.'/'.($obj->localtax1?$obj->localtax1:'0').'/'.($obj->localtax2?$obj->localtax2:'0').($obj->code?' ('.$obj->code.')':''); // Must never be used as key, only label
$positiverates='';
if ($obj->taux) $positiverates.=($positiverates?'/':'').$obj->taux;
if ($obj->localtax1) $positiverates.=($positiverates?'/':'').$obj->localtax1;
if ($obj->localtax2) $positiverates.=($positiverates?'/':'').$obj->localtax2;
if (empty($positiverates)) $positiverates='0';
$this->cache_vatrates[$i]['labelpositiverates'] = $positiverates.($obj->code?' ('.$obj->code.')':''); // Must never be used as key, only label
}

return $num;
Expand Down Expand Up @@ -4611,7 +4623,16 @@ function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $
$selectedfound=true;
}
}
$return.= '>'.vatrate($rate['libtva']);
$return.= '>';
//if (! empty($conf->global->MAIN_VAT_SHOW_POSITIVE_RATES))
if ($mysoc->country_code == 'IN' || ! empty($conf->global->MAIN_VAT_LABEL_IS_POSITIVE_RATES))
{
$return.= $rate['labelpositiverates'];
}
else
{
$return.= vatrate($rate['label']);
}
//$return.=($rate['code']?' '.$rate['code']:'');
$return.= (empty($rate['code']) && $rate['nprtva']) ? ' *': ''; // We show the * (old behaviour only if new vat code is not used)

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/menus/standard/eldy.lib.php
Expand Up @@ -871,7 +871,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// VAT
if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
{
$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
$newmenu->add("/compta/tva/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->transcountry("VAT", $mysoc->country_code),1,$user->rights->tax->charges->lire, '', $mainmenu, 'tax_vat');
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/card.php?leftmenu=tax_vat&action=create",$langs->trans("New"),2,$user->rights->tax->charges->creer);
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_vat/i',$leftmenu)) $newmenu->add("/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
Expand Down
32 changes: 24 additions & 8 deletions htdocs/langs/en_US/compta.lang
Expand Up @@ -30,18 +30,34 @@ Piece=Accounting Doc.
AmountHTVATRealReceived=Net collected
AmountHTVATRealPaid=Net paid
VATToPay=VAT sells
VATReceived=VAT received
VATToCollect=VAT purchases
VATSummary=VAT Balance
LT2SummaryES=IRPF Balance
VATReceived=Tax received
VATToCollect=Tax purchases
VATSummary=Tax Balance
VATPaid=Tax paid
LT1Summary=Tax 2 summary
LT2Summary=Tax 3 summary
LT1SummaryES=RE Balance
VATPaid=VAT paid
LT2PaidES=IRPF Paid
LT2SummaryES=IRPF Balance
LT1SummaryIN=CGST Balance
LT2SummaryIN=SGST Balance
LT1Paid=Tax 2 paid
LT2Paid=Tax 3 paid
LT1PaidES=RE Paid
LT2CustomerES=IRPF sales
LT2SupplierES=IRPF purchases
LT2PaidES=IRPF Paid
LT1PaidIN=CGST Paid
LT2PaidIN=SGST Paid
LT1Customer=Tax 2 sales
LT1Supplier=Tax 2 purchases
LT1CustomerES=RE sales
LT1SupplierES=RE purchases
LT1CustomerIN=CGST sales
LT1SupplierIN=CGST purchases
LT2Customer=Tax 3 sales
LT2Supplier=Tax 3 purchases
LT2CustomerES=IRPF sales
LT2SupplierES=IRPF purchases
LT2CustomerIN=SGST sales
LT2SupplierIN=SGST purchases
VATCollected=VAT collected
ToPay=To pay
SpecialExpensesArea=Area for all special payments
Expand Down
9 changes: 9 additions & 0 deletions htdocs/langs/en_US/main.lang
Expand Up @@ -356,17 +356,26 @@ Totalforthispage=Total for this page
TotalTTC=Total (inc. tax)
TotalTTCToYourCredit=Total (inc. tax) to your credit
TotalVAT=Total tax
TotalVATIN=Total IGST
TotalLT1=Total tax 2
TotalLT2=Total tax 3
TotalLT1ES=Total RE
TotalLT2ES=Total IRPF
TotalLT1IN=Total CGST
TotalLT2IN=Total SGST
HT=Net of tax
TTC=Inc. tax
INCT=Inc. all taxes
VAT=Sales tax
VATIN=IGST
VATs=Sales taxes
VATINs=IGST taxes
LT1=Sales tax 2
LT2=Sales tax 3
LT1ES=RE
LT2ES=IRPF
LT1IN=CGST
LT2IN=SGST
VATRate=Tax Rate
Average=Average
Sum=Sum
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/modulebuilder.lang
Expand Up @@ -51,6 +51,7 @@ WidgetFile=Widget file
ReadmeFile=Readme file
ChangeLog=ChangeLog file
SqlFile=Sql file
SqlFileExtraFields=Sql file for complementary attributes
SqlFileKey=Sql file for keys
AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case
UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown)
6 changes: 4 additions & 2 deletions htdocs/langs/en_US/website.lang
Expand Up @@ -12,7 +12,8 @@ MediaFiles=Media library
EditCss=Edit Style/CSS or HTML header
EditMenu=Edit menu
EditPageMeta=Edit Meta
EditPageContent=Edit Content
EditPageSource=Edit HTML Source
EditPageContent=Edit with CKEditor
Website=Web site
Webpage=Web page/container
AddPage=Add page/container
Expand All @@ -33,7 +34,8 @@ PreviewSiteServedByDolibarr=Preview %s in a new tab.<br><br>The %s will be serve
VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined
NoPageYet=No pages yet
SyntaxHelp=Help on code syntax
YouCanEditHtmlSource=You can edit HTML source code using the "Source" button in editor. You can also include PHP code into this source using tags <strong>&lt;?php ?&gt;</strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong>&lt;?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?&gt;</strong><br><br>To include a link to download a file stored into the documents/medias directory, use syntax:<br><strong>&lt;a href="/document.php?modulepart=medias&file=filename.ext"&gt;</strong>.
YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor.
YouCanEditHtmlSource=You can include PHP code into this source using tags <strong>&lt;?php ?&gt;</strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong>&lt;?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?&gt;</strong><br><br>To include a link to download a file stored into the documents/medias directory, use syntax:<br><strong>&lt;a href="/document.php?modulepart=medias&file=filename.ext"&gt;</strong>.
ClonePage=Clone page/container
CloneSite=Clone site
ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page.
Expand Down

0 comments on commit 764c7ac

Please sign in to comment.