Example #1
0
    def get(self):
        # validate access token
        if not self.ValidateToken():
            return

        # instantiate order
        order = Order()

        order.identifier = self.get_argument("id", "")
        order.salesman = self.get_argument("salesman_id", "")
        order.customer = self.get_argument("customer", "")
        order.subtotal = self.get_argument("subtotal", "")
        order.discount = self.get_argument("discount", "")
        order.iva = self.get_argument("iva", "")
        order.total = self.get_argument("total", "")
        order.address = self.get_argument("address", "")
        order.town = self.get_argument("town", "")
        order.city = self.get_argument("city", "")
        order.country = self.get_argument("country", "")
        order.type = self.get_argument("type", "")
        order.source = self.get_argument("source", "")
        order.items_quantity = self.get_argument("items_quantity", "")
        order.product_quantity = self.get_argument("product_quantity", "")
        order.state = self.get_argument("state", "")
        order.payment_type = self.get_argument("payment_type", "")
        order.billing_id = self.get_argument("billing_id", "")
        order.shipping_id = self.get_argument("shipping_id", "")

        #saving the current order
        oid = order.Edit(self.db.orders)

        self.write(oid)
Example #2
0
    def get(self):
        # validate access token
        if not self.ValidateToken():
            return

        # instantiate order
        order = Order()

        order.id = self.get_argument("id", "")
        order.date = datetime.now(
            pytz.timezone('Chile/Continental')).strftime('%d-%m-%Y %H:%M:%S')
        order.salesman = self.get_argument("salesman", "")
        order.customer = self.get_argument("customer", "")
        order.subtotal = self.get_argument("subtotal", "")
        order.discount = self.get_argument("discount", "")
        order.tax = self.get_argument("tax", "")
        order.total = self.get_argument("total", "")
        order.address = self.get_argument("address", "")
        order.town = self.get_argument("town", "")
        order.city = self.get_argument("city", "")
        order.country = self.get_argument("country", "")
        order.type = self.get_argument("type", "")
        order.source = self.get_argument("source", "")
        order.items_quantity = self.get_argument("items_quantity", "")
        order.product_quantity = self.get_argument("product_quantity", "")
        order.state = self.get_argument("state", "")
        order.payment_type = self.get_argument("payment_type", "")
        order.billing_id = self.get_argument("billing_id", "")
        order.shipping_id = self.get_argument("shipping_id", "")

        # saving the current order
        oid = order.Save()

        self.write(oid)