[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9213] property: add order category to invoice-handli
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9213] property: add order category to invoice-handling |
Date: |
Tue, 24 Apr 2012 06:44:55 +0000 |
Revision: 9213
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9213
Author: sigurdne
Date: 2012-04-24 06:44:51 +0000 (Tue, 24 Apr 2012)
Log Message:
-----------
property: add order category to invoice-handling
Modified Paths:
--------------
trunk/property/inc/class.soinvoice.inc.php
trunk/property/inc/class.uiinvoice2.inc.php
trunk/property/inc/class.uiproject.inc.php
trunk/property/js/portico/ajax_invoice.js
trunk/property/js/yahoo/invoice2.index.js
trunk/property/setup/phpgw_no.lang
trunk/property/setup/setup.inc.php
trunk/property/setup/tables_current.inc.php
trunk/property/setup/tables_update.inc.php
trunk/property/templates/base/config.tpl
trunk/property/templates/base/invoice2.xsl
Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/inc/class.soinvoice.inc.php 2012-04-24 06:44:51 UTC (rev
9213)
@@ -472,6 +472,7 @@
'dima'
=> $this->db->f('dima'),
'dimb'
=> $this->db->f('dimb'),
'dimd'
=> $this->db->f('dimd'),
+ 'dime'
=> $this->db->f('dime'),
'remark'
=> !!$this->db->f('merknad'),
'tax_code'
=> $this->db->f('mvakode'),
'amount'
=> $this->db->f('belop'),
@@ -1304,6 +1305,7 @@
'dim_a'
=> $this->db->f('dima'),
'dim_b'
=> $this->db->f('dimb'),
'dim_d'
=> $this->db->f('dimd'),
+ 'dim_e'
=> $this->db->f('dime'),
'tax_code'
=> $this->db->f('mvakode'),
'invoice_id'
=> $this->db->f('fakturanr'),
'kid_nr'
=> $this->db->f('kidnr'),
@@ -1874,6 +1876,7 @@
$value_set_line['pmwrkord_code'] =
$data['order_id'];
$value_set_line['dimb'] =
$data['dim_b'];
$value_set_line['dima'] =
$data['dim_a'];
+ $value_set_line['dime'] =
$data['dim_e'];
$value_set_line['mvakode'] =
$data['tax_code'];
$value_set_line['project_id'] =
$data['project_group'];
$value_set_line['spbudact_code'] =
$data['b_account_id'];
@@ -1938,7 +1941,7 @@
$value_set = array();
- $skip_values =
array('id','pmwrkord_code', 'spbudact_code', 'dima', 'dimb', 'loc1', 'mvakode',
'dimd', 'merknad',
'line_text','oppsynsmannid','saksbehandlerid','oppsynsigndato','saksigndato','budsjettsigndato');
+ $skip_values =
array('id','pmwrkord_code', 'spbudact_code', 'dima', 'dimb', 'dime', 'loc1',
'mvakode', 'dimd', 'merknad',
'line_text','oppsynsmannid','saksbehandlerid','oppsynsigndato','saksigndato','budsjettsigndato');
foreach($metadata as $_field)
{
if(!in_array($_field->name,
$skip_values))
Modified: trunk/property/inc/class.uiinvoice2.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice2.inc.php 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/inc/class.uiinvoice2.inc.php 2012-04-24 06:44:51 UTC (rev
9213)
@@ -306,6 +306,13 @@
),
array
(
+ 'key' => 'dime',
+ 'label' => lang('dime'),
+ 'sortable' => false,
+ 'formatter' => 'FormatterRight',
+ ),
+ array
+ (
'key' => 'project_group',
'label' => lang('project group'),
'sortable' => false,
@@ -417,6 +424,12 @@
$entry['split'] = "<input type =\"text\"
name=\"values[split_amount][{$entry['id']}]\" value=\"\" size=\"8\">";
$entry['approved_amount_hidden'] =
$entry['approved_amount'];
$entry['approved_amount'] = "<input type
=\"text\" name=\"values[approved_amount][{$entry['id']}]\"
value=\"{$entry['approved_amount']}\" size=\"8\">";
+ if($entry['dime'])
+ {
+ $catetory =
execMethod('phpgwapi.categories.return_single',$entry['dime']);
+ $entry['dime'] = $catetory[0]['name'];
+ }
+
$results['results'][]= $entry;
}
@@ -492,6 +505,7 @@
$sign_orig = '';
$my_initials =
$GLOBALS['phpgw_info']['user']['account_lid'];
+
if(count($voucher))
{
@@ -587,7 +601,7 @@
foreach ($voucher as $line)
{
$voucher_info['generic']['approved_amount'] += $line['approved_amount'];
- $voucher_info['generic']['amount'] +=
$line['amount'];
+ $voucher_info['generic']['amount'] +=
$line['amount'];
}
$voucher_info['generic']['approved_amount'] =
number_format($voucher_info['generic']['approved_amount'], 2, ',', ' ');
@@ -628,6 +642,7 @@
}
$voucher_info['generic']['process_log'] =
$voucher[0]['process_log'];
$voucher[0]['image_url'] =
'';//'http://www.nettavisen.no/';
+
}
else
{
@@ -652,6 +667,17 @@
);
}
+ $cats = CreateObject('phpgwapi.categories', -1,
'property', '.project');
+ $cats->supress_info = true;
+
+ $categories =
$cats->formatted_xslt_list(array('selected' => isset($voucher[0]['dime']) &&
$voucher[0]['dime'] ? $voucher[0]['dime'] : 0));
+
+ foreach($categories['cat_list'] as &$cat)
+ {
+ $cat['id'] = $cat['cat_id'];
+ $cat['selected'] = $cat['selected'] ? 1 : 0;
+ }
+ $voucher_info['generic']['dime_list'] = array('options'
=> $categories['cat_list']);
$voucher_info['generic']['approved_list'] =
$approved_list;
$voucher_info['generic']['process_code_list'] =
array('options' => execMethod('property.bogeneric.get_list', array(
'type' => 'voucher_process_code',
@@ -659,11 +685,13 @@
array_unshift
($voucher_info['generic']['process_code_list']['options'],array
('id'=>'','name'=>lang('select')));
array_unshift
($voucher_info['generic']['dimb_list']['options'],array
('id'=>'','name'=>lang('select')));
+ array_unshift
($voucher_info['generic']['dime_list']['options'],array
('id'=>'','name'=>lang('select')));
array_unshift
($voucher_info['generic']['periodization_list']['options'],array('id' => '',
'name' => lang('none')));
$voucher_info['voucher'] = $voucher;
$voucher_info['generic']['sign_orig'] = $sign_orig;
$voucher_info['generic']['my_initials'] = $my_initials;
+
//_debug_array($voucher_info);die();
return $voucher_info;
Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/inc/class.uiproject.inc.php 2012-04-24 06:44:51 UTC (rev
9213)
@@ -1152,10 +1152,13 @@
$error_id=true;
}
- if(!$values['cat_id'])
+
if(!isset($config->config_data['project_optional_category']) ||
!$config->config_data['project_optional_category'])
{
-
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
- $error_id=true;
+ if(!$values['cat_id'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
+ $error_id=true;
+ }
}
if(!$values['coordinator'])
Modified: trunk/property/js/portico/ajax_invoice.js
===================================================================
--- trunk/property/js/portico/ajax_invoice.js 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/js/portico/ajax_invoice.js 2012-04-24 06:44:51 UTC (rev
9213)
@@ -204,6 +204,7 @@
$("#process_log").html( '' );
$("#dim_a").val('' );
$("#dim_b").html( "<option>Velg</option>" );
+ $("#dim_e").html( "<option>Velg</option>" );
$("#period").html( "<option>Velg</option>" );
$("#periodization").html( "<option>Velg</option>" );
$("#periodization_start").html( "<option>Velg</option>" );
@@ -458,6 +459,22 @@
$("#dim_b").html( htmlString );
}
+
if(typeof(data['generic']['dime_list']['options']) != 'undefined')
+ {
+ var htmlString = "";
+ var obj =
data['generic']['dime_list']['options'];
+
+ $.each(obj, function(i) {
+ var selected = '';
+ if(obj[i].id ==
voucher[0].dim_e)
+ {
+ selected = ' selected';
+ }
+ htmlString += "<option
value='" + obj[i].id + "'" + selected + ">" + obj[i].name + "</option>";
+ });
+
+ $("#dim_e").html( htmlString );
+ }
if(typeof(data['generic']['tax_code_list']['options']) != 'undefined')
{
var htmlString = "";
@@ -618,6 +635,7 @@
$("#process_log").html( '' );
$("#dim_a").val('' );
$("#dim_b").html( "<option>Velg</option>" );
+ $("#dim_e").html( "<option>Velg</option>" );
$("#period").html( "<option>Velg</option>" );
$("#periodization").html(
"<option>Velg</option>" );
$("#periodization_start").html(
"<option>Velg</option>" );
Modified: trunk/property/js/yahoo/invoice2.index.js
===================================================================
--- trunk/property/js/yahoo/invoice2.index.js 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/js/yahoo/invoice2.index.js 2012-04-24 06:44:51 UTC (rev
9213)
@@ -34,7 +34,7 @@
td_empty(1);
td_sum(tmp_sum1);
td_sum(tmp_sum2);
- td_empty(7);
+ td_empty(8);
myfoot = tableYUI.createTFoot();
myfoot.setAttribute("id","myfoot");
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2012-04-23 14:44:49 UTC (rev 9212)
+++ trunk/property/setup/phpgw_no.lang 2012-04-24 06:44:51 UTC (rev 9213)
@@ -522,6 +522,7 @@
no authorities demands property no Ingen myndighetskrav
no dimb property no K Ikke valgt
dim d property no Dim D
+dime property no Kategori
directory created property no katalog er opprettet
disable property no Deaktiver
disabled property no inaktivt
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2012-04-23 14:44:49 UTC (rev 9212)
+++ trunk/property/setup/setup.inc.php 2012-04-24 06:44:51 UTC (rev 9213)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.641';
+ $setup_info['property']['version'] = '0.9.17.642';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/setup/tables_current.inc.php 2012-04-24 06:44:51 UTC (rev
9213)
@@ -1055,6 +1055,7 @@
'dimb' => array('type' => 'int','precision' =>
'2','nullable' => True),
'mvakode' => array('type' => 'int','precision'
=> '2','nullable' => True),
'dimd' => array('type' => 'varchar','precision'
=> '5','nullable' => True),
+ 'dime' => array('type' => 'int','precision' =>
'4','nullable' => True),
'oppsynsmannid' => array('type' =>
'varchar','precision' => '12','nullable' => True),
'saksbehandlerid' => array('type' =>
'varchar','precision' => '12','nullable' => True),
'budsjettansvarligid' => array('type' =>
'varchar','precision' => '12','nullable' => False),
@@ -1108,6 +1109,7 @@
'dimb' => array('type' => 'int','precision' =>
'2','nullable' => True),
'mvakode' => array('type' => 'int','precision'
=> '2','nullable' => True),
'dimd' => array('type' => 'varchar','precision'
=> '5','nullable' => True),
+ 'dime' => array('type' => 'int','precision' =>
'4','nullable' => True),
'oppsynsmannid' => array('type' =>
'varchar','precision' => '12','nullable' => True),
'saksbehandlerid' => array('type' =>
'varchar','precision' => '12','nullable' => True),
'budsjettansvarligid' => array('type' =>
'varchar','precision' => '12','nullable' => False),
@@ -1357,7 +1359,7 @@
'name' => array('type' => 'varchar','precision'
=> '255','nullable' => False),
'user_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
'access' => array('type' =>
'varchar','precision' => '7','nullable' => True),
- 'category' => array('type' => 'int','precision'
=> '4','nullable' => False),
+ 'category' => array('type' => 'int','precision'
=> '4','nullable' => true),
'entry_date' => array('type' =>
'int','precision' => '4','nullable' => False),
'start_date' => array('type' =>
'int','precision' => '4','nullable' => False),
'end_date' => array('type' => 'int','precision'
=> '4','nullable' => False),
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/setup/tables_update.inc.php 2012-04-24 06:44:51 UTC (rev
9213)
@@ -6228,3 +6228,19 @@
return $GLOBALS['setup_info']['property']['currentver'];
}
}
+
+
+ $test[] = '0.9.17.641';
+ function property_upgrade0_9_17_641()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_project','category',array('type'
=> 'int', 'precision' => 4, 'nullable' => True, 'default' => '0'));
+ $GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','dime',
array('type' => 'int','precision' => 4,'nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','dime',
array('type' => 'int','precision' => 4,'nullable' => True));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.642';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/templates/base/config.tpl 2012-04-24 06:44:51 UTC (rev
9213)
@@ -352,7 +352,15 @@
</select>
</td>
</tr>
-
+ <tr class="row_on">
+ <td>{lang_project_optional_category}.</td>
+ <td>
+ <select
name="newsettings[project_optional_category]">
+ <option value=""
{selected_project_optional_category_}>NO</option>
+ <option value="1"
{selected_project_optional_category_1}>YES</option>
+ </select>
+ </td>
+ </tr>
<tr class="row_off">
<td>{lang_request_show_dates}.</td>
<td>
Modified: trunk/property/templates/base/invoice2.xsl
===================================================================
--- trunk/property/templates/base/invoice2.xsl 2012-04-23 14:44:49 UTC (rev
9212)
+++ trunk/property/templates/base/invoice2.xsl 2012-04-24 06:44:51 UTC (rev
9213)
@@ -26,6 +26,7 @@
//select { width: 200px; }
#voucher_id_filter { width: 800px; }
#dim_b { width: 200px; }
+#dim_e { width: 200px; }
#period { width: 200px; }
#periodization { width: 200px; }
#periodization_start { width: 200px; }
@@ -433,6 +434,16 @@
</tr>
<tr class ='row_off'>
<td>
+ <xsl:value-of select="php:function('lang',
'dime')" />
+ </td>
+ <td>
+ <select id="dim_e" name="values[dim_e]">
+ <xsl:apply-templates
select="voucher_info/generic/dime_list/options"/>
+ </select>
+ </td>
+ </tr>
+ <tr class ='row_off'>
+ <td>
<xsl:value-of select="php:function('lang',
'invoice line text')" />
</td>
<td>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9213] property: add order category to invoice-handling,
Sigurd Nes <=