|
|
@@ -37,7 +37,8 @@ namespace BulkPrinting
|
|
37
|
37
|
|
|
38
|
38
|
public static string GetPrinterInitString(DBHelper db)
|
|
39
|
39
|
{
|
|
40
|
|
- var hex = GetSavedParameter(db, "PrinterInitString");
|
|
|
40
|
+ //var hex = GetSavedParameter(db, "PrinterInitString");
|
|
|
41
|
+ var hex = Globals.DefaultPrinterInitString;
|
|
41
|
42
|
return Encoding.ASCII.GetString(HexStringToBytes(hex));
|
|
42
|
43
|
}
|
|
43
|
44
|
|
|
|
@@ -438,10 +439,10 @@ namespace BulkPrinting
|
|
438
|
439
|
string VendorId = Globals.SessionData.Credentials.Payload.Vendor.id.ToString();
|
|
439
|
440
|
|
|
440
|
441
|
var PrinterInitString = GetPrinterInitString(db);
|
|
441
|
|
- int initJobID = Globals.MaxPrinter.Open("Printer_Init");
|
|
|
442
|
+ int initJobID = Globals.MaxPrinter.Open("Vouchers");
|
|
442
|
443
|
if (initJobID == 0) return;
|
|
443
|
444
|
Globals.MaxPrinter.Print(PrinterInitString.ToString());
|
|
444
|
|
- Globals.MaxPrinter.Close();
|
|
|
445
|
+ //Globals.MaxPrinter.Close();
|
|
445
|
446
|
|
|
446
|
447
|
List<EventLog> LogEvents = new List<EventLog>();
|
|
447
|
448
|
|
|
|
@@ -453,8 +454,8 @@ namespace BulkPrinting
|
|
453
|
454
|
{
|
|
454
|
455
|
using (SQLiteDataReader read = Command.ExecuteReader())
|
|
455
|
456
|
{
|
|
456
|
|
- int JobID = Globals.MaxPrinter.Open("Vouchers");
|
|
457
|
|
- if (JobID == 0) return;
|
|
|
457
|
+ //int JobID = Globals.MaxPrinter.Open("Vouchers");
|
|
|
458
|
+ //if (JobID == 0) return;
|
|
458
|
459
|
while (read.Read())
|
|
459
|
460
|
{
|
|
460
|
461
|
VoucherCount++;
|
|
|
@@ -477,13 +478,13 @@ namespace BulkPrinting
|
|
477
|
478
|
if (VoucherCount >= 5 || TotalCount == (EndSeqNo - StartSeqNo))
|
|
478
|
479
|
{
|
|
479
|
480
|
RowCount++;
|
|
480
|
|
- string PrintRow = "\r\n\n\n ";
|
|
|
481
|
+ string PrintRow = "\r\n\n\n\x1B\x50 ";
|
|
481
|
482
|
for (int Column = 0; Column < VoucherRow.Count(); Column++)
|
|
482
|
483
|
{
|
|
483
|
484
|
IndividualVoucher = VoucherRow[Column];
|
|
484
|
|
- PrintRow += (Column == 2 ? " " : "") + (" " + IndividualVoucher.DecryptedPIN).PadRight(30, ' ');
|
|
|
485
|
+ PrintRow += (Column == 3 ? " " : "") + (IndividualVoucher.DecryptedPIN).PadRight(25, ' ');
|
|
485
|
486
|
}
|
|
486
|
|
- PrintRow = PrintRow.TrimEnd() + "\r\n\n ";
|
|
|
487
|
+ PrintRow = PrintRow.TrimEnd() + "\x1B\x4D\r\n\n ";
|
|
487
|
488
|
for (int Column = 0; Column < VoucherRow.Count(); Column++)
|
|
488
|
489
|
{
|
|
489
|
490
|
IndividualVoucher = VoucherRow[Column];
|
|
|
@@ -492,25 +493,25 @@ namespace BulkPrinting
|
|
492
|
493
|
{
|
|
493
|
494
|
SerialNumberTrimmed = SerialNumberTrimmed.Substring(0, 24);
|
|
494
|
495
|
}
|
|
495
|
|
- PrintRow += (Column == 2 ? " " : "") + SerialNumberTrimmed.PadRight(30, ' ');
|
|
|
496
|
+ PrintRow += (Column == 3 ? " " : "") + SerialNumberTrimmed.PadRight(30, ' ');
|
|
496
|
497
|
}
|
|
497
|
498
|
PrintRow = PrintRow.TrimEnd() + "\r\n ";
|
|
498
|
499
|
for (int Column = 0; Column < VoucherRow.Count(); Column++)
|
|
499
|
500
|
{
|
|
500
|
501
|
IndividualVoucher = VoucherRow[Column];
|
|
501
|
502
|
int CurrentPage = (int)Math.Ceiling(((decimal)IndividualVoucher.SequenceNumber) / 20);
|
|
502
|
|
- PrintRow += (Column == 2 ? " " : "") + String.Format("{0}/{1}/{2}", IndividualVoucher.BatchId, IndividualVoucher.SequenceNumber, PageCount).PadRight(30, ' ');
|
|
|
503
|
+ PrintRow += (Column == 3 ? " " : "") + String.Format("{0}/{1}/{2}", IndividualVoucher.BatchId, IndividualVoucher.SequenceNumber, PageCount).PadRight(30, ' ');
|
|
503
|
504
|
}
|
|
504
|
505
|
PrintRow = PrintRow.TrimEnd() + "\r\n ";
|
|
505
|
506
|
for (int Column = 0; Column < VoucherRow.Count(); Column++)
|
|
506
|
507
|
{
|
|
507
|
508
|
IndividualVoucher = VoucherRow[Column];
|
|
508
|
|
- PrintRow += (Column == 2 ? " " : "") + IndividualVoucher.Description.PadRight(30, ' ');
|
|
|
509
|
+ PrintRow += (Column == 3 ? " " : "") + IndividualVoucher.Description.PadRight(30, ' ');
|
|
509
|
510
|
}
|
|
510
|
511
|
PrintRow = PrintRow.TrimEnd() + "\r\n ";
|
|
511
|
512
|
for (int Column = 0; Column < VoucherRow.Count(); Column++)
|
|
512
|
513
|
{
|
|
513
|
|
- PrintRow += (Column == 2 ? " " : "") + VendorId.PadRight(30, ' ');
|
|
|
514
|
+ PrintRow += (Column == 3 ? " " : "") + VendorId.PadRight(30, ' ');
|
|
514
|
515
|
}
|
|
515
|
516
|
|
|
516
|
517
|
PrintRow = PrintRow.TrimEnd() + "\r\n\n\n\n\n\n\n\n\n\n";
|
|
|
@@ -536,9 +537,10 @@ namespace BulkPrinting
|
|
536
|
537
|
}
|
|
537
|
538
|
TotalCount++;
|
|
538
|
539
|
}
|
|
539
|
|
- Globals.MaxPrinter.Close();
|
|
|
540
|
+ //Globals.MaxPrinter.Close();
|
|
540
|
541
|
}
|
|
541
|
542
|
}
|
|
|
543
|
+ Globals.MaxPrinter.Close();
|
|
542
|
544
|
LogBulkEvents(db, LogEvents);
|
|
543
|
545
|
}
|
|
544
|
546
|
|