fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17397] more on agresso integration


From: sigurdne
Subject: [Fmsystem-commits] [17397] more on agresso integration
Date: Tue, 5 Dec 2017 10:12:26 -0500 (EST)

Revision: 17397
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17397
Author:   sigurdne
Date:     2017-12-05 10:12:25 -0500 (Tue, 05 Dec 2017)
Log Message:
-----------
more on agresso integration

Modified Paths:
--------------
    trunk/property/inc/class.bocommon.inc.php
    trunk/property/inc/class.bogeneric.inc.php
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.uigeneric.inc.php
    trunk/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
    trunk/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
    trunk/property/js/portico/tts.view.js
    trunk/property/templates/base/tts.xsl

Modified: trunk/property/inc/class.bocommon.inc.php
===================================================================
--- trunk/property/inc/class.bocommon.inc.php   2017-12-05 11:39:37 UTC (rev 
17396)
+++ trunk/property/inc/class.bocommon.inc.php   2017-12-05 15:12:25 UTC (rev 
17397)
@@ -189,7 +189,7 @@
                        {
                                foreach ($list as &$entry)
                                {
-                                       if ($entry['id'] == $selected)
+                                       if ($entry['id'] === $selected)
                                        {
                                                $entry['selected'] = 1;
                                                break;

Modified: trunk/property/inc/class.bogeneric.inc.php
===================================================================
--- trunk/property/inc/class.bogeneric.inc.php  2017-12-05 11:39:37 UTC (rev 
17396)
+++ trunk/property/inc/class.bogeneric.inc.php  2017-12-05 15:12:25 UTC (rev 
17397)
@@ -195,7 +195,7 @@
                                unset($data['location_info']);
                        }
                        $custom_fields = false;
-                       $system_location = 
$this->location_info['system_location'] ? 
$this->location_info['system_location'] : $this->location_info['acl_location'];
+                       $system_location = 
!empty($this->location_info['system_location']) ? 
$this->location_info['system_location'] : $this->location_info['acl_location'];
                        if 
($GLOBALS['phpgw']->locations->get_attrib_table($this->location_info['acl_app'],
 $this->location_info['acl_location']))
                        {
                                $custom_fields = true;
@@ -203,7 +203,7 @@
                                $values['attributes'] = 
$this->custom->find($this->location_info['acl_app'], $system_location, 0, '', 
'ASC', 'attrib_sort', true, true);
                        }
 
-                       if (isset($data['id']) && $data['id'])
+                       if (isset($data['id']) && $data['id'] || (int) 
$data['id'] ===0 )
                        {
                                $values = $this->so->read_single($data, 
$values);
                        }
@@ -223,7 +223,7 @@
 
                        if ($action == 'edit')
                        {
-                               if ($data['id'] != '')
+                               if ($data['id'] !== '')
                                {
 
                                        $receipt = $this->so->edit($data, 
$values_attribute);

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2017-12-05 11:39:37 UTC (rev 
17396)
+++ trunk/property/inc/class.botts.inc.php      2017-12-05 15:12:25 UTC (rev 
17397)
@@ -1853,7 +1853,7 @@
 
                public function receive_order( $id, $received_amount )
                {
-                       $receive_order = true; // used as trigger within the 
custom function
+                       $transfer_action = 'receive_order'; // used as trigger 
within the custom function
                        $acl_location = $this->acl_location;
 
                        $criteria = array(

Modified: trunk/property/inc/class.uigeneric.inc.php
===================================================================
--- trunk/property/inc/class.uigeneric.inc.php  2017-12-05 11:39:37 UTC (rev 
17396)
+++ trunk/property/inc/class.uigeneric.inc.php  2017-12-05 15:12:25 UTC (rev 
17397)
@@ -154,13 +154,21 @@
                                $values[$field['name']] = 
phpgw::clean_value($_POST['values'][$field['name']],$value_type);
                        }
 
-                       $values[$id_name] = 
phpgw::clean_value($_POST['values'][$id_name]);
+                       $values[$id_name] = 
phpgw::clean_value($_POST[$id_name]);
 
                        $values_attribute = phpgw::get_var('values_attribute');
 
-                       if (!$id && !$values[$id_name] && 
$this->location_info['id']['type'] != 'auto')
+//                     if (!$id && !$values[$id_name] && 
$this->location_info['id']['type'] != 'auto')
+//                     {
+//                             $this->receipt['error'][] = array('msg' => 
lang('missing value for %1', lang('id')));
+//                     }
+
+                       if ($this->location_info['id']['type'] != 'auto')
                        {
-                               $this->receipt['error'][] = array('msg' => 
lang('missing value for %1', lang('id')));
+                               if (empty($values[$id_name]) && 
$values[$id_name] !== '0')
+                               {
+                                       $this->receipt['error'][] = array('msg' 
=> lang('missing value for %1', lang('id')));
+                               }
                        }
 
                        if ($values[$id_name] && 
$this->location_info['id']['type'] == 'int' && !ctype_digit($values[$id_name]))
@@ -601,12 +609,12 @@
                                return;
                        }
 
-                       $id = isset($values['id']) && $values['id'] ? 
$values['id'] : phpgw::get_var($this->location_info['id']['name']);
+                       $id = isset($values['id']) && ($values['id'] || 
$values['id'] === '0') ? $values['id'] : 
phpgw::get_var($this->location_info['id']['name']);
                        $values_attribute = phpgw::get_var('values_attribute');
 
                        $GLOBALS['phpgw_info']['apps']['manual']['section'] = 
'general.edit.' . $this->type;
 
-                       if ($id)
+                       if ($id || $id === '0' )
                        {
                                $values = $this->bo->read_single(array('id' => 
$id));
                                $function_msg = 
$this->location_info['edit_msg'];
@@ -1028,7 +1036,7 @@
 
                        $values = phpgw::get_var('values');
 
-                       if ($id)
+                       if ($id || (int)$id === 0)
                        {
                                $data = $this->bo->read_single(array('id' => 
$id,'view' => true));
                                $action = 'edit';

Modified: 
trunk/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
===================================================================
--- 
trunk/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php    
    2017-12-05 11:39:37 UTC (rev 17396)
+++ 
trunk/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php    
    2017-12-05 15:12:25 UTC (rev 17397)
@@ -163,7 +163,7 @@
                                }
                                $historylog->add('RM', $id, "Varemottak: 
{$received_amount} overført til agresso");
                                $now = time();
-                               $GLOBALS['phpgw']->db->query("UPDATE {$table} 
SET order_received = {$now}, order_received_amount = {$received_amount} WHERE 
id = {$id}");
+                               $GLOBALS['phpgw']->db->query("UPDATE {$table} 
SET order_received = {$now}, order_received_amount = order_received_amount + 
{$received_amount} WHERE id = {$id}");
                        }
                }
        }
@@ -249,7 +249,7 @@
                }
        }
 
-       if (isset($id) && $id && isset($acl_location) && $acl_location && 
isset($transfer_action) && $transfer_action = 'receive_order')
+       if (!empty($id) && !empty($acl_location) && isset($transfer_action) && 
$transfer_action == 'receive_order')
        {
                $exporter_varemottak = new 
lag_agresso_varemottak($acl_location, $id);
                $result = $exporter_varemottak->transfer($id, $received_amount);

Modified: 
trunk/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
===================================================================
--- trunk/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php  
2017-12-05 11:39:37 UTC (rev 17396)
+++ trunk/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php  
2017-12-05 15:12:25 UTC (rev 17397)
@@ -150,6 +150,21 @@
 
                        $dim6 = 9;
 
+                       //Override from order
+                       $tax_code = $_ticket['tax_code'] ? $_ticket['tax_code'] 
: 0;
+                       switch ($tax_code)
+                       {
+                               case '0':
+                                       $tax_code = '6A';
+                                       break;
+                               case '75':
+                                       $tax_code = '60';
+                                       break;
+                               default:
+                                       $tax_code = '6A';
+                                       break;
+                       }
+
                        if ($_ticket['order_dim1'])
                        {
                                $sogeneric = CreateObject('property.sogeneric', 
'order_dim1');
@@ -194,7 +209,7 @@
                                'vendor_name' => $vendor['name'],
                                'vendor_address' => 
mb_substr($vendor['address'], 0, 50),
                                'order_id' => $_ticket['order_id'],
-                               'tax_code' => $_ticket['tax_code'],
+                               'tax_code' => $tax_code,
                                'buyer' => $buyer,
                                'lines' => array(
                                        array(

Modified: trunk/property/js/portico/tts.view.js
===================================================================
--- trunk/property/js/portico/tts.view.js       2017-12-05 11:39:37 UTC (rev 
17396)
+++ trunk/property/js/portico/tts.view.js       2017-12-05 15:12:25 UTC (rev 
17397)
@@ -207,7 +207,7 @@
 
                                        if(data.length > 0)
                                        {
-//                                             
$("#vendor_contract_id").attr("data-validation", "required");
+                                               
$("#vendor_contract_id").attr("data-validation", "required");
                                                htmlString = "<option value=''> 
kontrakter funnet</option>";
                                        }
                                        else
@@ -230,7 +230,6 @@
        }
 };
 
-
 this.onDOMAttrModified = function (e)
 {
        var attr = e.attrName || e.propertyName;
@@ -347,7 +346,8 @@
                                {
                                        msg = 'OK';
                                        
$("#order_received_time").html(data['time']);
-                                       
$("#current_received_amount").html($("#order_received_amount").val());
+                                       var current_received_amount = 
Number($("#current_received_amount").html());
+                                       
$("#current_received_amount").html(current_received_amount + 
Number($("#order_received_amount").val()));
                                }
                                else
                                {

Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl       2017-12-05 11:39:37 UTC (rev 
17396)
+++ trunk/property/templates/base/tts.xsl       2017-12-05 15:12:25 UTC (rev 
17397)
@@ -75,7 +75,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="php:function('lang', 'Group')"/>
                                                                </label>
-                                                               
+
                                                                
<xsl:call-template name="group_select"/>
                                                        </div>
                                                        <xsl:choose>
@@ -84,7 +84,7 @@
                                                                                
<label>
                                                                                
        <xsl:value-of select="php:function('lang', 'Assign to')"/>
                                                                                
</label>
-                                                                               
+
                                                                                
<xsl:call-template name="user_id_select"/>
                                                                        </div>
                                                                </xsl:when>
@@ -109,7 +109,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="php:function('lang', 'Priority')"/>
                                                                </label>
-                                                       
+
                                                                <xsl:variable 
name="lang_priority_statustext">
                                                                        
<xsl:value-of select="lang_priority_statustext"/>
                                                                </xsl:variable>
@@ -124,7 +124,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="php:function('lang', 'status')"/>
                                                                </label>
-                                                               
+
                                                                <select 
id="status_id" name="values[status]" class="pure-input-1-2" >
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="php:function('lang', 'Set the status of the ticket')"/>
@@ -153,7 +153,7 @@
                                                <label>
                                                        <xsl:value-of 
select="php:function('lang', 'subject')"/>
                                                </label>
-                                               
+
                                                <input type="text" 
name="values[subject]" value="{value_subject}" class="pure-input-1-2" >
                                                        <xsl:attribute 
name="title">
                                                                <xsl:value-of 
select="php:function('lang', 'Enter the subject of this ticket')"/>
@@ -173,7 +173,7 @@
                                                <label>
                                                        <xsl:value-of 
select="php:function('lang', 'Details')"/>
                                                </label>
-                                               
+
                                                <textarea 
class="pure-input-1-2" rows="10" name="values[details]" >
                                                        <xsl:attribute 
name="title">
                                                                <xsl:value-of 
select="php:function('lang', 'Enter the details of this ticket')"/>
@@ -193,7 +193,7 @@
                                                                <label>
                                                                        
<xsl:value-of select="lang_upload_file"/>
                                                                </label>
-                                                               
+
                                                                <input  
class="pure-input-1-2" type="file" name="file">
                                                                        
<xsl:attribute name="title">
                                                                                
<xsl:value-of select="lang_file_statustext"/>
@@ -266,7 +266,7 @@
                var strURL = phpGWLink('index.php', oArgs);
                TINY.box.show({iframe:strURL, 
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
 mask:true, animate:true, close: true});
                }
-                       
+
                function preview_html(id)
                {
 
@@ -580,7 +580,7 @@
                                                                                
<label>
                                                                                
        <xsl:value-of select="php:function('lang', 'finnish date')"/>
                                                                                
</label>
-                                                                       
+
                                                                                
<input type="text" id="values_finnish_date" name="values[finnish_date]" 
size="10" value="{value_finnish_date}" readonly="readonly">
                                                                                
        <xsl:attribute name="title">
                                                                                
                <xsl:value-of select="php:function('lang', 'select the 
estimated date for closing the task')"/>
@@ -714,7 +714,7 @@
                                                                                
<label>
                                                                                
        <xsl:value-of select="php:function('lang', 'make order')"/>
                                                                                
</label>
-                                                                               
        
+
                                                                                
<input type="checkbox" name="values[make_order]" value="True">
                                                                                
        <xsl:attribute name="title">
                                                                                
                <xsl:value-of select="php:function('lang', 'make order')"/>
@@ -795,6 +795,11 @@
                                                                                
        <xsl:value-of select="php:function('lang', 'contract')"/>
                                                                                
</label>
                                                                                
<select id="vendor_contract_id" name="values[contract_id]" 
class="pure-input-1-2">
+                                                                               
        <xsl:if test="count(contract_list/options) &gt; 0">
+                                                                               
                <xsl:attribute name="data-validation">
+                                                                               
                        <xsl:text>required</xsl:text>
+                                                                               
                </xsl:attribute>
+                                                                               
        </xsl:if>
                                                                                
        <option value="">
                                                                                
                <xsl:value-of select="php:function('lang', 'select')"/>
                                                                                
        </option>
@@ -886,7 +891,7 @@
                                                                                
<label>
                                                                                
        <xsl:value-of select="$lang_building_part"/>
                                                                                
</label>
-                                                                               
                
+
                                                                                
<select name="values[building_part]" class="pure-input-1-2" >
                                                                                
        <xsl:attribute name="title">
                                                                                
                <xsl:value-of select="$lang_building_part"/>
@@ -962,6 +967,9 @@
                                                                                
                <xsl:attribute name="data-validation-error-msg">
                                                                                
                        <xsl:value-of select="$lang_tax_code"/>
                                                                                
                </xsl:attribute>
+                                                                               
                <option value="">
+                                                                               
                        <xsl:value-of select="$lang_tax_code"/>
+                                                                               
                </option>
                                                                                
                <xsl:apply-templates select="tax_code_list/options"/>
                                                                                
        </select>
                                                                                
</div>
@@ -1132,7 +1140,7 @@
                                                                                
<label>
                                                                                
        <xsl:value-of select="php:function('lang', 'actual cost')"/>
                                                                                
</label>
-                                                                               
                
+
                                                                                
<div class = 'pure-u-md-1-2'>
                                                                                
        <!--div  id="paging_4"> </div>
                                                                                
        <div class="pure-table" id="datatable-container_4"/-->
@@ -1228,7 +1236,7 @@
                                                                                
        <xsl:apply-templates select="status_list/options"/>
                                                                                
</select>
                                                                        </div>
-                                                                       <!--div 
class="pure-control-group">
+                                                                       <div 
class="pure-control-group">
                                                                                
<label for="name">
                                                                                
        <xsl:value-of select="php:function('lang', 'order received')"/>
                                                                                
</label>
@@ -1260,7 +1268,7 @@
                                                                                
        </table>
                                                                                
</div>
                                                                                
<input  class="pure-custom" type="text" id="order_received_amount" size="6"/>
-                                                                       </div-->
+                                                                       </div>
 
                                                                        <div 
class="pure-control-group">
                                                                                
<div class="pure-custom">
@@ -1309,7 +1317,7 @@
                                                                                
<label>
                                                                                
        <xsl:value-of select="php:function('lang', 'order id')"/>
                                                                                
</label>
-                                                                               
                
+
                                                                                
<xsl:value-of select="value_order_id"/>
                                                                        </div>
                                                                        
<xsl:call-template name="vendor_view"/>
@@ -1339,7 +1347,7 @@
                                                <label>
                                                        <xsl:value-of 
select="php:function('lang', 'notify')"/>
                                                </label>
-                                       
+
                                                <!--div id="paging_5"> </div>
                                                <div class="pure-table" 
id="datatable-container_5"/>
                                                <div 
id="datatable-buttons_5"/-->




reply via email to

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