fix price in timeaccounts
authorCornelius Weiß <c.weiss@metaways.de>
Tue, 18 Jul 2017 15:57:07 +0000 (17:57 +0200)
committerCornelius Weiss <c.weiss@metaways.de>
Wed, 19 Jul 2017 10:14:09 +0000 (12:14 +0200)
Change-Id: I7660d86402d21d96ff1b515a91fe3568357b4e77
Reviewed-on: http://gerrit.tine20.com/customers/5244
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Timetracker/Model/Timeaccount.php
tine20/Timetracker/js/TimeaccountEditDialog.js

index b874c8f..c7ad190 100644 (file)
@@ -130,10 +130,12 @@ class Timetracker_Model_Timeaccount extends Sales_Model_Accountable_Abstract
                 'default'               => 'hours',
                 'validators'            => array(Zend_Filter_Input::ALLOW_EMPTY => true, Zend_Filter_Input::DEFAULT_VALUE => 'hours'),
             ),
-            'price'             => array(
-                'type'                  => 'integer',
-                'inputFilters'          => array('Zend_Filter_PregReplace' => array('/,/', '.'), 'Zend_Filter_Empty' => NULL),
-                'validators'            => array(Zend_Filter_Input::ALLOW_EMPTY => true, Zend_Filter_Input::DEFAULT_VALUE => 0),
+            'price' => array(
+                'type'         => 'money',
+                'nullable'     => true,
+                'validators'   => array(Zend_Filter_Input::ALLOW_EMPTY => TRUE),
+                'label'        => 'Price', // _('Price')
+                'inputFilters' => array('Zend_Filter_Empty' => NULL),
             ),
             'price_unit'        => array(
                 'shy'                   => TRUE,
index 4e8a834..9a4656b 100644 (file)
@@ -85,7 +85,7 @@ Tine.Timetracker.TimeaccountEditDialog = Ext.extend(Tine.widgets.dialog.EditDial
             fieldLabel: this.app.i18n._('Unit'),
             name: 'price_unit'
         }, {
-            xtype: 'numberfield',
+            xtype: 'extuxmoneyfield',
             fieldLabel: this.app.i18n._('Unit Price'),
             name: 'price',
             allowNegative: false