예제 #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 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)
예제 #5
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);
예제 #6
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);
예제 #7
0
 def api_devis(did, session):
     assert isinstance(did, int)
     check_session(app, session)
     devis = db.get_devis(cursor, did)
     return dict(data=devis)
예제 #8
0
 def api_devis(session):
     check_session(app, session)
     devis = db.get_devis(cursor)
     print devis
     return dict(data=devis)
예제 #9
0
파일: r_api.py 프로젝트: beeone42/bdc
 def api_devis(session):
     check_session(app, session)
     devis = db.get_devis(cursor)
     print devis
     return dict(data=devis)
예제 #10
0
파일: r_api.py 프로젝트: beeone42/bdc
 def api_devis(did, session):
     assert isinstance(did, int)
     check_session(app, session)
     devis = db.get_devis(cursor, did)
     return dict(data=devis)