Fix: Si rep export compta existe pas on le crée
This commit is contained in:
parent
d040a3f7f8
commit
4ed0ff200d
@ -33,6 +33,8 @@ require_once("./ComptaJournalVente.class.php");
|
|||||||
|
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
|
|
||||||
|
$dir = $conf->compta->dir_output."/export/";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -43,6 +45,8 @@ if ($_GET["action"] == 'export')
|
|||||||
$modulename='Poivre';
|
$modulename='Poivre';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/export/modules/compta.export.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/export/modules/compta.export.class.php';
|
||||||
|
|
||||||
|
create_exdir($dir);
|
||||||
|
|
||||||
$exc = new ComptaExport($db, $user, $modulename);
|
$exc = new ComptaExport($db, $user, $modulename);
|
||||||
|
|
||||||
@ -117,7 +121,6 @@ print "</table>\n";
|
|||||||
|
|
||||||
print '</td><td valign="top" width="70%">';
|
print '</td><td valign="top" width="70%">';
|
||||||
|
|
||||||
$dir = DOL_DATA_ROOT."/compta/export/";
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -125,16 +128,18 @@ print '<td>'.$langs->trans("File").'</td>';
|
|||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$handle=opendir($dir);
|
$handle=@opendir($dir);
|
||||||
|
if ($handle)
|
||||||
while (($file = readdir($handle))!==false)
|
|
||||||
{
|
{
|
||||||
if (is_readable($dir.$file) && is_file($dir.$file))
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
print '<tr><td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=export_compta&file=export/'.$file.'&type=text/plain">'.$file.'</a><td>';
|
if (is_readable($dir.$file) && is_file($dir.$file))
|
||||||
|
{
|
||||||
print '</tr>';
|
print '<tr><td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=export_compta&file=export/'.$file.'&type=text/plain">'.$file.'</a><td>';
|
||||||
}
|
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|||||||
@ -19,10 +19,19 @@
|
|||||||
* $Source$
|
* $Source$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\file htdocs/compta/export/liste.php
|
||||||
|
\ingroup compta
|
||||||
|
\brief Page export ventilations
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
|
||||||
$langs->load("compta");
|
$langs->load("compta");
|
||||||
|
|
||||||
|
$dir = $conf->compta->dir_output."/export/";
|
||||||
|
|
||||||
|
|
||||||
// Sécurité accés client
|
// Sécurité accés client
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
@ -31,14 +40,6 @@ if ($user->societe_id > 0)
|
|||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
llxHeader('','Compta - Export');
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
$page = $_GET["page"];
|
$page = $_GET["page"];
|
||||||
$sortorder = $_GET["sortorder"];
|
$sortorder = $_GET["sortorder"];
|
||||||
$sortfield = $_GET["sortfield"];
|
$sortfield = $_GET["sortfield"];
|
||||||
@ -47,11 +48,15 @@ $offset = $conf->liste_limit * $page ;
|
|||||||
if ($sortorder == "") $sortorder="DESC";
|
if ($sortorder == "") $sortorder="DESC";
|
||||||
if ($sortfield == "") $sortfield="ec.date_export";
|
if ($sortfield == "") $sortfield="ec.date_export";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mode Liste
|
* Mode Liste
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
llxHeader('','Compta - Export');
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT ec.rowid,".$db->pdate("ec.date_export")." as date_export, ec.ref";
|
$sql = "SELECT ec.rowid,".$db->pdate("ec.date_export")." as date_export, ec.ref";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."export_compta as ec";
|
$sql .= " FROM ".MAIN_DB_PREFIX."export_compta as ec";
|
||||||
|
|
||||||
@ -60,43 +65,41 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print_barre_liste($langs->trans("Exports"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
|
|
||||||
|
|
||||||
print"\n<!-- debut table -->\n";
|
print_barre_liste($langs->trans("Exports"), $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
|
|
||||||
print_liste_field_titre($langs->trans("Ref"),"liste.php","ec.ref");
|
print"\n<!-- debut table -->\n";
|
||||||
print_liste_field_titre($langs->trans("Date"),"liste.php","ec.date_export");
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
print "<td>-</td></tr>\n";
|
print_liste_field_titre($langs->trans("Ref"),"liste.php","ec.ref");
|
||||||
|
print_liste_field_titre($langs->trans("Date"),"liste.php","ec.date_export");
|
||||||
|
|
||||||
$var=True;
|
print "<td>-</td></tr>\n";
|
||||||
|
|
||||||
$dir = DOL_DATA_ROOT."/compta/export/";
|
$var=True;
|
||||||
|
|
||||||
while ($i < min($num,$conf->liste_limit))
|
while ($i < min($num,$conf->liste_limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
|
|
||||||
print '<td>'.$obj->ref.'</td>';
|
print '<td>'.$obj->ref.'</td>';
|
||||||
print '<td>'.strftime("%a %e %b %Y %H:%M:%S",$obj->date_export).'</td>';
|
print '<td>'.dolibarr_print_date($obj->date_export,"%a %e %b %Y %H:%M:%S").'</td>';
|
||||||
print '<td><a href="index.php?action=export&id='.$obj->rowid.'">Regénérer</a></td>';
|
print '<td><a href="index.php?action=export&id='.$obj->rowid.'">'.$langs->trans("ReBuild").'</a></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user