File: storedProcErrorLookup.cpp

package info (click to toggle)
postbooks 4.9.5-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 103,120 kB
  • sloc: cpp: 288,269; sh: 607; xml: 214; awk: 104; makefile: 49
file content (1623 lines) | stat: -rw-r--r-- 106,163 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
/*
 * This file is part of the xTuple ERP: PostBooks Edition, a free and
 * open source Enterprise Resource Planning software suite,
 * Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
 * It is licensed to you under the Common Public Attribution License
 * version 1.0, the full text of which (including xTuple-specific Exhibits)
 * is available at www.xtuple.com/CPAL.  By using this software, you agree
 * to be bound by its terms.
 */

#include <QMessageBox>
#include <QMultiHash>
#include <QObject>
#include <QPair>
#include <QString>
#include <QCoreApplication>

/*	try to address bug 4218
  This code assumes that stored procedures
  return zero or positive integers on success
  return negative integers on failure
 */

QMultiHash< QString, QPair<int, QString> >	ErrorLookupHash;

/*
  developers add error messages to an array for ease of adding new ones.
  initErrorLookupHash then inserts these into a QMultiHash(key, value).
  The key is the stored procedure name.
  The value is a QPair* of (return value, error message).
*/

const struct {
  QString	procName;	// name of the stored procedure
  int		retVal;		// return value from the stored procedure
  const char*	msg;		// msg to display, but see msgPtr and proxyName
  int		msgPtr;		// if <> 0 then look up (procName, msgPtr)
  QString	proxyName;	// look up (proxyName, retVal)
} errors[] = {

  { "attachQuoteToOpportunity", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Quote cannot be attached because "
                            "the Quote cannot be found."),                     0, "" },
  { "attachQuoteToOpportunity", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Quote cannot be attached because "
                            "the Opportunity cannot be found."),               0, "" },
  { "attachQuoteToOpportunity", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Quote cannot be attached because "
                            "it is already associated with an Opportunity.  You must "
                            "detach this Quote before you may attach it."),    0, "" },

  { "attachSalesOrderToOpportunity", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order cannot be attached because "
                            "the Sales Order cannot be found."),                     0, "" },
  { "attachSalesOrderToOpportunity", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order cannot be attached because "
                            "the Opportunity cannot be found."),               0, "" },
  { "attachSalesOrderToOpportunity", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order cannot be attached because "
                            "it is already associated with an Opportunity.  You must "
                            "detach this Sales Order before you may attach it."),    0, "" },

  { "changeCMHeadTaxAuth", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Return was not found."),	0, "" },
  { "changeCMHeadTaxAuth", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority was not found."),	0, "" },

  { "changeInvoiceTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Invoice was not found."),	0, "" },
  { "changeInvoiceTaxZone", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Freight Tax Type was not found."),0, "" },

  { "changeCobTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Bill was not found."),	0, "" },
  { "changeCobTaxZone", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Freight Tax Type was not found."),0, "" },

  { "changeQuoteTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Quote was not found."),		0, "" },
 // { "changeQuoteTaxAuth", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority was not found."),	0, "" },

  { "changeSOTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order was not found."),	0, "" },
 // { "changeSOTaxAuth", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority was not found."),	0, "" },
  { "changeTOTax", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order was not found."),	0, "" },
  { "changeTOTaxAuth", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority was not found."),	0, "" },

  { "closeAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be "
				    "closed because it is already closed."),
									0, "" },
  { "closeAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be "
				    "closed because there is a gap between the "
				    "end of the previous Period and the start "
				    "of this Period. You must edit either the "
				    "previous Perod or this Period to "
				    "eliminate the gap."),		0, "" },
  { "closeAccountingPeriod", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be "
				    "closed because the previous Period is not "
				    "closed. You must close the previous Period"
				    " before you may close this Period."),
									0, "" },
  { "closeAccountingPeriod", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be "
				    "closed because there is a gap between the "
				    "end of this Period and the start of the "
				    "next Period. You must edit either this "
				    "Period or the next Period to eliminate "
				    "the gap."),			0, "" },
  { "closeAccountingPeriod", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be "
				    "closed because it ends in the future."),
									0, "" },
  { "closeAccountingPeriod", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be "
				    "closed because it is the last period in "
				    "the Fiscal Year and the next Fiscal Year "
				    "has not been defined yet. Create the "
				    "next Fiscal Year before closing this "
				    "Accounting Period."),		0, "" },

  { "closeAccountingYearPeriod", -1, "", -1, "closeAccountingPeriod" },
  { "closeAccountingYearPeriod", -2, "", -2, "closeAccountingPeriod" },
  { "closeAccountingYearPeriod", -3, "", -3, "closeAccountingPeriod" },
  { "closeAccountingYearPeriod", -4, "", -4, "closeAccountingPeriod" },
  { "closeAccountingYearPeriod", -5, "", -5, "closeAccountingPeriod" },
  { "closeAccountingYearPeriod", -6, "", -6, "closeAccountingPeriod" },
  { "closeAccountingYearPeriod", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be closed "
                                        "because you have not specified a Year End Equity Account "
                                        "in the accounting configuration."), 0, "" },
  { "closeAccountingYearPeriod", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be "
                                        "closed because there does not seem to "
                                        "be an Accounting Period defined for "
                                        "the beginning of the next Fiscal "
                                        "Year."),                       0, "" },
  { "closeAccountingYearPeriod", -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be closed "
                                        "because there is no Trial Balance record for "
                                        "the account in the required Period. Or you have "
                                        "not specified a Year End Equity Account in the "
                                        "accounting configuration."), 0, "" },
  { "closeAccountingYearPeriod", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be closed "
                                      "because there are periods within the year that are still open."), 0, "" },
  { "closeAccountingYearPeriod", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be closed "
                                    "because there are prior years that are still open."), 0, "" },
  { "closeToItem",	 -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The item cannot be Closed at this time "
				"as there is inventory at shipping."),	0, "" },

  { "convertCustomerToProspect",	-1, "", -1, "deleteCustomer" },
  { "convertCustomerToProspect",	-2, "", -2, "deleteCustomer" },
  { "convertCustomerToProspect",	-3, "", -3, "deleteCustomer" },
  { "convertCustomerToProspect",	-4, "", -4, "deleteCustomer" },
  { "convertCustomerToProspect",	-5, "", -5, "deleteCustomer" },
  { "convertCustomerToProspect",
		       -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not convert Customer to Prospect to "
			       "because there is already a Prospect with "
			       "this internal ID."),		   0, "" },

  { "convertProspectToCustomer",	-1, "", -1, "deleteProspect" },
  { "convertProspectToCustomer",
		       -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not convert Prospect to Customer "
			       "because there is already a Customer with "
			       "this internal ID."),		   0, "" },

  { "convertQuote", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 has one or more line items without a "
			   "warehouse specified. These line items must be "
			   "fixed before you may convert this quote." ),
								   0, "" },
  { "convertQuote", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot find the Customer data for Quote #%1."),
								   0, "" },
  { "convertQuote", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 is associated with a Prospect, "
			       "not a Customer. Convert the Prospect to a "
			       "Customer first."),		   0, "" },
  { "convertQuote", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 is for a Customer that has been "
			   "placed on a Credit Hold and you do not have "
			   "privilege to create Sales Orders for Customers on "
			   "Credit Hold.  The selected Customer must be taken "
			   "off of Credit Hold before you may create convert "
			   "this Quote."),			   0, "" },

  { "convertQuote", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 is for a Customer that has been "
			   "placed on a Credit Warning and you do not have "
			   "privilege to create Sales Orders for Customers on "
			   "Credit Warning.  The selected Customer must be "
			   "taken off of Credit Warning before you may create "
			   "convert this Quote."),		   0, "" },
  { "convertQuote", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 has expired and can not be converted."),
								   0, "" },
  { "convertQuote", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Customer PO required."),
    0, "" },
  { "convertQuote", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Duplicate Customer PO."),
    0, "" },

  { "copyItemSite",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not copy the Item Site because it "
			    "does not appear to exist."),		0, "" },
  { "copyItemSite",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not copy the Item Site because the "
			    "warehouse for the new Item Site record "
			    "does not appear to exist."),		0, "" },
  { "copyItemSite",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You do not have sufficient privilege to "
			    "create an Item Site."),			0, "" },

  { "copyBOM", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not find the Source BOM to copy."), 0, "" },
  { "copyBOM", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected source Item does not "
                                     "have any Bill of Material Component Items associated with it."), 0, "" },
  { "copyBOM", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected target Item already has a "
                                     "Bill of Materials associated with it.\n"
                                     "You must first delete the Bill of Materials for the selected target item before "
                                     "attempting to copy an existing Bill of Materials."), 0, "" },
  { "copyBOM", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Item you are trying to copy "
                                     "this Bill of Material to is a "
                                     "component item which would cause a recursive Bill of Material."),	0, "" },

  { "copyPO", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not find the P/O to copy."),		0, "" },
  { "copyPO", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Vendor of the original P/O does not match "
		     "the Vendor for the copy. Changing the Vendor "
		     "is not yet supported when copying a P/O."),	0, "" },
  { "copyPO", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The system does not allow purchases of Items for this "
		     "Vendor without Item Sources and at least one line item "
		     "item in the original P/O does not have an active "
		     "Item Source."),					0, "" },
  { "copyPO", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "At least one line item in the original P/O does not have "
		     "an active Item Source Price for this Vendor."),	0, "" },

  { "copyPrj",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Copying an existing project failed, possibly because "
                       "the source project does not exist."),           0, "" },
  { "copyPrj", -10, "",                                      -10, "saveAlarm" },

  { "correctOperationPosting",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You may not correct a quantity greater than the amount "
                                       "originally posted."),	0, "" },
  { "correctReceipt",  -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The receipt has been split and may not be corrected. "
				      "Correct Receipt."),	0, "" },
  { "createAccountingPeriod",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Start Date falls within another "
				      "Accounting Period."),	0, "" },
  { "createAccountingPeriod",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The End Date falls within another "
				      "Accounting Period."),	0, "" },
  { "createAccountingPeriod",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Start and End Dates enclose another "
				      "Accounting Period."),	0, "" },
  { "createAccountingPeriod",  -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Period dates are outside the "
				      "selected Fiscal Year."),	0, "" },
  { "createAccountingPeriod",  -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Start Date must be prior "
				      "to the End Date."),	0, "" },

  { "createAccountingYearPeriod",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Year is closed." ),	0, "" },
  { "createAccountingYearPeriod",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Year dates may not overlap another year." ),	0, "" },
  { "createAccountingYearPeriod",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Year dates may not overlap another year." ),	0, "" },
  { "createAccountingYearPeriod",  -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Periods exist for this "
                                                       "year outside the proposed dates." ),	0, "" },
  { "createAccountingYearPeriod",  -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Start Date must be prior to the End Date" ),	0, "" },

  { "createAPCreditMemoApplication",
			-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You may not apply more than the balance due "
			       "to this document."),		0, "" },
  { "createAPCreditMemoApplication",
			-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You may not apply more than the amount "
			       "available to apply for this Credit Memo."),
								0, "" },

  { "createARCreditMemo", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either the Prepaid Account or the A/R Account"
				 " for this Customer could not be found."),
								0, "" },

  { "createARDebitMemo", -1, "",		-1, "createARCreditMemo" },

  { "createBOMItem",	 -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You may not create a BOM Item that defines a "
				"Parent that is composed of itself."),	0, "" },
  { "createBOMItem",	 -2, QT_TRANSLATE_NOOP("storedProcErrorLookup",  "The Component that you have selected for this"
				 "BOM Item is a manufactured or phantom Item "
				 "that uses the Parent Item as a Component "
				 "Item in its own BOM. You may not create a "
				 "recursive BOM."),			0, "" },

  { "createCrmAcct",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Account Number is already in use by "
			       "an existing Account. Please choose a "
			       "different number and save again."),	0, "" },
  { "createCrmAcct",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Account Number is already in use by "
			       "an existing Customer. Please choose a different"
			       " number and save again."),		0, "" },
  { "createCrmAcct",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Account Number is already in use by "
			       "an existing Prospect. Please choose a different"
			       " number and save again."),		0, "" },
  { "createCrmAcct",	-6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Account Number is already in use by "
			       "an existing Vendor. Please choose a different"
			       " number and save again."),		0, "" },
  { "createCrmAcct",	-7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Account Number is already in use by "
			       "an existing Tax Authority. Please choose a "
			       "different number and save again."),	0, "" },

  { "createProspect",	 -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create a Prospect because there is no "
				"Account to tie it to."),
								0, "" },
  { "createProspect",	 -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create a Prospect for this Account "
				"because it is already a Customer."),
								0, "" },
  { "createProspect",    -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create a Prospect for this Account "
				"because it is already a Prospect."),
								0, "" },
  { "createPurchaseToSale", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "SO Header Information related to this SO Item not found!"),	0, "" },
  { "createPurchaseToSale", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Item Source Information not found!"),	0, "" },

  { "createRecurringItems", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create recurring items with an "
                                    "unrecognized object type."),       0, "" },

  { "CreateRevision", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Revision control not enabled."),	0, "" },
  { "createTodoItem",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be created as "
			       "there is no assigned User."),	0, "" },
  { "createTodoItem",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be created as "
			       "the Task Name is blank."),	0, "" },
  { "createTodoItem",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be created as "
			       "there is no Due Date."),	0, "" },

  { "createWo",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order can not be created because Site "
			       "not allowed to Manufacture this Item."),	0, "" }, 
  { "createWo",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order can not be exploded because items on "
			       "the BOM exist without itemsites."),	0, "" }, 

  { "deleteAccount",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Cost Categories."
                             "  You must reassign these Cost Category "
                             "assignments before you may delete the selected "
                             "Ledger Account."),                           0, "" },
  { "deleteAccount",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Sales Account "
                             "Assignment. You must reassign these Sales "
                             "Account Assignments before you may delete "
                             "the selected Ledger Account."),              0, "" },
  { "deleteAccount",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Customer A/R "
                             "Account assignments. You must reassign these "
                             "Customer A/R Account assignments before you may "
                             "delete the selected Ledger Account."),       0, "" },
  { "deleteAccount",  -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used as the default Account one or "
                             "more Sites. You must reassign the default "
                             "Account for these Sites before you may delete "
                             "the selected Ledger Account."),              0, "" },
  { "deleteAccount",  -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Bank Accounts. "
                             "You must reassign these Bank Accounts before you "
                             "may delete the selected Ledger Account."),   0, "" },
  { "deleteAccount",  -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Expense "
                             "Categories. You must reassign these Expense "
                             "Categories before you may delete the selected "
                             "Ledger Account."),                           0, "" },
  { "deleteAccount",  -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Tax Codes. "
                             "You must reassign these Tax Codes before you "
                             "may delete the selected Ledger Account."),   0, "" },
  { "deleteAccount",  -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Standard "
                             "Journals. You must reassign these Standard "
                             "Journal Items before you may delete the selected "
                             "Ledger Account."),                           0, "" },
  { "deleteAccount",  -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Customer A/P "
                             "Account assignments. You must reassign these "
                             "Customer A/P Account assignments before you may "
                             "delete the selected Ledger Account."),       0, "" },
  { "deleteAccount", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more Currency "
                             "definition. You must reassign these Currency "
                             "definitions before you may delete the selected "
                             "Ledger Account."),                           0, "" },
  { "deleteAccount", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as it "
                             "is currently used in one or more A/R Open Items. "
                             "You must reassign these Currency definitions "
                             "before you may delete the selected Ledger Account."),
                                                                        0, "" },
  { "deleteAccount", -99, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Ledger Account cannot be deleted as "
                             "there have been Ledger Transactions posted "
                             "against it."),                            0, "" },

  { "deleteAccountingPeriod", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period has G/L "
				     "Transactions posted against it and, thus, "
				     "cannot be deleted."), 0, "" },

  { "deleteAccountingPeriod", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period is not "
				     "the last accounting period and "
				     "cannot be deleted."), 0, "" },

  { "deleteAccountingYearPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be "
					 "deleted because it is closed."),
									0, "" },
  { "deleteAccountingYearPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be "
					 "deleted because there are Accounting "
					 "Periods defined for it."),	0, "" },

  { "deleteAddress",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as "
			       "it is used by an active Contact."),
								 0, "" },
  { "deleteAddress",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as "
			       "it is used by an active Vendor."),
								 0, "" },
  { "deleteAddress",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as "
			       "it is used by an active Ship-To Address."),
								 0, "" },
  { "deleteAddress",	-4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as "
			       "it is used by an active Vendor Address."),
								 0, "" },
  { "deleteAddress",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as "
			       "it is used by an active Site."),
			       					 0, "" },

  { "deleteBankAdjustmentType",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Bank Adjustment Type "
                                        "cannot be deleted because it is "
                                        "currently used by a Bank Adjustment."),
                                                                 0, "" },

  { "deleteCashrcpt",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be deleted "
                              "because it is a Customer Deposit made with "
                              "a Credit Card and the card has already been "
                              "charged."),                              0, "" },
  { "deleteCharacteristic",
			-99, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Characteristic cannot be deleted "
			       "because it has been assigned to other documents."
			       "You must remove these assignments before "
			       "you may delete the selected Characteristic."),
			       					 0, "" },

  { "deleteCheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot delete this Payment because either it has not "
                          "been voided, it has already been posted or replaced,"
                          " or it has been transmitted electronically."),
			           					0, "" },

  { "deleteClassCode", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup",  "The selected Class Code cannot be deleted "
                              "because there are Items that are assigned to "
                              "it. You must reassign these Items before you "
                              "may delete the selected Class Code." ),  0, ""},

  { "deleteCompany", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Company cannot be deleted as it "
                            "is in use by existing Account. You must reclass "
                            "these Accounts before you may delete the selected "
                            "Company." ),                        0, "" },

  { "deleteContact",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as "
			       "s/he is the primary or secondary Contact "
			       " for a Account."),		 0, "" },
  { "deleteContact",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as "
			       "s/he is the Correspondence or Billing "
			       "Contact for a Customer."),	 0, "" },
  { "deleteContact",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as "
			       "s/he is the primary or secondary "
			       "Contact for a Vendor."),	 0, "" },
  { "deleteContact",	-4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as "
			       "s/he is the Contact for a Ship-To Address."),
								 0, "" },
  { "deleteContact",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as "
			       "s/he is the Contact for a Vendor Address."),
			       					 0, "" },
  { "deleteContact",	-6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as "
			       "s/he is the Contact for a Site."),
								 0, "" },

  { "deleteCRMAccount",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Account cannot be deleted as "
			       "it is a Customer."),		 0, "" },
  { "deleteCRMAccount",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Account cannot be deleted as "
			       "it is a Vendor."),		 0, "" },
  { "deleteCRMAccount",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Account cannot be deleted as "
			       "it is a Prospect."),		 0, "" },
  { "deleteCRMAccount",	-4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Account cannot be deleted as "
			       "it has Contacts. You may Detach the Contacts "
			       "from this Account and try deleting it "
			       "again or set its status to inactive"),
								 0, "" },
  { "deleteCRMAccount",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Account cannot be deleted as "
			       "it is a Tax Authority."),	 0, "" },
  { "deleteCRMAccount",	-6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Account cannot be deleted as "
			       "it is a Sales Rep."),	        0, "" },
  { "deleteCRMAccount",	-7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Account cannot be deleted as "
			       "it is a Employee."),	        0, "" },
  { "deleteCRMAccount",	-8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Account cannot be deleted as "
			       "it is a User."),	        0, "" },

  { "deleteCustomer",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted as there "
			       "are still Ship-Tos assigned to it. You must "
			       "delete all of the selected Customer's Ship-Tos "
			       "before you may delete it."),	 0, "" },
  { "deleteCustomer",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted "
			       "as there has been Sales History recorded "
			       "for this Customer. You may Edit the "
			       "selected Customer and set its status to "
			       "inactive."),			 0, "" }, //Purchase Orders
  { "deleteCustomer",	-3, "Returns",		-2, "" },
  { "deleteCustomer",	-4, "custhist",		-2, "" },
  { "deleteCustomer",	-5, "A/R Open",		-2, "" },
  { "deleteCustomer",	-6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted as "
			       "Payments have been written to it."),	0, "" },
  { "deleteCustomer",   -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted as there "
                               "are still Invoices assigned to it. You must "
                               "delete all of the selected Customer's Invoices "
                               "before you may delete it"),      0, "" },
  { "deleteCustomer",   -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted as there "
                               "are still Quotes assigned to it. You must "
                               "delete all of the selected Customer's Quotes "
                               "before you may delete it"),      0, "" },

  { "deleteCustomerType", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer Type cannot be deleted "
                                 "as there are one or more Customers assigned "
                                 "to it. You must reassign these Customers "
                                 "before you may delete the selected Customer "
                                 "Type."),                              0, "" },

{ "deleteEmpgrp",       -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Employee Group cannot be deleted "
                               "as there are one or more Employees assigned "
                               "to it. You must reassign these Employees "
                               "before you may delete the selected Employee "
                               "Group."),                              0, "" },

  { "deleteForm", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Check Format cannot be deleted as it is "
                         "used by one or more Bank Accounts. You must reassign "
                         "these Bank Accounts before you may delete the "
                         "selected Check Form." ),                      0, "" },

  { "deleteFreightClass", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup",  "The selected Freight Class cannot be deleted "
                                  "because there are Items that are assigned to "
                                  "it. You must reassign these Items before you "
                                  "may delete the selected Freight Class." ),  0, ""},

  { "deleteIncident",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Incident cannot be deleted as there are "
			       "To-Do List Items associated with it."),
								 	0, "" },
  { "deleteIncident",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Incident cannot be deleted as there are "
			       "Comments associated with it."), 	0, "" },

  { "deleteItem",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as it is used "
			       "in one or more bills of materials."), 	0, "" },
  { "deleteItem",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are "
			       "Item Site records associated with it."), 	0, "" },
  { "deleteItem",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are "
			       "Substitute records associated with it."), 	0, "" },
  { "deleteItem",	-4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are "
			       "Breeder BOM records associated with it."), 	0, "" },
  { "deleteItem",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are "
			       "assignement records associated with it."), 	0, "" },
  { "deleteItem",	-6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are "
			       "Revision Control records associated with it."), 	0, "" },
  { "deleteItemSite",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as "
			      "there is Inventory History posted against it. "
			      "You may edit the Item Site and deactivate it."),	0, "" },
  { "deleteItemSite",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as "
			      "there is Work Order History posted against it. "
			      "You may edit the Item Site and deactivate it."),	0, "" },
  { "deleteItemSite",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as "
			      "there is Sales History posted against it. "
			      "You may edit the Item Site and deactivate it."),	0, "" },
  { "deleteItemSite",  -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as "
			      "there is Purchasing History posted against it. "
			      "You may edit the Item Site and deactivate it."),	0, "" },
  { "deleteItemSite",  -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as "
			      "there is Planning History posted against it. "
			      "You may edit the Item Site and deactivate it."),	0, "" },
  { "deleteItemSite",  -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as "
			      "there are Production Plans associated with it."),	0, "" },
  { "deleteItemSite",  -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as "
			      "it is used as a Supplied from Site."),	0, "" },
  { "deleteItemSite",  -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as "
			      "there is a non-zero Inventory Quantity posted "
			      "against it."),	0, "" },

  { "deleteItemUOMConv", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This UOM Conversion cannot be deleted as "
			       "there are records for this Item which use this "
                               "UOM."), 	                        0, "" },

  { "deleteOpenRecurringItems",  -1, "",                 -1, "deleteIncident" },
  { "deleteOpenRecurringItems",  -2, "",                 -2, "deleteIncident" },
  { "deleteOpenRecurringItems", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot delete open recurring items "
                                        "with an invalid type."),       0, "" },
  { "deleteOpenRecurringItems", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot delete open recurring items "
                                        "without a valid parent item."),0, "" },

  { "deleteOpportunity", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Opportunity cannot be deleted because "
                            "there are ToDo Items assigned to it.  You must "
                            "delete or reassign these ToDo Items "
                            "before you may delete it."),                      0, "" },
  { "deleteOpportunity", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Opportunity cannot be deleted because "
                            "there are Quotes assigned to it.  You must "
                            "delete or reassign these Quotes "
                            "before you may delete it."),                      0, "" },
  { "deleteOpportunity", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Opportunity cannot be deleted because "
                            "there are Sales Orders assigned to it.  You must "
                            "delete or reassign these Sales Orders "
                            "before you may delete it."),                      0, "" },

  { "deletePackage", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Package cannot be deleted because "
                            "there are other packages that depend on it to "
                            "function properly."),                      0, "" },

  { "deleteProfitCenter", -1,
                        QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Profit Center cannot be deleted as it "
                           "is in use by existing Account. You must reclass "
                           "these Accounts before you may delete the selected "
                           "Profit Center." ),                          0, "" },

  { "deleteProspect",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Prospect cannot be deleted as "
			       "there are still Quotes for it. You must delete "
			       "all of this Prospect's Quotes before you may "
			       "delete the Prospect."),		 0, "" },
  { "deleteSalesRep",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Rep. cannot be deleted as "
                              "he/she is still assigned to one or more "
                              "Customers.  You must reassign different Sales "
                              "Reps. to all Customers to which the selected "
                              "Sales Rep. is assigned before you may delete "
                              "the selected Sales Rep." ),      0, "" },
  { "deleteSalesRep",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Rep. cannot be deleted as "
                              "he/she is still assigned to one or more "
                              "Ship-tos.  You must reassign different Sales "
                              "Reps. to all Ship-tos to which the selected "
                              "Sales Rep. is assigned before you may delete "
                              "the selected Sales Rep." ),      0, "" },
  { "deleteSalesRep",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Rep. cannot be deleted as "
                              "there has been sales history recorded against "
                              "him/her.  You may edit and set the selected "
                              "Sales Rep's active status to inactive." ),
                                                                0, "" },

  { "deleteShipto",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Shipto cannot be deleted as there "
			       "is still Archived Sales History assigned to it. You must "
			       "delete all of the selected Customer's Ship-Tos "
			       "before you may delete it."),	 0, "" },
  { "deleteShipto",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Shipto cannot be deleted "
			       "as there has been Sales History recorded "
			       "for this Shipto. You may Edit the "
			       "selected Shipto and set its status to "
			       "inactive."),			 0, "" },
  { "deleteShipto",	-3, "The selected Shipto cannot be deleted "
			       "as there has been Returns recorded "
			       "for this Shipto. You may Edit the "
			       "selected Shipto and set its status to "
			       "inactive.",		-2, "" },
  { "deleteShipto",	-4, "The selected Shipto cannot be deleted "
			       "as there has been Sales History recorded "
			       "for this Shipto. You may Edit the "
			       "selected Shipto and set its status to "
			       "inactive.",		-2, "" },
  { "deleteShipto",	-5, "The selected Shipto cannot be deleted "
			       "as there has been Quote History recorded "
			       "for this Shipto. You may Edit the "
			       "selected Shipto and set its status to "
			       "inactive.",		-2, "" },
  { "deleteShipto",	-6, "The selected Shipto cannot be deleted "
			       "as there has been Invoice History recorded "
			       "for this Shipto. You may Edit the "
			       "selected Shipto and set its status to "
			       "inactive.",			 0, "" },

  { "deleteSO",	 -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted because a Credit "
			"Card has been charged for it."),		0, "" },
  { "deleteSO",	 -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted because there is "
			"Credit Card transaction history for it."),	0, "" },
  /* uncomment this when releaseSoNumber returns INTEGER instead of BOOLEAN
  { "deleteSO",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted because there was "
			"an internal error releasing the Sales Order Number."),
									0, "" },
  */
  { "deleteSO",  -101, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its "
			"line items have already been shipped."),	0, "" },
  { "deleteSO",  -102, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its "
			"line items have already been issued to shipping.  "),		0, "" },
  { "deleteSO",  -103, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its "
			"line items are linked to a Return Authorization.  "
			"You must resolve this conflict before "
		        "you may delete this Sales Order."),		0, "" },
  { "deleteSO",  -104, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its "
			"line items are linked to an In Process Work Order.  "
			"You must resolve this conflict before "
		        "you may delete this Sales Order."),		0, "" },
  { "deleteSO",  -105, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its "
			"line items have transaction history.  "),		0, "" },
  { "deleteSO",  -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as one or more "
                        "of its Line items have associated Purchase Order Line Items which are either closed or "
                        "have receipts associated with them. You may want to consider cancelling this Sales "
                        "Order instead."), 0, "" },
  { "deleteSO",  -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Sales Order was deleted successfully. However, "
                        "the Released Purchase Orders associated with one or more line items of this Sales Order "
                        "could not be deleted. You must delete these Purchase Orders seperately if desired."), 0, "" },

  { "deleteSOItem",  -101, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it has already been shipped."),	0, "" },
  { "deleteSOItem",  -102, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it has already been issued to shipping."),	0, "" },
  { "deleteSOItem",  -103, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it is linked to a Return Authorization.  "
			"You must resolve this conflict before "
		        "you may delete this Sales Order Item."),		0, "" },
  { "deleteSOItem",  -104, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it is linked to an In Process Work Order.  "
			"You must resolve this conflict before "
		        "you may delete this Sales Order Item."),		0, "" },
  { "deleteSOItem",  -105, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it has generated Inventory History.  "
		        "You may want to consider cancelling this Sales Order Item."),		0, "" },
  { "deleteSOItem",  -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it has associated Purchase Order Line Item "
                        "which is either closed or has receipts associated with it. You may want to consider cancelling this Sales Order Item instead."), 0, "" },
  { "deleteSOItem",  -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Sales Order Item was deleted successfully. However, the Purchase Order Line Item "
                        "associated with this Sales Line could not be deleted. You must delete this Purchase Line Item seperately if desired."), 0, "" },

  { "deleteSubaccount", -1,
                        QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Subaccount cannot be deleted as it "
                           "is in use by existing Account. You must reclass "
                           "these Accounts before you may delete the selected "
                           "Subaccount."),                              0, "" },

  { "deleteTO",		-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as some of "
			       "its line items have already been shipped."),
								 0, "" },
  { "deleteTO",		-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as some of "
			       "its line items have already been issued to "
			       "shipping. You must return this stock before "
			       "you may delete this Transfer Order."),
			       					 0, "" },

  { "deleteTax", -10,	QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Code cannot be deleted as there are "
			   "Tax Assignments that refer to it. Change those "
			   "Tax Assignments before trying to delete this "
			   "Tax Code."),				0, "" },
    
  { "deleteTaxAuthority", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority cannot be deleted as "
				 "there are Tax Selections for it. Change or "
				 "delete those Tax Selections before deleting "
				 "this Tax Authority."),		0, "" },
  { "deleteTaxAuthority", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority cannot be deleted as "
				 "Payments have been written to it."),	0, "" },

  { "deleteTaxClass", -1,	QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Class cannot be deleted as there are "
			   "Tax Codes that refer to it."),	0, "" },
  
  { "deleteTaxZone", -1,	QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Zone cannot be deleted as there are "
			   "Tax Assignments that refer to it."),	0, "" },
  { "deleteTaxZone", -2,	QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Zone cannot be deleted as there are "
			   "Tax Registrations that refer to it."),	0, "" },
  
  { "deleteTo",	 -1,	QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as line "
			   "items for it have already been shipped."),	0, "" },
  { "deleteTo",	 -2,	QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as line "
			   "items for it have been issued to shipping."),0, "" },
  { "deleteTo",	 -3,	QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as the "
			   "order number cannot be released."),		0, "" },

  { "deleteVendor",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there"
			       "have been P/Os created against it. "
			       "You may deactivate this Vendor instead."),
								 0, "" },
  { "deleteVendor",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there"
			       "has been P/O Material Receipt History posted "
			       "against it. "
			       "You may deactivate this Vendor instead."),
								 0, "" },
  { "deleteVendor",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there"
			       "has been P/O Material Return History posted "
			       "against it. "
			       "You may deactivate this Vendor instead."),
								 0, "" },
  { "deleteVendor",	-4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there"
			       "have been Vouchers posted against it. "
			       "You may deactivate this Vendor instead."),
								 0, "" },
  { "deleteVendor",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there"
			       "have been A/P Open Items posted against it. "
			       "You may deactivate this Vendor instead."),
								 0, "" },
  { "deleteVendor",	-6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there"
			       "have been A/P Applications posted against it. "
			       "You may deactivate this Vendor instead."),
								 0, "" },
  { "deleteVendor",	-7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there "
			       "have been Payments posted against it. "
			       "You may deactivate this Vendor instead."),
								 0, "" },

  { "deleteWo",		-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Work Order cannot be deleted because time "
			       "clock entries exist for it. Please Close it "
			       "instead of trying to Delete it."),
								 0, "" },
  { "deleteWo",		-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Work Order cannot be deleted for Job Item Types. "
             "Please close the associated Sales Order "
			       "instead of trying to Delete it."),
								 0, "" },
  { "deleteWo",		-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Work Order cannot be deleted in the current status. "
             "Please close the associated Sales Order "
             "instead of trying to Delete it."),
                 0, "" },

  { "disablePackage", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This version of the PostgreSQL database server "
                             "does not support package enabling or disabling. "
                             "Upgrade to PostgreSQL 8.2 or later."),    0, "" },
  { "disablePackage", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not find a package with the internal id % "
                             "to enable or disable."),                  0, "" },

  { "distributeVoucherLine", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Distribution would result in zero "
                                    "quantity and amount."
                                    "Please distribute manually."),     0, "" },
  { "distributeVoucherLine", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The purchase order and voucher have "
                                    "different currencies. "
                                    "Please distribute manually."),     0, "" },
  { "distributeVoucherLine", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Distribution would result in a negative "
                                    "amount. "
                                    "Please distribute manually."),     0, "" },
  { "distributeVoucherLine", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Item has multiple cost elements. "
                                    "Please distribute manually."),     0, "" },

  { "distributetodefault", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There was an error distributing to default location. "
                                                 "There is no default location defined for this Item Site."),     0, "" },
  { "distributetodefault", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There was an error distributing to default location. "
                                                 "There is no quantity to distribute for this Item Site."),     0, "" },


  { "editccnumber",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You must select Master Card, Visa, American "
			       "Express or Discover as the credit card type."),
								 0, "" },
  { "editccnumber",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The length of a Master Card credit card number "
			       "has to be 16 digits."),		 0, "" },
  { "editccnumber",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The length of a Visa credit card number "
			       "has to be either 13 or 16 digits."), 0, "" },
  { "editccnumber",	-4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The length of an American Express credit card "
			       "number has to be 15 digits."),	 0, "" },
  { "editccnumber",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The length of a Discover credit card number "
			       "has to be 16 digits."),		 0, "" },
  { "editccnumber",	-6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The first two digits for a valid Master Card "
			       "number must be between 51 and 55"),
								 0, "" },
  { "editccnumber",	-7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The first digit for a valid Visa number must "
			       "be 4"),				 0, "" },
  { "editccnumber",	-8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The first two digits for a valid American "
			       "Express number must be 34 or 37."),
								 0, "" },
  { "editccnumber",	-9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The first four digits for a valid Discover "
			       "Express number must be 6011."),	 0, "" },
  { "editccnumber",    -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The credit card number that you have provided "
			       "is not valid."),		 0, "" },

  { "enablePackage",  -1, "", -1, "disablePackage" },
  { "enablePackage",  -2, "", -2, "disablePackage" },

  { "enterReceipt",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Information for this order line item could not "
			       "be found. If it is a Purchase Order Item then "
			       "it does not appear to exist. If it is a "
			       "Transfer Order Item then either the Transfer "
			       "Order does not exist or there is no Item Site "
			       "for this line item."),		0, "" },

  { "explodeWo",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded as there is no "
			 "valid Bill of Materials on file for the Work Order "
			 "Item. You must create a valid Bill of Materials "
			 "for the Work Order Item before you may explode the "
			 "Work Order."),				0, "" },
  { "explodeWo",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded as there are one "
			 "or more Component Items on the Bill of Materials for "
                         "the Work Order Item that are not valid in the Work "
			 "Order Site. You must create a valid Item Site "
			 "for all of the Component Items before you may "
			 "explode this Work Order."),			0, "" },
  { "explodeWo",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded as there are one "
			 "or more Co-Product/By-Product Items on the Breeder "
			 "Bill of Materials for the Work Order Item that do "
			 "not exist in the Work Order Site. You must "
			 "create a valid Item Site for all of the Co-Product/"
			 "By-Product Items before you may explode this "
			 "Work Order."),				0, "" },
  { "explodeWo",  -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded because it is not "
			 "Open."),					0, "" },
  { "explodeWo",  -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded because the quantity"
			 "ordered is not valid."),			0, "" },

  { "fkeycheck",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup",
                                        "Cannot check dependencies when the "
                                        "contact is one of multiple foreign "
                                        "key columns."),                0, "" },

  { "freezeAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot freeze this Accounting Period "
				     "because it is still open."),     0, "" },
  { "freezeAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot freeze this Accounting Period "
				     "because it is already frozen."), 0, "" },

  { "insertGLTransaction",
			-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Nothing to do as the value to post to the "
			       "G/L is 0."),			 0, "" },
  { "insertGLTransaction",
			-4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post a G/L transaction to a "
			       "closed period."),		 0, "" },

  { "insertIntoGLSeries", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot add to a G/L Series because the "
				 "Account is NULL or -1."),	0, "" },
  { "insertIntoGLSeries", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot add to a G/L Series because the "
				 "Accounting Period is closed."), 0, "" },

  { "issueAllBalanceToShipping",  -1, "",	 -1, "issueToShipping" },
  { "issueAllBalanceToShipping", -10, "",	-10, "issueToShipping" },
  { "issueAllBalanceToShipping", -12, "",	-12, "issueToShipping" },
  { "issueAllBalanceToShipping", -13, "",	-13, "issueToShipping" },
  { "issueAllBalanceToShipping", -14, "",	-14, "issueToShipping" },
  { "issueAllBalanceToShipping", -15, "",	-15, "issueToShipping" },
  { "issueAllBalanceToShipping", -20, "",	-20, "issueToShipping" },

  { "issueLineBalanceToShipping",  -1, "",	 -1, "issueToShipping" },
  { "issueLineBalanceToShipping", -10, "",	-10, "issueToShipping" },
  { "issueLineBalanceToShipping", -12, "",	-12, "issueToShipping" },
  { "issueLineBalanceToShipping", -13, "",	-13, "issueToShipping" },
  { "issueLineBalanceToShipping", -14, "",	-14, "issueToShipping" },
  { "issueLineBalanceToShipping", -15, "",	-15, "issueToShipping" },
  { "issueLineBalanceToShipping", -20, "",	-20, "issueToShipping" },

  { "issueToShipping",	-1, "",		 	 -1, "postInvTrans" },
  { "issueToShipping", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Next Shipment Number has not been set in "
			       "the Configure S/R window. Set that value and "
			       "try issuing to shipping again."), 0, "" },
  { "issueToShipping", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order is on Credit Hold and "
			       "must be taken off of Credit Hold before any "
			       "inventory may be issued to it."),	0, "" },
  { "issueToShipping", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order is on Packing Hold "
			       "and must be taken off of Packing Hold before "
			       "any inventory may be issued to it."),	0, "" },
  { "issueToShipping", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order is on Return Hold. "
			       "The Customer must return all materials for a "
			       "related Return Authorization before any inven"
			       "tory may be issued to this Order."),	0, "" },
  { "issueToShipping", -15, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order is configured for Auto Registration. "
			       "The Customer Account does not have a Primary Contact. "
			       "A Primary Contact must be assigned to this Customer Account before any inven"
			       "tory may be issued to this Order."),	0, "" },
  { "issueToShipping", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There is not enough Inventory to "
                                           "issue the amount required of one "
                                           "of the Average Cost items requested.  "
                                           "Average Cost items may not have a negative quantity on hand."),0, ""},

  { "login",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The specified Username does not exist in the specified "
                     "Database. Contact your Systems Administrator to report "
                     "this issue"),                                     0, "" },
  { "login",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The specified Username exists in the specified Database "
                     "but is not Active. Contact your Systems Administrator "
                     "to report this issue."),                          0, "" },
  { "login",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The specified Database is currently in Maintenance Mode "
                     "and can only be accessed by System Administators. "
                     "Contact your Systems Administrator to report this issue."),
                                                                        0, "" },

  { "massReplaceBomitem",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot make this BOM Item replacement "
				  "because it would create a recursive BOM."),
									0, "" },

  { "openAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Period because "
				   "it is already open."),		0, "" },
  { "openAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Period because "
				   "it is frozen."),			0, "" },
  { "openAccountingPeriod", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Period because "
                                    "subsequent periods are closed."),			0, "" },
  { "openAccountingPeriod", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Period because "
                                  "the fiscal year is closed."),			0, "" },

  { "openAccountingYearPeriod", -1, "", -1, "openAccountingPeriod" },
  { "openAccountingYearPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Year because "
                                     "subsequent years are closed."),			0, "" },

  { "openRecurringItems", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot count open recurring items with an "
                                  "invalid type."),                     0, "" },
  { "openRecurringItems", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot count open recurring items without "
                                  "a valid parent item."),              0, "" },
  { "openRecurringItems", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Don't know how to count open recurring "
                                  "invoices."),                         0, "" },

  { "postAPCreditMemoApplication", -1,
      QT_TRANSLATE_NOOP("storedProcErrorLookup", "There are no A/P Credit Memo applications to post."),         0, "" },
  { "postAPCreditMemoApplication", -2,
      QT_TRANSLATE_NOOP("storedProcErrorLookup", "There are no A/P Credit Memo applications to post."),         0, "" },
  { "postAPCreditMemoApplication", -3,
      QT_TRANSLATE_NOOP("storedProcErrorLookup", "The total value of the applications that are you attempting to post "
         "is greater than the value of the A/P Credit Memo itself." ),  0, "" },
  { "postAPCreditMemoApplication", -4,
	QT_TRANSLATE_NOOP("storedProcErrorLookup", "At least one A/P Credit Memo application cannot be posted because "
           "there is no current exchange rate for its currency."),      0, "" },
  { "postAPCreditMemoApplication", -5,
	QT_TRANSLATE_NOOP("storedProcErrorLookup", "The A/P Credit Memo to apply was not found."),              0, "" },
  { "postAPCreditMemoApplication", -6,
	QT_TRANSLATE_NOOP("storedProcErrorLookup", "The amount to apply for this A/P Credit Memo is NULL."),    0, "" },
  { "postAPCreditMemoApplication", -7,
    QT_TRANSLATE_NOOP("storedProcErrorLookup", "The value of the applications that are you attempting to post "
                      "is greater than the balance of the target A/P open item." ),  0, "" },

  { "postARCreditMemoApplication", -1,
	    QT_TRANSLATE_NOOP("storedProcErrorLookup", "There are no A/R Credit Memo applications to post."),	0, "" },
  { "postARCreditMemoApplication", -2,
	    QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either there are no A/R Credit Memo applications to post or there"
	       " is no exchange rate for one of the applications."),	0, "" },
  { "postARCreditMemoApplication", -3,
	    QT_TRANSLATE_NOOP("storedProcErrorLookup", "The total value of the applications that you are attempting to "
	       "post is greater than the value of the A/R Credit Memo itself. "
               "Please reduce the applications to total less than the value "
               "of the Credit Memo."),                                  0, "" },
  { "postARCreditMemoApplication", -4,
	    QT_TRANSLATE_NOOP("storedProcErrorLookup", "At least one A/R Credit Memo application cannot be posted "
	       "because there is no current exchange rate for its currency."),
									0, "" },
  { "postARCreditMemoApplication", -5,
	    QT_TRANSLATE_NOOP("storedProcErrorLookup", "The A/R Credit Memo to apply was not found."),		0, "" },

  { "postBankAdjustment", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Bank Adjustment could not be posted "
				 "because the one or more required records do "
				 "not exist."),				0, "" },
  { "postBankAdjustment", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Bank Adjustment could not be posted "
				 "because the total adjustment is 0 so there "
				 "is nothing to post."),		0, "" },

  { "postBankReconciliation", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Bank Reconciliation could not be "
				     "posted because the Ledger Account could not "
				     "be verified."),		0, "" },
  { "createInvoice",
			-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Billing Approval cannot be posted "
			       "because it has already been posted."),	0, "" },

  { "createInvoices",
                -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Ledger Account Assignments for one or more of the "
                       "Billing Approvals that you are trying to post are not "
                       "configured correctly. Therefore, G/L Transactions "
                       "cannot be posted for these. You must contact your "
                       "Systems Administrator to have this corrected before "
                       "you may post these Billing Approvals."),       0, "" },

  { "postCashReceipt", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted as "
			      "the amount distributed is greater than the "
			      "amount received. You must correct this before "
			      "you may post this Cash Receipt."),	0, "" },
  { "postCashReceipt", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted as "
			      "the amount received must be greater than zero. You must correct this before "
			      "you may post this Cash Receipt."),	0, "" },
  { "postCashReceipt", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted as "
                               "the A/R Account cannot be determined. You must "
			       "make an A/R Account Assignment for the "
			       "Customer Type to which this Customer is "
			       "assigned before you may post this Cash "
			       "Receipt."),				0, "" },
  { "postCashReceipt", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted as "
			      "the Bank Account cannot be determined. You must "
			      "make a Bank Account Assignment for this Cash "
			      "Receipt before you may post it." ),	0, "" },
  { "postCashReceipt", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted, "
			      "probably because the Customer's Prepaid Account "
			      "was not found."),			0, "" },
  { "postCashReceipt", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Cash Receipt because the "
                            "credit card records could not be found."), 0, "" },

  { "postCCCashReceipt",  -1, "", -1, "createARCreditMemo" },
  { "postCCCashReceipt", -10, "", -1, "postCCcredit" },
  { "postCCCashReceipt", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Cash Receipt because the "
                                 "record of the credit card transaction either "
                                 "does not exist or is not consistent."),
                                                                        0, "" },

  { "postCCcredit",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Credit Card refund because the "
                            "default Bank Account for this Credit Card "
                            "could not be found."),                     0, "" },
  { "postCCcredit",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Credit Card refund because an "
                            "invalid id/reference-type pair was passed."),
                                                                        0, "" },
  { "postCCcredit",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Credit Card refund because the "
                            "credit card and refund records could not be "
                            "found."),                                  0, "" },
  { "postCCcredit",  -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Credit Card refund because the "
                            "credit card payment records is not for a refund."),
                                                                        0, "" },

  { "postCheck",  -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Payment because it has already "
			 "been posted."),				0, "" },
  { "postCheck",  -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Payment because the recipient "
			 "type is not valid."),				0, "" },
  { "postCheck",  -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Payment because the Expense "
			 "Category could not be found."),		0, "" },
  { "postCheck",  -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Payment because the Ledger Account "
			 "against which it is to be posted is not valid."),
			 						0, "" },
  { "postCountTag",  -1, QT_TRANSLATE_NOOP("storedProcErrorLookup",
                           "Cannot post this Count Tag because The total Count "
                           "Slip quantity is greater than the Count Tag "
                           "quantity."),                                0, "" },
  { "postCountTag",  -2, QT_TRANSLATE_NOOP("storedProcErrorLookup",
                           "Cannot post this Count Tag because the total Count "
                           "Slip quantity is less than the Count Tag quantity "
                           "for a Lot/Serial-controlled Item Site."),   0, "" },
  { "postCountTag",  -3, QT_TRANSLATE_NOOP("storedProcErrorLookup",
                           "Cannot post this Count Tag because the total Count "
                           "Slip quantity is less than the Count Tag quantity "
                           "and there is no default location."),        0, "" },
  { "postCountTag",  -4, QT_TRANSLATE_NOOP("storedProcErrorLookup",
                           "Cannot post this Count Tag because the total Count "
                           "Slip quantity is less than the Count Tag quantity "
                           "and we don't post to default locations."),  0, "" },

  { "postCountTagLocation", -1, "", -1, "postCountTag" },
  { "postCountTagLocation", -2, "", -2, "postCountTag" },
  { "postCountTagLocation", -3, "", -3, "postCountTag" },
  { "postCountTagLocation", -4, "", -4, "postCountTag" },

  { "postCreditMemo",	-10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Return cannot be posted because it "
			       "has already been posted."),	 0, "" },
  { "postCreditMemo",	-11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Return is on Hold and, thus, cannot "
			       "be posted."),			 0, "" },
  { "postCreditMemo",	-12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Sales Account Assignment for this Return "
			       "is not configured correctly. Because of "
			       "this, G/L Transactions cannot be posted for "
			       "this Return. You must contact your "
			       "Systems Administrator to have this corrected "
			       "before you may post this Return."),
								 0, "" },
  { "postCreditMemo",	-14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Misc. Charge Account Assignment for this Return "
			       "is not configured correctly. Because of "
			       "this, G/L Transactions cannot be posted for "
			       "this Return. You must contact your "
			       "Systems Administrator to have this corrected "
			       "before you may post this Return."),
								 0, "" },
  { "postCreditMemo",	-16, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Freight Account Assignment for this Return "
			       "is not configured correctly. Because of "
			       "this, G/L Transactions cannot be posted for "
			       "this Return. You must contact your "
			       "Systems Administrator to have this corrected "
			       "before you may post this Return."),
								 0, "" },
  { "postCreditMemo",	-18, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The A/R Account Assignment for this Return "
			       "is not configured correctly. Because of "
			       "this, G/L Transactions cannot be posted for "
			       "this Return. You must contact your "
			       "Systems Administrator to have this corrected "
			       "before you may post this Return."),
								 0, "" },

  { "postGLSeries", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post this G/L Series because the "
				 "Accounting Period is closed."), 0, "" },
  { "postGLSeries", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post this G/L Series because the G/L "
			   "Series Discrepancy Account was not found."),
								 0, "" },
  { "postGLSeriesNoSumm", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post this G/L Series because the "
				 "Debits and Credits are unbalanced."), 0, "" },
  { "postGLSeriesNoSumm", -4, "", -4, "postGLSeries" },
  { "postGLSeriesNoSumm", -5, "", -5, "postGLSeries" },

  { "postInvoice",  -1, "", -1, "insertIntoGLSeries" },
  { "postInvoice",  -4, "", -4, "insertIntoGLSeries" },
  { "postInvoice",  -5, "", -5, "postGLSeries" },
  { "postInvoice", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because it has "
			   "already been posted."),		 0, "" },
  { "postInvoice", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because the Sales "
			   "Account was not found."),		 0, "" },
  { "postInvoice", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because there was an "
			   "error processing Line Item taxes."), 0, "" },
  { "postInvoice", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because there was an "
			   "error processing Misc. Line Item taxes."), 0, "" },
  { "postInvoice", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because the Freight "
			   "Account was not found."),		 0, "" },
  { "postInvoice", -15, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because there was an "
			   "error processing Freight taxes."),	 0, "" },
  { "postInvoice", -16, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because there was an "
			   "error processing Tax Adjustments."), 0, "" },
  { "postInvoice", -17, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because the A/R "
			   "Account was not found."),		 0, "" },


  { "postInvTrans",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post an inventory transaction because"
			       " the Item Site has no Control Method or the "
			       "Item has an Item Type of Reference."),
								0, "" },
  { "postInvTrans",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post an inventory transaction because"
			       " the transaction will cause an Average Costed "
			       "Item to go negative which is not allowed."),
								0, "" },
  { "postInvTrans",	-3, "",	 -3, "insertGLTransaction" },
  { "postInvTrans",	-4, "",	 -4, "insertGLTransaction" },

  { "postPoReceipt",	-1, "",	 -1, "postReceipt" },
  { "postPoReceipt",	-2, "",	 -2, "postReceipt" },
  { "postPoReceipt",	-3, "",	 -3, "postReceipt" },
  { "postPoReceipt",	-4, "",	 -4, "postReceipt" },
  { "postPoReceipt",   -10, "",	-10, "postReceipt" },
  { "postPoReceipt",   -11, "", -11, "postReceipt" },
  { "postPoReceipt",   -12, "", -12, "postReceipt" },

  { "postProduction", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Production because the Work Order "
                             "status is not Exploded, Released, or InProcess."), 0, "" },
  { "postProduction", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Production because backflushing "
                             "component usage could not be completed due "
                             "to missing Item Sites."),		 0, "" },
  { "postProduction", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Production because of missing "
                           "Item Site or Cost Category."), 0, "" },

  { "postReceipt",  -1, "",	 -1, "postInvTrans" },
  { "postReceipt",  -2, "",	 -2, "postInvTrans" },
  { "postReceipt",  -3, "",	 -3, "insertGLTransaction" },
  { "postReceipt",  -4, "",	 -4, "insertGLTransaction" },
  { "postReceipt", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Receipt Line has already been posted."),
  									0, "" },
  { "postReceipt", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Receipt Line cannot be "
			   "posted because it has a quantity of 0."),	0, "" },
  { "postReceipt", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Purchase Order Receipt Line has no "
			   "Standard Cost assigned to it."),		0, "" },
  { "postReceipt", -16, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot not issue item to shipping. "
			   "No Sales Order item found against this PO Item."), 0, "" },
  { "postReceipt", -17, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot not issue item to shipping. "
			   "Inventory history not found."),		0, "" },
  { "postReceipt", -20, "", -1, "issueToShipping" },
  { "postReceipt", -21, "", -10, "issueToShipping" },
  { "postReceipt", -22, "", -12, "issueToShipping" },
  { "postReceipt", -23, "", -13, "issueToShipping" },
  { "postReceipt", -24, "", -14, "issueToShipping" },
  { "postReceipt", -25, "", -15, "issueToShipping" },
  { "postReceipt", -26, "", -12, "shipShipment" },
  { "postReceipt", -27, "", -13, "shipShipment" },
  { "postReceipt", -28, "", -14, "shipShipment" },
  { "postReceipt", -29, "", -15, "shipShipment" },
  { "postReceipt", -30, "", -1, "shipShipment" },
  { "postReceipt", -31, "", -3, "shipShipment" },
  { "postReceipt", -32, "", -4, "shipShipment" },
  { "postReceipt", -33, "", -5, "shipShipment" },
  { "postReceipt", -34, "", -6, "shipShipment" },
  { "postReceipt", -35, "", -8, "shipShipment" },
  { "postReceipt", -36, "", -50, "shipShipment" },
  { "postReceipt", -37, "", -99, "shipShipment" },

  { "postPoReceipts",   -1, "",	 -1, "postPoReceipt" },
  { "postPoReceipts",   -3, "",	 -3, "postPoReceipt" },
  { "postPoReceipts",   -4, "",	 -4, "postPoReceipt" },
  { "postPoReceipts",  -10, "",	-10, "postPoReceipt" },
  { "postPoReceipts",  -12, "",	-12, "postPoReceipt" },

  { "postPoReturns", -1, "", -1, "postInvTrans" },
  { "postPoReturns", -3, "", -3, "insertGLTransaction" },
  { "postPoReturns", -4, "", -4, "insertGLTransaction" },

  { "postVoucher",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Cost Category for one or more Item Sites "
			       "for the Purchase Order covered by this Voucher "
			       "is not configured with Purchase Price Variance "
			       "or P/O Liability Clearing Account Numbers or "
			       "the Vendor of this Voucher is not configured "
			       "with an A/P Account Number. Because of this, "
			       "G/L Transactions cannot be posted for this "
			       "Voucher."),
								0, "" },

  { "recallShipment",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled because it "
			       "does not appear to have been shipped."),
								0, "" },
  { "recallShipment",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled because it "
			       "appears to have been invoiced."),
								0, "" },
  { "recallShipment",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled "
			       "because it has already been received "
			       "at its destination."),		0, "" },
{ "recallShipment",	-4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled because it "
                             "appears to have been invoiced and the invoice has been posted."),
                                                              0, "" },
  { "recallShipment",	-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled because it "
			       "contains one or more Line Items with Site/"
			       "Product Category/Customer combinations that "
			       "have not been properly described in Sales "
			       "Account Assignments. These assignments must be "
			       "made before G/L Transactions can be posted and"
			       "this Sales Order is allowed to be recalled."),
								0, "" },
  { "recallShipment",	-6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled "
                             "because the associated Transfer Order is closed."),		0, "" },

  { "releasePurchaseOrder",
			-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot release this Purchase Order because it "
			       "does not have any unreleased Purchase Order Items."),	0, "" },

  { "releaseTransferOrder", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot release this Transfer Order because "
                                   "it does not have any line items."), 0, "" },
  { "releaseUnusedBillingHeader",
			-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot release this Billing Header because it "
			       "has already been posted."),	0, "" },
  { "releaseUnusedBillingHeader",
			-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot release this Billing Header because it "
			       "has Line Items."), 		0, "" },

  { "relocateInventory", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You cannot Relocate more inventory than is "
                                "available."),                  0, "" },

  { "replaceAllVoidedChecks", -1, "", -1, "replaceVoidedCheck" },

  { "replaceVoidedCheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot replace this voided Payment because "
				 "either it has not been voided, it has "
				 "already been posted, or it has already been"
				 "replaced."), 0, "" },

  { "returnCompleteShipment",
			-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either a Cost Category for the Items you are "
			       "trying to Return is not configured with a "
			       "Shipping Asset Account Number or a Customer "
			       "Type/Product Category/Site Sales Account "
			       "assignment does not exist . Because of this, " 
			       "G/L Transactions cannot be posted for this "
			       "Return. You must contact your Systems "
			       "Administrator to have this corrected before "
			       "you may Return this Shipment."),
								0, "" },
  { "returnItemShipments", -1, "", -1, "postInvTrans" },
  { "returnItemShipments",
			-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either a Cost Category for the Items you are "
			       "trying to Return is not configured with a "
			       "Shipping Asset Account Number or a Customer "
			       "Type/Product Category/Site Sales Account "
			       "assignment does not exist . Because of this, " 
			       "G/L Transactions cannot be posted for this "
			       "Return. You must contact your Systems "
			       "Administrator to have this corrected before "
			       "you may Return this Shipment."),
								0, "" },

  { "returnShipmentTransaction",
			-5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either a Cost Category for the Items you are "
			       "trying to Return is not configured with a "
			       "Shipping Asset Account Number or a Customer "
			       "Type/Product Category/Site Sales Account "
			       "assignment does not exist . Because of this, " 
			       "G/L Transactions cannot be posted for this "
			       "Return. You must contact your Systems "
			       "Administrator to have this corrected before "
			       "you may Return this Shipment."),
								0, "" },

  { "reverseCashReceipt", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed as "
			      "the amount distributed is greater than the "
			      "amount received."),	0, "" },
  { "reverseCashReceipt", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed as "
			      "the amount received must be greater than zero."),	0, "" },
  { "reverseCashReceipt", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed as "
                               "the A/R Account cannot be determined. You must "
			       "make an A/R Account Assignment for the "
			       "Customer Type to which this Customer is "
			       "assigned before you may reverse this Cash "
			       "Receipt."),				0, "" },
  { "reverseCashReceipt", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed as "
			      "the Bank Account cannot be determined. You must "
			      "make a Bank Account Assignment for this Cash "
			      "Receipt before you may reverse it." ),	0, "" },
  { "reverseCashReceipt", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed, "
			      "probably because the Customer's Prepaid Account "
			      "was not found."),			0, "" },
  { "reverseCashReceipt", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot reverse this Cash Receipt because the "
                            "credit card records could not be found."),  0, "" },

  { "saveAlarm", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "An alarm for this item already exists."), 0, "" },

  { "selectForBilling",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The quantity you have approved for Billing is "
			       "less than the quantity shipped. You may not "
			       "bill for less than the quantity shipped."),
								0, "" },

  { "selectPayment",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Document cannot be approved because it "
                                            "cannot be found or is the wrong document type."),
    0, "" },
  { "selectPayment",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Document cannot be approved because the "
                                            "balance is less than the amount plus discount."),
    0, "" },
  { "selectPayment",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Bank account company does not match "
                                            "the voucher distribution account company."),
    0, "" },
  
  { "shipShipment",  -1, "",	 -1, "postInvTrans"		},
  { "shipShipment",  -3, "",	 -3, "insertGLTransaction"	},
  { "shipShipment",  -4, "",	 -4, "insertGLTransaction"	},
  { "shipShipment",  -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order may not be shipped as it "
			    "contains one or more Line Items that have "
			    "Site/Product Category/Customer combinations "
			    "that have not been properly described in Sales "
			    "Account Assignments.  These assignments must be "
			    "made before G/L Transactions can be posted and "
			    "this Sales Order is allowed to ship."),	0, "" },
  { "shipShipment",  -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order may not be shipped "
			    "because there is no Item Site for the "
			    "Transit Site."),			0, "" },
  { "shipShipment",  -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Shipment cannot be shipped because it "
			    "appears to have already shipped."),	0, "" },
  { "shipShipment", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Order is on Credit Hold and must be "
			    "taken off of Credit Hold before it "
			    "may be shipped."),				0, "" },
  { "shipShipment", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Order is on Packing Hold and must be "
			     "taken off of Packing Hold before it "
			     "may be shipped."),			0, "" },
  { "shipShipment", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Order is on Return Hold. The Customer"
			     " must return all materials for a related Return "
			     "Authorization before this order may be shipped."),
			     						0, "" },
  { "shipShipment", -15, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Order is on Shipping Hold and must "
			     "be taken off of Shipping Hold before it "
			     "may be shipped."),			0, "" },
  { "shipShipment", -50, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Shipment cannot be shipped because it "
			    "does not appear to exist."),		0, "" },
  { "shipShipment", -99, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Order may not be shipped because it has been "
			    "marked as Ship Complete and quantities for one or "
			    "more Line Items are still not completely issued. "
			    "Please correct this before shipping the Order."),
									0, "" },
  { "splitReceipt", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Only Purchase Order Receipts may be split."),		0, "" },
  { "splitReceipt", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Only posted receipts may be split."),		0, "" },
  { "splitReceipt", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Vouchered receitps may not be split."),		0, "" },
  { "splitReceipt", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Split quantity must me less than original receipt quantity."),		0, "" },
  { "splitReceipt", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Split freight may not be greater than original freight."),		0, "" },
  { "splitReceipt", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Receipt not found."),		0, "" },
  { "splitReceipt", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The split quantity must be a positive number."),		0, "" },

  { "splitRecurrence", -10, "",                   -10, "createRecurringItems" },
  { "splitRecurrence", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create recurring items without a valid "
                               "parent item to copy."),                 0, "" },

  { "sufficientInventoryToShipItem", -1,
	    QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot figure out which line item to issue."),	0, "" },
  { "sufficientInventoryToShipItem", -2,
	    QT_TRANSLATE_NOOP("storedProcErrorLookup", "There is not enough Inventory to issue the amount required of "
	       "Item %1 in Site %2."),			0, "" },
  { "sufficientInventoryToShipItem", -3, 
            QT_TRANSLATE_NOOP("storedProcErrorLookup", "Item Number %1 in Site %2 is a Multiple Location or "
               "Lot/Serial controlled Item which is short on Inventory. "
               "This transaction cannot be completed as is. Please make "
               "sure there is sufficient Quantity on Hand before proceeding."),
								0, "" },
  { "sufficientInventoryToShipItem", -4,
    QT_TRANSLATE_NOOP("storedProcErrorLookup", "There is not enough Inventory Reserved to issue the amount required of "
                      "Item %1 in Site %2."),			0, "" },
  { "sufficientInventoryToShipItem", -11,
            QT_TRANSLATE_NOOP("storedProcErrorLookup", "Invalid Order Type.  Only Sales Orders and Transfer Orders "
               "may be shipped from this window."),
								0, "" },                            
  { "sufficientInventoryToShipOrder", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot check inventory levels for"
                                             "an invalid item."),       0, ""},
  { "sufficientInventoryToShipOrder", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There is not enough Inventory to "
                                             "issue the amount required of one "
                                             "of the items requested."),0, ""},
  { "sufficientInventoryToShipOrder", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "One of the requested items is a "
                                             "Multiple Location or Lot/Serial "
                                             "controlled Item which is sort on "
                                             "Inventory."),             0, ""},
  { "sufficientInventoryToShipOrder", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There is not enough Inventory Reserved to "
                                                            "issue the amount required of one "
                                                            "of the items requested."),0, ""},
  { "sufficientInventoryToShipOrder",-11, "",-11, "sufficientInventoryToShipItem"},

  { "thawAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot thaw this Accounting Period "
				     "because it is closed."), 0, "" },

  { "thawAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot thaw this Accounting Period "
				     "because it is not frozen."), 0, "" },

  { "todoItemMove",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot change the Sequence of a non-existent "
			       "To-Do List Item. Possible cause: no To-Do "
			       "List Item was selected."),
								0, "" },

  { "unreleasePurchaseOrder",
    -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot unrelease this Purchase Order because it "
                          "has in process Purchase Order Items."),	0, "" },
  
  { "updateTodoItem",	-1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be updated as "
			       "there is no assigned User."),	0, "" },
  { "updateTodoItem",	-2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be updated as "
			       "the Task Name is blank."),	0, "" },
  { "updateTodoItem",	-3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be updated as "
			       "there is no Due Date."),	0, "" },
  { "updateTodoItem",  -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be updated as "
			       "an invalid internal ID was supplied ."),
								 0, "" },

  { "voidAPOpenVoucher", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot Void Voucher Id % as apopen not found. "),				0, "" },
  { "voidAPOpenVoucher", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot Void Voucher #% as vohead not found. "),				0, "" },
  { "voidAPOpenVoucher", -30, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot Void Voucher #% as applications exist. "),				0, "" },
  { "voidAPOpenVoucher", -40, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot Void Voucher #% due to unassigned G/L Accounts. "),				0, "" },
  { "voidAPOpenVoucher", -50, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot Void Voucher #% due to unassigned G/L Accounts. "),				0, "" },
  { "voidAPOpenVoucher", -60, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot Void Voucher #% due to an unassigned A/P Account. "),				0, "" },
  { "voidAPOpenVoucher", -70, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Credit application failed with result %. "),				0, "" },

  { "voidCheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this Payment because either it has already "
			"been voided, posted, or replaced, or it has been "
			"transmitted electronically. If this Payment has been "
			"posted, try Void Posted Payment with the Payment Register "
			"window."),					0, "" },

  { "voidCreditMemo",  -1, "", -1, "insertIntoGLSeries" },
  { "voidCreditMemo",  -4, "", -4, "insertIntoGLSeries" },
  { "voidCreditMemo",  -5, "", -5, "postGLSeries" },
  { "voidCreditMemo", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Credit Memo because it has "
                         "not been posted."),		 0, "" },
  { "voidCreditMemo", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Credit Memo because the Sales "
                         "Account was not found."),		 0, "" },
  { "voidCreditMemo", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Credit Memo because there "
                         "A/R Applications posted against this Credit Memo."), 0, "" },

  { "voidInvoice",  -1, "", -1, "insertIntoGLSeries" },
  { "voidInvoice",  -4, "", -4, "insertIntoGLSeries" },
  { "voidInvoice",  -5, "", -5, "postGLSeries" },
  { "voidInvoice", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Invoice because it has "
                         "not been posted."),		 0, "" },
  { "voidInvoice", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Invoice because the Sales "
                         "Account was not found."),		 0, "" },
  { "voidInvoice", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Invoice because there "
                         "A/R Applications posted against this Invoice."), 0, "" },

  { "voidPostedCheck", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this Payment because it has already "
			       "been voided."),				0, "" },
  { "voidPostedCheck", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this Payment because the recipient "
			       "type is not valid."),			0, "" },
  { "voidPostedCheck", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this Payment because the Expense "
			       "Category could not be found."),		0, "" },
  { "voidPostedCheck", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this Payment because the Ledger Account "
			       "to which the funds should be credited is not "
			       "valid."),				0, "" },
  { "voidPostedCheck", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this Payment because the Payment has "
			       "has been reconciled in Bank Reconciliation."),		0, "" },

  { "replaceVoidedCheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot replace a Payment that is not voided "
                                 "or has already been posted or replaced."),
                                                                        0, "" },
  { "replaceVoidedCheck", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot replace this voided Payment because "
                                 "one of its line items has been reapproved "
                                 "for billing and is represented on another "
                                 "Payment."),                             0, "" },

  { "reserveSoLineBalance", -1, "", -1, "reserveSoLineQty" },
  { "reserveSoLineBalance", -2, "", -2, "reserveSoLineQty" },
  { "reserveSoLineBalance", -3, "", -3, "reserveSoLineQty" },

  { "reserveSoLineQty", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot reserve more quantity than remaining on order."), 0, ""},
  { "reserveSoLineQty", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot reserve negative quantities."), 0, ""},
  { "reserveSoLineQty", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot reserve more quantity than currently on hand and already reserved."), 0, ""},


  { "woClockIn",  -1, "", -1, "explodeWo" },
  { "woClockIn",  -2, "", -2, "explodeWo" },
  { "woClockIn",  -3, "", -3, "explodeWo" },
  { "woClockIn",  -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded as it seems to have "
			 "an invalid Order Quantity."),			0, "" },
  { "woClockIn", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 has at least one Item in its Bill of "
			 "Materials with the Push issue method that has not "
			 "yet been issued. You must issue all Push Items "
			 "to this Work Order."),			0, "" },
  { "woClockIn", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 has at least one Item in its Bill of "
			 "Materials with the Push issue method that does not "
			 "have the required quantity issued. You must issue "
			 "all Push Items to this Work Order."),		0, "" },
  { "woClockIn", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 is closed."),			0, "" },
};

void initErrorLookupHash()
{
  if (! ErrorLookupHash.isEmpty())
  {
    QMessageBox::critical(0, QCoreApplication::translate("storedProcErrorLookup", "ErrorLookupHash initialization error"),
		QCoreApplication::translate("storedProcErrorLookup", "ErrorLookupHash has already been initialized."));
    return;
  }

  unsigned int numElems = sizeof(errors) / sizeof(errors[0]);
  for (unsigned int i = 0; i < numElems; i++)
  {
    QPair<int, QString> currPair;
    if (errors[i].msgPtr == 0)
      currPair = qMakePair(errors[i].retVal, QCoreApplication::translate("storedProcErrorLookup", errors[i].msg));
    else
    {
      QList<QPair<int, QString> > proxyList;

      QString proxyname;
      if (errors[i].proxyName.isEmpty())
	proxyname = errors[i].procName.toUpper();
      else
	proxyname = errors[i].proxyName.toUpper();

      proxyList = ErrorLookupHash.values(proxyname);

      if (proxyList.size() > 0)
      {
	int proxyIndex;
	for (proxyIndex = 0; proxyIndex < proxyList.size(); proxyIndex++)
	{
	  if (proxyList.at(proxyIndex).first == errors[i].msgPtr)
	  {
	    currPair = qMakePair(errors[i].retVal,
				 QString(proxyList.at(proxyIndex).second));
	    break;
	  }
	}

	if (proxyIndex >= proxyList.size())
	{
          QMessageBox::critical(0, QCoreApplication::translate("storedProcErrorLookup", "Lookup Error"),
                                QCoreApplication::translate("storedProcErrorLookup",
                                   "Could not find (%1, %2) in ErrorLookupHash "
                                   "when trying to insert proxy entry for "
                                   "(%3, %4).")
			   .arg(proxyname).arg(errors[i].msgPtr)
			   .arg(errors[i].procName).arg(errors[i].retVal));
	  continue;
	}
      }
      else // couldn't find proxyList => forward reference
      {
	unsigned int j;
	for (j = i + 1; j < numElems; j++)
	{
	  if (errors[j].retVal == errors[i].msgPtr &&
	      errors[j].procName.toUpper() == proxyname)
	    {
	    currPair = qMakePair(errors[i].retVal,
				 QString(QCoreApplication::translate("storedProcErrorLookup", errors[j].msg)));
	    break;
	    }
	}
	if (j >= numElems)
	{
          QMessageBox::critical(0, QCoreApplication::translate("storedProcErrorLookup", "Lookup Error"),
                                QCoreApplication::translate("storedProcErrorLookup",
                                   "Could not find (%1, %2) in ErrorLookupHash "
                                   "when trying to insert proxy entry for "
                                   "(%3, %4).")
			  .arg(errors[i].proxyName).arg(errors[i].msgPtr)
			  .arg(errors[i].procName).arg(errors[i].retVal));
	continue;
	}
      }
    }

    ErrorLookupHash.insert(errors[i].procName.toUpper(), currPair);
  } // for
}


QString storedProcErrorLookup(const QString procName, const int retVal)
{
  QString returnStr = "";

  if (ErrorLookupHash.isEmpty())
    initErrorLookupHash();

  QList<QPair<int, QString> > list = ErrorLookupHash.values(procName.toUpper());

  for (int i = 0; i < list.size(); i++)
  {
    if (list.at(i).first == retVal)
    {
      returnStr = list.at(i).second;
      break;
    }
  }

  if (returnStr.isEmpty())
    returnStr = QCoreApplication::translate("storedProcErrorLookup", "A Stored Procedure failed to run properly.");

  returnStr = QString("<p>") + returnStr +
	      QString("<br>(%1, %2)<br>").arg(procName).arg(retVal);

  return returnStr;
}