Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

@@ -435,7 +435,7 @@ class _Purchase extends \IPS\Node\Model
*/
public function set_renewals( \IPS\nexus\Purchase\RenewalTerm $term = NULL )
{
if ( $term === NULL )
if ( $term === NULL OR $term->cost->amount->isZero() )
{
$this->_data['renewals'] = 0;
}
@@ -955,6 +955,19 @@ class _Purchase extends \IPS\Node\Model
throw new \BadMethodCallException;
}
/**
* Purchase can be reactivated in the ACP?
*
* @param \IPS\nexus\Purchase $purchase The purchase
* @param NULL $error Error to show, passed by reference
* @return bool
*/
public function canAcpReactivate( &$error=NULL )
{
$extension = $this->extension();
return $extension::canAcpReactivate( $this, $error );
}
/**
* Get output for API
*
@@ -1552,14 +1565,18 @@ class _Purchase extends \IPS\Node\Model
if ( ( !$this->billing_agreement or $this->billing_agreement->canceled ) and ( !$this->grouped_renewals or !$parent or !$parent->billing_agreement or $parent->billing_agreement->canceled ) and \IPS\Member::loggedIn()->hasAcpRestriction( 'nexus', 'customers', 'purchases_cancel' ) )
{
$extension = $this->extension();
if ( $this->cancelled )
{
$return['reactivate'] = array(
'icon' => 'check',
'title' => 'reactivate',
'link' => $url->setQueryString( 'do', 'reactivate' )->csrf(),
'data' => array( 'confirm' => '' )
);
if ( $extension::canAcpReactivate( $this ) )
{
$return['reactivate'] = array(
'icon' => 'check',
'title' => 'reactivate',
'link' => $url->setQueryString( 'do', 'reactivate' )->csrf(),
'data' => array( 'confirm' => '' )
);
}
}
else
{