Browse Source

Add reason to loss transaction lines and customer to sale transaction lines in item transactions report.

Neal Wilson 9 years ago
parent
commit
7059429b7a
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      config/Reports/itemtransactions.xml

+ 5
- 1
config/Reports/itemtransactions.xml View File

176
 					scriptFile.close();
176
 					scriptFile.close();
177
 					output.writeEndElement();
177
 					output.writeEndElement();
178
 					
178
 					
179
-					query.prepare("SELECT time::date, type, quantity / :c1, balance / :c2, (SELECT files FROM roasting_log WHERE roasting_log.time = item_history.time AND item = ANY(unroasted_id)), (SELECT invoice_id FROM invoice_items WHERE item = item_id AND item_history.type = 'PURCHASE'), (SELECT vendor || ' ' || invoice FROM invoices WHERE id = (SELECT invoice_id FROM invoice_items WHERE item = item_id AND item_history.type = 'PURCHASE')), (SELECT name FROM items WHERE id = (SELECT roasted_id FROM roasting_log WHERE roasting_log.time = item_history.time AND item = ANY(unroasted_id))) FROM item_history(:item)");
179
+					query.prepare("SELECT time::date, type, quantity / :c1, balance / :c2, (SELECT files FROM roasting_log WHERE roasting_log.time = item_history.time AND item = ANY(unroasted_id)), (SELECT invoice_id FROM invoice_items WHERE item = item_id AND item_history.type = 'PURCHASE'), (SELECT vendor || ' ' || invoice FROM invoices WHERE id = (SELECT invoice_id FROM invoice_items WHERE item = item_id AND item_history.type = 'PURCHASE')), (SELECT name FROM items WHERE id = (SELECT roasted_id FROM roasting_log WHERE roasting_log.time = item_history.time AND item = ANY(unroasted_id))), customer, reason FROM item_history(:item)");
180
 					switch(unitBox.currentIndex)
180
 					switch(unitBox.currentIndex)
181
 					{
181
 					{
182
 						case 0:
182
 						case 0:
240
 							output.writeCDATA(query.value(7) + " " + query.value(4));
240
 							output.writeCDATA(query.value(7) + " " + query.value(4));
241
 							output.writeEndElement();
241
 							output.writeEndElement();
242
 							output.writeEndElement();
242
 							output.writeEndElement();
243
+                                                } else if(query.value(1) == "LOSS") {
244
+                                                    output.writeTextElement("td", query.value(9));
245
+                                                } else if(query.value(1) == "SALE") {
246
+                                                    output.writeTextElement("td", query.value(8));
243
 						} else {
247
 						} else {
244
 							output.writeTextElement("td", "");
248
 							output.writeTextElement("td", "");
245
 						}
249
 						}

Loading…
Cancel
Save