Browse Source

Fix manual entry for sample batches

Neal Wilson 7 years ago
parent
commit
2819ce9a8c
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      config/Windows/manuallogentry.xml

+ 6
- 2
config/Windows/manuallogentry.xml View File

416
 				}
416
 				}
417
 				query.prepare("INSERT INTO coffee_sample_items(id, name, reference, unit, quantity, category, arrival, vendor, attribute_ids, attribute_values) VALUES (DEFAULT, :name, NULL, 'lb', 0, 'Coffee: Green Sample', :arrival, :vendor, :attrids, :attrvals) RETURNING id");
417
 				query.prepare("INSERT INTO coffee_sample_items(id, name, reference, unit, quantity, category, arrival, vendor, attribute_ids, attribute_values) VALUES (DEFAULT, :name, NULL, 'lb', 0, 'Coffee: Green Sample', :arrival, :vendor, :attrids, :attrvals) RETURNING id");
418
 				query.bind(":name", sampleGreenName.text);
418
 				query.bind(":name", sampleGreenName.text);
419
-				query.bind(":arrival", sampleGreenArrival.date);
419
+				query.bind(":arrival", sampleGreenArrivalDate.date);
420
 				query.bind(":attrids", attributes.bindableColumnArray(0, 32));
420
 				query.bind(":attrids", attributes.bindableColumnArray(0, 32));
421
 				query.bind(":attrvals", attributes.bindableQuotedColumnArray(1, 0));
421
 				query.bind(":attrvals", attributes.bindableQuotedColumnArray(1, 0));
422
 				query.exec();
422
 				query.exec();
437
 				query.bind(":note", notes.plainText);
437
 				query.bind(":note", notes.plainText);
438
 				query.bind(":machine", Number(selectedRoasterID));
438
 				query.bind(":machine", Number(selectedRoasterID));
439
 				query.bind(":duration", roastDuration.text);
439
 				query.bind(":duration", roastDuration.text);
440
-				query.bind(":files", "{" + fileID + "}");
440
+				if(fileID > 0) {
441
+					query.bind(":files", "{" + fileID + "}");
442
+				} else {
443
+					query.bind(":file", "{}");
444
+				}
441
 				query.bind(":user", Application.currentTypicaUser());
445
 				query.bind(":user", Application.currentTypicaUser());
442
 				query.exec();
446
 				query.exec();
443
 			} else {
447
 			} else {

Loading…
Cancel
Save