fix bugs
This commit is contained in:
+12
-5
@@ -10,6 +10,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
|
||||
@@ -30,7 +31,10 @@ namespace SafeBagDE70
|
||||
public static ListView logListView = null;
|
||||
public static int MaxLogCount = 500;
|
||||
public static int MaxNotes = 300;
|
||||
public static string BaseURL = "";
|
||||
public static int TenantId = 0;
|
||||
public static DeviceStatus? DeviceStatus = null;
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
|
||||
@@ -55,7 +59,7 @@ namespace SafeBagDE70
|
||||
DeviceStatus = new DeviceStatus
|
||||
{
|
||||
Device = Environment.MachineName,
|
||||
TenantId = 5,
|
||||
TenantId = AppData.TenantId,
|
||||
Status = 0,
|
||||
CDMStatus = 0,
|
||||
PrinterStatus = 0,
|
||||
@@ -70,8 +74,9 @@ namespace SafeBagDE70
|
||||
public static void GetNewTransactionCode()
|
||||
{
|
||||
DateTime transactionDateTime = DateTime.Now;
|
||||
string merchantCode = CurrentCustomerAccount.CustomerId;
|
||||
|
||||
|
||||
var match = Regex.Match(CurrentCustomerAccount.CustomerId, @"\d+$");
|
||||
string merchantCode_part = match.Value;
|
||||
// Adjust transaction date if it's past cut-off time (12:00 noon)
|
||||
DateTime prevadjustedDate = CurrentCustomerAccount.TransactionTime.Hour >= CutOffTime.Hour ? transactionDateTime.Date : transactionDateTime.Date.AddDays(-1);
|
||||
|
||||
@@ -90,7 +95,7 @@ namespace SafeBagDE70
|
||||
string transactionCountPart = transactionCount.ToString("D2"); // Ensure 2 digits
|
||||
|
||||
// Combine all parts to form the transaction ID
|
||||
string transactionId = $"{datePart}{timePart}{merchantCode}{transactionCountPart}";
|
||||
string transactionId = $"{datePart}{timePart}{merchantCode_part}{transactionCountPart}";
|
||||
|
||||
CurrentCustomerAccount.TransactionCode = transactionId;
|
||||
CurrentCustomerAccount.TransactionTime = transactionDateTime;
|
||||
@@ -114,8 +119,9 @@ namespace SafeBagDE70
|
||||
AppData.CDMSTATE.IsRejectPocketFull = data[3] & 0x40;
|
||||
AppData.CDMSTATE.IsNotesInRejectPocket = data[3] & 0x10;
|
||||
AppData.CDMSTATE.IsNotesInHopper = data[3] & 0x01;
|
||||
AppData.CDMSTATE.IsStackerFull = (data[2] == 0x43?1:0);
|
||||
|
||||
if (data[0] == 0x40 && data[1] == 0x07 && data[2] == 0x41)
|
||||
if (data[0] == 0x40 && data[1] == 0x07)
|
||||
AppData.CDMSTATE.IsError = 0;
|
||||
else
|
||||
AppData.CDMSTATE.IsError = 1;
|
||||
@@ -270,6 +276,7 @@ namespace SafeBagDE70
|
||||
public int IsRejectPocketFull = 0;
|
||||
public int IsNotesInRejectPocket = 0;
|
||||
public int IsNotesInHopper = 0;
|
||||
public int IsStackerFull = 0;
|
||||
public int IsError = 0;
|
||||
public RecvData? RecvDat = null;
|
||||
public byte GetSR1()
|
||||
|
||||
Reference in New Issue
Block a user