# Cambios en la etiqueta
Se agregaron dos variables nuevas para las etiquetas $V4$ - Número consecutivo $V5$ - Fecha/Hora de ejecución-impresión Se agregó una condición para que el consecutivo se reinicie cada dia. Se arreglaron algunos errores de compilación
This commit is contained in:
@@ -49,7 +49,7 @@ namespace ScaBox30.Controller
|
||||
#endregion
|
||||
|
||||
#region ZEBRA -> buildPrn()
|
||||
public void buildPrn(String v1, String v2, String v3, String barcode)
|
||||
public void buildPrn(String v1, String v2, String v3, String v4, DateTime v5, String barcode)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -85,6 +85,15 @@ namespace ScaBox30.Controller
|
||||
{
|
||||
etiqueta += line.Replace("$V3$", v3);
|
||||
}
|
||||
else if (line.Contains("$V4$"))
|
||||
{
|
||||
etiqueta += line.Replace("$V4$", v4.ToString()); //consecutivo
|
||||
}
|
||||
else if (line.Contains("$V5$"))
|
||||
{
|
||||
// Insert formatted date/time for V5
|
||||
etiqueta += line.Replace("$V5$", v5.ToString("dd/MM/yyyy HH:mm:ss")); // fecha y hora
|
||||
}
|
||||
else
|
||||
{
|
||||
etiqueta += line;
|
||||
@@ -94,7 +103,6 @@ namespace ScaBox30.Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace ScaBox30
|
||||
public static Boolean debug = false;
|
||||
public static Boolean boxcapacity = false;
|
||||
public static Config cfg = new Config();
|
||||
public static int consec = 00000;
|
||||
public static DateTime consecDate = DateTime.MinValue;
|
||||
//Fields
|
||||
|
||||
|
||||
@@ -139,7 +141,7 @@ namespace ScaBox30
|
||||
codigo + ":028," +
|
||||
codigo + ":029," +
|
||||
codigo + ":030";
|
||||
//"0199170978" + ":030";
|
||||
//"ERROR";
|
||||
//"0199170978" + ":030";
|
||||
//"ERROR";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,6 +188,9 @@ namespace ScaBox30
|
||||
// CARGA DE CONFIGURACIONES
|
||||
LoadConfigJson(Globals.config_json);
|
||||
|
||||
// Initialize daily consecutive date to today to avoid unexpected reset on first print
|
||||
Globals.consecDate = DateTime.Today;
|
||||
|
||||
if (Globals.cfg.printerenabled)
|
||||
{
|
||||
btnPrinter.ForeColor = Color.White;
|
||||
@@ -371,8 +374,6 @@ namespace ScaBox30
|
||||
|
||||
string found_code = keyOfMaxCount;
|
||||
element = Globals.actual_data.Find(x => x.CCE.Equals(found_code)); //Busca el elemento que coincide con el codigo -> obtiene fila con la informacion de la etiqueta
|
||||
Console.WriteLine($"Buscando código: '{found_code}'");
|
||||
Console.WriteLine($"Total registros en BD: {Globals.actual_data.Count}");
|
||||
Globals.found_element = element;
|
||||
}
|
||||
|
||||
@@ -409,8 +410,6 @@ namespace ScaBox30
|
||||
System.Threading.Thread.Sleep(Globals.cfg.interval);
|
||||
|
||||
}
|
||||
Console.WriteLine("[DEBUG] BLOAD completado, esperando 300ms para estabilización...");
|
||||
System.Threading.Thread.Sleep(300); // El sensor necesita tiempo después de cambiar programa
|
||||
|
||||
response = "";
|
||||
|
||||
@@ -744,9 +743,6 @@ namespace ScaBox30
|
||||
//disable image clear timer
|
||||
timer1.Enabled = false;
|
||||
|
||||
|
||||
|
||||
|
||||
//Disable button for re-clic and master barcode from being scanned
|
||||
TgrBtn.Enabled = false;
|
||||
UpdateTgrBtn();
|
||||
@@ -815,10 +811,25 @@ namespace ScaBox30
|
||||
}
|
||||
|
||||
|
||||
private Form CreateDataUIInstance()
|
||||
{
|
||||
// Use reflection to instantiate the Form type named "DataUI" (avoids compiler ambiguity if a generated resource class shares the name)
|
||||
var asm = typeof(Principal).Assembly;
|
||||
var dataUiType = asm.GetTypes().FirstOrDefault(t => t.Name == "DataUI" && typeof(Form).IsAssignableFrom(t));
|
||||
if (dataUiType != null)
|
||||
{
|
||||
return Activator.CreateInstance(dataUiType) as Form;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void btnBD_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
DataUI data = new DataUI();
|
||||
data.ShowDialog();
|
||||
var dataForm = CreateDataUIInstance();
|
||||
if (dataForm != null)
|
||||
{
|
||||
dataForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -920,7 +931,6 @@ namespace ScaBox30
|
||||
string sr2000w_ip;
|
||||
sr2000w_ip = Globals.cfg.ipscanner;
|
||||
|
||||
|
||||
if (reader_found)
|
||||
{
|
||||
//Stop liveview.
|
||||
@@ -1165,16 +1175,26 @@ namespace ScaBox30
|
||||
|
||||
if (Globals.cfg.printerenabled)
|
||||
{
|
||||
// Reset daily consecutive counter if day changed
|
||||
if (Globals.consecDate.Date != DateTime.Today)
|
||||
{
|
||||
Globals.consec = 0;
|
||||
Globals.consecDate = DateTime.Today;
|
||||
}
|
||||
|
||||
string etiqueta = barcode_lbl.Text;
|
||||
|
||||
if (Globals.found_element.CCE == etiqueta)
|
||||
{
|
||||
String v1 = Globals.found_element.nom_1;
|
||||
String v2 = Globals.found_element.@base + " / " + Globals.found_element.addition + " " + Globals.found_element.oeil;
|
||||
String v3 = btnToogleMode.Text == operation_mode.manual ? "" : completa_parcial + " contiene: " + ok_count.ToString() + " de: " + Globals.found_element.Box_Capacity.Substring(0, 2);
|
||||
//String v3 = btnToogleMode.Text == operation_mode.manual ? "" : completa_parcial + " contiene: " + ok_count.ToString() + " de: " + Globals.found_element.Box_Capacity.Substring(0,2);
|
||||
String v3 = btnToogleMode.Text == operation_mode.manual ? "" : completa_parcial + ok_count.ToString() + " de " + Globals.found_element.Box_Capacity.Substring(0, 2);
|
||||
String v4 = Globals.consec.ToString(); //Numero consecutivo
|
||||
DateTime v5 = DateTime.Now; //Fecha y hora de impresión
|
||||
String barcode = Globals.found_element.CCE;
|
||||
|
||||
ZT231.buildPrn(v1, v2, v3, barcode);
|
||||
ZT231.buildPrn(v1, v2, v3, v4, v5, barcode);
|
||||
|
||||
switch (Globals.cfg.printertype)
|
||||
{
|
||||
@@ -1186,6 +1206,7 @@ namespace ScaBox30
|
||||
break;
|
||||
}
|
||||
}
|
||||
Globals.consec++;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1258,4 +1279,4 @@ namespace ScaBox30
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user