correct for invoice supplier links
This commit is contained in:
parent
5f7a308552
commit
e3920edb79
@ -16,13 +16,11 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/compta/recap-compta.php
|
* \file htdocs/compta/recap-compta.php
|
||||||
* \ingroup compta
|
* \ingroup compta
|
||||||
* \brief Page de fiche recap customer
|
* \brief Page de fiche recap customer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
@ -32,35 +30,27 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||||
restrictedArea($user,'banque');
|
restrictedArea($user,'banque');
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
if (! empty($conf->facture->enabled)) $langs->load("bills");
|
if (! empty($conf->facture->enabled)) $langs->load("bills");
|
||||||
|
|
||||||
$date_start =GETPOST('date_start','alpha');
|
$date_start =GETPOST('date_start','alpha');
|
||||||
$date_startDay= GETPOST('date_startday','int');
|
$date_startDay= GETPOST('date_startday','int');
|
||||||
$date_startMonth= GETPOST('date_startmonth','int');
|
$date_startMonth= GETPOST('date_startmonth','int');
|
||||||
$date_startYear= GETPOST('date_startyear','int');
|
$date_startYear= GETPOST('date_startyear','int');
|
||||||
$date_start=($date_startDay)?dol_mktime(0,0,0,$date_startMonth,$date_startDay,$date_startYear):strtotime($date_start);
|
$date_start=($date_startDay)?dol_mktime(0,0,0,$date_startMonth,$date_startDay,$date_startYear):strtotime($date_start);
|
||||||
|
|
||||||
$date_stop =GETPOST('date_stop','alpha');
|
$date_stop =GETPOST('date_stop','alpha');
|
||||||
$date_stopDay= GETPOST('date_stopday','int');
|
$date_stopDay= GETPOST('date_stopday','int');
|
||||||
$date_stopMonth= GETPOST('date_stopmonth','int');
|
$date_stopMonth= GETPOST('date_stopmonth','int');
|
||||||
$date_stopYear= GETPOST('date_stopyear','int');
|
$date_stopYear= GETPOST('date_stopyear','int');
|
||||||
//FIXME doldate
|
//FIXME doldate
|
||||||
$date_stop=($date_stopDay)?dol_mktime(0,0,0,$date_stopMonth,$date_stopDay,$date_stopYear):strtotime($date_stop);
|
$date_stop=($date_stopDay)?dol_mktime(0,0,0,$date_stopMonth,$date_stopDay,$date_stopYear):strtotime($date_stop);
|
||||||
|
|
||||||
$action =GETPOST('action','alpha');
|
$action =GETPOST('action','alpha');
|
||||||
// Security check
|
// Security check
|
||||||
//if ($user->societe_id) $id=$user->societe_id;
|
//if ($user->societe_id) $id=$user->societe_id;
|
||||||
//$result = restrictedArea($user, 'societe', $id, '&societe');
|
//$result = restrictedArea($user, 'societe', $id, '&societe');
|
||||||
|
|
||||||
//$object = new Societe($db);
|
//$object = new Societe($db);
|
||||||
//if ($id > 0) $object->fetch($id);
|
//if ($id > 0) $object->fetch($id);
|
||||||
|
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('comptafilescard','globalcard'));
|
$hookmanager->initHooks(array('comptafilescard','globalcard'));
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield','alpha');
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
@ -72,20 +62,16 @@ $pageprev = $page - 1;
|
|||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (! $sortfield) $sortfield="f.datef,f.rowid"; // Set here default search field
|
if (! $sortfield) $sortfield="f.datef,f.rowid"; // Set here default search field
|
||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
|
|
||||||
|
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
'date'=>array('label'=>"Date", 'checked'=>1),
|
'date'=>array('label'=>"Date", 'checked'=>1),
|
||||||
//...
|
//...
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
//$parameters = array('socid' => $id);
|
//$parameters = array('socid' => $id);
|
||||||
//$reshook = $hookmanager->executeHooks('doActions', $parameters, $object); // Note that $object may have been modified by some hooks
|
//$reshook = $hookmanager->executeHooks('doActions', $parameters, $object); // Note that $object may have been modified by some hooks
|
||||||
//if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
//if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fetch the lines/files from db /
|
* Fetch the lines/files from db /
|
||||||
*/
|
*/
|
||||||
@ -93,22 +79,22 @@ $filesarray=array();
|
|||||||
$result=false;
|
$result=false;
|
||||||
if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
|
if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
|
||||||
$wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
|
$wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
|
||||||
$sql="SELECT rowid, facnumber as ref,paye as paid,total_ttc,fk_soc,datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
|
$sql="SELECT rowid as id, facnumber as ref,paye as paid,total_ttc,fk_soc,datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
|
||||||
$sql.=" WHERE datef between ".$wheretail;
|
$sql.=" WHERE datef between ".$wheretail;
|
||||||
$sql.=" UNION ALL";
|
$sql.=" UNION ALL";
|
||||||
$sql.=" SELECT rowid,ref, paye as paid, total_ttc, fk_soc,datef as date, 'InvoiceSupplier' as item FROM ".MAIN_DB_PREFIX."facture_fourn";
|
$sql.=" SELECT rowid as id,ref, paye as paid, total_ttc, fk_soc,datef as date, 'InvoiceSupplier' as item FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||||
$sql.=" WHERE datef between ".$wheretail;
|
$sql.=" WHERE datef between ".$wheretail;
|
||||||
$sql.=" UNION ALL";
|
$sql.=" UNION ALL";
|
||||||
$sql.=" SELECT rowid,ref,paid,total_ttc,fk_user_author as fk_soc,date_fin as date,'Expense' as item FROM ".MAIN_DB_PREFIX."expensereport";
|
$sql.=" SELECT rowid as id,ref,paid,total_ttc,fk_user_author as fk_soc,date_fin as date,'Expense' as item FROM ".MAIN_DB_PREFIX."expensereport";
|
||||||
$sql.=" WHERE date_fin between ".$wheretail;
|
$sql.=" WHERE date_fin between ".$wheretail;
|
||||||
$sql.=" UNION ALL";
|
$sql.=" UNION ALL";
|
||||||
$sql.=" SELECT rowid,ref,paid,amount as total_ttc,CONCAT(firstname,' ',lastname) as fk_soc,datedon as date,'Donation' as item FROM ".MAIN_DB_PREFIX."don";
|
$sql.=" SELECT rowid as id,ref,paid,amount as total_ttc,CONCAT(firstname,' ',lastname) as fk_soc,datedon as date,'Donation' as item FROM ".MAIN_DB_PREFIX."don";
|
||||||
$sql.=" WHERE datedon between ".$wheretail;
|
$sql.=" WHERE datedon between ".$wheretail;
|
||||||
$sql.=" UNION ALL";
|
$sql.=" UNION ALL";
|
||||||
$sql.=" SELECT rowid,label as ref,1 as paid,amount as total_ttc,fk_user as fk_soc,datep as date,'Salary' as item FROM ".MAIN_DB_PREFIX."payment_salary";
|
$sql.=" SELECT rowid as id,label as ref,1 as paid,amount as total_ttc,fk_user as fk_soc,datep as date,'Salary' as item FROM ".MAIN_DB_PREFIX."payment_salary";
|
||||||
$sql.=" WHERE datep between ".$wheretail;
|
$sql.=" WHERE datep between ".$wheretail;
|
||||||
$sql.=" UNION ALL";
|
$sql.=" UNION ALL";
|
||||||
$sql.=" SELECT rowid,num_paiement as ref,1 as paid,amount as total_ttc,fk_charge as fk_soc,datep as date,'Charge' as item FROM ".MAIN_DB_PREFIX."paiementcharge";
|
$sql.=" SELECT rowid as id,num_paiement as ref,1 as paid,amount as total_ttc,fk_charge as fk_soc,datep as date,'Charge' as item FROM ".MAIN_DB_PREFIX."paiementcharge";
|
||||||
$sql.=" WHERE datep between ".$wheretail;
|
$sql.=" WHERE datep between ".$wheretail;
|
||||||
$resd = $db->query($sql);
|
$resd = $db->query($sql);
|
||||||
$files=array();
|
$files=array();
|
||||||
@ -133,7 +119,7 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
|
|||||||
$link="../../document.php?modulepart=facture&file=".str_replace('/','%2F',$subdir).'%2F';
|
$link="../../document.php?modulepart=facture&file=".str_replace('/','%2F',$subdir).'%2F';
|
||||||
break;
|
break;
|
||||||
case "InvoiceSupplier":
|
case "InvoiceSupplier":
|
||||||
$subdir=get_exdir($objd->id,2,0,0,$objd,'invoice_supplier').$objd->ref;
|
$subdir=get_exdir($objd->id,2,0,0,$objd,'invoice_supplier').dol_sanitizeFileName($objd->ref);
|
||||||
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
|
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
|
||||||
$link="../../document.php?modulepart=facture_fournisseur&file=".str_replace('/','%2F',$subdir).'%2F';
|
$link="../../document.php?modulepart=facture_fournisseur&file=".str_replace('/','%2F',$subdir).'%2F';
|
||||||
break;
|
break;
|
||||||
@ -143,17 +129,17 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
|
|||||||
$link="../../document.php?modulepart=expensereport&file=".str_replace('/','%2F',$subdir).'%2F';
|
$link="../../document.php?modulepart=expensereport&file=".str_replace('/','%2F',$subdir).'%2F';
|
||||||
break;
|
break;
|
||||||
case "Salary":
|
case "Salary":
|
||||||
$subdir=dol_sanitizeFileName($objd->rowid);
|
$subdir=dol_sanitizeFileName($objd->id);
|
||||||
$upload_dir = $conf->salaries->dir_output.'/'.$subdir;
|
$upload_dir = $conf->salaries->dir_output.'/'.$subdir;
|
||||||
$link="../../document.php?modulepart=salaries&file=".str_replace('/','%2F',$subdir).'%2F';
|
$link="../../document.php?modulepart=salaries&file=".str_replace('/','%2F',$subdir).'%2F';
|
||||||
break;
|
break;
|
||||||
case "Donation":
|
case "Donation":
|
||||||
$subdir=get_exdir(null,2,0,1,$objd,'donation'). '/'. dol_sanitizeFileName($objd->idd);
|
$subdir=get_exdir(null,2,0,1,$objd,'donation'). '/'. dol_sanitizeFileName($objd->id);
|
||||||
$upload_dir = $conf->don->dir_output . '/' . $subdir;
|
$upload_dir = $conf->don->dir_output . '/' . $subdir;
|
||||||
$link="../../document.php?modulepart=don&file=".str_replace('/','%2F',$subdir).'%2F';
|
$link="../../document.php?modulepart=don&file=".str_replace('/','%2F',$subdir).'%2F';
|
||||||
break;
|
break;
|
||||||
case "Charge":
|
case "Charge":
|
||||||
$subdir=dol_sanitizeFileName($objd->rowid);
|
$subdir=dol_sanitizeFileName($objd->id);
|
||||||
$upload_dir = $conf->tax->dir_output . '/' . $subdir;
|
$upload_dir = $conf->tax->dir_output . '/' . $subdir;
|
||||||
$link="../../document.php?modulepart=tax&file=".str_replace('/','%2F',$subdir).'%2F';
|
$link="../../document.php?modulepart=tax&file=".str_replace('/','%2F',$subdir).'%2F';
|
||||||
break;
|
break;
|
||||||
@ -182,11 +168,10 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
|
|||||||
$nofile['ref']=$objd->ref;
|
$nofile['ref']=$objd->ref;
|
||||||
$nofile['fk']=$objd->fk_soc;
|
$nofile['fk']=$objd->fk_soc;
|
||||||
$nofile['item']=$objd->item;
|
$nofile['item']=$objd->item;
|
||||||
|
|
||||||
$filesarray[]=$nofile;
|
$filesarray[]=$nofile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->free($resd);
|
$db->free($resd);
|
||||||
@ -196,8 +181,6 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
|
|||||||
* cleanup of old ZIP
|
* cleanup of old ZIP
|
||||||
*/
|
*/
|
||||||
//FIXME
|
//FIXME
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*ZIP creation
|
*ZIP creation
|
||||||
*/
|
*/
|
||||||
@ -207,14 +190,11 @@ if($result & $action=="dl"){
|
|||||||
$zipname = 'export.zip';
|
$zipname = 'export.zip';
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive;
|
||||||
$res = $zip->open($zipname, ZipArchive::OVERWRITE|ZipArchive::CREATE);
|
$res = $zip->open($zipname, ZipArchive::OVERWRITE|ZipArchive::CREATE);
|
||||||
if ($res){
|
if ($res){
|
||||||
foreach ($filesarray as $key=> $file) {
|
foreach ($filesarray as $key=> $file) {
|
||||||
|
|
||||||
if(file_exists($file["fullname"])) $zip->addFile($file["fullname"],$file["name"]);//
|
if(file_exists($file["fullname"])) $zip->addFile($file["fullname"],$file["name"]);//
|
||||||
$log.=$file['date'].','.$file['item'].','.$file['ref'].','.$file['amount'].','.$file['paid'].','.$file["name"].','.$file['fk']."\n";
|
$log.=$file['date'].','.$file['item'].','.$file['ref'].','.$file['amount'].','.$file['paid'].','.$file["name"].','.$file['fk']."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$zip->addFromString('log.csv', $log);
|
$zip->addFromString('log.csv', $log);
|
||||||
$zip->close();
|
$zip->close();
|
||||||
///Then download the zipped file.
|
///Then download the zipped file.
|
||||||
@ -222,33 +202,23 @@ if($result & $action=="dl"){
|
|||||||
header('Content-disposition: attachment; filename='.$zipname);
|
header('Content-disposition: attachment; filename='.$zipname);
|
||||||
header('Content-Length: ' . filesize($zipname));
|
header('Content-Length: ' . filesize($zipname));
|
||||||
readfile($zipname);
|
readfile($zipname);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// None
|
// None
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$userstatic=new User($db);
|
$userstatic=new User($db);
|
||||||
|
|
||||||
$title=$langs->trans("ComptaFiles").' - '.$langs->trans("List");
|
$title=$langs->trans("ComptaFiles").' - '.$langs->trans("List");
|
||||||
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Symmary");
|
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Symmary");
|
||||||
$help_url='EN:Module_Accounting|FR:Module_Compatibilite'; //FIXME
|
$help_url='EN:Module_Accounting|FR:Module_Compatibilite'; //FIXME
|
||||||
|
|
||||||
llxHeader('',$title,$help_url);
|
llxHeader('',$title,$help_url);
|
||||||
|
|
||||||
print '<div><form name="searchfiles" action="?action=searchfiles'.$tail.'" method="POST" >'."\n\t\t\t";
|
print '<div><form name="searchfiles" action="?action=searchfiles'.$tail.'" method="POST" >'."\n\t\t\t";
|
||||||
print '<a>'.$langs->trans("dateStart").': '.$form->select_date($date_start,'date_start',0,0,0,"",1,1,1)."\n</a>";
|
print '<a>'.$langs->trans("dateStart").': '.$form->select_date($date_start,'date_start',0,0,0,"",1,1,1)."\n</a>";
|
||||||
print '<a>'.$langs->trans("dateStop").': '.$form->select_date($date_stop,'date_stop',0,0,0,"",1,1,1)."\n</a>";
|
print '<a>'.$langs->trans("dateStop").': '.$form->select_date($date_stop,'date_stop',0,0,0,"",1,1,1)."\n</a>";
|
||||||
|
|
||||||
print '<input class="butAction" type="submit" value="Go" /></form></div>'."\n\t\t";
|
print '<input class="butAction" type="submit" value="Go" /></form></div>'."\n\t\t";
|
||||||
|
|
||||||
if (!empty($date_start) && !empty($date_stop))echo dol_print_date($date_start)." - ".dol_print_date($date_stop);
|
if (!empty($date_start) && !empty($date_stop))echo dol_print_date($date_start)." - ".dol_print_date($date_stop);
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -261,53 +231,41 @@ print '<td>'.$langs->trans("Paid").'</td>';
|
|||||||
print '<td align="right">'.$langs->trans("Debit").'</td>';
|
print '<td align="right">'.$langs->trans("Debit").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Credit").'</td>';
|
print '<td align="right">'.$langs->trans("Credit").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Balance").'</td>';
|
print '<td align="right">'.$langs->trans("Balance").'</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$TData = dol_sort_array($filesarray, 'date', 'ASC');
|
$TData = dol_sort_array($filesarray, 'date', 'ASC');
|
||||||
if(empty($TData)) {
|
if(empty($TData)) {
|
||||||
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoItem").'</td></tr>';
|
print '<tr class="oddeven"><td colspan="7">'.$langs->trans("NoItem").'</td></tr>';
|
||||||
} else {
|
} else {
|
||||||
|
// Sort array by date ASC to calucalte balance
|
||||||
|
|
||||||
// Sort array by date ASC to calucalte balance
|
$totalDebit = 0;
|
||||||
|
$totalCredit = 0;
|
||||||
$totalDebit = 0;
|
// Balance calculation
|
||||||
$totalCredit = 0;
|
$balance = 0;
|
||||||
// Balance calculation
|
foreach($TData as &$data1) {
|
||||||
$balance = 0;
|
if($data1['item']!='Invoice'&& $data1['item']!='Donation' ){
|
||||||
foreach($TData as &$data1) {
|
|
||||||
if($data1['item']!='Invoice'&& $data1['item']!='Donation' ){
|
|
||||||
$data1['amount']=-$data1['amount'];
|
$data1['amount']=-$data1['amount'];
|
||||||
}
|
}
|
||||||
if ($data1['amount']>0){
|
if ($data1['amount']>0){
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
}
|
}
|
||||||
$balance += $data1['amount'];
|
$balance += $data1['amount'];
|
||||||
$data1['balance'] = $balance;
|
$data1['balance'] = $balance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Display array
|
// Display array
|
||||||
foreach($TData as $data) {
|
foreach($TData as $data) {
|
||||||
|
|
||||||
$html_class = '';
|
$html_class = '';
|
||||||
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
|
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
|
||||||
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
|
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
|
||||||
|
|
||||||
print '<tr class="oddeven '.$html_class.'">';
|
print '<tr class="oddeven '.$html_class.'">';
|
||||||
|
|
||||||
print "<td align=\"center\">";
|
print "<td align=\"center\">";
|
||||||
print dol_print_date($data['date'],'day');
|
print dol_print_date($data['date'],'day');
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td aling="left">'.$data['item'].'</td>';
|
print '<td aling="left">'.$data['item'].'</td>';
|
||||||
print '<td aling="left">'.$data['ref'].'</td>';
|
print '<td aling="left">'.$data['ref'].'</td>';
|
||||||
print '<td> <a href='.$data['link'].">".$data['name']."</a></td>\n";
|
print '<td> <a href='.$data['link'].">".$data['name']."</a></td>\n";
|
||||||
|
|
||||||
print '<td aling="left">'.$data['paid'].'</td>';
|
print '<td aling="left">'.$data['paid'].'</td>';
|
||||||
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
|
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
|
||||||
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
|
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
|
||||||
@ -315,12 +273,8 @@ if ($result)
|
|||||||
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
|
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
|
||||||
// Balance
|
// Balance
|
||||||
print '<td align="right">'.price($data['balance'])."</td>\n";
|
print '<td align="right">'.price($data['balance'])."</td>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td colspan="5"> </td>';
|
print '<td colspan="5"> </td>';
|
||||||
print '<td align="right">'.price($totalDebit).'</td>';
|
print '<td align="right">'.price($totalDebit).'</td>';
|
||||||
@ -328,16 +282,24 @@ if ($result)
|
|||||||
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
|
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '<form name="dl" action="?action=dl" method="POST" >'."\n\t\t\t";
|
print '<form name="dl" action="?action=dl" method="POST" >'."\n\t\t\t";
|
||||||
print '<input type="hidden" name="date_start" value="'.dol_print_date($date_start,'day').'" />';
|
print '<input type="hidden" name="date_start" value="'.dol_print_date($date_start,'day').'" />';
|
||||||
print '<input type="hidden" name="date_stop" value="'.dol_print_date($date_stop,'day').'" />';
|
print '<input type="hidden" name="date_stop" value="'.dol_print_date($date_stop, 'day').'" />';
|
||||||
|
|
||||||
|
print '<input type="hidden" name="date_stopDay" value="'.dol_print_date($date_stop, '%d').'" />';
|
||||||
|
print '<input type="hidden" name="date_stopMonth" value="'.dol_print_date($date_stop, '%m').'" />';
|
||||||
|
print '<input type="hidden" name="date_stopYear" value="'.dol_print_date($date_stop, '%Y').'" />';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<input class="butAction" type="submit" value="Download" /></form>'."\n\t\t</th>\n\t\t<th>\n\t\t\t";
|
print '<input class="butAction" type="submit" value="Download" /></form>'."\n\t\t</th>\n\t\t<th>\n\t\t\t";
|
||||||
|
|
||||||
llxFooter();
|
|
||||||
|
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user