fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14671] Property: include gabinfo in pdf-order


From: Sigurd Nes
Subject: [Fmsystem-commits] [14671] Property: include gabinfo in pdf-order
Date: Mon, 25 Jan 2016 09:54:40 +0000

Revision: 14671
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14671
Author:   sigurdne
Date:     2016-01-25 09:54:40 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
Property: include gabinfo in pdf-order

Modified Paths:
--------------
    branches/dev-syncromind/property/inc/class.uiwo_hour.inc.php

Modified: branches/dev-syncromind/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiwo_hour.inc.php        
2016-01-25 09:35:20 UTC (rev 14670)
+++ branches/dev-syncromind/property/inc/class.uiwo_hour.inc.php        
2016-01-25 09:54:40 UTC (rev 14671)
@@ -1236,20 +1236,8 @@
 
                        $location_code = 
isset($common_data['workorder']['location_code']) && 
$common_data['workorder']['location_code'] ? 
$common_data['workorder']['location_code'] : $project['location_code'];
 
-                       $gabinfos = execMethod('property.sogab.read', 
array('location_code' => $location_code,
-                               'allrows' => true));
-                       if($gabinfos != null && is_array($gabinfos) && 
count($gabinfos) == 1)
-                       {
-                               $gabinfo = array_shift($gabinfos);
-                               $gab_id = $gabinfo['gab_id'];
-                       }
+                       $formatted_gab_id = $this->get_gab_id($location_code);
 
-                       $formatted_gab_id = '';
-                       if(isset($gab_id))
-                       {
-                               $formatted_gab_id = substr($gab_id, 4, 5) . ' / 
' . substr($gab_id, 9, 4) . ' / ' . substr($gab_id, 13, 4) . ' / ' . 
substr($gab_id, 17, 3);
-                       }
-
                        $email_data = array
                                (
                                'formatted_gab_id' => $formatted_gab_id,
@@ -1906,6 +1894,8 @@
                                )
                        ));
 
+                       $location_code = 
isset($common_data['workorder']['location_code']) && 
$common_data['workorder']['location_code'] ? 
$common_data['workorder']['location_code'] : $project['location_code'];
+
                        $delivery_address = lang('delivery address') . ':';
                        
if(isset($this->config->config_data['delivery_address']) && 
$this->config->config_data['delivery_address'])
                        {
@@ -1913,7 +1903,6 @@
                        }
                        else
                        {
-                               $location_code = 
isset($common_data['workorder']['location_code']) && 
$common_data['workorder']['location_code'] ? 
$common_data['workorder']['location_code'] : $project['location_code'];
                                $address_element = 
execMethod('property.botts.get_address_element', $location_code);
                                foreach($address_element as $entry)
                                {
@@ -1921,6 +1910,9 @@
                                }
                        }
 
+                       $formatted_gab_id = $this->get_gab_id($location_code);
+                       $delivery_address .= "\nGnr/Bnr: {$formatted_gab_id}";
+
                        $invoice_address = lang('invoice address') . 
":\n{$this->config->config_data['invoice_address']}";
 
                        
$GLOBALS['phpgw']->preferences->set_account_id($common_data['workorder']['user_id'],
 true);
@@ -3349,4 +3341,24 @@
                        $historylog = CreateObject('property.historylog', 
'workorder');
                        $historylog->add('M', $workorder_id, 
"{$_to}{$_attachment_log}");
                }
+
+               function get_gab_id($location_code)
+               {
+                       $formatted_gab_id = '';
+                       $gabinfos = execMethod('property.sogab.read', 
array('location_code' => $location_code,
+                               'allrows' => true));
+                       if($gabinfos != null && is_array($gabinfos) && 
count($gabinfos) == 1)
+                       {
+                               $gabinfo = array_shift($gabinfos);
+                               $gab_id = $gabinfo['gab_id'];
+                       }
+
+                       $formatted_gab_id = '';
+                       if(isset($gab_id))
+                       {
+                               $formatted_gab_id = substr($gab_id, 4, 5) . ' / 
' . substr($gab_id, 9, 4) . ' / ' . substr($gab_id, 13, 4) . ' / ' . 
substr($gab_id, 17, 3);
+                       }
+                       return $formatted_gab_id;
+               }
+
        }
\ No newline at end of file




reply via email to

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