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 Item Class for Purchases
|
||||
* @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 10 Feb 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
@@ -179,16 +179,20 @@ abstract class _Purchase extends \IPS\nexus\Invoice\Item
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'ps_name', $purchase->_name, TRUE, array( 'maxLength' => 128 ) ) );
|
||||
|
||||
if ( !$purchase->grouped_renewals )
|
||||
if ( !$purchase->grouped_renewals and ( !$purchase->billing_agreement or $purchase->billing_agreement->canceled ) )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Date( 'ps_expire', $purchase->expire ?: 0, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'does_not_expire', 'disabled' => !$purchase->canChangeExpireDate() ) ) );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\nexus\Form\RenewalTerm( 'ps_renewals', $renewals, FALSE, array( 'lockTerm' => !$purchase->canChangeExpireDate() ) ) );
|
||||
|
||||
if ( !$purchase->billing_agreement or $purchase->billing_agreement->canceled )
|
||||
{
|
||||
$form->add( new \IPS\nexus\Form\RenewalTerm( 'ps_renewals', $renewals, FALSE, array( 'lockTerm' => !$purchase->canChangeExpireDate() ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'ps_grace_period', $purchase->grace_period / 86400, FALSE, array( 'max' => \IPS\Settings::i()->cm_invoice_expireafter ?: NULL ), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('days') ) );
|
||||
}
|
||||
|
||||
if ( !$purchase->grouped_renewals )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'ps_parent', $purchase->parent(), FALSE, array( 'class' => 'IPS\nexus\Purchase', 'forceOwner' => $purchase->member, 'zeroVal' => 'no_parent' ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'ps_parent', $purchase->parent(), FALSE, array( 'class' => 'IPS\nexus\Purchase', 'forceOwner' => $purchase->member, 'zeroVal' => 'no_parent', 'disabledIds' => array( $purchase->id ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,14 +209,21 @@ abstract class _Purchase extends \IPS\nexus\Invoice\Item
|
||||
if ( $purchase->grouped_renewals )
|
||||
{
|
||||
$purchase->ungroupFromParent();
|
||||
$purchase->renewals = $values['ps_renewals'];
|
||||
if ( !$purchase->billing_agreement or $purchase->billing_agreement->canceled )
|
||||
{
|
||||
$purchase->renewals = $values['ps_renewals'];
|
||||
}
|
||||
$purchase->save();
|
||||
$purchase->groupWithParent();
|
||||
}
|
||||
else
|
||||
{
|
||||
$purchase->expire = ( $values['ps_expire'] ?: NULL );
|
||||
$purchase->renewals = $values['ps_renewals'];
|
||||
if ( !$purchase->billing_agreement or $purchase->billing_agreement->canceled )
|
||||
{
|
||||
$purchase->expire = ( $values['ps_expire'] ?: NULL );
|
||||
$purchase->renewals = $values['ps_renewals'];
|
||||
$purchase->grace_period = $values['ps_grace_period'] ? ( $values['ps_grace_period'] * 86400 ) : 0;
|
||||
}
|
||||
$purchase->parent = $values['ps_parent'] ?: NULL;
|
||||
$purchase->save();
|
||||
}
|
||||
@@ -263,6 +274,17 @@ abstract class _Purchase extends \IPS\nexus\Invoice\Item
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ACP Support View HTML
|
||||
*
|
||||
* @param \IPS\nexus\Purchase $purchase The purchase
|
||||
* @return string
|
||||
*/
|
||||
public static function acpSupportView( \IPS\nexus\Purchase $purchase )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Support Severity
|
||||
*
|
||||
@@ -274,6 +296,17 @@ abstract class _Purchase extends \IPS\nexus\Invoice\Item
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get renewal payment methods IDs
|
||||
*
|
||||
* @param \IPS\nexus\Purchase $purchase The purchase
|
||||
* @return array|NULL
|
||||
*/
|
||||
public static function renewalPaymentMethodIds( \IPS\nexus\Purchase $purchase )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* On Purchase Generated
|
||||
*
|
||||
@@ -331,6 +364,17 @@ abstract class _Purchase extends \IPS\nexus\Invoice\Item
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning to display to admin when cancelling a purchase
|
||||
*
|
||||
* @param \IPS\nexus\Invoice $invoice The invoice
|
||||
* @return string
|
||||
*/
|
||||
public static function onCancelWarning( \IPS\nexus\Purchase $purchase )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* On Purchase Deleted
|
||||
*
|
||||
@@ -365,6 +409,17 @@ abstract class _Purchase extends \IPS\nexus\Invoice\Item
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Requires Billing Address
|
||||
*
|
||||
* @return bool
|
||||
* @throws \DomainException
|
||||
*/
|
||||
public function requiresBillingAddress()
|
||||
{
|
||||
return in_array( 'product', explode( ',', \IPS\Settings::i()->nexus_require_billing ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Purchase Record?
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user