Exemplo n.º 1
0
    def updateTotals(self):
        total, ptTotal = 0, 0

        plan_total, pt_plan_total = 0, 0
        comp_total, pt_cmp_total = 0, 0
        interim_total, pt_interim_total = 0, 0

        for est in self.ests:
            if est.completed == est.COMPLETED:
                comp_total += est.fee
                pt_cmp_total += est.ptfee
            elif est.completed == est.PARTIALLY_COMPLETED:
                interim_total += est.interim_fee
                pt_interim_total += est.interim_pt_fee
                plan_total += est.fee - est.interim_fee
                pt_plan_total += est.ptfee - est.interim_pt_fee
            else:  # est.PLANNED
                plan_total += est.fee
                pt_plan_total += est.ptfee
            total += est.fee
            ptTotal += est.ptfee

        self.fees_total_le.setText(localsettings.decimalise(total))
        self.charges_total_le.setText(localsettings.decimalise(ptTotal))
        self.planned_fees_total_le.setText(
            localsettings.decimalise(plan_total))
        self.planned_charges_total_le.setText(
            localsettings.decimalise(pt_plan_total))
        self.completed_fees_total_le.setText(
            localsettings.decimalise(comp_total))
        self.completed_charges_total_le.setText(
            localsettings.decimalise(pt_cmp_total))
        self.interim_fees_total_le.setText(
            localsettings.decimalise(interim_total))
        self.interim_charges_total_le.setText(
            localsettings.decimalise(pt_interim_total))

        interim_in_use = interim_total != 0 and pt_interim_total != 0
        if interim_in_use:
            LOGGER.debug("est widget using interim fees")

        for widg in (self.interim_charges_total_le, self.interim_fees_total_le,
                     self.interim_total_label):
            widg.setVisible(interim_in_use)

        self.updated_fees_signal.emit()
        self.edited_signal.emit()
Exemplo n.º 2
0
    def updateTotals(self):
        total, ptTotal = 0, 0

        plan_total, pt_plan_total = 0, 0
        comp_total, pt_cmp_total = 0, 0
        interim_total, pt_interim_total = 0, 0

        for est in self.ests:
            if est.completed == est.COMPLETED:
                comp_total += est.fee
                pt_cmp_total += est.ptfee
            elif est.completed == est.PARTIALLY_COMPLETED:
                interim_total += est.interim_fee
                pt_interim_total += est.interim_pt_fee
                plan_total += est.fee - est.interim_fee
                pt_plan_total += est.ptfee - est.interim_pt_fee
            else:  # est.PLANNED
                plan_total += est.fee
                pt_plan_total += est.ptfee
            total += est.fee
            ptTotal += est.ptfee

        self.fees_total_le.setText(localsettings.decimalise(total))
        self.charges_total_le.setText(localsettings.decimalise(ptTotal))
        self.planned_fees_total_le.setText(
            localsettings.decimalise(plan_total))
        self.planned_charges_total_le.setText(
            localsettings.decimalise(pt_plan_total))
        self.completed_fees_total_le.setText(
            localsettings.decimalise(comp_total))
        self.completed_charges_total_le.setText(
            localsettings.decimalise(pt_cmp_total))
        self.interim_fees_total_le.setText(
            localsettings.decimalise(interim_total))
        self.interim_charges_total_le.setText(
            localsettings.decimalise(pt_interim_total))

        interim_in_use = interim_total != 0 and pt_interim_total != 0
        if interim_in_use:
            LOGGER.debug("est widget using interim fees")

        for widg in (self.interim_charges_total_le,
                     self.interim_fees_total_le, self.interim_total_label):
            widg.setVisible(interim_in_use)

        self.updated_fees_signal.emit()
        self.edited_signal.emit()
Exemplo n.º 3
0
 def setPtFee(self, fee):
     '''
     update the fee lineedit
     '''
     self.ptFee_lineEdit.setText(localsettings.decimalise(fee))
Exemplo n.º 4
0
 def setPtFee(self, fee):
     '''
     update the fee lineedit
     '''
     self.ptFee_lineEdit.setText(localsettings.decimalise(fee))