Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
bddee5d01f
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -154,7 +154,7 @@ if ($result) {
|
|||||||
print_liste_field_titre($langs->trans("Accountparent"), $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Accountparent"), $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Active"), $_SERVER["PHP_SELF"], "aa.active", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Activated"), $_SERVER["PHP_SELF"], "aa.active", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -174,12 +174,17 @@ if ($result) {
|
|||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
|
$accountstatic=new AccountingAccount($db);
|
||||||
|
|
||||||
while ( $i < min($num, $limit) ) {
|
while ( $i < min($num, $limit) ) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$var = ! $var;
|
$accountstatic->id=$obj->rowid;
|
||||||
|
$accountstatic->label=$obj->label;
|
||||||
|
$accountstatic->account_number=$obj->account_number;
|
||||||
|
|
||||||
print '<tr ' . $bc[$var] . '>';
|
print '<tr ' . $bc[$var] . '>';
|
||||||
print '<td><a href="./card.php?id=' . $obj->rowid . '">' . $obj->account_number . '</td>';
|
print '<td>' . $accountstatic->getNomUrl(1) . '</td>';
|
||||||
print '<td>' . $obj->label . '</td>';
|
print '<td>' . $obj->label . '</td>';
|
||||||
print '<td>' . $obj->account_parent . '</td>';
|
print '<td>' . $obj->account_parent . '</td>';
|
||||||
print '<td>' . $obj->pcg_type . '</td>';
|
print '<td>' . $obj->pcg_type . '</td>';
|
||||||
@ -210,6 +215,7 @@ if ($result) {
|
|||||||
print '</td>' . "\n";
|
print '</td>' . "\n";
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
$var=!$var;
|
||||||
$i ++;
|
$i ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@ -66,8 +66,7 @@ class AccountingAccount extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function fetch($rowid = null, $account_number = null)
|
function fetch($rowid = null, $account_number = null)
|
||||||
{
|
{
|
||||||
if ($rowid || $account_number)
|
if ($rowid || $account_number) {
|
||||||
{
|
|
||||||
$sql = "SELECT rowid, datec, tms, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, fk_user_author, fk_user_modif, active";
|
$sql = "SELECT rowid, datec, tms, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, fk_user_author, fk_user_modif, active";
|
||||||
$sql.= " FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE";
|
$sql.= " FROM " . MAIN_DB_PREFIX . "accountingaccount WHERE";
|
||||||
if ($rowid) {
|
if ($rowid) {
|
||||||
@ -78,12 +77,10 @@ class AccountingAccount extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
|
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
if ($obj)
|
if ($obj) {
|
||||||
{
|
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
$this->rowid = $obj->rowid;
|
$this->rowid = $obj->rowid;
|
||||||
$this->datec = $obj->datec;
|
$this->datec = $obj->datec;
|
||||||
@ -99,18 +96,13 @@ class AccountingAccount extends CommonObject
|
|||||||
$this->active = $obj->active;
|
$this->active = $obj->active;
|
||||||
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,6 +336,31 @@ class AccountingAccount extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return clicable name (with picto eventually)
|
||||||
|
*
|
||||||
|
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||||
|
* @return string Chaine avec URL
|
||||||
|
*/
|
||||||
|
function getNomUrl($withpicto=0)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$result='';
|
||||||
|
|
||||||
|
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$this->id.'">';
|
||||||
|
$linkend='</a>';
|
||||||
|
|
||||||
|
$picto='billr';
|
||||||
|
|
||||||
|
$label=$langs->trans("Show").': '.$this->account_number.' - '.$this->label;
|
||||||
|
|
||||||
|
if ($withpicto) $result.=($link.img_object($label,$picto).$linkend);
|
||||||
|
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||||
|
if ($withpicto != 2) $result.=$link.$this->account_number.$linkend;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information on record
|
* Information on record
|
||||||
*
|
*
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -203,7 +203,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
|
|||||||
|
|
||||||
if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire)
|
if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, x.rowid, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status";
|
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE u.rowid = x.fk_user_author";
|
$sql.= " WHERE u.rowid = x.fk_user_author";
|
||||||
@ -238,8 +238,8 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
|
|||||||
while ($i < $num && $i < $max)
|
while ($i < $num && $i < $max)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$expensereportstatic->ref=$obj->rowid;
|
|
||||||
$expensereportstatic->id=$obj->rowid;
|
$expensereportstatic->id=$obj->rowid;
|
||||||
|
$expensereportstatic->ref=$obj->ref;
|
||||||
$userstatic->id=$obj->uid;
|
$userstatic->id=$obj->uid;
|
||||||
$userstatic->lastname=$obj->lastname;
|
$userstatic->lastname=$obj->lastname;
|
||||||
$userstatic->firstname=$obj->firstname;
|
$userstatic->firstname=$obj->firstname;
|
||||||
|
|||||||
@ -21,7 +21,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
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
@ -39,8 +40,7 @@ $langs->load("other");
|
|||||||
|
|
||||||
// Date range
|
// Date range
|
||||||
$year=GETPOST("year");
|
$year=GETPOST("year");
|
||||||
if (empty($year))
|
if (empty($year)) {
|
||||||
{
|
|
||||||
$year_current = strftime("%Y",dol_now());
|
$year_current = strftime("%Y",dol_now());
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
} else {
|
} else {
|
||||||
@ -50,38 +50,55 @@ if (empty($year))
|
|||||||
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]);
|
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]);
|
||||||
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
||||||
// 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=GETPOST("q");
|
||||||
$q=GETPOST("q");
|
if (empty($q)) {
|
||||||
if (empty($q))
|
if (isset($_REQUEST["month"])) {
|
||||||
{
|
$date_start=dol_get_first_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); }
|
$date_end=dol_get_last_day($year_start,$_REQUEST["month"],false);
|
||||||
else
|
} else {
|
||||||
{
|
$month_current = strftime("%m",dol_now());
|
||||||
$month_current = strftime("%m",dol_now());
|
if ($month_current >= 10) $q=4;
|
||||||
if ($month_current >= 10) $q=4;
|
elseif ($month_current >= 7) $q=3;
|
||||||
elseif ($month_current >= 7) $q=3;
|
elseif ($month_current >= 4) $q=2;
|
||||||
elseif ($month_current >= 4) $q=2;
|
else $q=1;
|
||||||
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) {
|
||||||
if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); }
|
$date_start=dol_get_first_day($year_start,1,false);
|
||||||
if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); }
|
$date_end=dol_get_last_day($year_start,3,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==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 = GETPOST("min");
|
$min = GETPOST("min");
|
||||||
if (empty($min)) $min = 0;
|
if (empty($min)) {
|
||||||
|
$min = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Define modetax (0 or 1)
|
// Define modetax (0 or 1)
|
||||||
// 0=normal, 1=option vat for services is on debit
|
// 0=normal, 1=option vat for services is on debit
|
||||||
$modetax = $conf->global->TAX_MODE;
|
$modetax = $conf->global->TAX_MODE;
|
||||||
if (isset($_REQUEST["modetax"])) $modetax=$_REQUEST["modetax"];
|
if (isset($_REQUEST["modetax"])) {
|
||||||
|
$modetax=$_REQUEST["modetax"];
|
||||||
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid','int');
|
$socid = GETPOST('socid','int');
|
||||||
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');
|
||||||
|
|
||||||
|
|
||||||
@ -95,9 +112,15 @@ $company_static=new Societe($db);
|
|||||||
|
|
||||||
$morequerystring='';
|
$morequerystring='';
|
||||||
$listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday');
|
$listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday');
|
||||||
foreach($listofparams as $param)
|
foreach($listofparams as $param) {
|
||||||
{
|
if (GETPOST($param)!='') {
|
||||||
if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
|
$morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$special_report = false;
|
||||||
|
if (isset($_REQUEST['extra_report']) && $_REQUEST['extra_report'] == 1) {
|
||||||
|
$special_report = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
llxHeader('','','','',0,0,'','',$morequerystring);
|
llxHeader('','','','',0,0,'','',$morequerystring);
|
||||||
@ -109,62 +132,92 @@ $fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
|
|||||||
$fsearch.=' <input type="text" name="min" id="min" value="'.$min.'" size="6">';
|
$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
|
||||||
{
|
$name=$langs->trans("VATReportByCustomersInDueDebtMode");
|
||||||
$name=$langs->trans("VATReportByCustomersInDueDebtMode");
|
|
||||||
$calcmode=$langs->trans("CalcModeVATDebt");
|
$calcmode=$langs->trans("CalcModeVATDebt");
|
||||||
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
//$name.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=0">','</a>').')';
|
//$name.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=0">','</a>').')';
|
||||||
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||||
//$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("RulesVATDueServices");
|
$description=$langs->trans("RulesVATDueServices");
|
||||||
$description.='<br>';
|
$description.='<br>';
|
||||||
$description.=$langs->trans("RulesVATDueProducts");
|
$description.=$langs->trans("RulesVATDueProducts");
|
||||||
//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');
|
||||||
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='<br>'.$langs->trans("DepositsAreNotIncluded");
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
else $description.='<br>'.$langs->trans("DepositsAreIncluded");
|
$description.='<br>'.$langs->trans("DepositsAreNotIncluded");
|
||||||
|
} else {
|
||||||
|
$description.='<br>'.$langs->trans("DepositsAreIncluded");
|
||||||
|
}
|
||||||
$description.=$fsearch;
|
$description.=$fsearch;
|
||||||
|
$description.='<br>'
|
||||||
|
. '<input type="radio" name="extra_report" value="0" '.($special_report?'':'checked="checked"').'> '
|
||||||
|
. $langs->trans('SimpleReport')
|
||||||
|
. '</input>'
|
||||||
|
. '<br>'
|
||||||
|
. '<input type="radio" name="extra_report" value="1" '.($special_report?'checked="checked"':'').'> '
|
||||||
|
. $langs->trans('AddExtraReport')
|
||||||
|
. '</input>'
|
||||||
|
. '<br>';
|
||||||
$builddate=time();
|
$builddate=time();
|
||||||
//$exportlink=$langs->trans("NotYetAvailable");
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
|
|
||||||
$elementcust=$langs->trans("CustomersInvoices");
|
$elementcust=$langs->trans("CustomersInvoices");
|
||||||
$productcust=$langs->trans("Description");
|
$productcust=$langs->trans("Description");
|
||||||
$amountcust=$langs->trans("AmountHT");
|
$amountcust=$langs->trans("AmountHT");
|
||||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
if ($mysoc->tva_assuj) {
|
||||||
|
$vatcust.=' ('.$langs->trans("ToPay").')';
|
||||||
|
}
|
||||||
$elementsup=$langs->trans("SuppliersInvoices");
|
$elementsup=$langs->trans("SuppliersInvoices");
|
||||||
$productsup=$langs->trans("Description");
|
$productsup=$langs->trans("Description");
|
||||||
$amountsup=$langs->trans("AmountHT");
|
$amountsup=$langs->trans("AmountHT");
|
||||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
if ($mysoc->tva_assuj) {
|
||||||
|
$vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($modetax==0) // Invoice for goods, payment for services
|
if ($modetax==0) { // Invoice for goods, payment for services
|
||||||
{
|
$name=$langs->trans("VATReportByCustomersInInputOutputMode");
|
||||||
$name=$langs->trans("VATReportByCustomersInInputOutputMode");
|
$calcmode=$langs->trans("CalcModeVATEngagement");
|
||||||
$calcmode=$langs->trans("CalcModeVATEngagement");
|
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
//$name.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=1">','</a>').')';
|
||||||
//$name.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=1">','</a>').')';
|
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||||
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
//$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("RulesVATInServices");
|
||||||
$description=$langs->trans("RulesVATInServices");
|
$description.=' '.$langs->trans("DepositsAreIncluded");
|
||||||
$description.=' '.$langs->trans("DepositsAreIncluded");
|
$description.='<br>';
|
||||||
$description.='<br>';
|
$description.=$langs->trans("RulesVATInProducts");
|
||||||
$description.=$langs->trans("RulesVATInProducts");
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded");
|
$description .= ' ' . $langs->trans("DepositsAreNotIncluded");
|
||||||
else $description.=' '.$langs->trans("DepositsAreIncluded");
|
} else {
|
||||||
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
$description .= ' ' . $langs->trans("DepositsAreIncluded");
|
||||||
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
}
|
||||||
$description.=$fsearch;
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
$builddate=time();
|
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
||||||
//$exportlink=$langs->trans("NotYetAvailable");
|
$description.=$fsearch;
|
||||||
|
$description.='<br>'
|
||||||
|
. '<input type="radio" name="extra_report" value="0" '.($special_report?'':'checked="checked"').'> '
|
||||||
|
. $langs->trans('SimpleReport')
|
||||||
|
. '</input>'
|
||||||
|
. '<br>'
|
||||||
|
. '<input type="radio" name="extra_report" value="1" '.($special_report?'checked="checked"':'').'> '
|
||||||
|
. $langs->trans('AddExtraReport')
|
||||||
|
. '</input>'
|
||||||
|
. '<br>';
|
||||||
|
$builddate=time();
|
||||||
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
|
|
||||||
$elementcust=$langs->trans("CustomersInvoices");
|
$elementcust=$langs->trans("CustomersInvoices");
|
||||||
$productcust=$langs->trans("Description");
|
$productcust=$langs->trans("Description");
|
||||||
$amountcust=$langs->trans("AmountHT");
|
$amountcust=$langs->trans("AmountHT");
|
||||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
if ($mysoc->tva_assuj) {
|
||||||
|
$vatcust.=' ('.$langs->trans("ToPay").')';
|
||||||
|
}
|
||||||
$elementsup=$langs->trans("SuppliersInvoices");
|
$elementsup=$langs->trans("SuppliersInvoices");
|
||||||
$productsup=$langs->trans("Description");
|
$productsup=$langs->trans("Description");
|
||||||
$amountsup=$langs->trans("AmountHT");
|
$amountsup=$langs->trans("AmountHT");
|
||||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
if ($mysoc->tva_assuj) {
|
||||||
|
$vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode);
|
report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode);
|
||||||
|
|
||||||
@ -198,25 +251,18 @@ $parameters["direction"] = 'sell';
|
|||||||
$hookmanager->initHooks(array('externalbalance'));
|
$hookmanager->initHooks(array('externalbalance'));
|
||||||
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (is_array($coll_list))
|
if (is_array($coll_list)) {
|
||||||
{
|
|
||||||
$var=true;
|
$var=true;
|
||||||
$total = 0; $totalamount = 0;
|
$total = 0; $totalamount = 0;
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($coll_list as $coll)
|
foreach ($coll_list as $coll) {
|
||||||
{
|
if ($min == 0 or ($min > 0 && $coll->amount > $min)) {
|
||||||
if($min == 0 or ($min > 0 && $coll->amount > $min))
|
|
||||||
{
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$intra = str_replace($find,$replace,$coll->tva_intra);
|
$intra = str_replace($find,$replace,$coll->tva_intra);
|
||||||
if(empty($intra))
|
if(empty($intra)) {
|
||||||
{
|
if($coll->assuj == '1') {
|
||||||
if($coll->assuj == '1')
|
|
||||||
{
|
|
||||||
$intra = $langs->trans('Unknown');
|
$intra = $langs->trans('Unknown');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
//$intra = $langs->trans('NotRegistered');
|
//$intra = $langs->trans('NotRegistered');
|
||||||
$intra = '';
|
$intra = '';
|
||||||
}
|
}
|
||||||
@ -232,28 +278,27 @@ if (is_array($coll_list))
|
|||||||
print '<td class="nowrap">'.$intra."</td>";
|
print '<td class="nowrap">'.$intra."</td>";
|
||||||
print "<td class=\"nowrap\" align=\"right\">".price($coll->amount)."</td>";
|
print "<td class=\"nowrap\" align=\"right\">".price($coll->amount)."</td>";
|
||||||
print "<td class=\"nowrap\" align=\"right\">".price($coll->tva)."</td>";
|
print "<td class=\"nowrap\" align=\"right\">".price($coll->tva)."</td>";
|
||||||
$totalamount = $totalamount + $coll->amount;
|
$totalamount = $totalamount + $coll->amount;
|
||||||
$total = $total + $coll->tva;
|
$total = $total + $coll->tva;
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$x_coll_sum = $total;
|
$x_coll_sum = $total;
|
||||||
|
|
||||||
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
|
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
|
||||||
print '<td class="nowrap" align="right">'.price($totalamount).'</td>';
|
print '<td class="nowrap" align="right">'.price($totalamount).'</td>';
|
||||||
print '<td class="nowrap" align="right">'.price($total).'</td>';
|
print '<td class="nowrap" align="right">'.price($total).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
if ($coll_list == -1)
|
if ($coll_list == -1) {
|
||||||
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
|
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
|
||||||
else if ($coll_list == -2)
|
} else if ($coll_list == -2) {
|
||||||
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
|
||||||
else
|
} else {
|
||||||
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
|
print '<tr><td colspan="5">' . $langs->trans("Error") . '</td></tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//print '</table>';
|
//print '</table>';
|
||||||
@ -279,25 +324,18 @@ $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy');
|
|||||||
|
|
||||||
$parameters["direction"] = 'buy';
|
$parameters["direction"] = 'buy';
|
||||||
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
if (is_array($coll_list))
|
if (is_array($coll_list)) {
|
||||||
{
|
|
||||||
$var=true;
|
$var=true;
|
||||||
$total = 0; $totalamount = 0;
|
$total = 0; $totalamount = 0;
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($coll_list as $coll)
|
foreach ($coll_list as $coll) {
|
||||||
{
|
if ($min == 0 or ($min > 0 && $coll->amount > $min)) {
|
||||||
if($min == 0 or ($min > 0 && $coll->amount > $min))
|
|
||||||
{
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$intra = str_replace($find,$replace,$coll->tva_intra);
|
$intra = str_replace($find,$replace,$coll->tva_intra);
|
||||||
if(empty($intra))
|
if (empty($intra)) {
|
||||||
{
|
if ($coll->assuj == '1') {
|
||||||
if($coll->assuj == '1')
|
|
||||||
{
|
|
||||||
$intra = $langs->trans('Unknown');
|
$intra = $langs->trans('Unknown');
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
//$intra = $langs->trans('NotRegistered');
|
//$intra = $langs->trans('NotRegistered');
|
||||||
$intra = '';
|
$intra = '';
|
||||||
}
|
}
|
||||||
@ -313,44 +351,197 @@ if (is_array($coll_list))
|
|||||||
print '<td class="nowrap">'.$intra."</td>";
|
print '<td class="nowrap">'.$intra."</td>";
|
||||||
print "<td class=\"nowrap\" align=\"right\">".price($coll->amount)."</td>";
|
print "<td class=\"nowrap\" align=\"right\">".price($coll->amount)."</td>";
|
||||||
print "<td class=\"nowrap\" align=\"right\">".price($coll->tva)."</td>";
|
print "<td class=\"nowrap\" align=\"right\">".price($coll->tva)."</td>";
|
||||||
$totalamount = $totalamount + $coll->amount;
|
$totalamount = $totalamount + $coll->amount;
|
||||||
$total = $total + $coll->tva;
|
$total = $total + $coll->tva;
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$x_paye_sum = $total;
|
$x_paye_sum = $total;
|
||||||
|
|
||||||
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
|
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
|
||||||
print '<td class="nowrap" align="right">'.price($totalamount).'</td>';
|
print '<td class="nowrap" align="right">'.price($totalamount).'</td>';
|
||||||
print '<td class="nowrap" align="right">'.price($total).'</td>';
|
print '<td class="nowrap" align="right">'.price($total).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
// Total to pay
|
// Total to pay
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
$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="4">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').'</td>';
|
print '<td class="liste_total" colspan="4">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').'</td>';
|
||||||
print '<td class="liste_total nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
|
print '<td class="liste_total nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
if ($coll_list == -1)
|
if ($coll_list == -1) {
|
||||||
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
|
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
|
||||||
else if ($coll_list == -2)
|
} else if ($coll_list == -2) {
|
||||||
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
|
||||||
else
|
} else {
|
||||||
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
|
print '<tr><td colspan="5">' . $langs->trans("Error") . '</td></tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
if ($special_report) {
|
||||||
|
// Get country 2-letters code
|
||||||
|
global $mysoc;
|
||||||
|
$country_id = $mysoc->country_id;
|
||||||
|
$country = new Ccountry($db);
|
||||||
|
$country->fetch($country_id);
|
||||||
|
|
||||||
|
// Print listing of other-country customers as additional report
|
||||||
|
// This matches tax requirements to list all same-country customers (only)
|
||||||
|
print '<h3>'.$langs->trans('OtherCountriesCustomersReport').'</h3>';
|
||||||
|
print $langs->trans('BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry');
|
||||||
|
$coll_list = vat_by_thirdparty($db, 0, $date_start, $date_end, $modetax, 'sell');
|
||||||
|
|
||||||
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
|
print "<tr class=\"liste_titre\">";
|
||||||
|
print '<td align="left">' . $langs->trans("Num") . "</td>";
|
||||||
|
print '<td align="left">' . $langs->trans("Customer") . "</td>";
|
||||||
|
print "<td>" . $langs->trans("VATIntra") . "</td>";
|
||||||
|
print "<td align=\"right\">" . $langs->trans("AmountHTVATRealReceived") . "</td>";
|
||||||
|
print "<td align=\"right\">" . $vatcust . "</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
if (is_array($coll_list)) {
|
||||||
|
$var = true;
|
||||||
|
$total = 0;
|
||||||
|
$totalamount = 0;
|
||||||
|
$i = 1;
|
||||||
|
foreach ($coll_list as $coll) {
|
||||||
|
if (substr($coll->tva_intra, 0, 2) == $country->code) {
|
||||||
|
// Only use different-country VAT codes
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($min == 0 or ($min > 0 && $coll->amount > $min)) {
|
||||||
|
$var = !$var;
|
||||||
|
$intra = str_replace($find, $replace, $coll->tva_intra);
|
||||||
|
if (empty($intra)) {
|
||||||
|
if ($coll->assuj == '1') {
|
||||||
|
$intra = $langs->trans('Unknown');
|
||||||
|
} else {
|
||||||
|
//$intra = $langs->trans('NotRegistered');
|
||||||
|
$intra = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "<tr " . $bc[$var] . ">";
|
||||||
|
print '<td class="nowrap">' . $i . "</td>";
|
||||||
|
$company_static->id = $coll->socid;
|
||||||
|
$company_static->name = $coll->name;
|
||||||
|
$company_static->client = 1;
|
||||||
|
print '<td class="nowrap">' . $company_static->getNomUrl(1,
|
||||||
|
'customer') . '</td>';
|
||||||
|
$find = array(' ', '.');
|
||||||
|
$replace = array('', '');
|
||||||
|
print '<td class="nowrap">' . $intra . "</td>";
|
||||||
|
print "<td class=\"nowrap\" align=\"right\">" . price($coll->amount) . "</td>";
|
||||||
|
print "<td class=\"nowrap\" align=\"right\">" . price($coll->tva) . "</td>";
|
||||||
|
$totalamount = $totalamount + $coll->amount;
|
||||||
|
$total = $total + $coll->tva;
|
||||||
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$x_coll_sum = $total;
|
||||||
|
|
||||||
|
print '<tr class="liste_total"><td align="right" colspan="3">' . $langs->trans("Total") . ':</td>';
|
||||||
|
print '<td class="nowrap" align="right">' . price($totalamount) . '</td>';
|
||||||
|
print '<td class="nowrap" align="right">' . price($total) . '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
} else {
|
||||||
|
$langs->load("errors");
|
||||||
|
if ($coll_list == -1) {
|
||||||
|
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
|
||||||
|
} else {
|
||||||
|
if ($coll_list == -2) {
|
||||||
|
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
|
||||||
|
} else {
|
||||||
|
print '<tr><td colspan="5">' . $langs->trans("Error") . '</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
// Print listing of same-country customers as additional report
|
||||||
|
// This matches tax requirements to list all same-country customers (only)
|
||||||
|
print '<h3>'.$langs->trans('SameCountryCustomersWithVAT').'</h3>';
|
||||||
|
print $langs->trans('BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry');
|
||||||
|
$coll_list = vat_by_thirdparty($db, 0, $date_start, $date_end, $modetax, 'sell');
|
||||||
|
|
||||||
|
print "<table class=\"noborder\" width=\"100%\">";
|
||||||
|
print "<tr class=\"liste_titre\">";
|
||||||
|
print '<td align="left">' . $langs->trans("Num") . "</td>";
|
||||||
|
print '<td align="left">' . $langs->trans("Customer") . "</td>";
|
||||||
|
print "<td>" . $langs->trans("VATIntra") . "</td>";
|
||||||
|
print "<td align=\"right\">" . $langs->trans("AmountHTVATRealReceived") . "</td>";
|
||||||
|
print "<td align=\"right\">" . $vatcust . "</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
if (is_array($coll_list)) {
|
||||||
|
$var = true;
|
||||||
|
$total = 0;
|
||||||
|
$totalamount = 0;
|
||||||
|
$i = 1;
|
||||||
|
foreach ($coll_list as $coll) {
|
||||||
|
if (substr($coll->tva_intra, 0, 2) != $country->code) {
|
||||||
|
// Only use same-country VAT codes
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($min == 0 or ($min > 0 && $coll->amount > $min)) {
|
||||||
|
$var = !$var;
|
||||||
|
$intra = str_replace($find, $replace, $coll->tva_intra);
|
||||||
|
if (empty($intra)) {
|
||||||
|
if ($coll->assuj == '1') {
|
||||||
|
$intra = $langs->trans('Unknown');
|
||||||
|
} else {
|
||||||
|
//$intra = $langs->trans('NotRegistered');
|
||||||
|
$intra = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "<tr " . $bc[$var] . ">";
|
||||||
|
print '<td class="nowrap">' . $i . "</td>";
|
||||||
|
$company_static->id = $coll->socid;
|
||||||
|
$company_static->name = $coll->name;
|
||||||
|
$company_static->client = 1;
|
||||||
|
print '<td class="nowrap">' . $company_static->getNomUrl(1, 'customer') . '</td>';
|
||||||
|
$find = array(' ', '.');
|
||||||
|
$replace = array('', '');
|
||||||
|
print '<td class="nowrap">' . $intra . "</td>";
|
||||||
|
print "<td class=\"nowrap\" align=\"right\">" . price($coll->amount) . "</td>";
|
||||||
|
print "<td class=\"nowrap\" align=\"right\">" . price($coll->tva) . "</td>";
|
||||||
|
$totalamount = $totalamount + $coll->amount;
|
||||||
|
$total = $total + $coll->tva;
|
||||||
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$x_coll_sum = $total;
|
||||||
|
|
||||||
|
print '<tr class="liste_total"><td align="right" colspan="3">' . $langs->trans("Total") . ':</td>';
|
||||||
|
print '<td class="nowrap" align="right">' . price($totalamount) . '</td>';
|
||||||
|
print '<td class="nowrap" align="right">' . price($total) . '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
} else {
|
||||||
|
$langs->load("errors");
|
||||||
|
if ($coll_list == -1) {
|
||||||
|
print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
|
||||||
|
} else {
|
||||||
|
if ($coll_list == -2) {
|
||||||
|
print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
|
||||||
|
} else {
|
||||||
|
print '<tr><td colspan="5">' . $langs->trans("Error") . '</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
|||||||
@ -72,8 +72,8 @@ function tva_coll($db,$y,$q)
|
|||||||
$sql.= " AND f.fk_statut in (1,2)";
|
$sql.= " AND f.fk_statut in (1,2)";
|
||||||
$sql.= " AND f.rowid = d.fk_facture ";
|
$sql.= " AND f.rowid = d.fk_facture ";
|
||||||
$sql.= " AND date_format(f.datef,'%Y') = '".$y."'";
|
$sql.= " AND date_format(f.datef,'%Y') = '".$y."'";
|
||||||
$sql.= " AND (round(date_format(f.datef,'%m') > ".(($q-1)*3);
|
$sql.= " AND (date_format(f.datef,'%m') > ".(($q-1)*3);
|
||||||
$sql.= " AND round(date_format(f.datef,'%m')) <= ".($q*3).")";
|
$sql.= " AND date_format(f.datef,'%m') <= ".($q*3).")";
|
||||||
$sql.= " ORDER BY rate, facid";
|
$sql.= " ORDER BY rate, facid";
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ function tva_paye($db, $y,$q)
|
|||||||
if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES")
|
if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES")
|
||||||
{
|
{
|
||||||
// Si on paye la tva sur les factures dues (non brouillon)
|
// Si on paye la tva sur les factures dues (non brouillon)
|
||||||
$sql = "SELECT d.fk_facture_fourn as facid, f.facnumber as facnum, d.tva_tx as rate, d.total_ht as totalht, d.tva as amount";
|
$sql = "SELECT d.fk_facture_fourn as facid, f.ref_supplier as facnum, d.tva_tx as rate, d.total_ht as totalht, d.tva as amount";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."facture_fourn_det as d" ;
|
$sql.= ", ".MAIN_DB_PREFIX."facture_fourn_det as d" ;
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
@ -222,8 +222,7 @@ if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES")
|
|||||||
$subtot_coll_vat = 0;
|
$subtot_coll_vat = 0;
|
||||||
$subtot_paye_total = 0;
|
$subtot_paye_total = 0;
|
||||||
$subtot_paye_vat = 0;
|
$subtot_paye_vat = 0;
|
||||||
for ($q = 1 ; $q <= 4 ; $q++)
|
for ($q = 1 ; $q <= 4 ; $q++) {
|
||||||
{
|
|
||||||
print "<tr class=\"liste_titre\"><td colspan=\"8\">".$langs->trans("Quadri")." $q (".dol_print_date(dol_mktime(0,0,0,(($q-1)*3)+1,1,$y),"%b %Y").' - '.dol_print_date(dol_mktime(0,0,0,($q*3),1,$y),"%b %Y").")</td></tr>";
|
print "<tr class=\"liste_titre\"><td colspan=\"8\">".$langs->trans("Quadri")." $q (".dol_print_date(dol_mktime(0,0,0,(($q-1)*3)+1,1,$y),"%b %Y").' - '.dol_print_date(dol_mktime(0,0,0,($q*3),1,$y),"%b %Y").")</td></tr>";
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
|
|||||||
713
htdocs/compta/tva/quarter_report.php
Normal file
713
htdocs/compta/tva/quarter_report.php
Normal file
@ -0,0 +1,713 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2006-2007, 2015 Yannick Warnier <ywarnier@beeznest.org>
|
||||||
|
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/compta/tva/quadri_detail.php
|
||||||
|
* \ingroup tax
|
||||||
|
* \brief Trimestrial page - detailed version
|
||||||
|
* TODO Deal with recurrent invoices as well
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||||
|
|
||||||
|
$langs->load("main");
|
||||||
|
$langs->load("bills");
|
||||||
|
$langs->load("compta");
|
||||||
|
$langs->load("companies");
|
||||||
|
$langs->load("products");
|
||||||
|
$langs->load("other");
|
||||||
|
|
||||||
|
// Date range
|
||||||
|
$year=GETPOST('year', 'int');
|
||||||
|
if (empty($year)) {
|
||||||
|
$year_current = strftime("%Y",dol_now());
|
||||||
|
$year_start = $year_current;
|
||||||
|
} else {
|
||||||
|
$year_current = $year;
|
||||||
|
$year_start = $year;
|
||||||
|
}
|
||||||
|
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]);
|
||||||
|
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
||||||
|
// Quarter
|
||||||
|
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
|
||||||
|
$q=GETPOST('q', 'int');
|
||||||
|
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);
|
||||||
|
} 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==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 = GETPOST("min");
|
||||||
|
if (empty($min)) {
|
||||||
|
$min = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define modetax (0 or 1)
|
||||||
|
// 0=normal, 1=option vat for services is on debit
|
||||||
|
$modetax = $conf->global->TAX_MODE;
|
||||||
|
if (isset($_REQUEST["modetax"])) {
|
||||||
|
$modetax=$_REQUEST["modetax"];
|
||||||
|
}
|
||||||
|
if (empty($modetax)) {
|
||||||
|
$modetax=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOST('socid','int');
|
||||||
|
if ($user->societe_id) {
|
||||||
|
$socid=$user->societe_id;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
llxHeader('','','','',0,0,'','',$morequerystring);
|
||||||
|
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
|
$company_static=new Societe($db);
|
||||||
|
$invoice_customer=new Facture($db);
|
||||||
|
$invoice_supplier=new FactureFournisseur($db);
|
||||||
|
$product_static=new Product($db);
|
||||||
|
$payment_static=new Paiement($db);
|
||||||
|
$paymentfourn_static=new PaiementFourn($db);
|
||||||
|
|
||||||
|
//print_fiche_titre($langs->trans("VAT"),"");
|
||||||
|
|
||||||
|
//$fsearch.='<br>';
|
||||||
|
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
|
||||||
|
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
|
||||||
|
//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
|
||||||
|
//$fsearch.=' <input type="text" name="min" value="'.$min.'">';
|
||||||
|
|
||||||
|
|
||||||
|
// Affiche en-tete du rapport
|
||||||
|
if ($modetax==1) { // Calculate on invoice for goods and services
|
||||||
|
$nom=$langs->trans("VATReportByQuartersInDueDebtMode");
|
||||||
|
$calcmode=$langs->trans("CalcModeVATDebt");
|
||||||
|
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
|
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||||
|
$prevyear=$year_start; $prevquarter=$q;
|
||||||
|
if ($prevquarter > 1) {
|
||||||
|
$prevquarter--;
|
||||||
|
} else {
|
||||||
|
$prevquarter=4; $prevyear--;
|
||||||
|
}
|
||||||
|
$nextyear=$year_start; $nextquarter=$q;
|
||||||
|
if ($nextquarter < 4) {
|
||||||
|
$nextquarter++;
|
||||||
|
} 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>":"");
|
||||||
|
$description=$langs->trans("RulesVATDueServices");
|
||||||
|
$description.='<br>';
|
||||||
|
$description.=$langs->trans("RulesVATDueProducts");
|
||||||
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
|
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$description.='<br>'.$langs->trans("DepositsAreNotIncluded");
|
||||||
|
} else {
|
||||||
|
$description.='<br>'.$langs->trans("DepositsAreIncluded");
|
||||||
|
}
|
||||||
|
$description.=$fsearch;
|
||||||
|
$builddate=time();
|
||||||
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
|
|
||||||
|
$elementcust=$langs->trans("CustomersInvoices");
|
||||||
|
$productcust=$langs->trans("ProductOrService");
|
||||||
|
$amountcust=$langs->trans("AmountHT");
|
||||||
|
$vatcust=$langs->trans("VATReceived");
|
||||||
|
$namecust=$langs->trans("Name");
|
||||||
|
if ($mysoc->tva_assuj) {
|
||||||
|
$vatcust.=' ('.$langs->trans("ToPay").')';
|
||||||
|
}
|
||||||
|
$elementsup=$langs->trans("SuppliersInvoices");
|
||||||
|
$productsup=$langs->trans("ProductOrService");
|
||||||
|
$amountsup=$langs->trans("AmountHT");
|
||||||
|
$vatsup=$langs->trans("VATPaid");
|
||||||
|
$namesup=$namecust;
|
||||||
|
if ($mysoc->tva_assuj) {
|
||||||
|
$vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($modetax==0) { // Invoice for goods, payment for services
|
||||||
|
$nom=$langs->trans("VATReportByQuartersInInputOutputMode");
|
||||||
|
$calcmode=$langs->trans("CalcModeVATEngagement");
|
||||||
|
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||||
|
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||||
|
$prevyear=$year_start; $prevquarter=$q;
|
||||||
|
if ($prevquarter > 1) {
|
||||||
|
$prevquarter--;
|
||||||
|
} else {
|
||||||
|
$prevquarter=4; $prevyear--;
|
||||||
|
}
|
||||||
|
$nextyear=$year_start; $nextquarter=$q;
|
||||||
|
if ($nextquarter < 4) {
|
||||||
|
$nextquarter++;
|
||||||
|
} 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>":"");
|
||||||
|
$description=$langs->trans("RulesVATInServices");
|
||||||
|
$description.=' '.$langs->trans("DepositsAreIncluded");
|
||||||
|
$description.='<br>';
|
||||||
|
$description.=$langs->trans("RulesVATInProducts");
|
||||||
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
|
$description.=' '.$langs->trans("DepositsAreNotIncluded");
|
||||||
|
} else {
|
||||||
|
$description.=' '.$langs->trans("DepositsAreIncluded");
|
||||||
|
}
|
||||||
|
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||||
|
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
|
||||||
|
$description.=$fsearch;
|
||||||
|
$builddate=time();
|
||||||
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
|
|
||||||
|
$elementcust=$langs->trans("CustomersInvoices");
|
||||||
|
$productcust=$langs->trans("ProductOrService");
|
||||||
|
$amountcust=$langs->trans("AmountHT");
|
||||||
|
$vatcust=$langs->trans("VATReceived");
|
||||||
|
$namecust=$langs->trans("Name");
|
||||||
|
if ($mysoc->tva_assuj) {
|
||||||
|
$vatcust.=' ('.$langs->trans("ToPay").')';
|
||||||
|
}
|
||||||
|
$elementsup=$langs->trans("SuppliersInvoices");
|
||||||
|
$productsup=$productcust;
|
||||||
|
$amountsup=$amountcust;
|
||||||
|
$vatsup=$langs->trans("VATPaid");
|
||||||
|
$namesup=$namecust;
|
||||||
|
if ($mysoc->tva_assuj) {
|
||||||
|
$vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode);
|
||||||
|
|
||||||
|
$vatcust=$langs->trans("VATReceived");
|
||||||
|
$vatsup=$langs->trans("VATPaid");
|
||||||
|
|
||||||
|
|
||||||
|
// VAT Received and paid
|
||||||
|
|
||||||
|
echo '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
$y = $year_current;
|
||||||
|
$total = 0;
|
||||||
|
$i=0;
|
||||||
|
$columns = 6;
|
||||||
|
|
||||||
|
// Load arrays of datas
|
||||||
|
$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell');
|
||||||
|
$x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy');
|
||||||
|
|
||||||
|
if (!is_array($x_coll) || !is_array($x_paye)) {
|
||||||
|
$langs->load("errors");
|
||||||
|
if ($x_coll == -1) {
|
||||||
|
print '<tr><td colspan="' . $columns . '">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
|
||||||
|
} else if ($x_coll == -2) {
|
||||||
|
print '<tr><td colspan="' . $columns . '">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
|
||||||
|
} else {
|
||||||
|
print '<tr><td colspan="' . $columns . '">' . $langs->trans("Error") . '</td></tr>';
|
||||||
|
}
|
||||||
|
} 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_rate) {
|
||||||
|
$x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht'];
|
||||||
|
$x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat'];
|
||||||
|
$x_both[$my_coll_rate]['paye']['totalht'] = 0;
|
||||||
|
$x_both[$my_coll_rate]['paye']['vat'] = 0;
|
||||||
|
$x_both[$my_coll_rate]['coll']['links'] = '';
|
||||||
|
$x_both[$my_coll_rate]['coll']['detail'] = array();
|
||||||
|
foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy) {
|
||||||
|
$invoice_customer->id=$x_coll[$my_coll_rate]['facid'][$id];
|
||||||
|
$invoice_customer->ref=$x_coll[$my_coll_rate]['facnum'][$id];
|
||||||
|
$invoice_customer->type=$x_coll[$my_coll_rate]['type'][$id];
|
||||||
|
$company_static->fetch($x_coll[$my_coll_rate]['company_id'][$id]);
|
||||||
|
$x_both[$my_coll_rate]['coll']['detail'][] = array(
|
||||||
|
'id' =>$x_coll[$my_coll_rate]['facid'][$id],
|
||||||
|
'descr' =>$x_coll[$my_coll_rate]['descr'][$id],
|
||||||
|
'pid' =>$x_coll[$my_coll_rate]['pid'][$id],
|
||||||
|
'pref' =>$x_coll[$my_coll_rate]['pref'][$id],
|
||||||
|
'ptype' =>$x_coll[$my_coll_rate]['ptype'][$id],
|
||||||
|
'payment_id'=>$x_coll[$my_coll_rate]['payment_id'][$id],
|
||||||
|
'payment_amount'=>$x_coll[$my_coll_rate]['payment_amount'][$id],
|
||||||
|
'ftotal_ttc'=>$x_coll[$my_coll_rate]['ftotal_ttc'][$id],
|
||||||
|
'dtotal_ttc'=>$x_coll[$my_coll_rate]['dtotal_ttc'][$id],
|
||||||
|
'dtype' =>$x_coll[$my_coll_rate]['dtype'][$id],
|
||||||
|
'datef' =>$x_coll[$my_coll_rate]['datef'][$id],
|
||||||
|
'company_link'=>$company_static->getNomUrl(1,'',20),
|
||||||
|
'ddate_start'=>$x_coll[$my_coll_rate]['ddate_start'][$id],
|
||||||
|
'ddate_end' =>$x_coll[$my_coll_rate]['ddate_end'][$id],
|
||||||
|
'totalht' =>$x_coll[$my_coll_rate]['totalht_list'][$id],
|
||||||
|
'vat' =>$x_coll[$my_coll_rate]['vat_list'][$id],
|
||||||
|
'link' =>$invoice_customer->getNomUrl(1,'',12)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// tva paid
|
||||||
|
foreach (array_keys($x_paye) as $my_paye_rate) {
|
||||||
|
$x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht'];
|
||||||
|
$x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat'];
|
||||||
|
if (!isset($x_both[$my_paye_rate]['coll']['totalht'])) {
|
||||||
|
$x_both[$my_paye_rate]['coll']['totalht'] = 0;
|
||||||
|
$x_both[$my_paye_rate]['coll']['vat'] = 0;
|
||||||
|
}
|
||||||
|
$x_both[$my_paye_rate]['paye']['links'] = '';
|
||||||
|
$x_both[$my_paye_rate]['paye']['detail'] = array();
|
||||||
|
|
||||||
|
foreach ($x_paye[$my_paye_rate]['facid'] as $id=>$dummy) {
|
||||||
|
$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id];
|
||||||
|
$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id];
|
||||||
|
$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id];
|
||||||
|
$company_static->fetch($x_paye[$my_paye_rate]['company_id'][$id]);
|
||||||
|
$x_both[$my_paye_rate]['paye']['detail'][] = array(
|
||||||
|
'id' =>$x_paye[$my_paye_rate]['facid'][$id],
|
||||||
|
'descr' =>$x_paye[$my_paye_rate]['descr'][$id],
|
||||||
|
'pid' =>$x_paye[$my_paye_rate]['pid'][$id],
|
||||||
|
'pref' =>$x_paye[$my_paye_rate]['pref'][$id],
|
||||||
|
'ptype' =>$x_paye[$my_paye_rate]['ptype'][$id],
|
||||||
|
'payment_id'=>$x_paye[$my_paye_rate]['payment_id'][$id],
|
||||||
|
'payment_amount'=>$x_paye[$my_paye_rate]['payment_amount'][$id],
|
||||||
|
'ftotal_ttc'=>price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]),
|
||||||
|
'dtotal_ttc'=>price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]),
|
||||||
|
'dtype' =>$x_paye[$my_paye_rate]['dtype'][$id],
|
||||||
|
'datef' =>$x_paye[$my_paye_rate]['datef'][$id],
|
||||||
|
'company_link'=>$company_static->getNomUrl(1,'',20),
|
||||||
|
'ddate_start'=>$x_paye[$my_paye_rate]['ddate_start'][$id],
|
||||||
|
'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id],
|
||||||
|
'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
|
||||||
|
'vat' =>$x_paye[$my_paye_rate]['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
|
||||||
|
|
||||||
|
$x_coll_sum = 0;
|
||||||
|
$x_coll_ht = 0;
|
||||||
|
$x_paye_sum = 0;
|
||||||
|
$x_paye_ht = 0;
|
||||||
|
|
||||||
|
$span=$columns-3;
|
||||||
|
if ($modetax == 0) $span+=2;
|
||||||
|
|
||||||
|
//print '<tr><td colspan="'.($span+1).'">'..')</td></tr>';
|
||||||
|
|
||||||
|
// Customers invoices
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td align="left">'.$elementcust.'</td>';
|
||||||
|
print '<td align="left">'.$langs->trans("Date").'</td>';
|
||||||
|
print '<td align="left">'.$namecust.'</td>';
|
||||||
|
print '<td align="left">'.$productcust.'</td>';
|
||||||
|
if ($modetax == 0) {
|
||||||
|
print '<td align="right">'.$amountcust.'</td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right">'.$langs->trans("AmountHTVATRealReceived").'</td>';
|
||||||
|
print '<td align="right">'.$vatcust.'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$action = "tvadetail";
|
||||||
|
$parameters["mode"] = $modetax;
|
||||||
|
$parameters["start"] = $date_start;
|
||||||
|
$parameters["end"] = $date_end;
|
||||||
|
$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('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
|
foreach (array_keys($x_coll) as $rate) {
|
||||||
|
$subtot_coll_total_ht = 0;
|
||||||
|
$subtot_coll_vat = 0;
|
||||||
|
|
||||||
|
if (is_array($x_both[$rate]['coll']['detail'])) {
|
||||||
|
// VAT Rate
|
||||||
|
$var=true;
|
||||||
|
print "<tr>";
|
||||||
|
print '<td class="tax_rate">'.$langs->trans("Rate").': '.vatrate($rate).'%</td><td colspan="'.$span.'"></td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) {
|
||||||
|
// Define type
|
||||||
|
$type=($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;
|
||||||
|
}
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<td class="nowrap" align="left">'.$fields['link'].'</td>';
|
||||||
|
|
||||||
|
// Invoice date
|
||||||
|
print '<td align="left">' . $fields['datef'] . '</td>';
|
||||||
|
// Company name
|
||||||
|
print '<td align="left">' . $fields['company_link'] . '</td>';
|
||||||
|
|
||||||
|
// Description
|
||||||
|
print '<td align="left">';
|
||||||
|
if ($fields['pid']) {
|
||||||
|
$product_static->id=$fields['pid'];
|
||||||
|
$product_static->ref=$fields['pref'];
|
||||||
|
$product_static->type=$fields['ptype'];
|
||||||
|
print $product_static->getNomUrl(1);
|
||||||
|
if (dol_string_nohtmltag($fields['descr'])) {
|
||||||
|
print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),16);
|
||||||
|
}
|
||||||
|
} 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']),16);
|
||||||
|
|
||||||
|
// Show range
|
||||||
|
print_date_range($fields['ddate_start'],$fields['ddate_end']);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Total HT
|
||||||
|
if ($modetax == 0) {
|
||||||
|
print '<td class="nowrap" align="right">';
|
||||||
|
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 '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Payment
|
||||||
|
$ratiopaymentinvoice=1;
|
||||||
|
if ($modetax == 0) {
|
||||||
|
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
|
||||||
|
$ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
|
||||||
|
}
|
||||||
|
print '<td class="nowrap" align="right">';
|
||||||
|
//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) {
|
||||||
|
print $langs->trans("NotUsedForGoods");
|
||||||
|
} else {
|
||||||
|
print $fields['payment_amount'];
|
||||||
|
if (isset($fields['payment_amount'])) {
|
||||||
|
print ' ('.round($ratiopaymentinvoice*100,2).'%)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Total collected
|
||||||
|
print '<td class="nowrap" align="right">';
|
||||||
|
$temp_ht=$fields['totalht'];
|
||||||
|
if ($type == 1) {
|
||||||
|
$temp_ht=$fields['totalht']*$ratiopaymentinvoice;
|
||||||
|
}
|
||||||
|
print price(price2num($temp_ht,'MT'),1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// VAT
|
||||||
|
print '<td class="nowrap" align="right">';
|
||||||
|
$temp_vat=$fields['vat'];
|
||||||
|
if ($type == 1) {
|
||||||
|
$temp_vat=$fields['vat']*$ratiopaymentinvoice;
|
||||||
|
}
|
||||||
|
print price(price2num($temp_vat,'MT'),1);
|
||||||
|
//print price($fields['vat']);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$subtot_coll_total_ht += $temp_ht;
|
||||||
|
$subtot_coll_vat += $temp_vat;
|
||||||
|
$x_coll_sum += $temp_vat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Total customers for this vat rate
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td colspan="'.$span.'"></td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
|
if ($modetax == 0) {
|
||||||
|
print '<td class="nowrap" align="right"> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
}
|
||||||
|
print '<td align="right">'.price(price2num($subtot_coll_total_ht,'MT')).'</td>';
|
||||||
|
print '<td class="nowrap" align="right">'.price(price2num($subtot_coll_vat,'MT')).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($x_coll) == 0) { // Show a total ine if nothing shown
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td colspan="'.$span.'"></td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
|
if ($modetax == 0) {
|
||||||
|
print '<td class="nowrap" align="right"> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
}
|
||||||
|
print '<td align="right">'.price(price2num(0,'MT')).'</td>';
|
||||||
|
print '<td class="nowrap" align="right">'.price(price2num(0,'MT')).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Blank line
|
||||||
|
print '<tr><td colspan="'.($span+1).'"> </td></tr>';
|
||||||
|
|
||||||
|
//print table headers for this quadri - expenses now
|
||||||
|
//imprime les en-tete de tables pour ce quadri - maintenant les d<>penses
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td align="left">'.$elementsup.'</td>';
|
||||||
|
print '<td align="left">'.$langs->trans("Date").'</td>';
|
||||||
|
print '<td align="left">'.$namesup.'</td>';
|
||||||
|
print '<td align="left">'.$productsup.'</td>';
|
||||||
|
if ($modetax == 0) {
|
||||||
|
print '<td align="right">'.$amountsup.'</td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')</td>';
|
||||||
|
}
|
||||||
|
print '<td align="right">'.$langs->trans("AmountHTVATRealPaid").'</td>';
|
||||||
|
print '<td align="right">'.$vatsup.'</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
foreach (array_keys($x_paye) as $rate) {
|
||||||
|
$subtot_paye_total_ht = 0;
|
||||||
|
$subtot_paye_vat = 0;
|
||||||
|
|
||||||
|
if (is_array($x_both[$rate]['paye']['detail'])) {
|
||||||
|
$var=true;
|
||||||
|
print "<tr>";
|
||||||
|
print '<td class="tax_rate">'.$langs->trans("Rate").': '.vatrate($rate).'%</td><td colspan="'.$span.'"></td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
foreach ($x_both[$rate]['paye']['detail'] as $index=>$fields) {
|
||||||
|
// Define type
|
||||||
|
$type=($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;
|
||||||
|
}
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<td class="nowrap" align="left">'.$fields['link'].'</td>';
|
||||||
|
// Invoice date
|
||||||
|
print '<td align="left">' . $fields['datef'] . '</td>';
|
||||||
|
// Company name
|
||||||
|
print '<td align="left">' . $fields['company_link'] . '</td>';
|
||||||
|
|
||||||
|
// Description
|
||||||
|
print '<td align="left">';
|
||||||
|
if ($fields['pid']) {
|
||||||
|
$product_static->id=$fields['pid'];
|
||||||
|
$product_static->ref=$fields['pref'];
|
||||||
|
$product_static->type=$fields['ptype'];
|
||||||
|
print $product_static->getNomUrl(1);
|
||||||
|
if (dol_string_nohtmltag($fields['descr'])) {
|
||||||
|
print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),16);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($type) {
|
||||||
|
$text = img_object($langs->trans('Service'),'service');
|
||||||
|
} else {
|
||||||
|
$text = img_object($langs->trans('Product'),'product');
|
||||||
|
}
|
||||||
|
print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),16);
|
||||||
|
|
||||||
|
// Show range
|
||||||
|
print_date_range($fields['ddate_start'],$fields['ddate_end']);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Total HT
|
||||||
|
if ($modetax == 0) {
|
||||||
|
print '<td class="nowrap" align="right">';
|
||||||
|
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 '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Payment
|
||||||
|
$ratiopaymentinvoice=1;
|
||||||
|
if ($modetax == 0) {
|
||||||
|
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
|
||||||
|
$ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
|
||||||
|
}
|
||||||
|
print '<td class="nowrap" align="right">';
|
||||||
|
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
|
||||||
|
$paymentfourn_static->id=$fields['payment_id'];
|
||||||
|
print $paymentfourn_static->getNomUrl(2);
|
||||||
|
}
|
||||||
|
if ($type == 0) {
|
||||||
|
print $langs->trans("NotUsedForGoods");
|
||||||
|
} else {
|
||||||
|
print $fields['payment_amount'];
|
||||||
|
if (isset($fields['payment_amount'])) {
|
||||||
|
print ' ('.round($ratiopaymentinvoice*100,2).'%)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// VAT paid
|
||||||
|
print '<td class="nowrap" align="right">';
|
||||||
|
$temp_ht=$fields['totalht'];
|
||||||
|
if ($type == 1) {
|
||||||
|
$temp_ht=$fields['totalht']*$ratiopaymentinvoice;
|
||||||
|
}
|
||||||
|
print price(price2num($temp_ht,'MT'),1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// VAT
|
||||||
|
print '<td class="nowrap" align="right">';
|
||||||
|
$temp_vat=$fields['vat'];
|
||||||
|
if ($type == 1) {
|
||||||
|
$temp_vat=$fields['vat']*$ratiopaymentinvoice;
|
||||||
|
}
|
||||||
|
print price(price2num($temp_vat,'MT'),1);
|
||||||
|
//print price($fields['vat']);
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$subtot_paye_total_ht += $temp_ht;
|
||||||
|
$subtot_paye_vat += $temp_vat;
|
||||||
|
$x_paye_sum += $temp_vat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Total suppliers for this vat rate
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td colspan="'.$span.'"></td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
|
if ($modetax == 0) {
|
||||||
|
print '<td class="nowrap" align="right"> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
}
|
||||||
|
print '<td align="right">'.price(price2num($subtot_paye_total_ht,'MT')).'</td>';
|
||||||
|
print '<td class="nowrap" align="right">'.price(price2num($subtot_paye_vat,'MT')).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($x_paye) == 0) { // Show a total ine if nothing shown
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td colspan="'.$span.'"></td>';
|
||||||
|
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||||
|
if ($modetax == 0) {
|
||||||
|
print '<td class="nowrap" align="right"> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
}
|
||||||
|
print '<td align="right">'.price(price2num(0,'MT')).'</td>';
|
||||||
|
print '<td class="nowrap" align="right">'.price(price2num(0,'MT')).'</td>';
|
||||||
|
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="'.$span.'">'.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').'</td>';
|
||||||
|
print '<td class="liste_total nowrap" align="right"><b>'.price(price2num($diff,'MT'))."</b></td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
echo '</table>';
|
||||||
|
|
||||||
|
$db->close();
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
@ -24,18 +24,18 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show header of a VAT report
|
* Show header of a VAT report
|
||||||
*
|
*
|
||||||
* @param string $nom Name of report
|
* @param string $nom Name of report
|
||||||
* @param string $variante Link for alternate report
|
* @param string $variante Link for alternate report
|
||||||
* @param string $period Period of report
|
* @param string $period Period of report
|
||||||
* @param string $periodlink Link to switch period
|
* @param string $periodlink Link to switch period
|
||||||
* @param string $description Description
|
* @param string $description Description
|
||||||
* @param timestamp|integer $builddate Date generation
|
* @param timestamp|integer $builddate Date generation
|
||||||
* @param string $exportlink Link for export or ''
|
* @param string $exportlink Link for export or ''
|
||||||
* @param array $moreparam Array with list of params to add into form
|
* @param array $moreparam Array with list of params to add into form
|
||||||
* @param string $calcmode Calculation mode
|
* @param string $calcmode Calculation mode
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='')
|
function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='')
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
|
|||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
foreach($moreparam as $key => $value)
|
foreach($moreparam as $key => $value)
|
||||||
{
|
{
|
||||||
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
|
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
|
||||||
}
|
}
|
||||||
print '<table width="100%" class="border">';
|
print '<table width="100%" class="border">';
|
||||||
|
|
||||||
|
|||||||
@ -280,10 +280,11 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
||||||
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
|
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
|
||||||
$sql.= " d.date_start as date_start, d.date_end as date_end,";
|
$sql.= " d.date_start as date_start, d.date_end as date_end,";
|
||||||
$sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,";
|
$sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||||
$sql.= " 0 as payment_id, 0 as payment_amount";
|
$sql.= " 0 as payment_id, 0 as payment_amount";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||||
|
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE f.entity = " . $conf->entity;
|
$sql.= " WHERE f.entity = " . $conf->entity;
|
||||||
@ -291,6 +292,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
||||||
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
||||||
$sql.= " AND f.rowid = d.".$fk_facture;
|
$sql.= " AND f.rowid = d.".$fk_facture;
|
||||||
|
$sql.= " AND s.rowid = f.fk_soc";
|
||||||
if ($y && $m)
|
if ($y && $m)
|
||||||
{
|
{
|
||||||
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
|
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
|
||||||
@ -325,10 +327,11 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
||||||
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
|
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
|
||||||
$sql.= " d.date_start as date_start, d.date_end as date_end,";
|
$sql.= " d.date_start as date_start, d.date_end as date_end,";
|
||||||
$sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,";
|
$sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef as date_f, s.nom as company_name, s.rowid as company_id,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||||
$sql.= " 0 as payment_id, 0 as payment_amount";
|
$sql.= " 0 as payment_id, 0 as payment_amount";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||||
|
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE f.entity = " . $conf->entity;
|
$sql.= " WHERE f.entity = " . $conf->entity;
|
||||||
@ -336,6 +339,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
||||||
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
||||||
$sql.= " AND f.rowid = d.".$fk_facture;
|
$sql.= " AND f.rowid = d.".$fk_facture;
|
||||||
|
$sql.= " AND s.rowid = f.fk_soc";
|
||||||
if ($y && $m)
|
if ($y && $m)
|
||||||
{
|
{
|
||||||
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
|
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
|
||||||
@ -384,6 +388,9 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
}
|
}
|
||||||
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
||||||
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
|
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
|
||||||
|
$list[$assoc['rate']]['datef'][] = $assoc['datef'];
|
||||||
|
$list[$assoc['rate']]['company_name'][] = $assoc['company_name'];
|
||||||
|
$list[$assoc['rate']]['company_id'][] = $assoc['company_id'];
|
||||||
$list[$assoc['rate']]['ddate_start'][] = $db->jdate($assoc['date_start']);
|
$list[$assoc['rate']]['ddate_start'][] = $db->jdate($assoc['date_start']);
|
||||||
$list[$assoc['rate']]['ddate_end'][] = $db->jdate($assoc['date_end']);
|
$list[$assoc['rate']]['ddate_end'][] = $db->jdate($assoc['date_end']);
|
||||||
|
|
||||||
@ -438,10 +445,11 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
||||||
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
|
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
|
||||||
$sql.= " d.date_start as date_start, d.date_end as date_end,";
|
$sql.= " d.date_start as date_start, d.date_end as date_end,";
|
||||||
$sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,";
|
$sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||||
$sql.= " 0 as payment_id, 0 as payment_amount";
|
$sql.= " 0 as payment_id, 0 as payment_amount";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||||
|
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d" ;
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE f.entity = " . $conf->entity;
|
$sql.= " WHERE f.entity = " . $conf->entity;
|
||||||
@ -449,6 +457,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
||||||
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
||||||
$sql.= " AND f.rowid = d.".$fk_facture;
|
$sql.= " AND f.rowid = d.".$fk_facture;
|
||||||
|
$sql.= " AND s.rowid = f.fk_soc";
|
||||||
if ($y && $m)
|
if ($y && $m)
|
||||||
{
|
{
|
||||||
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
|
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
|
||||||
@ -484,12 +493,13 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
$sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,";
|
||||||
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
|
$sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, ";
|
||||||
$sql.= " d.date_start as date_start, d.date_end as date_end,";
|
$sql.= " d.date_start as date_start, d.date_end as date_end,";
|
||||||
$sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc,";
|
$sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,";
|
||||||
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
$sql.= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||||
$sql.= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount";
|
$sql.= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,";
|
$sql.= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$paymenttable." as pa,";
|
$sql.= " ".MAIN_DB_PREFIX.$paymenttable." as pa,";
|
||||||
|
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d";
|
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as d";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid";
|
||||||
$sql.= " WHERE f.entity = " . $conf->entity;
|
$sql.= " WHERE f.entity = " . $conf->entity;
|
||||||
@ -497,6 +507,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
|
||||||
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
||||||
$sql.= " AND f.rowid = d.".$fk_facture;
|
$sql.= " AND f.rowid = d.".$fk_facture;
|
||||||
|
$sql.= " AND s.rowid = f.fk_soc";
|
||||||
$sql.= " AND pf.".$fk_facture2." = f.rowid";
|
$sql.= " AND pf.".$fk_facture2." = f.rowid";
|
||||||
$sql.= " AND pa.rowid = pf.".$fk_payment;
|
$sql.= " AND pa.rowid = pf.".$fk_payment;
|
||||||
if ($y && $m)
|
if ($y && $m)
|
||||||
@ -548,6 +559,9 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
|||||||
}
|
}
|
||||||
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
$list[$assoc['rate']]['dtotal_ttc'][] = $assoc['total_ttc'];
|
||||||
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
|
$list[$assoc['rate']]['dtype'][] = $assoc['dtype'];
|
||||||
|
$list[$assoc['rate']]['datef'][] = $assoc['datef'];
|
||||||
|
$list[$assoc['rate']]['company_name'][] = $assoc['company_name'];
|
||||||
|
$list[$assoc['rate']]['company_id'][] = $assoc['company_id'];
|
||||||
$list[$assoc['rate']]['ddate_start'][] = $db->jdate($assoc['date_start']);
|
$list[$assoc['rate']]['ddate_start'][] = $db->jdate($assoc['date_start']);
|
||||||
$list[$assoc['rate']]['ddate_end'][] = $db->jdate($assoc['date_end']);
|
$list[$assoc['rate']]['ddate_end'][] = $db->jdate($assoc['date_end']);
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -245,16 +245,21 @@ if ($resql)
|
|||||||
$total_total_ht = 0;
|
$total_total_ht = 0;
|
||||||
$total_total_ttc = 0;
|
$total_total_ttc = 0;
|
||||||
$total_total_tva = 0;
|
$total_total_tva = 0;
|
||||||
|
|
||||||
|
$expensereportstatic=new ExpenseReport($db);
|
||||||
|
|
||||||
if($num > 0)
|
if($num > 0)
|
||||||
{
|
{
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$expensereportstatic->id=$objp->rowid;
|
||||||
|
$expensereportstatic->ref=$objp->ref;
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td><a href="card.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowTrip"),"trip").' '.$objp->ref.'</a></td>';
|
print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
|
||||||
print '<td align="center">'.($objp->date_debut > 0 ? dol_print_date($objp->date_debut, 'day') : '').'</td>';
|
print '<td align="center">'.($objp->date_debut > 0 ? dol_print_date($objp->date_debut, 'day') : '').'</td>';
|
||||||
print '<td align="center">'.($objp->date_fin > 0 ? dol_print_date($objp->date_fin, 'day') : '').'</td>';
|
print '<td align="center">'.($objp->date_fin > 0 ? dol_print_date($objp->date_fin, 'day') : '').'</td>';
|
||||||
print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->id_user.'">'.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($objp->firstname, $objp->lastname).'</a></td>';
|
print '<td align="left"><a href="'.DOL_URL_ROOT.'/user/card.php?id='.$objp->id_user.'">'.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($objp->firstname, $objp->lastname).'</a></td>';
|
||||||
|
|||||||
@ -2313,6 +2313,11 @@ else
|
|||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
|
// modified by hook
|
||||||
|
if (empty($reshook)) {
|
||||||
|
|
||||||
// Modify a validated invoice with no payments
|
// Modify a validated invoice with no payments
|
||||||
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
|
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
@ -2432,6 +2437,7 @@ else
|
|||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
//print '</td></tr></table>';
|
//print '</td></tr></table>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Show mail form
|
* Show mail form
|
||||||
|
|||||||
@ -489,11 +489,11 @@ IMG;
|
|||||||
$name=preg_replace('/\.odt/i', '', $name);
|
$name=preg_replace('/\.odt/i', '', $name);
|
||||||
if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT))
|
if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT))
|
||||||
{
|
{
|
||||||
$command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.$name.' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
|
$command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($name).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$command = '../../scripts/odt2pdf/odt2pdf.sh '.$name.' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
|
$command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($name).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -205,3 +205,9 @@ ACCOUNTING_ACCOUNT_SUPPLIER=Accountancy code by default for supplier thirdpartie
|
|||||||
CloneTax=Clone a social/fiscal tax
|
CloneTax=Clone a social/fiscal tax
|
||||||
ConfirmCloneTax=Confirm the clone of a social/fiscal tax payment
|
ConfirmCloneTax=Confirm the clone of a social/fiscal tax payment
|
||||||
CloneTaxForNextMonth=Clone it for next month
|
CloneTaxForNextMonth=Clone it for next month
|
||||||
|
SimpleReport=Simple report
|
||||||
|
AddExtraReport=Extra reports
|
||||||
|
OtherCountriesCustomersReport=Foreign customers report
|
||||||
|
BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry=Based on the two first letters of the VAT number being different from your own company's country code
|
||||||
|
SameCountryCustomersWithVAT=National customers report
|
||||||
|
BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry=Based on the two first letters of the VAT number being the same as your own company's country code
|
||||||
@ -9,6 +9,7 @@ TripCard=Expense report card
|
|||||||
AddTrip=Create expense report
|
AddTrip=Create expense report
|
||||||
ListOfTrips=List of expense reports
|
ListOfTrips=List of expense reports
|
||||||
ListOfFees=List of fees
|
ListOfFees=List of fees
|
||||||
|
ShowTrip=Show expense report
|
||||||
NewTrip=New expense report
|
NewTrip=New expense report
|
||||||
CompanyVisited=Company/foundation visited
|
CompanyVisited=Company/foundation visited
|
||||||
Kilometers=Kilometers
|
Kilometers=Kilometers
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user