SELECT DISTINCT vendor FROM purchase UNION SELECT '' ORDER BY vendor ASC
SELECT DISTINCT name FROM coffees UNION SELECT '' ORDER BY name ASC
SELECT DISTINCT origin FROM coffees UNION SELECT '' ORDER BY origin ASC
SELECT DISTINCT decaf_method FROM decaf_coffees UNION SELECT '' ORDER BY decaf_method ASC
SELECT DISTINCT certification FROM certifications UNION SELECT '' ORDER BY certification ASC
SELECT DISTINCT name FROM item_attributes UNION SELECT '' ORDER BY name ASC
1) {
table.setData(currentRow, 6, itemCertifications.quotedColumnArray(0, 0), 0);
}
itemClear();
});
var newCancel = findChildObject(this, 'newCancel');
newCancel.clicked.connect(function() {
pages.setCurrentIndex(0);
});
var newFee = findChildObject(this, 'newFee');
newFee.clicked.connect(function() {
pages.setCurrentIndex(3);
});
var feeCancel = findChildObject(this, 'feeCancel');
feeCancel.clicked.connect(function() {
clearFeePage();
});
var feeDescription = findChildObject(this, 'feeDescription');
var feePrice = findChildObject(this, 'feePrice');
var feeSave = findChildObject(this, 'feeSave');
feeSave.clicked.connect(function() {
if(table.data(currentRow, 9, 0) == "NOP") {
table.setData(currentRow, 10, table.data(currentRow, 2, 0));
table.setData(currentRow, 11, table.data(currentRow, 5, 0));
table.setData(currentRow, 0, "UPDATE", 0);
} else {
table.setData(currentRow, 9, "INSERT", 0);
}
table.setData(currentRow, 2, feeDescription.text, 0);
table.setData(currentRow, 3, feePrice.text, 0);
table.setData(currentRow, 5, feePrice.text, 0);
table.setData(currentRow, 8, "FEE", 0);
clearFeePage();
});
function clearFeePage() {
feeDescription.text = "";
feePrice.text = "";
table.resizeColumnsToContents();
pages.setCurrentIndex(0);
}
function loadFeePage() {
feeDescription.text = table.data(currentRow, 2, 0);
feePrice.text = table.data(currentRow, 5, 0);
pages.setCurrentIndex(3);
}
var feeDelete = findChildObject(this, 'feeDelete');
feeDelete.clicked.connect(function() {
if(table.data(currentRow, 9, 0) == "INSERT") {
table.removeRow(currentRow);
} else if(table.data(currentRow, 9, 0) == "UPDATE") {
table.setData(currentRow, 9, "DELETE", 0);
table.hideRow(currentRow);
} else if(table.data(currentRow, 9, 0) == "NOP") {
table.setData(currentRow, 9, "DELETE", 0);
table.hideRow(currentRow);
}
clearFeePage();
});
]]>