瀏覽代碼

Fix manual entry for sample batches

Neal Wilson 7 年之前
父節點
當前提交
2819ce9a8c
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6
    2
      config/Windows/manuallogentry.xml

+ 6
- 2
config/Windows/manuallogentry.xml 查看文件

@@ -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…
取消
儲存