예제 #1
0
def addTravelExpensesStarCampaigners():
    form = AddTravelExpensesStarCampaigners()
    not_admin_msg()

    if form.validate_on_submit():
        campaignersCount = contract.functions.getERecStarCampaignersCount(
            form.recordId.data).call()
        campaignersCount = 0 if campaignersCount == 0 else campaignersCount - 1
        tx_hash = contract.functions.addTravelExpensesStarCampaigners(
            form.recordId.data,
            campaignersCount,  #index
            form.stateAndVenue.data,
            form.dateOfMeeting.data,
            form.starCampaigner.data,
            form.modeOfTravel.data,
            form.nameOfAircraftPayee.data,
            form.totalExpenses.data).transact()
        txHash = web3.toHex(tx_hash)
        flash(
            "Travel Expenses Star Campaigners added! Transaction Hash: " +
            txHash, 'info')
        return redirect(url_for('index'))

    return render_template('addTravelExpensesStarCampaigners.html',
                           title='Travel Expenses Star Campaigners',
                           form=form)
예제 #2
0
def addStarCampaignerInRecord():
    form = AddNewStarCampaignerInRecord()
    not_admin_msg()
    if form.validate_on_submit():
        tx_hash = contract.functions.addStarCampaignerInRecord(
            form.recordId.data, form.travelExpId.data,
            form.starCampaigner.data).transact()
        txHash = web3.toHex(tx_hash)
        flash("Star Campaigner added! Transaction Hash: " + txHash, 'info')
        return redirect(url_for('index'))

    return render_template('addStarCampaigner.html',
                           title='Star Campaigner',
                           form=form)
예제 #3
0
def addGrossExpenditure():
    form = AddGrossExpenditure()
    not_admin_msg()
    if form.validate_on_submit():
        tx_hash = contract.functions.addGrossExpenditure(
            form.recordId.data, form.cash.data, form.chequeAmount.data,
            form.draft.data).transact()
        txHash = web3.toHex(tx_hash)
        flash("Gross Expenditure added! Transaction Hash: " + txHash, 'info')
        return redirect(url_for('index'))

    return render_template('addGrossExpenditure.html',
                           title='Gross Expenditure',
                           form=form)
예제 #4
0
def addExpensesOnMediaAd():
    form = AddExpensesOnMediaAd()
    not_admin_msg()
    if form.validate_on_submit():
        tx_hash = contract.functions.addExpensesOnMediaAd(
            form.recordId.data, form.stateAndVenue.data, form.nameOfPayee.data,
            form.nameOfMedia.data, form.dateOfTelecast.data,
            form.amount.data).transact()
        txHash = web3.toHex(tx_hash)
        flash("Expenses On MediaAd added! Transaction Hash: " + txHash, 'info')
        return redirect(url_for('index'))

    return render_template('addExpensesOnMediaAd.html',
                           title='Expenses On MediaAd',
                           form=form)
예제 #5
0
def updateOpeningBankBalance():
    form = UpdateOpeningBankBalance()
    not_admin_msg()
    if form.validate_on_submit():
        tx_hash = contract.functions.updateOpeningBankBalance(
            form.recordId.data, form.bankName.data,
            form.bankAmount.data).transact()
        txHash = web3.toHex(tx_hash)
        flash("Opening Bank Balance updated! Transaction Hash: " + txHash,
              'info')
        return redirect(url_for('index'))

    return render_template('updateOpeningBankBalance.html',
                           title='Update BankBalance',
                           form=form)
예제 #6
0
def addExpensesOnPublicMeetings():
    form = AddExpensesOnPublicMeetings()
    not_admin_msg()
    if form.validate_on_submit():
        tx_hash = contract.functions.addExpensesOnPublicMeetings(
            form.recordId.data, form.stateAndVenue.data,
            form.dateOfMeeting.data, form.detailsOfItems.data,
            form.amount.data).transact()
        txHash = web3.toHex(tx_hash)
        flash("Expenses On Public Meetings added! Transaction Hash: " + txHash,
              'info')
        return redirect(url_for('index'))

    return render_template('addExpensesOnPublicMeetings.html',
                           title='Expenses On Public Meetings',
                           form=form)
예제 #7
0
def addElectionRecord():
    form = ElectionRecordForm()
    not_admin_msg()
    if form.validate_on_submit():
        tx_hash = contract.functions.addElectionRecord(
            form.partyName.data, form.electionName.data, form.unitHQ.data,
            form.cash.data, form.otherDeposits.data, form.bankName.data,
            form.bankAmount.data, form.verified.data).transact()
        txHash = web3.toHex(tx_hash)
        flash(
            "New Election Record added for " + form.partyName.data +
            ". Transaction Hash: " + txHash, 'info')
        return redirect(url_for('index'))

    return render_template('addElectionRecord.html',
                           title='New Election Record',
                           form=form)