[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16241] Stable: Merge 16238:16240 from trunk
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16241] Stable: Merge 16238:16240 from trunk |
Date: |
Thu, 2 Feb 2017 14:21:07 -0500 (EST) |
Revision: 16241
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16241
Author: sigurdne
Date: 2017-02-02 14:21:07 -0500 (Thu, 02 Feb 2017)
Log Message:
-----------
Stable: Merge 16238:16240 from trunk
Modified Paths:
--------------
branches/Version-2_0-branch/phpgwapi/templates/pure/css/global.css
branches/Version-2_0-branch/property/inc/class.boworkorder.inc.php
branches/Version-2_0-branch/property/inc/class.soXport.inc.php
branches/Version-2_0-branch/property/inc/class.uiwo_hour.inc.php
branches/Version-2_0-branch/property/inc/cron/default/Import_fra_agresso_X205_BK.php
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
branches/Version-2_0-branch/property/templates/base/workorder.xsl
Property Changed:
----------------
branches/Version-2_0-branch/
Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-02-02 19:18:38 UTC (rev 16240)
+++ branches/Version-2_0-branch 2017-02-02 19:21:07 UTC (rev 16241)
Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
/branches/dev-syncromind:13653
/branches/dev-syncromind-2:14933-16188
/branches/stavangerkommune:12743-12875,12986
-/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237
\ No newline at end of property
+/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240
\ No newline at end of property
Modified: branches/Version-2_0-branch/phpgwapi/templates/pure/css/global.css
===================================================================
--- branches/Version-2_0-branch/phpgwapi/templates/pure/css/global.css
2017-02-02 19:18:38 UTC (rev 16240)
+++ branches/Version-2_0-branch/phpgwapi/templates/pure/css/global.css
2017-02-02 19:21:07 UTC (rev 16241)
@@ -37,3 +37,12 @@
padding: 2px;
text-align: center;
}
+
+.ui-datepicker-month
+{
+ color: black;
+}
+.ui-datepicker-year
+{
+ color: black;
+}
\ No newline at end of file
Modified: branches/Version-2_0-branch/property/inc/class.boworkorder.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.boworkorder.inc.php
2017-02-02 19:18:38 UTC (rev 16240)
+++ branches/Version-2_0-branch/property/inc/class.boworkorder.inc.php
2017-02-02 19:21:07 UTC (rev 16241)
@@ -1010,7 +1010,8 @@
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 = '.project.workorder.transfer';
$criteria = array(
Modified: branches/Version-2_0-branch/property/inc/class.soXport.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soXport.inc.php
2017-02-02 19:18:38 UTC (rev 16240)
+++ branches/Version-2_0-branch/property/inc/class.soXport.inc.php
2017-02-02 19:21:07 UTC (rev 16241)
@@ -233,6 +233,11 @@
$this->voucher_id =
$fields['bilagsnr'];
}
+ if($fields['pmwrkord_code'])
+ {
+
phpgwapi_cache::system_clear('property',
"budget_order_{$fields['pmwrkord_code']}");
+ }
+
$values = array(
$fields['project_id'],
$fields['kostra_id'],
Modified: branches/Version-2_0-branch/property/inc/class.uiwo_hour.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uiwo_hour.inc.php
2017-02-02 19:18:38 UTC (rev 16240)
+++ branches/Version-2_0-branch/property/inc/class.uiwo_hour.inc.php
2017-02-02 19:21:07 UTC (rev 16241)
@@ -1351,6 +1351,8 @@
'allrows' => true
);
+ $transfer_action = 'workorder'; // trigger for
transfer
+
$custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
foreach ($custom_functions as $entry)
@@ -3412,6 +3414,8 @@
'allrows' => true
);
+ $transfer_action = 'workorder';
+
$custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
foreach ($custom_functions as $entry)
Modified:
branches/Version-2_0-branch/property/inc/cron/default/Import_fra_agresso_X205_BK.php
===================================================================
---
branches/Version-2_0-branch/property/inc/cron/default/Import_fra_agresso_X205_BK.php
2017-02-02 19:18:38 UTC (rev 16240)
+++
branches/Version-2_0-branch/property/inc/cron/default/Import_fra_agresso_X205_BK.php
2017-02-02 19:21:07 UTC (rev 16241)
@@ -814,7 +814,8 @@
$sql = "SELECT
fm_workorder.location_code,"
. " fm_workorder.vendor_id,"
. " fm_workorder.account_id,"
- . " fm_project.ecodimb,"
+ . " fm_project.ecodimb as
project_ecodimb,"
+ . " fm_workorder.ecodimb,"
. " fm_workorder.category,"
. " fm_workorder.user_id,"
. " fm_workorder.title"
@@ -841,7 +842,8 @@
$order_info['vendor_id'] = $this->db->f('vendor_id');
$order_info['spbudact_code'] =
$this->db->f('account_id');
- $order_info['dimb'] = $this->db->f('ecodimb');
+ $ecodimb = $this->db->f('ecodimb');
+ $order_info['dimb'] = $ecodimb ? $ecodimb :
$this->db->f('project_ecodimb');
$order_info['dime'] = $this->db->f('category');
$order_info['title'] = $this->db->f('title', true);
Modified:
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
===================================================================
---
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
2017-02-02 19:18:38 UTC (rev 16240)
+++
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_data_til_Agresso.php
2017-02-02 19:21:07 UTC (rev 16241)
@@ -53,6 +53,7 @@
var $connection;
var $order_id;
var $voucher_type;
+ var $voucher_id;
var $batchid;
Modified:
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
===================================================================
---
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
2017-02-02 19:18:38 UTC (rev 16240)
+++
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
2017-02-02 19:21:07 UTC (rev 16241)
@@ -35,201 +35,209 @@
*
* @author Sigurd Nes
*/
- if (isset($id) && $id && isset($acl_location) && $acl_location &&
isset($receive_order) && $receive_order)
- {
- $exporter_varemottak = new
lag_agresso_varemottak($acl_location, $id);
- $result = $exporter_varemottak->transfer($id, $received_amount);
- }
- class lag_agresso_varemottak
+ if (!class_exists("lag_agresso_varemottak"))
{
+ class lag_agresso_varemottak
+ {
- private $acl_location;
- private $values;
- private $ordered_amount = 1;
- var $debug = true;
+ private $acl_location;
+ private $values;
+ private $ordered_amount = 1;
+ var $debug = true;
- function __construct( $acl_location, $id )
- {
- switch ($acl_location)
+ function __construct( $acl_location, $id )
{
- case '.ticket':
- $this->acl_location = $acl_location;
- $this->values =
ExecMethod('property.sotts.read_single', $id);
- $this->ordered_amount =
$this->_get_ordered_ticket_amount($id);
- break;
- default:
- $this->acl_location =
'.project.workorder';
- $this->values =
ExecMethod('property.soworkorder.read_single', $id);
- $this->values['order_id'] = $id;
- $this->ordered_amount =
$this->_get_ordered_workorder_amount($id);
- break;
+ switch ($acl_location)
+ {
+ case '.ticket':
+ $this->acl_location =
$acl_location;
+ $this->values =
ExecMethod('property.sotts.read_single', $id);
+ $this->ordered_amount =
$this->_get_ordered_ticket_amount($id);
+ break;
+ default:
+ $this->acl_location =
'.project.workorder';
+ $this->values =
ExecMethod('property.soworkorder.read_single', $id);
+ $this->values['order_id'] = $id;
+ $this->ordered_amount =
$this->_get_ordered_workorder_amount($id);
+ break;
+ }
}
- }
- private function _get_ordered_ticket_amount($id)
- {
- $amount = 0;
- $budgets = ExecMethod('property.botts.get_budgets',$id);
- foreach ($budgets as $budget)
+ private function _get_ordered_ticket_amount($id)
{
+ $amount = 0;
+ $budgets =
ExecMethod('property.botts.get_budgets',$id);
+ foreach ($budgets as $budget)
+ {
- $amount += $budget['amount'];
+ $amount += $budget['amount'];
+ }
+ return $amount ? $amount : 1;
}
- return $amount ? $amount : 1;
- }
- private function _get_ordered_workorder_amount($id)
- {
- return
ExecMethod('property.boworkorder.get_budget_amount',$id);
- }
+ private function _get_ordered_workorder_amount($id)
+ {
+ return
ExecMethod('property.boworkorder.get_budget_amount',$id);
+ }
- public function transfer( $id, $received_amount )
- {
- $values = $this->values;
-// _debug_array($values);die();
+ public function transfer( $id, $received_amount )
+ {
+ $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
- */
+ /*
+ 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
+ */
- $voucher_type = 'P4';
+ $voucher_type = 'P4';
- 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:<br/>" . __FILE__ . '<br/>linje:' .
__LINE__);
- }
+ 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:<br/>" . __FILE__ . '<br/>linje:' .
__LINE__);
+ }
- $param = array(
- 'voucher_type' => $voucher_type,
- 'order_id' => $values['order_id'],
- 'lines' => array(
- array(
- 'UnitCode' => 'STK',
- 'Quantity' =>
($received_amount/$this->ordered_amount),
+ $param = array(
+ 'voucher_type' => $voucher_type,
+ 'order_id' => $values['order_id'],
+ 'lines' => array(
+ array(
+ 'UnitCode' => 'STK',
+ 'Quantity' =>
($received_amount/$this->ordered_amount),
+ )
)
- )
- );
+ );
- $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 = new
BkBygg_exporter_varemottak_til_Agresso(array(
+ 'order_id' => $values['order_id'],
+ 'voucher_type' => $voucher_type
+ ));
+
$exporter_varemottak->create_transfer_xml($param);
- $export_ok =
$exporter_varemottak->transfer($this->debug);
- if ($export_ok)
- {
- $this->log_transfer( $id, $received_amount );
+ $export_ok =
$exporter_varemottak->transfer($this->debug);
+ if ($export_ok)
+ {
+ $this->log_transfer( $id,
$received_amount );
+ }
+ return $export_ok;
}
- return $export_ok;
- }
- private function log_transfer( $id, $received_amount )
- {
- $id = (int)$id;
- $received_amount = (int)$received_amount;
- switch ($this->acl_location)
+ private function log_transfer( $id, $received_amount )
{
- case '.ticket':
- $historylog =
CreateObject('property.historylog', 'tts');
- $table = 'fm_tts_tickets';
- break;
- default:
- $historylog =
CreateObject('property.historylog', 'workorder');
- $table = 'fm_workorder';
- break;
+ $id = (int)$id;
+ $received_amount = (int)$received_amount;
+ switch ($this->acl_location)
+ {
+ case '.ticket':
+ $historylog =
CreateObject('property.historylog', 'tts');
+ $table = 'fm_tts_tickets';
+ break;
+ default:
+ $historylog =
CreateObject('property.historylog', 'workorder');
+ $table = 'fm_workorder';
+ break;
+ }
+ $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}");
}
- $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}");
}
}
- class BkBygg_exporter_varemottak_til_Agresso extends
BkBygg_exporter_data_til_Agresso
+ if (!class_exists("BkBygg_exporter_varemottak_til_Agresso"))
{
+ class BkBygg_exporter_varemottak_til_Agresso extends
BkBygg_exporter_data_til_Agresso
+ {
- var $transfer_xml;
- var $connection;
- var $order_id;
- var $voucher_type;
- var $batch_id;
+ var $transfer_xml;
+ var $connection;
+ var $order_id;
+ var $voucher_type;
+ var $batch_id;
- public function __construct( $param )
- {
- parent::__construct($param);
- }
-
- public function create_transfer_xml( $param )
- {
- $Orders = array();
- $Detail = array();
- $i = 1;
- foreach ($param['lines'] as $line)
+ public function __construct( $param )
{
- $Detail[] = array(
- 'LineNo' => $i,
- 'Status' => 'N',
- 'UnitCode' => $line['UnitCode'],
- 'Quantity' => $line['Quantity'],
- );
- $i++;
+ parent::__construct($param);
}
- $Orders['Order'][] = array(
- 'OrderNo' => $param['order_id'],
- 'VoucherType' => $param['voucher_type'],
- 'TransType' => 51,
- 'Details' => array('Detail' => $Detail)
- );
+ public function create_transfer_xml( $param )
+ {
+ $Orders = array();
+ $Detail = array();
+ $i = 1;
+ foreach ($param['lines'] as $line)
+ {
+ $Detail[] = array(
+ 'LineNo' => $i,
+ 'Status' => 'N',
+ 'UnitCode' => $line['UnitCode'],
+ 'Quantity' => $line['Quantity'],
+ );
+ $i++;
+ }
-// _debug_array($Orders);
-// die();
+ $Orders['Order'][] = array(
+ 'OrderNo' => $param['order_id'],
+ 'VoucherType' => $param['voucher_type'],
+ 'TransType' => 51,
+ 'Details' => array('Detail' => $Detail)
+ );
- $root_attributes = array(
- 'Version' => "542",
- 'xmlns:xsi' =>
"http://www.w3.org/2001/XMLSchema-instance",
- 'xsi:noNamespaceSchemaLocation' =>
"http://services.agresso.com/schema/ABWOrder/2004/07/02/ABWOrder.xsd"
- );
- $xml_creator = new xml_creator('ABWOrder',
$root_attributes);
- $xml_creator->fromArray($Orders);
- $this->transfer_xml = $xml_creator->getDocument();
- return $this->transfer_xml;
- }
+ // _debug_array($Orders);
+ // die();
- protected function create_file_name( $ref = '' )
- {
- if (!$this->batchid)
- {
- throw new
Exception('BkBygg_exporter_data_til_Agresso::create_file_name() Mangler
referanse');
+ $root_attributes = array(
+ 'Version' => "542",
+ 'xmlns:xsi' =>
"http://www.w3.org/2001/XMLSchema-instance",
+ 'xsi:noNamespaceSchemaLocation' =>
"http://services.agresso.com/schema/ABWOrder/2004/07/02/ABWOrder.xsd"
+ );
+ $xml_creator = new xml_creator('ABWOrder',
$root_attributes);
+ $xml_creator->fromArray($Orders);
+ $this->transfer_xml =
$xml_creator->getDocument();
+ return $this->transfer_xml;
}
- $voucher_type = $this->voucher_type;
- if (!$voucher_type)
+
+ protected function create_file_name( $ref = '' )
{
- throw new
Exception('BkBygg_exporter_varemottak_til_Agresso::create_file_name() Mangler
bilagstype');
- }
+ if (!$this->batchid)
+ {
+ throw new
Exception('BkBygg_exporter_data_til_Agresso::create_file_name() Mangler
referanse');
+ }
+ $voucher_type = $this->voucher_type;
+ $order_id = $this->order_id;
+ if (!$voucher_type)
+ {
+ throw new
Exception('BkBygg_exporter_varemottak_til_Agresso::create_file_name() Mangler
bilagstype');
+ }
- $fil_katalog =
$this->config->config_data['export']['path'];
+ $fil_katalog =
$this->config->config_data['export']['path'];
- $filename =
"{$fil_katalog}/{$voucher_type}_varemottak_{$this->batchid}.xml";
+ $filename =
"{$fil_katalog}/{$voucher_type}_varemottak_{$order_id}_{$this->batchid}.xml";
- //Sjekk om filen eksisterer
- if (file_exists($filename))
- {
- unlink($filename);
+ //Sjekk om filen eksisterer
+ if (file_exists($filename))
+ {
+ unlink($filename);
+ }
+
+ return $filename;
}
+ }
+ }
- return $filename;
- }
- }
\ No newline at end of file
+ if (isset($id) && $id && isset($acl_location) && $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:
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
===================================================================
---
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
2017-02-02 19:18:38 UTC (rev 16240)
+++
branches/Version-2_0-branch/property/inc/custom/default/BkBygg_lag_Agresso_ordre_fra_workorder.php
2017-02-02 19:21:07 UTC (rev 16241)
@@ -330,7 +330,9 @@
}
}
// if (!$workorder['order_sent'])
+ if (!empty($transfer_action) && $transfer_action == 'workorder')
{
+
$exporter_ordre = new lag_agresso_ordre_fra_workorder();
try
{
Modified: branches/Version-2_0-branch/property/templates/base/workorder.xsl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/workorder.xsl
2017-02-02 19:18:38 UTC (rev 16240)
+++ branches/Version-2_0-branch/property/templates/base/workorder.xsl
2017-02-02 19:21:07 UTC (rev 16241)
@@ -1016,7 +1016,7 @@
</xsl:attribute>
</input>
</div>
- <xsl:choose>
+ <!--xsl:choose>
<xsl:when
test="value_workorder_id!='' and mode='edit'">
<div
class="pure-control-group">
<label
for="name">
@@ -1052,7 +1052,7 @@
<input
class="pure-custom" type="text" id="order_received_amount" size="6"/>
</div>
</xsl:when>
- </xsl:choose>
+ </xsl:choose-->
<xsl:choose>
<xsl:when
test="value_workorder_id!=''">
<div
class="pure-control-group">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16241] Stable: Merge 16238:16240 from trunk,
sigurdne <=