Example #1
0
 def deal(did, session):
     user_name = check_session(app, session)
     assert isinstance(did, int)
     users = db.get_users(cursor)
     deal_states = db.get_deal_states(cursor)
     sites = db.get_sites(cursor)
     print(users, deal_states, sites)
     d = { 'description': '', 'bdcid':db.find_next_bdcid(cursor, sites[0]['id']), \
           'site_name': sites[0]['name'], 'site_pic':sites[0]['pic'], 'site_id':sites[0]['id'], \
           'creator_id':users[0]['id'], 'creator_name':users[0]['fullname'], \
           'validator_id':users[0]['id'], 'validator_name':users[0]['fullname'], \
           'state':deal_states[0] }
     devis = 0
     if (did > 0):
         deals = db.get_deals(cursor, did)
         devis = db.get_devis(cursor, did)
         print(deals, devis)
         d = deals[0]
     return bottle.template('deal',
                            app=app,
                            user_name=user_name,
                            deal=d,
                            devis=devis,
                            users=users,
                            config=config,
                            did=did,
                            deal_states=deal_states,
                            sites=sites)
Example #2
0
 def devis(did, deid, session):
     user_name = check_session(app, session)
     assert isinstance(did, int)
     deal = db.get_deals(cursor, did)
     devis_states = db.get_devis_states(cursor)
     contractors = db.get_contractors(cursor)
     devis = {
         'description': deal[0]['description'],
         'contractor_id': 0, \
         'issuer': '', \
         'contact_name': '', \
         'amount':'', \
         'currency': deal[0]['currency'], \
         'd_received':'', \
         'state':'' }
     if (deid > 0):
         d = db.get_devis(cursor, did, deid)
         if (len(d) > 0):
             devis = d[0]
             print(devis)
     docs = db.get_docs(cursor, 0, did, deid)
     print(docs)
     return bottle.template('devis',
                            app=app,
                            user_name=user_name,
                            config=config,
                            devis_states=devis_states,
                            devis=devis,
                            contractors=contractors,
                            did=did,
                            deid=deid,
                            docs=docs)
Example #3
0
 def new_doc(did, deid, session):
     user_name = check_session(app, session)
     assert isinstance(did, int)
     deal = db.get_deals(cursor, did)
     d = db.get_devis(cursor, deid)
     devis = d[0]
     docs_types = db.get_docs_types(cursor)
     print (devis)
     return bottle.template('new_doc', app=app, user_name=user_name, config=config, devis=devis, docs_types=docs_types, did=did, deid=deid)
Example #4
0
def index(session):
    user_name = check_session(app, session)
    deals = db.get_deals(cursor)
    print deals
    return bottle.template('main',
                           app=app,
                           user_name=user_name,
                           deals=deals,
                           config=config)
Example #5
0
 def new_doc(did, deid, session):
     user_name = check_session(app, session)
     assert isinstance(did, int)
     deal = db.get_deals(cursor, did)
     d = db.get_devis(cursor, deid)
     devis = d[0]
     docs_types = db.get_docs_types(cursor)
     print(devis)
     return bottle.template('new_doc',
                            app=app,
                            user_name=user_name,
                            config=config,
                            devis=devis,
                            docs_types=docs_types,
                            did=did,
                            deid=deid)
Example #6
0
 def deal(did, session):
     user_name = check_session(app, session)
     assert isinstance(did, int)
     users = db.get_users(cursor)
     deal_states = db.get_deal_states(cursor)
     sites = db.get_sites(cursor)
     print (users, deal_states, sites)
     d = { 'description': '', 'bdcid':db.find_next_bdcid(cursor, sites[0]['id']), \
           'site_name': sites[0]['name'], 'site_pic':sites[0]['pic'], 'site_id':sites[0]['id'], \
           'creator_id':users[0]['id'], 'creator_name':users[0]['fullname'], \
           'validator_id':users[0]['id'], 'validator_name':users[0]['fullname'], \
           'state':deal_states[0] }
     devis = 0
     if (did > 0):
         deals = db.get_deals(cursor, did)
         devis = db.get_devis(cursor, did)
         print (deals, devis)
         d = deals[0]
     return bottle.template('deal', app=app, user_name=user_name, deal=d, devis=devis, users=users, config=config, did=did, deal_states=deal_states, sites=sites);
Example #7
0
 def devis(did, deid, session):
     user_name = check_session(app, session)
     assert isinstance(did, int)
     deal = db.get_deals(cursor, did)
     devis_states = db.get_devis_states(cursor)
     contractors = db.get_contractors(cursor)
     devis = {
         'description': deal[0]['description'],
         'contractor_id': 0, \
         'issuer': '', \
         'contact_name': '', \
         'amount':'', \
         'currency': deal[0]['currency'], \
         'd_received':'', \
         'state':'' }
     if (deid > 0):
         d = db.get_devis(cursor, did, deid)
         if (len(d) > 0):
             devis = d[0]
             print (devis)
     docs = db.get_docs(cursor, 0, did, deid)
     print (docs)
     return bottle.template('devis', app=app, user_name=user_name, config=config, devis_states=devis_states, devis=devis, contractors=contractors, did=did, deid=deid, docs=docs);
Example #8
0
 def api_deals(did, session):
     assert isinstance(did, int)
     check_session(app, session)
     deals = db.get_deals(cursor, did)
     return dict(data=deals)
Example #9
0
 def api_deals(session):
     check_session(app, session)
     deals = db.get_deals(cursor)
     print deals
     return dict(data=deals)
Example #10
0
 def api_deals(did, session):
     assert isinstance(did, int)
     check_session(app, session)
     deals = db.get_deals(cursor, did)
     return dict(data=deals)
Example #11
0
 def api_deals(session):
     check_session(app, session)
     deals = db.get_deals(cursor)
     print deals
     return dict(data=deals)
Example #12
0
File: main.py Project: beeone42/bdc
def index(session):
    user_name = check_session(app, session)
    deals = db.get_deals(cursor)
    print deals
    return bottle.template("main", app=app, user_name=user_name, deals=deals, config=config)