Beispiel #1
0
 def on_actionDisReinvestProduct_triggered(self):
     d = MyModalQDialog()
     d.setSettings(self.mem.settings, "frmInvestmentReport",
                   "frmDisReinvestProduct")
     d.setWindowTitle(self.tr("Divest / Reinvest simulation"))
     d.setWidgets(wdgDisReinvest(self.mem, self.investment, True, d))
     d.exec_()
Beispiel #2
0
 def on_actionReinvestCurrent_triggered(self):
     d = QDialog()
     d.resize(
         self.mem.settings.value("frmInvestmentReport/qdialog_disreinvest",
                                 QSize(1024, 768)))
     d.setWindowTitle(self.tr("Divest / Reinvest simulation"))
     w = wdgDisReinvest(self.mem, self.mqtwInvestments.selected, False, d)
     lay = QVBoxLayout(d)
     lay.addWidget(w)
     d.exec_()
     self.mem.settings.setValue("frmInvestmentReport/qdialog_disreinvest",
                                d.size())
Beispiel #3
0
 def on_actionReinvest_triggered(self):
     d = QDialog()
     d.resize(
         self.mem.settings.value("frmInvestmentReport/qdialog_disreinvest",
                                 QSize(1024, 768)))
     d.setWindowTitle(self.tr("Divest / Reinvest simulation"))
     w = wdgDisReinvest(self.mem, self.mqtwInvestments.selected, False, d)
     price = self.mqtwInvestments.selected.op_actual.last().price * (
         1 + self.spin.value() / Decimal(100))  #Is + because -·-
     w.txtValorAccion.setText(price)
     lay = QVBoxLayout(d)
     lay.addWidget(w)
     d.exec_()
     self.mem.settings.setValue("frmInvestmentReport/qdialog_disreinvest",
                                d.size())
Beispiel #4
0
    def on_actionShowReinvest_triggered(self):
        if self.mqtwOrders.selected.price is None or self.mqtwOrders.selected.shares is None or self.mqtwOrders.selected.investment.shares(
        ) == 0:
            qmessagebox(self.tr("This order can't be simulated"))
            return

        d = MyModalQDialog()
        d.setWindowTitle(self.tr("Order reinvest simulation"))
        d.setSettings(self.mem.settings, "wdgOrders", "frmDisReinvest")
        w = wdgDisReinvest(self.mem, self.mqtwOrders.selected.investment,
                           False, d)
        w.txtValorAccion.setText(self.mqtwOrders.selected.price)
        w.txtSimulacion.setText(self.mqtwOrders.selected.price *
                                self.mqtwOrders.selected.shares)
        d.setWidgets(w)
        d.exec_()
Beispiel #5
0
    def on_actionShowReinvestSameProduct_triggered(self):
        investment = self.mem.data.investments_active(
        ).Investment_merging_current_operations_with_same_product(
            self.mqtwOrders.selected.investment.product)
        if self.mqtwOrders.selected.price == None or self.mqtwOrders.selected.shares == None or investment.shares(
        ) == 0:
            qmessagebox(self.tr("This order can't be simulated"))
            return

        d = MyModalQDialog()
        d.setWindowTitle(
            self.
            tr("Order reinvest simulation with all investments with the same product"
               ))
        d.setSettings(self.mem.settings, "wdgOrders", "frmDisReinvest")
        w = wdgDisReinvest(self.mem, investment, True, d)
        w.txtValorAccion.setText(self.mqtwOrders.selected.price)
        w.txtSimulacion.setText(self.mqtwOrders.selected.price *
                                self.mqtwOrders.selected.shares)
        d.setWidgets(w)
        d.exec_()