~mrp/krait

bc1fe820cef665e74fd5a3ad89874319ce3b16be — Mark Penner 1 year, 8 months ago 21d38d2
add notes field to inventoryAddDialog; update sql_queries.py
2 files changed, 7 insertions(+), 1 deletions(-)

M krait/sql_queries.py
M krait/views.py
M krait/sql_queries.py => krait/sql_queries.py +3 -1
@@ 24,6 24,7 @@ ON batches.id = ib.batch_id;
    "Inventory Value": """-- figure value of coffee sold and coffee roasted but not sold
-- in a date range (which is defined in two places! change both!)
SELECT inventory.id,
       inventory.country,
       inventory.date,
       inventory.price,
       inventory.weight,


@@ 47,6 48,7 @@ LEFT OUTER JOIN(
    JOIN batches ON batches.id==ib.batch_id
    LEFT OUTER JOIN batch_sale ON batch_sale.batch_id==batches.id
    WHERE batches.date BETWEEN "2022-01-01" AND "2022-01-31"
    GROUP BY ib.inventory_id) AS summed_sales ON summed_sales.inventory_id==inventory.id;
    GROUP BY ib.inventory_id) AS summed_sales ON summed_sales.inventory_id==inventory.id
WHERE weight_used IS NOT NULL;
""",
}

M krait/views.py => krait/views.py +4 -0
@@ 262,6 262,8 @@ class inventoryAddDialog(QDialog):
        self.weightField.setObjectName("Weight")
        self.priceField = QLineEdit()
        self.priceField.setObjectName("Price")
        self.notesField = QLineEdit()
        self.notesField.setObjectName("Notes")

        # Lay out the data fields
        layout = QFormLayout()


@@ 270,6 272,7 @@ class inventoryAddDialog(QDialog):
        layout.addRow("Region:", self.regionField)
        layout.addRow("Weight:", self.weightField)
        layout.addRow("Price:", self.priceField)
        layout.addRow("Notes:", self.notesField)
        self.layout.addLayout(layout)

        # Add standard buttons to the dialog and connect them


@@ 313,6 316,7 @@ class inventoryAddDialog(QDialog):
        self.data["region"] = self.regionField.text()
        self.data["weight"] = self.weightField.text()
        self.data["price"] = self.priceField.text()
        self.data["notes"] = self.notesField.text()

        if not self.data:
            return