def set_inventory(self, inventory):
     self.treeWidget_inventory.clear()
     for inventory_item in inventory:
         helper.add_item_to_tree(
             content_item=inventory_item,
             parent=self.treeWidget_inventory,
             cols=[
                 f"{inventory_item.is_active}",
                 inventory_item.ordinal_number,
                 inventory_item.name,
                 f"{inventory_item.cost_group.id} / {inventory_item.cost_group.name}",
                 str(inventory_item.trade.name),
                 f"{inventory_item.units}",
                 f"{inventory_item.unit_type}",
                 amount_str(inventory_item.unit_price, self.currency),
                 amount_str(inventory_item.total_price, self.currency),
             ],
         )
     # Number of items
     self.label_items_all.setText(str(len(inventory)))
     self.label_items.setText(str(len([i for i in inventory if i.is_active])))
     self.label_items_deactivated.setText(
         str(len([i for i in inventory if not i.is_active]))
     )
     # Total prices sum
     total_price_sum_all = sum(i.total_price for i in inventory)
     total_price_sum = sum(i.total_price for i in inventory if i.is_active)
     total_price_deactivated = total_price_sum_all - total_price_sum
     self.label_total_price_sum_all.setText(
         amount_str(total_price_sum_all, self.currency)
     )
     self.label_total_price_sum.setText(amount_str(total_price_sum, self.currency))
     self.label_total_price_sum_deactivated.setText(
         amount_str(total_price_deactivated, self.currency)
     )
 def set_labels(self, total_price):
     """total price"""
     total_price_VAT_amount = total_price * self.vat
     total_price_w_VAT = total_price + total_price_VAT_amount
     self.label_total_price.setText(amount_str(total_price))
     self.label_total_price_w_VAT.setText(amount_str(total_price_w_VAT))
     self.label_total_price_VAT_amount.setText(amount_str(total_price_VAT_amount))
 def set_labels(
     self,
     *,
     budget_w_VAT,
     budget_VAT_amount,
     contact_person_first_name,
     contact_person_last_name,
 ):
     """budget"""
     self.label_budget_w_VAT.setText(amount_str(budget_w_VAT))
     self.label_budget_VAT_amount.setText(amount_str(budget_VAT_amount))
     """ contact person """
     self.label_contact_person_first_name.setText(contact_person_first_name)
     self.label_contact_person_last_name.setText(contact_person_last_name)
 def set_paid_safety_deposits(self, paid_safety_deposits):
     self.treeWidget_paid_safety_deposits.clear()
     psd_sum = 0
     for psd in paid_safety_deposits:
         helper.add_item_to_tree(
             content_item=psd,
             parent=self.treeWidget_paid_safety_deposits,
             cols=[
                 str(psd["date"].toPyDate()),
                 amount_str(psd["amount"], self.currency),
             ],
         )
         psd_sum += psd["amount"]
     self.label_paid_safety_deposits_sum.setText(amount_str(psd_sum))
 def set_safety_deposits_of_invoices(self, invoices):
     self.treeWidget_safety_deposits_of_invoices.clear()
     sd_sum = 0
     for invoice in invoices:
         helper.add_item_to_tree(
             content_item=invoice,
             parent=self.treeWidget_safety_deposits_of_invoices,
             cols=[
                 str(invoice.invoice_date.toPyDate()),
                 amount_str(invoice.safety_deposit_amount, self.currency),
             ],
         )
         sd_sum += invoice.safety_deposit_amount
     self.label_safety_deposits_of_invoices_sum.setText(amount_str(sd_sum))
    def set_inventory(self, inventory):
        self.treeView_inventory.clear()
        total_price_sum = 0
        for inventory_item in inventory:
            helper.add_item_to_tree(
                content_item=inventory_item,
                cost_group=self.treeView_inventory,
                cols=[
                    inventory_item.name,
                    f"{inventory_item.units} {inventory_item.unit_type}",
                    amount_str(inventory_item.unit_price, self.currency),
                    amount_str(inventory_item.total_price, self.currency),
                ],
            )
            total_price_sum += inventory_item.total_price

        self.label_total_price_sum.setText(amount_str(total_price_sum, self.currency))
 def set_labels(self, *, budget_w_VAT, budget_VAT_amount):
     """budget"""
     self.label_budget_w_VAT.setText(amount_str(budget_w_VAT))
     self.label_budget_VAT_amount.setText(amount_str(budget_VAT_amount))
 def set_labels(self, *, job_sum_w_VAT, job_sum_VAT_amount):
     """amounts"""
     self.label_job_sum_w_VAT.setText(amount_str(job_sum_w_VAT))
     self.label_job_sum_VAT_amount.setText(amount_str(job_sum_VAT_amount))
示例#9
0
 def set_labels(
     self,
     *,
     amount_w_VAT,
     amount_VAT_amount,
     verified_amount_w_VAT,
     verified_amount_VAT_amount,
     prev_invoices_count,
     prev_invoices_amount,
     rebate_amount,
     reduction_insurance_costs_amount,
     reduction_usage_costs_amount,
     amount_a_reductions_amount,
     amount_a_reductions_amount_w_VAT,
     amount_a_reductions_amount_VAT_amount,
     safety_deposit_amount,
     approved_amount,
     discount_amount,
     approved_amount_a_discount_amount,
 ):
     """amounts"""
     self.label_amount_w_VAT.setText(amount_str(amount_w_VAT))
     self.label_amount_VAT_amount.setText(amount_str(amount_VAT_amount))
     self.label_verified_amount_w_VAT.setText(
         amount_str(verified_amount_w_VAT))
     self.label_verified_amount_VAT_amount.setText(
         amount_str(verified_amount_VAT_amount))
     """ reductions """
     self.label_prev_invoices_count.setText(prev_invoices_count)
     self.label_prev_invoices_amount.setText(
         amount_str(prev_invoices_amount))
     self.label_rebate_amount.setText(amount_str(rebate_amount))
     self.label_reduction_insurance_costs_amount.setText(
         amount_str(reduction_insurance_costs_amount))
     self.label_reduction_usage_costs_amount.setText(
         amount_str(reduction_usage_costs_amount))
     self.label_amount_a_reductions_amount.setText(
         amount_str(amount_a_reductions_amount))
     self.label_amount_a_reductions_amount_w_VAT.setText(
         amount_str(amount_a_reductions_amount_w_VAT))
     self.label_amount_a_reductions_VAT_amount.setText(
         amount_str(amount_a_reductions_amount_VAT_amount))
     """ approved amount """
     self.label_approved_amount.setText(
         amount_str(approved_amount, self.app_data.project.get_currency()))
     self.label_discount_amount.setText(amount_str(discount_amount))
     self.label_approved_amount_a_discount_amount.setText(
         amount_str(approved_amount_a_discount_amount,
                    self.app_data.project.get_currency()))
     """ safety deposit """
     if not self.checkBox_sd_absolute.isChecked():
         self.doubleSpinBox_safety_deposit_absolute.setValue(
             safety_deposit_amount)
     else:
         self.doubleSpinBox_safety_deposit.setValue(0)