Browse Source

Fix manual entry for sample batches

Neal Wilson 6 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,7 +416,7 @@
416 416
 				}
417 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 418
 				query.bind(":name", sampleGreenName.text);
419
-				query.bind(":arrival", sampleGreenArrival.date);
419
+				query.bind(":arrival", sampleGreenArrivalDate.date);
420 420
 				query.bind(":attrids", attributes.bindableColumnArray(0, 32));
421 421
 				query.bind(":attrvals", attributes.bindableQuotedColumnArray(1, 0));
422 422
 				query.exec();
@@ -437,7 +437,11 @@
437 437
 				query.bind(":note", notes.plainText);
438 438
 				query.bind(":machine", Number(selectedRoasterID));
439 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 445
 				query.bind(":user", Application.currentTypicaUser());
442 446
 				query.exec();
443 447
 			} else {

Loading…
Cancel
Save