Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Invoice Items Iterator
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Nexus
|
||||
* @since 24 Mar 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -72,18 +72,68 @@ class _ItemsIterator extends \ArrayIterator
|
||||
{
|
||||
$class = 'IPS\nexus\extensions\nexus\Item\MiscellaneousCharge';
|
||||
}
|
||||
$obj = new $class( $data['itemName'], new \IPS\nexus\Money( $data['cost'], $this->currency ) );
|
||||
$obj = new $class( $data['itemName'], new \IPS\nexus\Money( number_format( $data['cost'], \IPS\nexus\Money::numberOfDecimalsForCurrency( $this->currency ), '.', '' ), $this->currency ) );
|
||||
}
|
||||
|
||||
/* Basic information */
|
||||
$obj->quantity = $data['quantity'];
|
||||
$obj->id = $data['itemID'];
|
||||
$obj->appKey = $data['app'];
|
||||
$obj->typeKey = $data['type'];
|
||||
|
||||
/* Details */
|
||||
$details = array();
|
||||
if ( isset( $data['cfields'] ) and $data['cfields'] )
|
||||
{
|
||||
$obj->details = $data['cfields'];
|
||||
foreach( $data['cfields'] AS $key => $value )
|
||||
{
|
||||
try
|
||||
{
|
||||
$field = \IPS\nexus\Package\CustomField::load( $key );
|
||||
if ( $field->invoice )
|
||||
{
|
||||
switch( $field->type )
|
||||
{
|
||||
case 'UserPass':
|
||||
$value = json_decode( \IPS\Text\Encrypt::fromTag( $value )->decrypt(), TRUE );
|
||||
$display = array();
|
||||
if ( $value['un'] )
|
||||
{
|
||||
$display[] = $value['un'];
|
||||
}
|
||||
|
||||
if ( $value['pw'] )
|
||||
{
|
||||
$display[] = $value['pw'];
|
||||
}
|
||||
|
||||
$details[ $key ] = implode( ' ⋅ ', $display );
|
||||
break;
|
||||
|
||||
case 'Ftp':
|
||||
$value = json_decode( \IPS\Text\Encrypt::fromTag( $value )->decrypt(), TRUE );
|
||||
$details[ $key ] = (string) \IPS\Http\Url::createFromComponents(
|
||||
$value['server'],
|
||||
( isset( $value['protocol'] ) ) ? "{$value['protocol']}://" : 'ftp://',
|
||||
( isset( $value['path'] ) ) ? $value['path'] : NULL,
|
||||
NULL,
|
||||
( isset( $value['port'] ) ) ? $value['port'] : NULL,
|
||||
( isset( $value['un'] ) ) ? $value['un'] : NULL,
|
||||
( isset( $value['pw'] ) ) ? $value['pw'] : NULL
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
$details[ $key ] = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( \OutOfRangeException $e ) {}
|
||||
}
|
||||
}
|
||||
|
||||
$obj->details = $details;
|
||||
|
||||
/* Tax */
|
||||
if ( isset( $data['tax'] ) AND $data['tax'] )
|
||||
|
||||
Reference in new issue
Block a user