コード例 #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)
コード例 #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)
コード例 #3
0
ファイル: r_docs.py プロジェクト: beeone42/bdc
 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)
コード例 #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)
コード例 #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)
コード例 #6
0
ファイル: r_deal.py プロジェクト: beeone42/bdc
 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);
コード例 #7
0
ファイル: r_devis.py プロジェクト: beeone42/bdc
 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);
コード例 #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)
コード例 #9
0
 def api_deals(session):
     check_session(app, session)
     deals = db.get_deals(cursor)
     print deals
     return dict(data=deals)
コード例 #10
0
ファイル: r_api.py プロジェクト: beeone42/bdc
 def api_deals(did, session):
     assert isinstance(did, int)
     check_session(app, session)
     deals = db.get_deals(cursor, did)
     return dict(data=deals)
コード例 #11
0
ファイル: r_api.py プロジェクト: beeone42/bdc
 def api_deals(session):
     check_session(app, session)
     deals = db.get_deals(cursor)
     print deals
     return dict(data=deals)
コード例 #12
0
ファイル: main.py プロジェクト: 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)