|
|
|
|
20
|
var costField = findChildObject(this, 'cost');
|
20
|
var costField = findChildObject(this, 'cost');
|
21
|
this.dataSet = function() {
|
21
|
this.dataSet = function() {
|
22
|
descField.text = window.rowData[2];
|
22
|
descField.text = window.rowData[2];
|
23
|
- costField.text = window.rowData[4];
|
|
|
|
|
23
|
+ costField.text = window.rowData[7];
|
24
|
};
|
24
|
};
|
25
|
button = findChildObject(this, 'submit');
|
25
|
button = findChildObject(this, 'submit');
|
26
|
button.clicked.connect(function() {
|
26
|
button.clicked.connect(function() {
|
|
|
|
|
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");
|
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");
|
29
|
query.bind(":name", descField.text);
|
29
|
query.bind(":name", descField.text);
|
30
|
query.bind(":cost", Number(costField.text));
|
30
|
query.bind(":cost", Number(costField.text));
|
31
|
- query.bind(":id", Number(window.rowData[1]);
|
|
|
|
|
31
|
+ query.bind(":id", Number(window.rowData[1]));
|
32
|
query.bind(":oldname", window.rowData[2]);
|
32
|
query.bind(":oldname", window.rowData[2]);
|
33
|
- query.bind(":oldcost", window.rowData[4]);
|
|
|
|
|
33
|
+ query.bind(":oldcost", window.rowData[7]);
|
34
|
query.exec();
|
34
|
query.exec();
|
35
|
query = query.invalidate();
|
35
|
query = query.invalidate();
|
36
|
window.close();
|
36
|
window.close();
|