fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11629] property: cron job - integration


From: Sigurd Nes
Subject: [Fmsystem-commits] [11629] property: cron job - integration
Date: Fri, 24 Jan 2014 14:57:31 +0000

Revision: 11629
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11629
Author:   sigurdne
Date:     2014-01-24 14:57:30 +0000 (Fri, 24 Jan 2014)
Log Message:
-----------
property: cron job - integration

Modified Paths:
--------------
    
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php

Modified: 
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
===================================================================
--- 
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
        2014-01-24 14:56:38 UTC (rev 11628)
+++ 
trunk/property/inc/cron/default/import_oppdatering_av_bestilling_fra_agresso_bkb.php
        2014-01-24 14:57:30 UTC (rev 11629)
@@ -107,7 +107,6 @@
                                                $ok = @rename($movefrom, 
$moveto);
                                                if(!$ok) // Should never happen.
                                                {
-                                               //      
$this->invoice->delete($bilagsnr);
                                                        
$this->db->transaction_abort();
                                                        
$this->receipt['error'][] = array('msg' => "Kunne ikke flytte importfil til 
arkiv, oppdatering avbrutt");
                                                }
@@ -173,7 +172,6 @@
                                {
                                        _debug_array($files);
                                }
-die();
 
                                foreach($files as $file_name)
                                {
@@ -198,7 +196,6 @@
                                                                        echo 
"Lokal file was deleted: {$file_local}<br/>";
                                                                }
                                                        }
-                                                       
                                                }
                                                fclose($fp);
                                        }
@@ -214,13 +211,13 @@
 
                        $fp = fopen($file,'rb');
 
-                       while (($data = fgetcsv($handle, 1000, ";")) !== false 
&& $ok == true )
+                       while (($data = fgetcsv($fp, 1000, ";")) !== false && 
$ok == true )
                        {
-                               if( preg_match('/^penger/i', $file_name) )
+                               if( preg_match('/^PENGER/i', $file_name) )
                                {
                                        $ok = $this->update_amount($data);
                                }
-                               else if( preg_match('/^status/i', $file_name) )
+                               else if( preg_match('/^STATUS/i', $file_name) )
                                {
                                        $ok = $this->update_status($data);
                                }
@@ -234,6 +231,7 @@
 
                private function update_amount($data)
                {
+                       //prosjektnummer;prosjektstatus;bestillingsnummer;beløp
                $agresso_prosjekt       = (int)$data[0];
                        $prosjektstatus         = trim($data[1]);
                        $order_id                       = trim($data[2]);
@@ -329,7 +327,8 @@
 
                        $subject = 'Melding er oppdatert fra Agresso';
                        $from = "Ikke svar<address@hidden>";
-                       $prefs = 
$this->bocommon->create_preferences('property', $assignedto);
+                       $bocommon = CreateObject('property.bocommon');
+                       $prefs = $bocommon->create_preferences('property', 
$assignedto);
                        if(isset($prefs['email']) && $prefs['email'])
                        {
                                $body = '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uitts.view', 'id' => $id),false,true).'">' . lang('Ticket').' #' .$id 
.'</a>'."\n";




reply via email to

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