(self, subscription=None)
Transfers all credit balances related to an account or subscription
        (if specified).
Transfers all credit balances related to an account or subscription
        (if specified).
Transfers all credit balances related to an account or subscription ( if specified ) .
def transfer_credits(self, subscription=None):
        """Transfers all credit balances related to an account or subscription
        (if specified).
        """
        if subscription is not None and self.account.pk != subscription.account.pk:
            raise CreditLineError(
                "Can only transfer subscription credits under the same "
                "Billing Account."
            )
        source_credits = CreditLine.objects.filter(
            account=self.account,
            subscription=self,
        ).all()
        for credit_line in source_credits:
            transferred_credit = CreditLine.add_credit(
                credit_line.balance,
                account=self.account,
                subscription=subscription,
                feature_type=credit_line.feature_type,
                is_product=credit_line.is_product,
                related_credit=credit_line
            )
            credit_line.is_active = False
            credit_line.adjust_credit_balance(
                credit_line.balance * Decimal('-1'),
                related_credit=transferred_credit,
            )
def transfer_credits ( self , subscription = None ) : if subscription is not None and self . account . pk != subscription . account . pk : raise CreditLineError ( "Can only transfer subscription credits under the same " "Billing Account." ) source_credits = CreditLine . objects . filter ( account = self . account , subscription = self , ) . all ( ) for credit_line in source_credits : transferred_credit = CreditLine . add_credit ( credit_line . balance , account = self . account , subscription = subscription , feature_type = credit_line . feature_type , is_product = credit_line . is_product , related_credit = credit_line ) credit_line . is_active = False credit_line . adjust_credit_balance ( credit_line . balance * Decimal ( '-1' ) , related_credit = transferred_credit , )