def acquire_twopack(fraction_id, source_fraction_id): #print('acquire_twopack'+str(fraction_id)+'/'+str(source_fraction_id)) fraction = FractionModel(fraction_id) source_fraction = FractionModel(source_fraction_id) transactions = TransactionModel(fraction_id,source_fraction_id) #get all transactions for the actuall date if 'acquiredate' in session: #print('ACQIREacquiredateInSession:',(session.get('acquiredate'))) trdata = transactions.get_simple(date=session.get('acquiredate')) #trdata = False else: trdata = False #get last inputs history_entries = transactions.acqusitions_get_last_inserts(12) # track productgroup if request.args.get('productgroup',''): session['productgroup']= request.args.get('productgroup','') return render_template('transaction/acquisition.html', fraction=fraction, source_fraction=source_fraction, history_entries=history_entries, transactions= trdata)
def retract_twopack(fraction_id, source_fraction_id): """ two fractions are defined """ if request.args.get('acquiredate'): session['acquiredate']= request.args.get('acquiredate') fraction = FractionModel(fraction_id) source_fraction = FractionModel(source_fraction_id) transaction_model = TransactionModel(fraction_id,source_fraction_id) #print('req.arg:'+request.args.get('acquiredate')) if 'acquiredate' in session: #print('RETRACTacquiredateInSession:',session.get('acquiredate')) transactions = transaction_model.get_simple(date=str(session.get('acquiredate'))) else: transactions = None #print(str(transactions)) nav_dates = transaction_model.acqusitions_get_last_dates() return render_template('transaction/retraction.html', fraction=fraction, source_fraction=source_fraction, nav_dates=nav_dates, transactions=transactions )