|
@@ -15,20 +15,22 @@
|
15
|
15
|
<program>
|
16
|
16
|
<![CDATA[
|
17
|
17
|
window = this;
|
|
18
|
+ var invoiceID = 0;
|
18
|
19
|
this.windowTitle = 'Typica - Fee Detail';
|
19
|
20
|
var descField = findChildObject(this, 'description');
|
20
|
21
|
var costField = findChildObject(this, 'cost');
|
21
|
22
|
this.dataSet = function() {
|
22
|
23
|
descField.text = window.rowData[2];
|
23
|
24
|
costField.text = window.rowData[7];
|
|
25
|
+ invoiceID = window.invoiceID;
|
24
|
26
|
};
|
25
|
27
|
button = findChildObject(this, 'submit');
|
26
|
28
|
button.clicked.connect(function() {
|
27
|
29
|
var query = new QSqlQuery();
|
28
|
|
- query.prepare("UPDATE invoice_items SET description = :name, cost = :cost WHERE invoice_id = :id AND record_type = 'FEE' AND item_id = NULL AND description = :oldname AND cost = :oldcost");
|
|
30
|
+ query.prepare("UPDATE invoice_items SET description = :name, cost = :cost WHERE invoice_id = :id AND record_type = 'FEE' AND description = :oldname AND cost = :oldcost");
|
29
|
31
|
query.bind(":name", descField.text);
|
30
|
32
|
query.bind(":cost", Number(costField.text));
|
31
|
|
- query.bind(":id", Number(window.rowData[1]));
|
|
33
|
+ query.bind(":id", Number(invoiceID));
|
32
|
34
|
query.bind(":oldname", window.rowData[2]);
|
33
|
35
|
query.bind(":oldcost", window.rowData[7]);
|
34
|
36
|
query.exec();
|