fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15813] Syncromind: merge 15799:15812 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15813] Syncromind: merge 15799:15812 from trunk
Date: Wed, 12 Oct 2016 09:15:58 +0000 (UTC)

Revision: 15813
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15813
Author:   sigurdne
Date:     2016-10-12 09:15:58 +0000 (Wed, 12 Oct 2016)
Log Message:
-----------
Syncromind: merge 15799:15812 from trunk

Modified Paths:
--------------
    branches/dev-syncromind-2/admin/inc/class.uiconfig2.inc.php
    branches/dev-syncromind-2/helpdesk/inc/class.sotts.inc.php
    branches/dev-syncromind-2/phpgwapi/templates/base/attributes_form.xsl
    branches/dev-syncromind-2/property/inc/class.soinvoice.inc.php
    branches/dev-syncromind-2/property/inc/class.uiasync.inc.php
    branches/dev-syncromind-2/property/inc/class.uitts.inc.php
    
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
    
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
    
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
    branches/dev-syncromind-2/property/templates/base/attributes_form.xsl
    branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
    branches/dev-syncromind-2/rental/inc/class.soinvoice_price_item.inc.php
    branches/dev-syncromind-2/rental/inc/class.sounit.inc.php
    branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
    branches/dev-syncromind-2/rental/setup/phpgw_no.lang

Property Changed:
----------------
    branches/dev-syncromind-2/


Property changes on: branches/dev-syncromind-2
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775,15777-15795,15797-15798
   + /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732,15734,15736-15746,15750-15770,15772-15775,15777-15795,15797-15798,15800-15812

Modified: branches/dev-syncromind-2/admin/inc/class.uiconfig2.inc.php
===================================================================
--- branches/dev-syncromind-2/admin/inc/class.uiconfig2.inc.php 2016-10-12 
06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/admin/inc/class.uiconfig2.inc.php 2016-10-12 
09:15:58 UTC (rev 15813)
@@ -735,7 +735,7 @@
                        $section_id     = phpgw::get_var('section_id', 'int');
                        $attrib_id      = phpgw::get_var('attrib_id', 'int');
                        $id                     = phpgw::get_var('id', 'int');
-                       $values         = phpgw::get_var('values');
+                       $values         = phpgw::get_var('values', 'raw');
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('config'));
 

Modified: branches/dev-syncromind-2/helpdesk/inc/class.sotts.inc.php
===================================================================
--- branches/dev-syncromind-2/helpdesk/inc/class.sotts.inc.php  2016-10-12 
06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/helpdesk/inc/class.sotts.inc.php  2016-10-12 
09:15:58 UTC (rev 15813)
@@ -300,7 +300,7 @@
                                $where = 'AND';
 
                                $membership = 
$GLOBALS['phpgw']->accounts->membership($user_id);
-                               $filtermethod .= ' OR (assignedto IS NULL AND 
group_id IN (' . implode(',',array_keys($membership)) . ')))'; 
+                               $filtermethod .= ' OR (assignedto IS NULL AND 
phpgw_helpdesk_tickets.group_id IN (' . implode(',',array_keys($membership)) . 
')))';
                        }
 
                        if ($owner_id > 0)

Modified: branches/dev-syncromind-2/phpgwapi/templates/base/attributes_form.xsl
===================================================================
--- branches/dev-syncromind-2/phpgwapi/templates/base/attributes_form.xsl       
2016-10-12 06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/phpgwapi/templates/base/attributes_form.xsl       
2016-10-12 09:15:58 UTC (rev 15813)
@@ -765,8 +765,7 @@
 <!-- New template-->
 <xsl:template name="choice">
        <xsl:param name="input_type" />
-
-       <xsl:variable name="id">
+       <xsl:variable name="attrib_id">
                <xsl:value-of select="id"/>
        </xsl:variable>
        <xsl:variable name="name">
@@ -776,10 +775,10 @@
                <xsl:for-each select="choice">
                        <xsl:choose>
                                <xsl:when test="selected='1'">
-                                       <input id="id_{$name}_{id}" 
type="{$input_type}" name="values_attribute[{$id}][value][]" value="{id}" 
checked="checked"/>
+                                       <input id="id_{$name}_{id}" 
type="{$input_type}" name="values_attribute[{$attrib_id}][value][]" 
value="{id}" checked="checked"/>
                                </xsl:when>
                                <xsl:otherwise>
-                                       <input id="id_{$name}_{id}" 
type="{$input_type}" name="values_attribute[{$id}][value][]" value="{id}"/>
+                                       <input id="id_{$name}_{id}" 
type="{$input_type}" name="values_attribute[{$attrib_id}][value][]" 
value="{id}"/>
                                </xsl:otherwise>
                        </xsl:choose>
                        <xsl:value-of select="value"/>

Modified: branches/dev-syncromind-2/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.soinvoice.inc.php      
2016-10-12 06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/property/inc/class.soinvoice.inc.php      
2016-10-12 09:15:58 UTC (rev 15813)
@@ -584,10 +584,15 @@
                                $where = 'AND';
                        }
 
+                       $join_project = '';
                        if ($project_id)
                        {
                                $filtermethod .= " {$where} fm_project.id = 
'{$project_id}'";
                                $where = 'AND';
+                               $join_project = ""
+                       //              . " {$this->join} fm_ecoart ON 
fm_ecoart.id = $table.artid"
+                                       . " {$this->join} fm_workorder ON 
fm_workorder.id = $table.pmwrkord_code"
+                                       . " {$this->join} fm_project ON 
fm_workorder.project_id = fm_project.id";
                        }
 
                        if ($year)
@@ -606,10 +611,7 @@
 
                        $sql = "SELECT DISTINCT 
pmwrkord_code,bilagsnr,bilagsnr_ut,fakturanr,sum(belop) as belop, 
sum(godkjentbelop) as godkjentbelop,"
                                . " 
currency,budsjettansvarligid,org_name,periode,periodization,periodization_start"
-                               . " FROM {$table}"
-//                             . " {$this->join} fm_ecoart ON fm_ecoart.id = 
$table.artid"
-//                             . " {$this->join} fm_workorder ON 
fm_workorder.id = $table.pmwrkord_code"
-//                             . " {$this->join} fm_project ON 
fm_workorder.project_id = fm_project.id"
+                               . " FROM {$table}{$join_project}"
                                . " {$this->join} fm_vendor ON 
{$table}.spvend_code = fm_vendor.id {$filtermethod} {$groupmethod}";
 
                        $this->db->query($sql . $ordermethod, __LINE__, 
__FILE__);

Modified: branches/dev-syncromind-2/property/inc/class.uiasync.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uiasync.inc.php        
2016-10-12 06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/property/inc/class.uiasync.inc.php        
2016-10-12 09:15:58 UTC (rev 15813)
@@ -100,6 +100,10 @@
 
                function index()
                {
+                       if(!$this->acl_read)
+                       {
+                               phpgw::no_access();
+                       }
 
                        if (phpgw::get_var('phpgw_return_as') == 'json')
                        {
@@ -330,6 +334,11 @@
                                return $this->edit();
                        }
 
+                       if(!$this->acl_edit)
+                       {
+                               phpgw::no_access();
+                       }
+
                        $id = phpgw::get_var('id', 'int');
                        $values = phpgw::get_var('values');
 
@@ -345,7 +354,7 @@
                        }
 
                        $data = str_replace(' ', '', 
stripslashes($values['data']));
-                       $data = stripslashes($values['data']);
+                       $data = 
html_entity_decode(stripslashes($values['data']));
 
                        $data = explode(",", $data);
 
@@ -389,9 +398,11 @@
 
                function edit()
                {
+                       if(!$this->acl_edit)
+                       {
+                               phpgw::no_access();
+                       }
                        $id = phpgw::get_var('id', 'int');
-                       $values = phpgw::get_var('values');
-
                        $tabs = array();
                        $tabs['general'] = array('label' => lang('general'), 
'link' => '#general');
                        $active_tab = 'general';

Modified: branches/dev-syncromind-2/property/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uitts.inc.php  2016-10-12 
06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/property/inc/class.uitts.inc.php  2016-10-12 
09:15:58 UTC (rev 15813)
@@ -2894,9 +2894,8 @@
                        $active_tab = 'general';
 
                        $unspsc_code = $ticket['unspsc_code'] ? 
$ticket['unspsc_code'] : 
$GLOBALS['phpgw_info']['user']['preferences']['property']['unspsc_code'];
-                       $enable_order_service_id = 
isset($config->config_data['enable_order_service_id']) && 
$config->config_data['enable_order_service_id'] ? true : false;
-                       $enable_unspsc = 
isset($config->config_data['enable_unspsc']) && 
$config->config_data['enable_unspsc'] ? true : false;
-
+                       $enable_order_service_id = 
!empty($this->bo->config->config_data['enable_order_service_id']) ? true : 
false;
+                       $enable_unspsc = 
!empty($this->bo->config->config_data['enable_unspsc']) ? true : false;
                        $relation_type_list = array(
                                array(
                                        'id'    => 'property.uirequest.index',

Modified: 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
===================================================================
--- 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
  2016-10-12 06:38:33 UTC (rev 15812)
+++ 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
  2016-10-12 09:15:58 UTC (rev 15813)
@@ -50,6 +50,7 @@
                var $transfer_xml;
                var $connection;
                var $order_id;
+               var $voucher_type;
 
                public function __construct( $param )
                {
@@ -57,6 +58,7 @@
                        $this->soXport = CreateObject('property.soXport');
                        $this->config = CreateObject('admin.soconfig', 
$GLOBALS['phpgw']->locations->get_id('property', '.invoice'));
                        $this->order_id = $param['order_id'];
+                       $this->voucher_type = $param['voucher_type'];
                }
 
                public function create_transfer_xml( $param )
@@ -105,7 +107,7 @@
                        $DetailInfo[] = array(
                                'ReferenceCode' => array(
                                        'Code' => 'C1',
-                                       'Value' => $param['dim1'] // Ansvar
+                                       'Value' => sprintf("%06s", 
$param['dim1']) // Ansvar
                                )
                        );
                        $DetailInfo[] = array(
@@ -129,7 +131,7 @@
                        $DetailInfo[] = array(
                                'ReferenceCode' => array(
                                        'Code' => 'B0',
-                                       'Value' => $param['dim5'] // Prosjekt
+                                       'Value' => $param['dim5'] ? 
$param['dim5'] : 9 // Prosjekt
                                )
                        );
                        $DetailInfo[] = array(
@@ -157,9 +159,9 @@
                                        'BuyerProductCode' => 
$line['unspsc_code'], //74000176, //UN-kode
                                        'BuyerProductDescr' => $line['descr'], 
//'Kopipapir',
                                        'UnitCode' => 'STK',
-                                       'Quantity' => 100,
-                                       'Price' =>'',
-                                       'Linetotal'=> '',
+                                       'Quantity' => 1,
+                                       'Price' => $line['price'],
+                                       'Linetotal'=> $line['price'],
                                        'DetailInfo' => $DetailInfo
                                );
 
@@ -169,7 +171,7 @@
 
                        $Orders['Order'][] = array(
                                'OrderNo' => $param['order_id'],
-                               'VoucherType' => 'P3',
+                               'VoucherType' => $param['voucher_type'],
                                'TransType' => 41,
                                'Header' => array($Header),
                                'Details' => array('Detail' => $Detail)
@@ -209,9 +211,14 @@
                        {
                                throw new 
Exception('BkBygg_exporter_data_til_Agresso::create_file_name() Mangler 
referanse');
                        }
+                       $voucher_type = $this->voucher_type;
+                       if (!$voucher_type)
+                       {
+                               throw new 
Exception('BkBygg_exporter_data_til_Agresso::create_file_name() Mangler 
bilagstype');
+                       }
                        $fil_katalog = 
$this->config->config_data['export']['path'];
 
-                       $filename = "{$fil_katalog}/FDV_ordre_{$ref}.xml";
+                       $filename = 
"{$fil_katalog}/{$voucher_type}_ordre_{$ref}.xml";
 
                        //Sjekk om filen eksisterer
                        if (file_exists($filename))
@@ -224,17 +231,16 @@
 
                public function transfer( $debug )
                {
-                       $this->db->transaction_begin();
 
                        $filename = $this->create_file_name($this->order_id);
                        $batchid = $this->soXport->increment_batchid();
                        $content = $this->transfer_xml;
 
-                       if(false) // keep a copy?
+                       if($debug) // keep a copy?
                        {
                                $file_written = false;
                                $fp = fopen($filename, "wb");
-                               fwrite($fp, $buffer);
+                               fwrite($fp, $content);
 
                                if (fclose($fp))
                                {
@@ -246,6 +252,8 @@
 //                     if ($this->config->config_data['common']['method'] == 
'ftp' || $this->config->config_data['common']['method'] == 'ssh')
                        if (!$debug)//Not yet...
                        {
+                               $this->db->transaction_begin();
+
                                if (!$connection = $this->connection)
                                {
                                        $connection = $this->phpftp_connect();

Modified: 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
===================================================================
--- 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
    2016-10-12 06:38:33 UTC (rev 15812)
+++ 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
    2016-10-12 09:15:58 UTC (rev 15813)
@@ -46,6 +46,7 @@
 
                private $acl_location;
                private $values;
+               var $debug = true;
 
                function __construct( $acl_location, $id )
                {
@@ -68,7 +69,29 @@
                        $values = $this->values;
 //             _debug_array($values);die();
 
+                       /*
+                       P3: EBF Innkjøpsordre Portico : 45000000-45249999
+                       V3: EBF Varemotttak Portico   : 45500000-45749999
+                       P4: EBE Innkjøpsordre Portico : 45250000-45499999
+                       V4: EBE Varemotttak Portico   : 45750000-45999999
+                       */
+
+
+                       if($values['order_id'] >= 45000000 && 
$values['order_id'] <= 45249999)
+                       {
+                               $voucher_type = 'V3';
+                       }
+                       else if ($values['order_id'] >= 45250000 && 
$values['order_id'] <= 45499999)
+                       {
+                               $voucher_type = 'V4';
+                       }
+                       else
+                       {
+                               throw new Exception("Ordrenummer 
'{$values['order_id']}' er utenfor serien");
+                       }
+
                        $param = array(
+                               'voucher_type'  => $voucher_type,
                                'order_id' => $values['order_id'],
                                'lines' => array(
                                        array(
@@ -78,12 +101,13 @@
                                )
                        );
 
-                       $exporter_varemottak = new 
BkBygg_exporter_varemottak_til_Agresso(array('order_id' => 
$values['order_id']));
+                       $exporter_varemottak = new 
BkBygg_exporter_varemottak_til_Agresso(array(
+                               'order_id' => $values['order_id'],
+                               'voucher_type' => $voucher_type
+                               ));
                        $exporter_varemottak->create_transfer_xml($param);
-       //              $exporter_varemottak->output();
-                       $export_ok = true;
-       //              die();
-       //              $export_ok = $exporter_varemottak->transfer();
+
+                       $export_ok = 
$exporter_varemottak->transfer($this->debug);
                        if ($export_ok)
                        {
                                $this->log_transfer( $id, $received_amount );
@@ -118,6 +142,7 @@
                var $transfer_xml;
                var $connection;
                var $order_id;
+               var $voucher_type;
 
                public function __construct( $param )
                {
@@ -142,7 +167,7 @@
 
                        $Orders['Order'][] = array(
                                'OrderNo' => $param['order_id'],
-                               'VoucherType' => 'VV',
+                               'VoucherType' => $param['voucher_type'],
                                'TransType' => 51,
                                'Details' => array('Detail' => $Detail)
                        );
@@ -167,9 +192,15 @@
                        {
                                throw new 
Exception('BkBygg_exporter_data_til_Agresso::create_file_name() Mangler 
referanse');
                        }
+                       $voucher_type = $this->voucher_type;
+                       if (!$voucher_type)
+                       {
+                               throw new 
Exception('BkBygg_exporter_varemottak_til_Agresso::create_file_name() Mangler 
bilagstype');
+                       }
+
                        $fil_katalog = 
$this->config->config_data['export']['path'];
 
-                       $filename = "{$fil_katalog}/FDV_varemottak_{$ref}.xml";
+                       $filename = 
"{$fil_katalog}/{$voucher_type}_varemottak_{$ref}.xml";
 
                        //Sjekk om filen eksisterer
                        if (file_exists($filename))

Modified: 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
===================================================================
--- 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
      2016-10-12 06:38:33 UTC (rev 15812)
+++ 
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_melding.php
      2016-10-12 09:15:58 UTC (rev 15813)
@@ -54,6 +54,14 @@
                                return 2;
                        }
 
+                       $price = 0;
+                       $budgets = ExecMethod('property.botts.get_budgets',$id);
+                       foreach ($budgets as $budget)
+                       {
+
+                               $price += $budget['amount'];
+                       }
+
 //             _debug_array($_ticket);die();
 
                        $contacts = CreateObject('property.sogeneric');
@@ -103,9 +111,9 @@
                                ),
                                'BuyerReferences' => array(
                                        array(
-                                               'Responsible' => $account_lid,
-                                               'RequestedBy' => $account_lid,
-                                               'Accountable' => $account_lid,
+                                               'Responsible' => 
strtoupper($account_lid),
+                                               'RequestedBy' => 
strtoupper($account_lid),
+                                               'Accountable' => 
strtoupper($account_lid),
                                        )
                                )
                        );
@@ -129,8 +137,30 @@
                                        $dim6 = 
"{$_ticket['building_part']}{$sogeneric_data['num']}";
                                }
                        }
+                       /*
+                       P3: EBF Innkjøpsordre Portico : 45000000-45249999
+                       V3: EBF Varemotttak Portico   : 45500000-45749999
+                       P4: EBE Innkjøpsordre Portico : 45250000-45499999
+                       V4: EBE Varemotttak Portico   : 45750000-45999999
+                       */
 
+
+                       if($_ticket['order_id'] >= 45000000 && 
$_ticket['order_id'] <= 45249999)
+                       {
+                               $voucher_type = 'P3';
+                       }
+                       else if ($_ticket['order_id'] >= 45250000 && 
$_ticket['order_id'] <= 45499999)
+                       {
+                               $voucher_type = 'P4';
+                       }
+                       else
+                       {
+                               throw new Exception("Ordrenummer 
'{$_ticket['order_id']}' er utenfor serien");
+                       }
+
+
                        $param = array(
+                               'voucher_type'  => $voucher_type,
                                'dim0' => $_ticket['b_account_id'],             
        // Art
                                'dim1' => $_ticket['ecodimb'],                  
        // Ansvar
                                'dim2' => $_ticket['service_id'] ? 
$_ticket['service_id'] : 9, // Tjeneste liste 30 stk, default 9
@@ -146,13 +176,19 @@
                                'buyer' => $buyer,
                                'lines' => array(
                                        array(
-                                               'unspsc_code' => 
$_ticket['unspsc_code'],
-                                               'descr' => 
strip_tags($_ticket['order_descr'])
+                                               'unspsc_code' => 
$_ticket['unspsc_code'] ? $_ticket['unspsc_code'] : 'UN-72000000',
+//                                             'descr' => 
$_ticket['order_descr'] ? strip_tags($_ticket['order_descr']) : 'Bygnings-, 
konstruksjons- og vedlikeholdstjenester'
+                                               'descr' => 
$_ticket['unspsc_code'] ? $this->get_unspsc_code_descr($_ticket['unspsc_code']) 
: 'Bygnings-, konstruksjons- og vedlikeholdstjenester',
+                                               'price' => $price,
                                        )
                                )
                        );
-
-                       $exporter_ordre = new 
BkBygg_exporter_data_til_Agresso(array('order_id' => $_ticket['order_id']));
+       
+                       $exporter_ordre = new 
BkBygg_exporter_data_til_Agresso(array(
+                               'order_id' => $_ticket['order_id'],
+                               'voucher_type' => $voucher_type
+                               )
+                       );
                        $exporter_ordre->create_transfer_xml($param);
 
                        $export_ok = $exporter_ordre->transfer($this->debug);
@@ -170,4 +206,11 @@
                        $now = time();
                        $GLOBALS['phpgw']->db->query("UPDATE fm_tts_tickets SET 
order_sent = {$now} WHERE id = {$id}");
                }
+
+               private function get_unspsc_code_descr( $unspsc_code )
+               {
+                       $GLOBALS['phpgw']->db->query("SELECT name FROM 
fm_unspsc_code WHERE id = '{$unspsc_code}'");
+                       $GLOBALS['phpgw']->db->next_record();
+                       return $GLOBALS['phpgw']->db->f('name');
+               }
        }
\ No newline at end of file

Modified: branches/dev-syncromind-2/property/templates/base/attributes_form.xsl
===================================================================
--- branches/dev-syncromind-2/property/templates/base/attributes_form.xsl       
2016-10-12 06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/property/templates/base/attributes_form.xsl       
2016-10-12 09:15:58 UTC (rev 15813)
@@ -762,8 +762,8 @@
 
 <!-- New template-->
 <xsl:template name="choice">
-       <xsl:variable name="counter">
-               <xsl:value-of select="counter"/>
+       <xsl:variable name="attrib_id">
+               <xsl:value-of select="id"/>
        </xsl:variable>
        <xsl:variable name="name">
                <xsl:value-of select="name"/>
@@ -772,10 +772,10 @@
                <xsl:for-each select="choice">
                        <xsl:choose>
                                <xsl:when test="checked='checked'">
-                                       <input id="id_{$name}_{id}" 
type="{input_type}" name="values_attribute[{$counter}][value][]" value="{id}" 
checked="checked"/>
+                                       <input id="id_{$name}_{id}" 
type="{input_type}" name="values_attribute[{$attrib_id}][value][]" value="{id}" 
checked="checked"/>
                                </xsl:when>
                                <xsl:otherwise>
-                                       <input id="id_{$name}_{id}" 
type="{input_type}" name="values_attribute[{$counter}][value][]" value="{id}"/>
+                                       <input id="id_{$name}_{id}" 
type="{input_type}" name="values_attribute[{$attrib_id}][value][]" 
value="{id}"/>
                                </xsl:otherwise>
                        </xsl:choose>
                        <xsl:value-of select="value"/>

Modified: branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php      
2016-10-12 06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/rental/inc/class.socomposite.inc.php      
2016-10-12 09:15:58 UTC (rev 15813)
@@ -394,9 +394,11 @@
                                                {
                                                        switch 
($attributes['column_name'])
                                                        {
+                                                               case 
'bruttoareal':
                                                                case 
'area_gross':
                                                                        
$location->set_area_gros($attributes['value']);
                                                                        break;
+                                                               case 
'nettoareal':
                                                                case 'area_net':
                                                                        
$location->set_area_net($attributes['value']);
                                                                        break;
@@ -584,6 +586,26 @@
                        $uicols['sortable'][] = true;
                        $uicols['input_type'][] = 'text';
 
+                       $uicols['name'][] = 'custom_prize';
+                       $uicols['descr'][] = lang('custom prize');
+                       $uicols['sortable'][] = true;
+                       $uicols['input_type'][] = 'text';
+
+                       $uicols['name'][] = 'prize_type';
+                       $uicols['descr'][] = lang('prize type');
+                       $uicols['sortable'][] = false;
+                       $uicols['input_type'][] = 'text';
+
+                       $uicols['name'][] = 'area_net';
+                       $uicols['descr'][] = lang('area_net');
+                       $uicols['sortable'][] = false;
+                       $uicols['input_type'][] = 'text';
+
+                       $uicols['name'][] = 'area_gros';
+                       $uicols['descr'][] = lang('area_gros');
+                       $uicols['sortable'][] = false;
+                       $uicols['input_type'][] = 'text';
+
                        return $uicols;
                }
        }
\ No newline at end of file

Modified: 
branches/dev-syncromind-2/rental/inc/class.soinvoice_price_item.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.soinvoice_price_item.inc.php     
2016-10-12 06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/rental/inc/class.soinvoice_price_item.inc.php     
2016-10-12 09:15:58 UTC (rev 15813)
@@ -74,9 +74,10 @@
                                        $this->db->f('is_area', true),
                                        $this->db->f('price', true),
                                        $this->db->f('area', true),
-                                       $this->db->f('count', true),
+                               (int)$this->db->f('count'),
                                        strtotime($this->db->f('date_start', 
true)),
-                                       strtotime($this->db->f('date_end', 
true))
+                                       strtotime($this->db->f('date_end', 
true)),
+                                       0 // price_type_id
                                );
        
                                
$price_item->set_total_price($this->db->f('total_price', true));

Modified: branches/dev-syncromind-2/rental/inc/class.sounit.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.sounit.inc.php   2016-10-12 
06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/rental/inc/class.sounit.inc.php   2016-10-12 
09:15:58 UTC (rev 15813)
@@ -114,14 +114,10 @@
                                switch ($attributes['column_name'])
                                {
                                        case 'area_gross':
-                                               
$location->set_area_gros($attributes['value']);
-                                               break;
-                                       case 'area_net':
-                                               
$location->set_area_net($attributes['value']);
-                                               break;
                                        case 'bruttoareal':
                                                
$location->set_area_gros($attributes['value']);
                                                break;
+                                       case 'area_net':
                                        case 'nettoareal':
                                                
$location->set_area_net($attributes['value']);
                                                break;

Modified: branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php      
2016-10-12 06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php      
2016-10-12 09:15:58 UTC (rev 15813)
@@ -221,6 +221,14 @@
                                        break;
                        }
 
+                       $price_item = new rental_price_item();
+                       $price_types = $price_item->get_price_types();
+                       foreach ($price_types as $price_type_id => 
&$price_type_title)
+                       {
+                               $price_type_title = lang($price_type_title);
+
+                       }
+
                        //Create an empty row set
                        $rows = array();
                        foreach ($result_objects as $result)
@@ -231,7 +239,9 @@
                                        {
                                                $result->set_status('Ikke i 
drift');
                                        }
-                                       $rows[] = $result->serialize();
+                                       $row = $result->serialize();
+                                       $row['prize_type'] = 
$price_types[$row['prize_type_id']];
+                                       $rows[] = $row;
                                }
                        }
 

Modified: branches/dev-syncromind-2/rental/setup/phpgw_no.lang
===================================================================
--- branches/dev-syncromind-2/rental/setup/phpgw_no.lang        2016-10-12 
06:38:33 UTC (rev 15812)
+++ branches/dev-syncromind-2/rental/setup/phpgw_no.lang        2016-10-12 
09:15:58 UTC (rev 15813)
@@ -637,4 +637,6 @@
 custom prize factor    rental  no      Prisfaktor
 standard       rental  no      Standard
 composite type rental  no      Leieobjekt type
-type   rental  no      Type
\ No newline at end of file
+type   rental  no      Type
+custom prize   rental  no      Taksering
+prize type     rental  no      Pristype
\ No newline at end of file




reply via email to

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