[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9266] property: invoice
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9266] property: invoice |
Date: |
Thu, 03 May 2012 10:41:30 +0000 |
Revision: 9266
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9266
Author: sigurdne
Date: 2012-05-03 10:41:28 +0000 (Thu, 03 May 2012)
Log Message:
-----------
property: invoice
Modified Paths:
--------------
trunk/property/inc/class.soinvoice.inc.php
trunk/property/inc/cron/default/Import_fra_basware_X205.php
trunk/property/setup/tables_current.inc.php
trunk/property/setup/tables_update.inc.php
Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php 2012-05-02 14:00:34 UTC (rev
9265)
+++ trunk/property/inc/class.soinvoice.inc.php 2012-05-03 10:41:28 UTC (rev
9266)
@@ -1096,6 +1096,18 @@
return $values;
}
+ function get_default_dimb_role_user($role_id, $dimb)
+ {
+ $dimb = (int) $dimb;
+ $role_id = (int) $role_id;
+ $sql = "SELECT user_id FROM fm_ecodimb_role_user"
+ ." WHERE role_id = {$role_id} AND ecodimb = {$dimb} AND
expired_on IS NULL AND default_user = 1";
+//_debug_array($sql);
+ $this->db->query($sql,__LINE__,__FILE__);
+ $this->db->next_record();
+ return (int)$this->db->f('user_id');
+ }
+
function check_count($voucher_id)
{
Modified: trunk/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
--- trunk/property/inc/cron/default/Import_fra_basware_X205.php 2012-05-02
14:00:34 UTC (rev 9265)
+++ trunk/property/inc/cron/default/Import_fra_basware_X205.php 2012-05-03
10:41:28 UTC (rev 9266)
@@ -43,9 +43,6 @@
var $splitt=0;
var $soXport;
var $invoice;
- var $bestiller = 85; //cat_id for rolle
- var $attestant = 150; //cat_id for rolle
- var $budsjettansvarlig = 146; //cat_id for rolle
var $default_kostra_id = 9999; //dummy
var $debug = false;
var $skip_import = false;
@@ -810,13 +807,10 @@
$toarray[] = $prefs['email'];
}
*/
- $criteria_supervisor =
array('ecodimb' => $order_info['dimb'], 'cat_id' => $this->attestant); //
attestere
- $supervisor_contact_id =
$this->responsible->get_responsible($criteria_supervisor);
- if($supervisor_contact_id)
+ $supervisor_user_id =
$this->invoice->get_default_dimb_role_user(2, $order_info['dimb']);
+ if($supervisor_user_id)
{
- $supervisor_user_id
= $this->responsible->get_contact_user_id($supervisor_contact_id);
$order_info['supervisor']
= $GLOBALS['phpgw']->accounts->get($supervisor_user_id)->lid;
-
/*
$prefs =
$this->bocommon->create_preferences('property', $supervisor_user_id);
if($prefs['email'])
@@ -826,11 +820,9 @@
*/
}
- $criteria_budget_responsible =
array('ecodimb' => $order_info['dimb'], 'cat_id' => $this->budsjettansvarlig);
//anviser
- $budget_responsible_contact_id =
$this->responsible->get_responsible($criteria_budget_responsible);
- if($budget_responsible_contact_id)
+ $budget_responsible_user_id =
$this->invoice->get_default_dimb_role_user(3, $order_info['dimb']);
+ if($budget_responsible_user_id)
{
- $budget_responsible_user_id
= $this->responsible->get_contact_user_id($budget_responsible_contact_id);
$order_info['budget_responsible'] =
$GLOBALS['phpgw']->accounts->get($budget_responsible_user_id)->lid;
}
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2012-05-02 14:00:34 UTC (rev
9265)
+++ trunk/property/setup/tables_current.inc.php 2012-05-03 10:41:28 UTC (rev
9266)
@@ -1163,7 +1163,7 @@
),
'fm_ecodimb' => array(
'fd' => array(
- 'id' => array('type' => 'int','precision' =>
'2','nullable' => False),
+ 'id' => array('type' => 'int','precision' =>
'4','nullable' => False),
'descr' => array('type' =>
'varchar','precision' => '25','nullable' => False)
),
'pk' => array('id'),
@@ -1184,7 +1184,7 @@
'fm_ecodimb_role_user' => array(
'fd' => array(
'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
- 'ecodimb' => array('type' => 'int','precision'
=> '2','nullable' => False),
+ 'ecodimb' => array('type' => 'int','precision'
=> '4','nullable' => False),
'user_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
'role_id' => array('type' => 'int','precision'
=> '4','nullable' => False),
'default' => array('type' => 'int','precision'
=> '2','nullable' => true),
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2012-05-02 14:00:34 UTC (rev
9265)
+++ trunk/property/setup/tables_update.inc.php 2012-05-03 10:41:28 UTC (rev
9266)
@@ -6249,6 +6249,7 @@
function property_upgrade0_9_17_642()
{
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+ $GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_ecodimb','id',
array('type' => 'int','precision' => '4','nullable' => false));
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_ecobilag','splitt',
array('type' => 'int','precision' => '4','nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_ecobilagoverf','splitt',
array('type' => 'int','precision' => '4','nullable' => True));
@@ -6273,7 +6274,7 @@
'fm_ecodimb_role_user', array(
'fd' => array(
'id' => array('type' =>
'auto','precision' => '4','nullable' => False),
- 'ecodimb' => array('type' =>
'int','precision' => '2','nullable' => False),
+ 'ecodimb' => array('type' =>
'int','precision' => '4','nullable' => False),
'user_id' => array('type' =>
'int','precision' => '4','nullable' => False),
'role_id' => array('type' =>
'int','precision' => '4','nullable' => False),
'default_user' => array('type' =>
'int','precision' => '2','nullable' => true),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9266] property: invoice,
Sigurd Nes <=