Fix: Several fix in vat calculation. Add warning to say deposit invoices are not included.
This commit is contained in:
parent
8bd0a98472
commit
81f9774715
@ -23,7 +23,7 @@
|
|||||||
* \file htdocs/compta/tva/clients.php
|
* \file htdocs/compta/tva/clients.php
|
||||||
* \ingroup tax
|
* \ingroup tax
|
||||||
* \brief Page des societes
|
* \brief Page des societes
|
||||||
* \version $Id$
|
* \version $Id: clients.php,v 1.31 2011/07/18 11:11:19 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require('../../main.inc.php');
|
require('../../main.inc.php');
|
||||||
@ -38,7 +38,7 @@ $langs->load("companies");
|
|||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
|
||||||
// Date range
|
// Date range
|
||||||
$year=$_REQUEST["year"];
|
$year=GETPOST("year");
|
||||||
if (empty($year))
|
if (empty($year))
|
||||||
{
|
{
|
||||||
$year_current = strftime("%Y",dol_now());
|
$year_current = strftime("%Y",dol_now());
|
||||||
@ -52,24 +52,26 @@ $date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"
|
|||||||
// Quarter
|
// Quarter
|
||||||
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||||
{
|
{
|
||||||
$q=(! empty($_REQUEST["q"]))?$_REQUEST["q"]:0;
|
$q=GETPOST("q");
|
||||||
if ($q==0)
|
if (empty($q))
|
||||||
{
|
{
|
||||||
if (isset($_REQUEST["month"])) { $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); }
|
if (isset($_REQUEST["month"])) { $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); }
|
||||||
else $q=1;
|
else
|
||||||
|
{
|
||||||
|
$month_current = strftime("%m",dol_now());
|
||||||
|
if ($month_current >= 10) $q=4;
|
||||||
|
elseif ($month_current >= 7) $q=3;
|
||||||
|
elseif ($month_current >= 4) $q=2;
|
||||||
|
else $q=1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
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==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==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==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); }
|
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// TODO We define q
|
|
||||||
|
|
||||||
}
|
$min = GETPOST("min");
|
||||||
|
|
||||||
$min = $_REQUEST["min"];
|
|
||||||
if (empty($min)) $min = 0;
|
if (empty($min)) $min = 0;
|
||||||
|
|
||||||
// Define modetax (0 or 1)
|
// Define modetax (0 or 1)
|
||||||
@ -78,7 +80,7 @@ $modetax = $conf->global->TAX_MODE;
|
|||||||
if (isset($_REQUEST["modetax"])) $modetax=$_REQUEST["modetax"];
|
if (isset($_REQUEST["modetax"])) $modetax=$_REQUEST["modetax"];
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:'';
|
$socid = GETPOST("socid");
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||||
|
|
||||||
@ -104,7 +106,7 @@ $fsearch.='<br>';
|
|||||||
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
|
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
|
||||||
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
|
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
|
||||||
$fsearch.=' '.$langs->trans("SalesTurnover").' '.$langs->trans("Minimum").': ';
|
$fsearch.=' '.$langs->trans("SalesTurnover").' '.$langs->trans("Minimum").': ';
|
||||||
$fsearch.=' <input type="text" name="min" value="'.$min.'">';
|
$fsearch.=' <input type="text" name="min" id="min" value="'.$min.'" size="6">';
|
||||||
|
|
||||||
// Affiche en-tete du rapport
|
// Affiche en-tete du rapport
|
||||||
if ($modetax==1) // Calculate on invoice for goods and services
|
if ($modetax==1) // Calculate on invoice for goods and services
|
||||||
@ -115,7 +117,8 @@ if ($modetax==1) // Calculate on invoice for goods and services
|
|||||||
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
|
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||||
$description=$langs->trans("RulesVATDue");
|
$description=$langs->trans("RulesVATDue");
|
||||||
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
$description.=$fsearch;
|
if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
||||||
|
$description.=$fsearch;
|
||||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
$builddate=time();
|
$builddate=time();
|
||||||
//$exportlink=$langs->trans("NotYetAvailable");
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
@ -137,9 +140,10 @@ if ($modetax==0) // Invoice for goods, payment for services
|
|||||||
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
|
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||||
$description=$langs->trans("RulesVATIn");
|
$description=$langs->trans("RulesVATIn");
|
||||||
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
$description.=$fsearch;
|
if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
||||||
|
$description.=$fsearch;
|
||||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
$builddate=time();
|
$builddate=time();
|
||||||
//$exportlink=$langs->trans("NotYetAvailable");
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
|
|
||||||
$elementcust=$langs->trans("CustomersInvoices");
|
$elementcust=$langs->trans("CustomersInvoices");
|
||||||
@ -167,7 +171,7 @@ print "<tr class=\"liste_titre\">";
|
|||||||
print '<td align="left">'.$langs->trans("Num")."</td>";
|
print '<td align="left">'.$langs->trans("Num")."</td>";
|
||||||
print '<td align="left">'.$langs->trans("Customer")."</td>";
|
print '<td align="left">'.$langs->trans("Customer")."</td>";
|
||||||
print "<td>".$langs->trans("VATIntra")."</td>";
|
print "<td>".$langs->trans("VATIntra")."</td>";
|
||||||
print "<td align=\"right\">".$langs->trans("SalesTurnover")." ".$langs->trans("HT")."</td>";
|
print "<td align=\"right\">".$langs->trans("AmountHTVATRealReceived")."</td>";
|
||||||
print "<td align=\"right\">".$vatcust."</td>";
|
print "<td align=\"right\">".$vatcust."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -175,7 +179,7 @@ $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell');
|
|||||||
if (is_array($coll_list))
|
if (is_array($coll_list))
|
||||||
{
|
{
|
||||||
$var=true;
|
$var=true;
|
||||||
$total = 0; $subtotal = 0;
|
$total = 0; $totalamount = 0;
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($coll_list as $coll)
|
foreach($coll_list as $coll)
|
||||||
{
|
{
|
||||||
@ -191,10 +195,11 @@ if (is_array($coll_list))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$intra = $langs->trans('NotRegistered');
|
//$intra = $langs->trans('NotRegistered');
|
||||||
|
$intra = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "<tr $bc[$var]>";
|
print "<tr ".$bc[$var].">";
|
||||||
print "<td nowrap>".$i."</td>";
|
print "<td nowrap>".$i."</td>";
|
||||||
$company_static->id=$coll->socid;
|
$company_static->id=$coll->socid;
|
||||||
$company_static->nom=$coll->nom;
|
$company_static->nom=$coll->nom;
|
||||||
@ -204,13 +209,17 @@ if (is_array($coll_list))
|
|||||||
print "<td nowrap>".$intra."</td>";
|
print "<td nowrap>".$intra."</td>";
|
||||||
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
|
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
|
||||||
print "<td nowrap align=\"right\">".price($coll->tva)."</td>";
|
print "<td nowrap align=\"right\">".price($coll->tva)."</td>";
|
||||||
|
$totalamount = $totalamount + $coll->amount;
|
||||||
$total = $total + $coll->tva;
|
$total = $total + $coll->tva;
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$x_coll_sum = $total;
|
||||||
|
|
||||||
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total").':</td><td nowrap align="right"><b>'.price($total).'</b></td>';
|
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
|
||||||
|
print '<td nowrap align="right">'.price($totalamount).'</td>';
|
||||||
|
print '<td nowrap align="right">'.price($total).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -237,7 +246,7 @@ print "<tr class=\"liste_titre\">";
|
|||||||
print '<td align="left">'.$langs->trans("Num")."</td>";
|
print '<td align="left">'.$langs->trans("Num")."</td>";
|
||||||
print '<td align="left">'.$langs->trans("Supplier")."</td>";
|
print '<td align="left">'.$langs->trans("Supplier")."</td>";
|
||||||
print "<td>".$langs->trans("VATIntra")."</td>";
|
print "<td>".$langs->trans("VATIntra")."</td>";
|
||||||
print "<td align=\"right\">".$langs->trans("Outcome")." ".$langs->trans("HT")."</td>";
|
print "<td align=\"right\">".$langs->trans("AmountHTVATRealPaid")."</td>";
|
||||||
print "<td align=\"right\">".$vatsup."</td>";
|
print "<td align=\"right\">".$vatsup."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -247,7 +256,7 @@ $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy');
|
|||||||
if (is_array($coll_list))
|
if (is_array($coll_list))
|
||||||
{
|
{
|
||||||
$var=true;
|
$var=true;
|
||||||
$total = 0; $subtotal = 0;
|
$total = 0; $totalamount = 0;
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($coll_list as $coll)
|
foreach($coll_list as $coll)
|
||||||
{
|
{
|
||||||
@ -263,7 +272,8 @@ if (is_array($coll_list))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$intra = $langs->trans('NotRegistered');
|
//$intra = $langs->trans('NotRegistered');
|
||||||
|
$intra = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
@ -276,14 +286,30 @@ if (is_array($coll_list))
|
|||||||
print "<td nowrap>".$intra."</td>";
|
print "<td nowrap>".$intra."</td>";
|
||||||
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
|
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
|
||||||
print "<td nowrap align=\"right\">".price($coll->tva)."</td>";
|
print "<td nowrap align=\"right\">".price($coll->tva)."</td>";
|
||||||
|
$totalamount = $totalamount + $coll->amount;
|
||||||
$total = $total + $coll->tva;
|
$total = $total + $coll->tva;
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$x_paye_sum = $total;
|
||||||
|
|
||||||
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total").':</td><td nowrap align="right"><b>'.price($total).'</b></td>';
|
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
|
||||||
|
print '<td nowrap align="right">'.price($totalamount).'</td>';
|
||||||
|
print '<td nowrap align="right">'.price($total).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
// Total to pay
|
||||||
|
print '<br><br>';
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
$diff = $x_coll_sum - $x_paye_sum;
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td class="liste_total" colspan="4">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').'</td>';
|
||||||
|
print '<td class="liste_total" nowrap="nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -301,5 +327,5 @@ print '</table>';
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/07/18 11:11:19 $ - $Revision: 1.31 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
* \file htdocs/compta/tva/quadri_detail.php
|
* \file htdocs/compta/tva/quadri_detail.php
|
||||||
* \ingroup tax
|
* \ingroup tax
|
||||||
* \brief Trimestrial page - detailed version
|
* \brief Trimestrial page - detailed version
|
||||||
* \version $Id$
|
* \version $Id: quadri_detail.php,v 1.43 2011/07/18 11:11:19 eldy Exp $
|
||||||
* \todo Deal with recurrent invoices as well
|
* \todo Deal with recurrent invoices as well
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ $langs->load("companies");
|
|||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
|
||||||
// Date range
|
// Date range
|
||||||
$year=$_REQUEST["year"];
|
$year=GETPOST("year");
|
||||||
if (empty($year))
|
if (empty($year))
|
||||||
{
|
{
|
||||||
$year_current = strftime("%Y",dol_now());
|
$year_current = strftime("%Y",dol_now());
|
||||||
@ -58,24 +58,26 @@ $date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"
|
|||||||
// Quarter
|
// Quarter
|
||||||
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||||
{
|
{
|
||||||
$q=(! empty($_REQUEST["q"]))?$_REQUEST["q"]:0;
|
$q=GETPOST("q");
|
||||||
if ($q==0)
|
if (empty($q))
|
||||||
{
|
{
|
||||||
if (isset($_REQUEST["month"])) { $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); }
|
if (isset($_REQUEST["month"])) { $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); }
|
||||||
else $q=1;
|
else
|
||||||
|
{
|
||||||
|
$month_current = strftime("%m",dol_now());
|
||||||
|
if ($month_current >= 10) $q=4;
|
||||||
|
elseif ($month_current >= 7) $q=3;
|
||||||
|
elseif ($month_current >= 4) $q=2;
|
||||||
|
else $q=1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
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==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==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==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); }
|
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// TODO We define q
|
|
||||||
|
|
||||||
}
|
$min = GETPOST("min");
|
||||||
|
|
||||||
$min = $_REQUEST["min"];
|
|
||||||
if (empty($min)) $min = 0;
|
if (empty($min)) $min = 0;
|
||||||
|
|
||||||
// Define modetax (0 or 1)
|
// Define modetax (0 or 1)
|
||||||
@ -85,7 +87,7 @@ if (isset($_REQUEST["modetax"])) $modetax=$_REQUEST["modetax"];
|
|||||||
if (empty($modetax)) $modetax=0;
|
if (empty($modetax)) $modetax=0;
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = isset($_REQUEST["socid"])?$_REQUEST["socid"]:'';
|
$socid = GETPOST("socid");
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||||
|
|
||||||
@ -134,9 +136,10 @@ if ($modetax==1) // Calculate on invoice for goods and services
|
|||||||
else { $nextquarter=1; $nextyear++; }
|
else { $nextquarter=1; $nextyear++; }
|
||||||
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
|
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||||
$description=$langs->trans("RulesVATDue");
|
$description=$langs->trans("RulesVATDue");
|
||||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
|
||||||
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
$description.=$fsearch;
|
if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
||||||
|
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
|
$description.=$fsearch;
|
||||||
$builddate=time();
|
$builddate=time();
|
||||||
//$exportlink=$langs->trans("NotYetAvailable");
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
|
|
||||||
@ -164,7 +167,8 @@ if ($modetax==0) // Invoice for goods, payment for services
|
|||||||
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
|
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||||
$description=$langs->trans("RulesVATIn");
|
$description=$langs->trans("RulesVATIn");
|
||||||
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
$description.=$fsearch;
|
if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
||||||
|
$description.=$fsearch;
|
||||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
$builddate=time();
|
$builddate=time();
|
||||||
//$exportlink=$langs->trans("NotYetAvailable");
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
@ -188,14 +192,10 @@ $vatsup=$langs->trans("VATPaid");
|
|||||||
|
|
||||||
// VAT Received and paid
|
// VAT Received and paid
|
||||||
|
|
||||||
//print "<br>";
|
|
||||||
//print_titre($vatcust);
|
|
||||||
|
|
||||||
echo '<table class="noborder" width="100%">';
|
echo '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
$y = $year_current;
|
$y = $year_current;
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$subtotal = 0;
|
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
// Load arrays of datas
|
// Load arrays of datas
|
||||||
@ -416,21 +416,36 @@ else
|
|||||||
$x_coll_sum += $temp_vat;
|
$x_coll_sum += $temp_vat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Total customers for this vat rate
|
||||||
// Total customers
|
print '<tr class="liste_total">';
|
||||||
print '<tr class="liste_total">';
|
print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
print '<td align="right">'.$langs->trans("Total").':</td>';
|
if ($modetax == 0)
|
||||||
if ($modetax == 0)
|
{
|
||||||
{
|
print '<td nowrap align="right"> </td>';
|
||||||
print '<td nowrap align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
print '<td align="right"> </td>';
|
}
|
||||||
}
|
print '<td align="right">'.price(price2num($subtot_coll_total_ht,'MT')).'</td>';
|
||||||
print '<td align="right">'.price(price2num($subtot_coll_total_ht,'MT')).'</td>';
|
print '<td nowrap align="right">'.price(price2num($subtot_coll_vat,'MT')).'</td>';
|
||||||
print '<td nowrap align="right">'.price(price2num($subtot_coll_vat,'MT')).'</td>';
|
print '</tr>';
|
||||||
print '</tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count($x_coll) == 0) // Show a total ine if nothing shown
|
||||||
|
{
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
|
if ($modetax == 0)
|
||||||
|
{
|
||||||
|
print '<td nowrap align="right"> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
}
|
||||||
|
print '<td align="right">'.price(price2num(0,'MT')).'</td>';
|
||||||
|
print '<td nowrap align="right">'.price(price2num(0,'MT')).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Blank line
|
||||||
print '<tr><td colspan="'.($span+1).'"> </td></tr>';
|
print '<tr><td colspan="'.($span+1).'"> </td></tr>';
|
||||||
|
|
||||||
//print table headers for this quadri - expenses now
|
//print table headers for this quadri - expenses now
|
||||||
@ -552,41 +567,51 @@ else
|
|||||||
$x_paye_sum += $temp_vat;
|
$x_paye_sum += $temp_vat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Total suppliers for this vat rate
|
||||||
// Total suppliers
|
print '<tr class="liste_total">';
|
||||||
print '<tr class="liste_total">';
|
print '<td> </td>';
|
||||||
print '<td> </td>';
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
print '<td align="right">'.$langs->trans("Total").':</td>';
|
if ($modetax == 0)
|
||||||
if ($modetax == 0)
|
{
|
||||||
{
|
print '<td nowrap align="right"> </td>';
|
||||||
print '<td nowrap align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
print '<td align="right"> </td>';
|
}
|
||||||
}
|
print '<td align="right">'.price(price2num($subtot_paye_total_ht,'MT')).'</td>';
|
||||||
print '<td align="right">'.price(price2num($subtot_paye_total_ht,'MT')).'</td>';
|
print '<td nowrap align="right">'.price(price2num($subtot_paye_vat,'MT')).'</td>';
|
||||||
print '<td nowrap align="right">'.price(price2num($subtot_paye_vat,'MT')).'</td>';
|
print '</tr>';
|
||||||
print '</tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr><td colspan="'.($span+1).'"> </td></tr>';
|
if (count($x_paye) == 0) // Show a total ine if nothing shown
|
||||||
|
{
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
|
if ($modetax == 0)
|
||||||
|
{
|
||||||
|
print '<td nowrap align="right"> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
}
|
||||||
|
print '<td align="right">'.price(price2num(0,'MT')).'</td>';
|
||||||
|
print '<td nowrap align="right">'.price(price2num(0,'MT')).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
// Total to pay
|
// Total to pay
|
||||||
print '<tr class="liste_titre">';
|
print '<br><br>';
|
||||||
print '<td class="liste_titre" colspan="'.($span-1).'"></td><td class="liste_titre" align="right" colspan="2">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').':</td>';
|
print '<table class="noborder" width="100%">';
|
||||||
print '</tr>'."\n";
|
$diff = $x_coll_sum - $x_paye_sum;
|
||||||
|
|
||||||
$diff = $x_coll_sum - $x_paye_sum;
|
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td class="liste_total" colspan="'.$span.'"></td>';
|
print '<td class="liste_total" colspan="'.$span.'">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').'</td>';
|
||||||
print '<td class="liste_total" nowrap="nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
|
print '<td class="liste_total" nowrap="nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
//print '<tr><td colspan="'.($span+1).'"> </td></tr>'."\n";
|
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/07/18 11:11:19 $ - $Revision: 1.43 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -128,3 +128,4 @@ InvoiceRef=Invoice ref.
|
|||||||
CodeNotDef=Not defined
|
CodeNotDef=Not defined
|
||||||
AddRemind=Dispatch available amount
|
AddRemind=Dispatch available amount
|
||||||
RemainToDivide= Remain to dispatch :
|
RemainToDivide= Remain to dispatch :
|
||||||
|
WarningDepositsNotIncluded=Deposits invoices are not included in this version with this accountancy module.
|
||||||
@ -140,3 +140,4 @@ COMPTA_ACCOUNT_CUSTOMER=Code comptable client par défaut (si non défini sur fi
|
|||||||
COMPTA_ACCOUNT_SUPPLIER=Code comptable fournisseur par défaut (si non défini sur fiche tiers)
|
COMPTA_ACCOUNT_SUPPLIER=Code comptable fournisseur par défaut (si non défini sur fiche tiers)
|
||||||
AddRemind=Ventiler montant disponible
|
AddRemind=Ventiler montant disponible
|
||||||
RemainToDivide=Reste à répartir :
|
RemainToDivide=Reste à répartir :
|
||||||
|
WarningDepositsNotIncluded=Les factures d'accomptes ne sont pas encore prises en compte dans cette version avec ce module de comptabilité.
|
||||||
@ -21,7 +21,7 @@
|
|||||||
* \file htdocs/lib/tax.lib.php
|
* \file htdocs/lib/tax.lib.php
|
||||||
* \ingroup tax
|
* \ingroup tax
|
||||||
* \brief Library for tax module
|
* \brief Library for tax module
|
||||||
* \version $Id: tax.lib.php,v 1.20 2011/07/04 09:01:37 eldy Exp $
|
* \version $Id: tax.lib.php,v 1.21 2011/07/18 11:11:19 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -142,8 +142,8 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! $sql) return -1;
|
if (! $sql) return -1;
|
||||||
if ($sql && $sql=='TODO') return -2;
|
if ($sql == 'TODO') return -2;
|
||||||
if ($sql && $sql!='TODO')
|
if ($sql != 'TODO')
|
||||||
{
|
{
|
||||||
dol_syslog("Tax.lib:thirdparty sql=".$sql);
|
dol_syslog("Tax.lib:thirdparty sql=".$sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -316,8 +316,8 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
|
|
||||||
//print $sql.'<br>';
|
//print $sql.'<br>';
|
||||||
if (! $sql) return -1;
|
if (! $sql) return -1;
|
||||||
if ($sql && $sql=='TODO') return -2;
|
if ($sql == 'TODO') return -2;
|
||||||
if ($sql && $sql!='TODO')
|
if ($sql != 'TODO')
|
||||||
{
|
{
|
||||||
dol_syslog("Tax.lib.php::vat_by_date sql=".$sql);
|
dol_syslog("Tax.lib.php::vat_by_date sql=".$sql);
|
||||||
|
|
||||||
@ -477,8 +477,8 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
dol_syslog("Tax.lib.php::vat_by_date no accountancy module enabled".$sql,LOG_ERR);
|
dol_syslog("Tax.lib.php::vat_by_date no accountancy module enabled".$sql,LOG_ERR);
|
||||||
return -1; // -1 = Not accountancy module enabled
|
return -1; // -1 = Not accountancy module enabled
|
||||||
}
|
}
|
||||||
if ($sql && $sql=='TODO') return -2; // -2 = Feature not yet available
|
if ($sql == 'TODO') return -2; // -2 = Feature not yet available
|
||||||
if ($sql && $sql!='TODO')
|
if ($sql != 'TODO')
|
||||||
{
|
{
|
||||||
dol_syslog("Tax.lib.php::vat_by_date sql=".$sql);
|
dol_syslog("Tax.lib.php::vat_by_date sql=".$sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user