Version 4.7.13

This commit is contained in:
Neo committed 2025-12-19 16:14:56 -08:00
1 parent fd22d99e69
commit 7124a02564
954 files changed
+29277 -59308

No files matched your search

@@ -405,7 +405,7 @@ class _checkout extends \IPS\Dispatcher\Controller
if( $qanda )
{
$question = \IPS\Db::i()->select( '*', 'core_question_and_answer', array( 'qa_id=?', $qanda ) )->first();
$answers = json_decode( $question['qa_answers'] );
$answers = json_decode( $question['qa_answers'], true );
if( \count( $answers ) )
{
@@ -1248,26 +1248,44 @@ class _checkout extends \IPS\Dispatcher\Controller
$term = $item->renewalTerm;
$dueDate = \IPS\DateTime::create()->add( $item->initialInterval ?: $term->interval );
}
if ( $term )
{
$format = $item->groupWithParent ? 'grouped' : $term->interval->format('%d/%m/%y') . '/' . $term->cost->currency . '/' . ( $term->tax ? $term->tax->id : '0' );
$clonedItem = clone $item;
$showDueDate = true;
if ( $item instanceof \IPS\nexus\Invoice\Item\Renewal ) // If they are renewing for more than one cycle now, that's fine, but subsequently they will be moved back to the normal terms
{
$clonedItem->quantity = 1;
}
/* If there are different expiration dates then we want to display things a little differently */
if( isset( $item->initialInterval ) AND $item->initialInterval instanceof \DateInterval )
{
$clonedItem->expireDate = \IPS\DateTime::create()->add( $item->initialInterval );
$showDueDate = false;
}
else
{
$clonedItem->expireDate = \IPS\DateTime::create()->add( $term->interval );
}
if ( isset( $recurrings[ $format ] ) )
{
$recurrings[ $format ]['items'][] = $clonedItem;
}
else
{
$recurrings[ $format ] = array( 'items' => array( $clonedItem ), 'term' => new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( 0, $term->cost->currency ), $term->interval, $term->tax ) );
$recurrings[ $format ] = array( 'items' => array( $clonedItem ), 'term' => new \IPS\nexus\Purchase\RenewalTerm( new \IPS\nexus\Money( 0, $term->cost->currency ), $term->interval, $term->tax ), 'showDueDate' => true );
}
$recurrings[ $format ]['term']->cost->amount = $recurrings[ $format ]['term']->cost->amount->add( $term->cost->amount->multiply( new \IPS\Math\Number( "{$clonedItem->quantity}" ) ) );
$recurrings[ $format ]['dueDate'] = $dueDate;
if( !$showDueDate )
{
$recurrings[ $format ]['showDueDate'] = false;
}
}
}
}