def create(data):
        created_ids = []
        for i in data:
            if DB().insert(i, 'ci_item') is False:
                return False
            created_ids.append(
                DB().selectFV("SELECT MAX(id) as id FROM ci_item;"))

        return created_ids
示例#2
0
    def create(data):
        created_ids = []
        for i in data:
            if DB().insert(i, 'material') is False:
                return False
            created_ids.append(
                DB().selectFV("SELECT MAX(id) as id FROM material;")['id'])

        return created_ids
 def get(client_id):
     return DB().SelectById(client_id,
                            ['id', 'name', 'phone', 'fax', 'contact'],
                            'client')
 def remove(ci_id):
     return DB().remove(ci_id, 'id')
 def create(data):
     return DB().insert(data, 'client')
示例#6
0
 def get(material_id):
     return DB().SelectById(material_id,
                            ['id', 'ncm', 'name', 'description'],
                            'material')
示例#7
0
 def all():
     return DB().selectAll(['id', 'ncm', 'name'], 'material')
 def all():
     return DB().selectAll(['id', 'name', 'phone', 'fax', 'contact'],
                           'client')
 def all():
     return DB().selectAll(['id', 'name', 'city', 'type'], 'transport')
示例#10
0
 def get(company_id):
     return DB().SelectById(company_id, ['id', 'name', 'cnpj', 'logo', 'phone', 'address'], 'company')
示例#11
0
 def remove(company_id):
     return DB().remove(company_id, 'company')
 def create(data):
     return DB().insert(data, 'adress')
示例#13
0
 def create(data):
     return DB().insert(data, 'company')
 def all():
     return DB().selectAll(['id', 'client_id', 'type', 'adress'], 'adress')
 def remove(address_id):
     return DB().remove(address_id, 'adress')
 def get(address_id):
     return DB().SelectById(address_id,
                            ['id', 'client_id', 'type', 'adress'], 'adress')
 def update(client_id, params):
     return DB().update(client_id, params, 'client')
 def get(ci_item_id):
     return DB().SelectById(ci_item_id, [
         'id', 'commercial_invoice_id', 'measurement_unit_id', 'material_id'
     ], 'ci_item')
 def remove(client_id):
     return DB().remove(client_id, 'client')
 def all():
     return DB().selectAll([
         'id', 'commercial_invoice_id', 'measurement_unit_id', 'material_id'
     ], 'ci_item')
示例#21
0
 def all():
     return DB().selectAll(['id', 'name', 'cnpj', 'logo', 'phone', 'address'], 'company')
 def getHome():
     return DB().selectFA("SELECT commercial_invoice.id, created_at, name as client_name  FROM commercial_invoice, client WHERE client_id = client.id AND commercial_invoice.removed = 0;")
 def remove(ci_item_id):
     return DB().remove(ci_item_id, 'ci_item')
示例#24
0
 def create(data):
     return DB().insert(data, 'commercial_invoice')
示例#25
0
 def update(material_id, data):
     return DB().update(material_id, data, 'material')
示例#26
0
 def get(ci_model_id):
     return DB().SelectById(ci_model_id,
                            ['id', 'transport_id', 'client_id'],
                            'commercial_invoice')
示例#27
0
 def remove(material_id):
     return DB().remove(material_id, 'material')
示例#28
0
 def remove(ci_model_id):
     return DB().remove(ci_model_id, 'commercial_invoice')
示例#29
0
 def all():
     return DB().selectAll(['id', 'transport_id', 'cliente_id'],
                           'commercial_invoice')
 def getTransport(ci_id):
     transport_id = DB().selectFV("SELECT transport_id FROM commercial_invoice WHERE id = {} AND removed = 0;".format(ci_id))
     return DB().runFetchRow("SELECT name, city, type FROM transport WHERE id = {} AND removed = 0;".format(transport_id['transport_id']))