Esempio n. 1
0
    def _an_task_config(self):
        from autonomie.models.task import (
            PaymentConditions, )
        for i in self.session.query(PaymentConditions):
            self.session.delete(i)

        for index, label in enumerate(
            [u"30 jours fin de mois", u"À réception de facture"]):
            condition = PaymentConditions(label=label)
            if index == 0:
                condition.default = True

            self.session.add(condition)
Esempio n. 2
0
    def _an_task_config(self):
        from autonomie.models.task import (
            PaymentConditions,
        )
        for i in self.session.query(PaymentConditions):
            self.session.delete(i)

        for index, label in enumerate(
            [u"30 jours fin de mois", u"À réception de facture"]
        ):
            condition = PaymentConditions(label=label)
            if index == 0:
                condition.default = True

            self.session.add(condition)
Esempio n. 3
0
def deferred_default_payment_condition(node, kw):
    entry = PaymentConditions.query().filter(
        PaymentConditions.default == True).first()
    if entry is not None:
        return entry.label
    else:
        return ""
Esempio n. 4
0
def deferred_default_payment_condition(node, kw):
    entry = PaymentConditions.query().filter(
        PaymentConditions.default==True
    ).first()
    if entry is not None:
        return entry.label
    else:
        return ""
Esempio n. 5
0
def json_payment_conditions(request):
    """
    Return The PaymentConditions objects available for the given form

    :param obj request: The current request object
    :returns: List of PaymentConditions in their json repr
    """
    query = PaymentConditions.query()
    return [item.__json__(request) for item in query]
Esempio n. 6
0
def json_payment_conditions(request):
    """
    Return The PaymentConditions objects available for the given form

    :param obj request: The current request object
    :returns: List of PaymentConditions in their json repr
    """
    query = PaymentConditions.query()
    return [item.__json__(request) for item in query]