예제 #1
0
    def handle(self, *args, **options):
    
        accounts = Account.objects.all()
        
        # Here we assume our billing period is monthly, first or later day of month
        current_period = get_current_billing_period()
    	next_period = get_next_billing_period()

        for account in accounts:
        	account.createInvoice(current_period, next_period)
예제 #2
0
파일: models.py 프로젝트: cnzhuran/mdcom
    def create_manual_credit(self, account, amount, memo):
        """
		Posts Manual Credit to account
		"""
        credit_transaction = AccountTransaction(
            account=account,
            tx_type='5',  # ATX_DEBIT
            amount=amount,
            period_start=get_current_billing_period(),
            period_end=get_next_billing_period(),
            memo=memo)
        credit_transaction.save()

        return credit_transaction
예제 #3
0
def enter_transaction(request):
    """
	Internal Use Menu to create account transaction for an account
	"""
    template_name = 'genbilling/create_transaction.html'

    context = get_context(request)
    #get begin and end period

    context['begin_period'] = get_current_billing_period()
    context['end_period'] = get_next_billing_period()

    context['practice_group_name'] = ManualTransactionForm()

    return render_to_response(template_name,
                              context,
                              context_instance=RequestContext(request))
예제 #4
0
    def handle(self, *args, **options):
    	"""
    	Get all Active accounts (based on flag active, NOT a account status)
    
    	for each active account, look for invoice account transaction (type = 0) for current period
   		and also get invoice row for each of the invoice account transactions
    	
    	attempt to charge total due on the invoice (ONLY IF NOT PAID ALREADY)
    	actual charge attempt and updates of all related data occurs in invoice.charge_this_invoice()    	
		"""

    	accounts = Account.objects.all()
        # Here we assume our billing period is monthly
        current_period = get_current_billing_period()

        for account in accounts:
			account.chargeInvoice(current_period)
예제 #5
0
    def handle(self, *args, **options):
        """
    	Get all Active accounts (based on flag active, NOT a account status)
    
    	for each active account, look for invoice account transaction (type = 0) for current period
   		and also get invoice row for each of the invoice account transactions
    	
    	attempt to charge total due on the invoice (ONLY IF NOT PAID ALREADY)
    	actual charge attempt and updates of all related data occurs in invoice.charge_this_invoice()    	
		"""

        accounts = Account.objects.all()
        # Here we assume our billing period is monthly
        current_period = get_current_billing_period()

        for account in accounts:
            account.chargeInvoice(current_period)