コード例 #1
0
        contratos
            - seram avisados um mes antes de vencer
            - nao gera fatura mensal
        
        boleto 
            termina em um mês ou menos
    """
    # non exist
    if Invoice.objects.filter(end_date=end + relativedelta(months=1), organization=x.organization).count() == 0:

        i = Invoice()  # new invoice
        i.organization = x.organization
        i.start_date = end
        i.end_date = end + relativedelta(months=1)
        i.payment_type = x.organization.payment_type
        i.ammount = x.organization.prefered_plan.value
        i.plan = x.organization.prefered_plan
        i.status = 0  # pendente
        i.save()

    to = []  # send mail to
    bcc = []
    bcc.append("*****@*****.**")

    """
        send mail just to user is_active = True
    """
    # administratror of org
    for e in x.organization.administrators_():
        if e.profile.user.is_active and not e.profile.user.email in to:
            to.append(e.profile.user.email)
コード例 #2
0
ファイル: createInoviceByOrg.py プロジェクト: Niets/gestorpsi
        last.end_date = date.today()

    # can not be None
    if o.payment_type == None:
        o.payment_type = PaymentType.objects.get(pk=1) # credit card
        o.save()

    # can not be None / Check how many professional are subscribed.
    if o.prefered_plan == None:
        o.prefered_plan = Plan.objects.get(pk=2) # 1 professional
        o.save()

    """
        contratos
            - seram avisados um mes antes de vencer
            - nao gera fatura mensal
        
        boleto 
            termina em um mês ou menos
    """
    if last.end_date <= ( date.today() + relativedelta(months=1) ):
        i = Invoice() # new invoice
        i.organization = o
        i.start_date = last.end_date
        i.end_date = i.start_date + relativedelta(months=1)
        i.payment_type = o.payment_type
        i.ammount = o.prefered_plan.value
        i.plan = o.prefered_plan
        i.status = 0 # pendente
        i.save()
コード例 #3
0
        contratos
            - seram avisados um mes antes de vencer
            - nao gera fatura mensal
        
        boleto 
            termina em um mês ou menos
    """
    # non exist
    if Invoice.objects.filter( end_date=end+relativedelta(months=1), organization=x.organization ).count() == 0 :

        i = Invoice() # new invoice
        i.organization = x.organization
        i.start_date = end
        i.end_date = end + relativedelta(months=1)
        i.payment_type = x.organization.payment_type
        i.ammount = x.organization.prefered_plan.value
        i.plan = x.organization.prefered_plan
        i.status = 0 # pendente
        i.save()

    to = [] # send mail to

    '''
        send mail just to user is_active = True
    '''
    # administratror of org
    for e in x.organization.administrators_():
        if e.profile.user.is_active and not e.profile.user.email in to:
            to.append(e.profile.user.email) 

    # secretary of org
コード例 #4
0
        last.end_date = date.today()

    # can not be None
    if o.payment_type == None:
        o.payment_type = PaymentType.objects.get(pk=1) # credit card
        o.save()

    # can not be None / Check how many professional are subscribed.
    if o.prefered_plan == None:
        o.prefered_plan = Plan.objects.get(pk=2) # 1 professional
        o.save()

    """
        contratos
            - seram avisados um mes antes de vencer
            - nao gera fatura mensal
        
        boleto 
            termina em um mês ou menos
    """
    if last.end_date <= ( date.today() + relativedelta(months=1) ):
        i = Invoice() # new invoice
        i.organization = o
        i.start_date = last.end_date
        i.end_date = i.start_date + relativedelta(months=1)
        i.payment_type = o.payment_type
        i.ammount = o.prefered_plan.value
        i.plan = o.prefered_plan
        i.status = 0 # pendente
        i.save()