phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] property/inc/export/Agresso, 1.6


From: nomail
Subject: [Phpgroupware-cvs] property/inc/export/Agresso, 1.6
Date: Wed, 15 Sep 2004 09:53:24 +0200

Update of /property/inc/export
Modified Files:
        Branch: 
          Agresso

date: 2004/09/15 07:53:24;  author: sigurdne;  state: Exp;  lines: +39 -17

Log Message:
no message
=====================================================================
Index: property/inc/export/Agresso
diff -u property/inc/export/Agresso:1.5 property/inc/export/Agresso:1.6
--- property/inc/export/Agresso:1.5     Tue Sep 14 09:18:20 2004
+++ property/inc/export/Agresso Wed Sep 15 07:53:24 2004
@@ -3,6 +3,9 @@
        class export_conv
        {
                //var $fil_katalog='c:/temp'; //On windows use 
"//computername/share/filename" or "\\\\computername\share\filename" to check 
files on network shares.
+               
+               var $old_files_deleted;
+               
                function export_conv()
                {
                        $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'property';
@@ -20,7 +23,7 @@
                {
                        if($pre_transfer)
                        {
-                               $sql= "SELECT DISTINCT periode from fm_ecobilag 
WHERE pre_transfer IS NULL ";
+                               $sql= "SELECT DISTINCT periode from fm_ecobilag 
WHERE utbetalingsigndato IS NULL ";
                        }
                        else
                        {
@@ -222,9 +225,18 @@
                {
 
 //                     $download = 'on';
-//                     $pre_transfer=True;
+                       $pre_transfer=True;
                        
 
+                       //Generer batch ID
+                       $batchid = $this->soXport->next_batchid();
+                       if ($download=='on')
+                       {
+                               $this->increment_batchid();
+                               //Lagre melding
+                               $this->log_start($batchid);
+                       }
+
                        //Velg ut alle perioder som har bilag som skal overføres
 
                        $periode = 
$this->select_periods_with_invoice_to_transfer($pre_transfer);
@@ -232,15 +244,6 @@
 
                        for ($i=0;$i<count($periode);$i++)
                        {
-                               //Generer batch ID
-                               $batchid = $this->soXport->next_batchid();
-
-                               if ($download=='on')
-                               {
-                                       $this->increment_batchid();
-                                       //Lagre melding
-                                       $this->log_start($batchid);
-                               }
 
                                $receipt['message'][]= array('msg' => 
$this->OverforPeriode($batchid,$periode[$i],$download,$pre_transfer));
                        }
@@ -360,14 +363,33 @@
                        {
                                $fil_katalog = 
$this->config->config_data['export_pre_path'];
                        
-                               $Filnavn = $fil_katalog . '/FDVankomst_' . 
$batchid. '.TXT';
-                       
-                               //Sjekk om filen eksisterer
-                               If (!file_exists($Filnavn))
+                               // Slett gamle filer
+                               if(!$this->old_files_deleted)
                                {
-                                       return $Filnavn;
+                                       for ($i=1;$i<11;$i++)
+                                       {
+                                               @unlink($fil_katalog . 
'/FDVankomst_' . $i. '.TXT');
+                                       }
+                                       
+                                       $this->old_files_deleted= True;
                                }
-                       
+
+
+                               $i = 1;
+                               do
+                               {
+                                       $Filnavn = $fil_katalog . 
'/FDVankomst_' . $i. '.TXT';
+                               
+                                       //Sjekk om filen eksisterer
+                                       If (!file_exists($Filnavn))
+                                       {
+                                               return $Filnavn;
+                                       }
+                               
+                                       $i++;
+                               }
+                               while  ($i < 11);
+
                        }
                        else
                        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]