fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8998] property: rollback


From: Sigurd Nes
Subject: [Fmsystem-commits] [8998] property: rollback
Date: Tue, 20 Mar 2012 14:44:53 +0000

Revision: 8998
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8998
Author:   sigurdne
Date:     2012-03-20 14:44:53 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
property: rollback

Modified Paths:
--------------
    trunk/property/inc/cron/default/Import_fra_basware_X205.php
    trunk/property/inc/export/default/Basware_X114

Modified: trunk/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
--- trunk/property/inc/cron/default/Import_fra_basware_X205.php 2012-03-20 
14:44:39 UTC (rev 8997)
+++ trunk/property/inc/cron/default/Import_fra_basware_X205.php 2012-03-20 
14:44:53 UTC (rev 8998)
@@ -579,15 +579,24 @@
                                        $duplicate = true;
                                        $_bilagsnr_ut = 
$this->db->f('bilagsnr_ut');
                                        $bilagsnr = $this->db->f('bilagsnr');
-                                       $receipt = 
$this->export->RullTilbake(false,false,$_bilagsnr_ut);
+                                       $__bilagsnr = $_bilagsnr_ut ? 
$_bilagsnr_ut : $bilagsnr;
+                                       
+                                       if($_bilagsnr_ut)
+                                       {
+                                               $receipt = 
$this->export->RullTilbake(false,false,$_bilagsnr_ut);
+                                       }
+                                       else
+                                       {
+                                               $receipt = 
$this->export->RullTilbake(false,false,false,$bilagsnr);
+                                       }
 
                                        if( isset($receipt['message']) )
                                        {
-                                               $this->receipt['message'][] = 
array('msg' => "Bilag rullet tilbake fra historikk : {$_bilagsnr_ut}");
+                                               $this->receipt['message'][] = 
array('msg' => "Bilag rullet tilbake fra historikk : {$__bilagsnr}");
                                        }
                                        else
                                        {
-                                               $this->receipt['error'][] = 
array('msg' => "Bilag ikke rullet tilbake fra historikk : {$_bilagsnr_ut}, 
extern ref: {$_data['SCANNINGNO']}");
+                                               $this->receipt['error'][] = 
array('msg' => "Bilag ikke rullet tilbake fra historikk : {$__bilagsnr}, extern 
ref: {$_data['SCANNINGNO']}");
                                        }
                                        unset($_bilagsnr_ut);
                                }

Modified: trunk/property/inc/export/default/Basware_X114
===================================================================
--- trunk/property/inc/export/default/Basware_X114      2012-03-20 14:44:39 UTC 
(rev 8997)
+++ trunk/property/inc/export/default/Basware_X114      2012-03-20 14:44:53 UTC 
(rev 8998)
@@ -199,7 +199,7 @@
                }
 
 
-               protected function select_invoice_rollback($date, 
$Filnavn,$rollback_voucher)
+               protected function select_invoice_rollback($date, 
$Filnavn,$rollback_voucher,$rollback_internal_voucher)
                {
                        $date_array = phpgwapi_datetime::date_array($date);
                        $day = $date_array['day'];
@@ -235,6 +235,11 @@
                                $rollback_voucher = (int)$rollback_voucher;
                                $sql="SELECT * FROM fm_ecobilagoverf WHERE 
bilagsnr_ut = {$rollback_voucher} AND manual_record IS NULL";
                        }
+                       else if($rollback_internal_voucher)
+                       {
+                               $rollback_internal_voucher = 
(int)$rollback_internal_voucher;
+                               $sql="SELECT * FROM fm_ecobilagoverf WHERE 
bilagsnr = {$rollback_internal_voucher} AND manual_record IS NULL";
+                       }
                        else
                        {
                                $sql="SELECT * FROM fm_ecobilagoverf WHERE 
filnavn='$Filnavn' AND $datepart_year=$year AND $datepart_month=$month AND 
$datepart_day= $day";
@@ -416,9 +421,9 @@
                        $this->log_error($batchid,$error_desr);
                }
 
-               public function RullTilbake($Filnavn, $date,$rollback_voucher)
+               public function RullTilbake($Filnavn, 
$date,$rollback_voucher,$rollback_internal_voucher)
                {
-                       $voucher = $this->select_invoice_rollback($date, 
$Filnavn,$rollback_voucher);
+                       $voucher = $this->select_invoice_rollback($date, 
$Filnavn,$rollback_voucher,$rollback_internal_voucher);
 
                        if ( $this->db->get_transaction() )
                        {
@@ -464,7 +469,7 @@
                        {
                                $fil_katalog = 
$this->config->config_data['export']['path'];
 
-                               if($rollback_voucher)
+                               if($rollback_voucher || 
$rollback_internal_voucher)
                                {
                                        if ( !$this->global_lock )
                                        {




reply via email to

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