Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| edf6109aa2 | |||
| eae6fc8b3a | |||
| 1bacbae673 |
20
Changelog.md
20
Changelog.md
@ -1,5 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
## 1.3.1 - 2026-02-32 - Add PackageListNumber
|
||||
### New Features
|
||||
* Add a Filed for Package List Number, so that multiple Shipments can be tracked
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.3.0 - 2026-02-19 - Change DataMatrix to real Json
|
||||
### New Features
|
||||
### Bugfixes
|
||||
### Changes
|
||||
* Change the Barcode to real json, so a , in a textfield not crashes the scanning.
|
||||
* Change the LabelCount Collumn to a Checkbox. When checked it only printed one Label.
|
||||
|
||||
## 1.2.0 - 2026-02-18 - Fix Quantity on Labels so that you can recieve only partial deliverys
|
||||
### New Features
|
||||
* Add a new Collumn to set the recieved Quantity on the Parts
|
||||
* Draw the Rows in Colurs to that's easier to find the missing ones.
|
||||
### Bugfixes
|
||||
### Changes
|
||||
|
||||
## 1.1.0 - 2016-02-14 - Rewrote to DataGridView
|
||||
### New Features
|
||||
* Rewrote the App, now it's using DataGridView to print Multiple Labels at onces.
|
||||
|
||||
@ -13,7 +13,7 @@ namespace BlubbFish.Applications.Barcodes.Inventree {
|
||||
label.DrawString(part.SKU, new Font("Arial", 10, FontStyle.Bold), Brushes.Black, 100, 33);
|
||||
|
||||
label.DrawString("Quantity", new Font("Arial", 6, FontStyle.Regular), Brushes.Black, 100, 48);
|
||||
label.DrawString(part.Quantity, new Font("Arial", 10, FontStyle.Bold), Brushes.Black, 100, 56);
|
||||
label.DrawString(part.Quantity.ToString(), new Font("Arial", 10, FontStyle.Bold), Brushes.Black, 100, 56);
|
||||
|
||||
label.DrawString("Position", new Font("Arial", 6, FontStyle.Regular), Brushes.Black, 100, 71);
|
||||
label.DrawString(part.CustomerPOLine, new Font("Arial", 10, FontStyle.Bold), Brushes.Black, 100, 79);
|
||||
|
||||
164
InventreeBarcodeGenerator/Form1.Designer.cs
generated
164
InventreeBarcodeGenerator/Form1.Designer.cs
generated
@ -53,6 +53,12 @@
|
||||
this.buttonNone = new Button();
|
||||
this.buttonAll = new Button();
|
||||
this.dataGridView1 = new DataGridView();
|
||||
this.Pos = new DataGridViewTextBoxColumn();
|
||||
this.Print = new DataGridViewCheckBoxColumn();
|
||||
this.Bag = new DataGridViewCheckBoxColumn();
|
||||
this.Teil = new DataGridViewTextBoxColumn();
|
||||
this.Sku = new DataGridViewTextBoxColumn();
|
||||
this.Got = new DataGridViewTextBoxColumn();
|
||||
this._textServerName = new Label();
|
||||
this.label8 = new Label();
|
||||
this._textPrinterName = new Label();
|
||||
@ -64,11 +70,8 @@
|
||||
this.Druckereinstellungen = new TabPage();
|
||||
this._checkBox_Landscape = new CheckBox();
|
||||
this._buttonSaveSettings2 = new Button();
|
||||
this.Column1 = new DataGridViewCheckBoxColumn();
|
||||
this.Column4 = new DataGridViewTextBoxColumn();
|
||||
this.Column2 = new DataGridViewTextBoxColumn();
|
||||
this.Column3 = new DataGridViewTextBoxColumn();
|
||||
this.Column6 = new DataGridViewTextBoxColumn();
|
||||
this.label7 = new Label();
|
||||
this.textBox1 = new TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this._mainTabBox.SuspendLayout();
|
||||
@ -80,7 +83,7 @@
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Location = new Point(907, 104);
|
||||
this.pictureBox1.Location = new Point(1298, 187);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new Size(488, 228);
|
||||
this.pictureBox1.TabIndex = 0;
|
||||
@ -154,7 +157,7 @@
|
||||
//
|
||||
// _buttonPrint
|
||||
//
|
||||
this._buttonPrint.Location = new Point(1323, 608);
|
||||
this._buttonPrint.Location = new Point(1711, 608);
|
||||
this._buttonPrint.Name = "_buttonPrint";
|
||||
this._buttonPrint.Size = new Size(94, 29);
|
||||
this._buttonPrint.TabIndex = 8;
|
||||
@ -192,7 +195,7 @@
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new Point(907, 80);
|
||||
this.label5.Location = new Point(1298, 164);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new Size(68, 20);
|
||||
this.label5.TabIndex = 12;
|
||||
@ -215,7 +218,7 @@
|
||||
// _buttonQueryPo
|
||||
//
|
||||
this._buttonQueryPo.Image = Properties.Resources.arrow_reload_24;
|
||||
this._buttonQueryPo.Location = new Point(840, 6);
|
||||
this._buttonQueryPo.Location = new Point(866, 6);
|
||||
this._buttonQueryPo.Name = "_buttonQueryPo";
|
||||
this._buttonQueryPo.Size = new Size(56, 29);
|
||||
this._buttonQueryPo.TabIndex = 15;
|
||||
@ -227,7 +230,7 @@
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new Point(6, 6);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new Size(828, 28);
|
||||
this.comboBox1.Size = new Size(854, 28);
|
||||
this.comboBox1.TabIndex = 16;
|
||||
this.comboBox1.SelectedIndexChanged += this.comboBox1_SelectedIndexChanged;
|
||||
//
|
||||
@ -237,7 +240,7 @@
|
||||
this.statusStrip1.Items.AddRange(new ToolStripItem[] { this._statusLabel });
|
||||
this.statusStrip1.Location = new Point(0, 640);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new Size(1433, 26);
|
||||
this.statusStrip1.Size = new Size(1821, 26);
|
||||
this.statusStrip1.TabIndex = 20;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
@ -255,11 +258,13 @@
|
||||
this._mainTabBox.Location = new Point(12, 12);
|
||||
this._mainTabBox.Name = "_mainTabBox";
|
||||
this._mainTabBox.SelectedIndex = 0;
|
||||
this._mainTabBox.Size = new Size(1409, 590);
|
||||
this._mainTabBox.Size = new Size(1797, 590);
|
||||
this._mainTabBox.TabIndex = 21;
|
||||
//
|
||||
// Label
|
||||
//
|
||||
this.Label.Controls.Add(this.textBox1);
|
||||
this.Label.Controls.Add(this.label7);
|
||||
this.Label.Controls.Add(this.labelCount);
|
||||
this.Label.Controls.Add(this.buttonNone);
|
||||
this.Label.Controls.Add(this.buttonAll);
|
||||
@ -275,7 +280,7 @@
|
||||
this.Label.Location = new Point(4, 29);
|
||||
this.Label.Name = "Label";
|
||||
this.Label.Padding = new Padding(3);
|
||||
this.Label.Size = new Size(1401, 557);
|
||||
this.Label.Size = new Size(1789, 557);
|
||||
this.Label.TabIndex = 0;
|
||||
this.Label.Text = "Label";
|
||||
this.Label.UseVisualStyleBackColor = true;
|
||||
@ -283,7 +288,7 @@
|
||||
// labelCount
|
||||
//
|
||||
this.labelCount.AutoSize = true;
|
||||
this.labelCount.Location = new Point(677, 526);
|
||||
this.labelCount.Location = new Point(1073, 526);
|
||||
this.labelCount.Name = "labelCount";
|
||||
this.labelCount.Size = new Size(219, 20);
|
||||
this.labelCount.TabIndex = 28;
|
||||
@ -316,7 +321,7 @@
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.AllowUserToResizeRows = false;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Columns.AddRange(new DataGridViewColumn[] { this.Column1, this.Column4, this.Column2, this.Column3, this.Column6 });
|
||||
this.dataGridView1.Columns.AddRange(new DataGridViewColumn[] { this.Pos, this.Print, this.Bag, this.Teil, this.Sku, this.Got });
|
||||
this.dataGridView1.EditMode = DataGridViewEditMode.EditOnKeystroke;
|
||||
this.dataGridView1.Location = new Point(6, 40);
|
||||
this.dataGridView1.MultiSelect = false;
|
||||
@ -324,16 +329,65 @@
|
||||
this.dataGridView1.RowHeadersVisible = false;
|
||||
this.dataGridView1.RowHeadersWidth = 51;
|
||||
this.dataGridView1.ShowEditingIcon = false;
|
||||
this.dataGridView1.Size = new Size(890, 476);
|
||||
this.dataGridView1.Size = new Size(1286, 476);
|
||||
this.dataGridView1.TabIndex = 25;
|
||||
this.dataGridView1.CellContentClick += this.DataGridView1_CellContentClick;
|
||||
this.dataGridView1.CellValueChanged += this.DataGridView1_CellValueChanged;
|
||||
this.dataGridView1.SelectionChanged += this.DataGridView1_SelectionChanged;
|
||||
//
|
||||
// Pos
|
||||
//
|
||||
this.Pos.HeaderText = "Pos";
|
||||
this.Pos.MinimumWidth = 45;
|
||||
this.Pos.Name = "Pos";
|
||||
this.Pos.ReadOnly = true;
|
||||
this.Pos.Resizable = DataGridViewTriState.False;
|
||||
this.Pos.Width = 45;
|
||||
//
|
||||
// Print
|
||||
//
|
||||
this.Print.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
|
||||
this.Print.HeaderText = "Drucken";
|
||||
this.Print.MinimumWidth = 70;
|
||||
this.Print.Name = "Print";
|
||||
this.Print.Resizable = DataGridViewTriState.False;
|
||||
this.Print.Width = 70;
|
||||
//
|
||||
// Bag
|
||||
//
|
||||
this.Bag.HeaderText = "Bag";
|
||||
this.Bag.MinimumWidth = 60;
|
||||
this.Bag.Name = "Bag";
|
||||
this.Bag.Resizable = DataGridViewTriState.True;
|
||||
this.Bag.Width = 60;
|
||||
//
|
||||
// Teil
|
||||
//
|
||||
this.Teil.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.Teil.HeaderText = "Teil";
|
||||
this.Teil.MinimumWidth = 300;
|
||||
this.Teil.Name = "Teil";
|
||||
this.Teil.ReadOnly = true;
|
||||
//
|
||||
// Sku
|
||||
//
|
||||
this.Sku.HeaderText = "SKU";
|
||||
this.Sku.MinimumWidth = 150;
|
||||
this.Sku.Name = "Sku";
|
||||
this.Sku.ReadOnly = true;
|
||||
this.Sku.Width = 150;
|
||||
//
|
||||
// Got
|
||||
//
|
||||
this.Got.HeaderText = "Got";
|
||||
this.Got.MinimumWidth = 50;
|
||||
this.Got.Name = "Got";
|
||||
this.Got.Width = 50;
|
||||
//
|
||||
// _textServerName
|
||||
//
|
||||
this._textServerName.AutoSize = true;
|
||||
this._textServerName.Location = new Point(1237, 80);
|
||||
this._textServerName.Location = new Point(1298, 80);
|
||||
this._textServerName.Name = "_textServerName";
|
||||
this._textServerName.Size = new Size(93, 20);
|
||||
this._textServerName.TabIndex = 23;
|
||||
@ -342,7 +396,7 @@
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new Point(1237, 60);
|
||||
this.label8.Location = new Point(1298, 60);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new Size(53, 20);
|
||||
this.label8.TabIndex = 22;
|
||||
@ -351,7 +405,7 @@
|
||||
// _textPrinterName
|
||||
//
|
||||
this._textPrinterName.AutoSize = true;
|
||||
this._textPrinterName.Location = new Point(1237, 23);
|
||||
this._textPrinterName.Location = new Point(1298, 23);
|
||||
this._textPrinterName.Name = "_textPrinterName";
|
||||
this._textPrinterName.Size = new Size(105, 20);
|
||||
this._textPrinterName.TabIndex = 21;
|
||||
@ -360,7 +414,7 @@
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new Point(1237, 3);
|
||||
this.label6.Location = new Point(1298, 3);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new Size(63, 20);
|
||||
this.label6.TabIndex = 20;
|
||||
@ -378,7 +432,7 @@
|
||||
this.Einstellungen.Location = new Point(4, 29);
|
||||
this.Einstellungen.Name = "Einstellungen";
|
||||
this.Einstellungen.Padding = new Padding(3);
|
||||
this.Einstellungen.Size = new Size(1401, 557);
|
||||
this.Einstellungen.Size = new Size(1789, 557);
|
||||
this.Einstellungen.TabIndex = 1;
|
||||
this.Einstellungen.Text = "Einstellungen";
|
||||
this.Einstellungen.UseVisualStyleBackColor = true;
|
||||
@ -424,7 +478,7 @@
|
||||
this.Druckereinstellungen.Location = new Point(4, 29);
|
||||
this.Druckereinstellungen.Name = "Druckereinstellungen";
|
||||
this.Druckereinstellungen.Padding = new Padding(3);
|
||||
this.Druckereinstellungen.Size = new Size(1401, 557);
|
||||
this.Druckereinstellungen.Size = new Size(1789, 557);
|
||||
this.Druckereinstellungen.TabIndex = 2;
|
||||
this.Druckereinstellungen.Text = "Druckereinstellungen";
|
||||
this.Druckereinstellungen.UseVisualStyleBackColor = true;
|
||||
@ -449,57 +503,32 @@
|
||||
this._buttonSaveSettings2.UseVisualStyleBackColor = true;
|
||||
this._buttonSaveSettings2.Click += this.ButtonSaveSettings_Click;
|
||||
//
|
||||
// Column1
|
||||
// label7
|
||||
//
|
||||
this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
|
||||
this.Column1.HeaderText = "Drucken";
|
||||
this.Column1.MinimumWidth = 70;
|
||||
this.Column1.Name = "Column1";
|
||||
this.Column1.Resizable = DataGridViewTriState.False;
|
||||
this.Column1.Width = 70;
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new Point(928, 9);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new Size(87, 20);
|
||||
this.label7.TabIndex = 29;
|
||||
this.label7.Text = "Package-ID:";
|
||||
//
|
||||
// Column4
|
||||
// textBox1
|
||||
//
|
||||
this.Column4.HeaderText = "Pos";
|
||||
this.Column4.MinimumWidth = 50;
|
||||
this.Column4.Name = "Column4";
|
||||
this.Column4.ReadOnly = true;
|
||||
this.Column4.Resizable = DataGridViewTriState.False;
|
||||
this.Column4.Width = 50;
|
||||
//
|
||||
// Column2
|
||||
//
|
||||
this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.Column2.HeaderText = "Teil";
|
||||
this.Column2.MinimumWidth = 300;
|
||||
this.Column2.Name = "Column2";
|
||||
this.Column2.ReadOnly = true;
|
||||
//
|
||||
// Column3
|
||||
//
|
||||
this.Column3.HeaderText = "SKU";
|
||||
this.Column3.MinimumWidth = 150;
|
||||
this.Column3.Name = "Column3";
|
||||
this.Column3.ReadOnly = true;
|
||||
this.Column3.Width = 150;
|
||||
//
|
||||
// Column6
|
||||
//
|
||||
this.Column6.HeaderText = "Labels";
|
||||
this.Column6.MinimumWidth = 60;
|
||||
this.Column6.Name = "Column6";
|
||||
this.Column6.SortMode = DataGridViewColumnSortMode.NotSortable;
|
||||
this.Column6.Width = 60;
|
||||
this.textBox1.Location = new Point(1021, 6);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new Size(271, 27);
|
||||
this.textBox1.TabIndex = 30;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
this.AutoScaleMode = AutoScaleMode.Font;
|
||||
this.ClientSize = new Size(1433, 666);
|
||||
this.ClientSize = new Size(1821, 666);
|
||||
this.Controls.Add(this._mainTabBox);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this._buttonPrint);
|
||||
this.Controls.Add(this._buttonPrintPreview);
|
||||
this.Icon = (Icon)resources.GetObject("$this.Icon");
|
||||
this.Name = "Form1";
|
||||
this.Text = "Inventree PO Label Generator";
|
||||
((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit();
|
||||
@ -556,10 +585,13 @@
|
||||
private Button buttonNone;
|
||||
private Button buttonAll;
|
||||
private Label labelCount;
|
||||
private DataGridViewCheckBoxColumn Column1;
|
||||
private DataGridViewTextBoxColumn Column4;
|
||||
private DataGridViewTextBoxColumn Column2;
|
||||
private DataGridViewTextBoxColumn Column3;
|
||||
private DataGridViewTextBoxColumn Column6;
|
||||
private DataGridViewTextBoxColumn Pos;
|
||||
private DataGridViewCheckBoxColumn Print;
|
||||
private DataGridViewCheckBoxColumn Bag;
|
||||
private DataGridViewTextBoxColumn Teil;
|
||||
private DataGridViewTextBoxColumn Sku;
|
||||
private DataGridViewTextBoxColumn Got;
|
||||
private TextBox textBox1;
|
||||
private Label label7;
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@ namespace BlubbFish.Applications.Barcodes.Inventree {
|
||||
private Helpers.WebRequest req;
|
||||
private readonly Queue<Ecia> printList = new();
|
||||
|
||||
|
||||
public Form1() {
|
||||
this.InitializeComponent();
|
||||
|
||||
@ -258,18 +257,21 @@ namespace BlubbFish.Applications.Barcodes.Inventree {
|
||||
private void PreparePintList() {
|
||||
this.printList.Clear();
|
||||
foreach(DataGridViewRow item in this.dataGridView1.Rows) {
|
||||
if(item.Cells[0].Value is Boolean b) {
|
||||
if(b && Int32.TryParse(item.Cells[4].Value.ToString(), out Int32 c) && c > 0) {
|
||||
if(item.Cells[2].Value is LineItem l) {
|
||||
for(Int32 i = 0; i < c; i++) {
|
||||
this.printList.Enqueue(l.EciaFormat);
|
||||
if(item.Cells[1].Value is Boolean print) {
|
||||
if(print && item.Cells[2].Value is Boolean bag) {
|
||||
if(item.Cells[3].Value is LineItem l) {
|
||||
if(Double.TryParse(item.Cells[5].Value.ToString(), out Double q)) {
|
||||
for(Int32 i = 0; i < Convert.ToInt32(bag ? 1 : q); i++) {
|
||||
Ecia t = l.EciaFormat;
|
||||
t.Quantity = q;
|
||||
this.printList.Enqueue(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonPrint_Click(Object sender, EventArgs e) {
|
||||
this.PreparePintList();
|
||||
this.printDocument1.Print();
|
||||
@ -353,32 +355,39 @@ namespace BlubbFish.Applications.Barcodes.Inventree {
|
||||
this.dataGridView1.Rows.Clear();
|
||||
Int32 i = 1;
|
||||
foreach(JsonData item in j["results"]) {
|
||||
DataGridViewRow r = new DataGridViewRow();
|
||||
DataGridViewRow r = new();
|
||||
r.CreateCells(this.dataGridView1);
|
||||
|
||||
r.Cells[0].Value = true;
|
||||
r.Cells[1].Value = i;
|
||||
r.Cells[2].Value = new LineItem {
|
||||
Double recieved = Double.Parse(item["received"].ToString());
|
||||
Double quantity = Double.Parse(item["quantity"].ToString());
|
||||
|
||||
r.Cells[0].Value = i;
|
||||
r.Cells[1].Value = quantity > recieved;
|
||||
r.Cells[2].Value = false;
|
||||
r.Cells[3].Value = new LineItem {
|
||||
Name = item["internal_part_name"].ToString(),
|
||||
SKU = item["sku"].ToString(),
|
||||
MPN = item["mpn"].ToString(),
|
||||
LineNr = i,
|
||||
Quantity = Double.Parse(item["quantity"].ToString()),
|
||||
Quantity = quantity,
|
||||
EciaFormat = new Ecia {
|
||||
CustomerPO = po.Reference,
|
||||
PackageId = po.SupplierReference,
|
||||
SupplierOrderNumber = po.SupplierReference,
|
||||
ShipDate = DateTime.Now.ToString("yyyyMMdd"),
|
||||
SKU = item["sku"].ToString(),
|
||||
MPN = item["mpn"].ToString(),
|
||||
CustomerPOLine = i++.ToString(),
|
||||
Quantity = Convert.ToInt32(Double.Parse(item["quantity"].ToString())).ToString(),
|
||||
Quantity = quantity,
|
||||
DateCode = DateTime.Now.ToString("yy01"),
|
||||
LotCode = "1",
|
||||
County = "DE"
|
||||
LotCode = "N/T",
|
||||
County = "DE",
|
||||
PackingListNumber = this.textBox1.Text
|
||||
}
|
||||
};
|
||||
r.Cells[3].Value = item["sku"].ToString();
|
||||
r.Cells[4].Value = Double.Parse(item["quantity"].ToString());
|
||||
r.Cells[4].Value = item["sku"].ToString();
|
||||
r.Cells[5].Value = quantity >= recieved ? quantity - recieved : 0;
|
||||
r.DefaultCellStyle.BackColor = quantity <= recieved ? Color.Green : recieved != 0? Color.Yellow: Color.White;
|
||||
|
||||
|
||||
_ = this.dataGridView1.Rows.Add(r);
|
||||
}
|
||||
@ -395,9 +404,11 @@ namespace BlubbFish.Applications.Barcodes.Inventree {
|
||||
private void CalcLabelCount() {
|
||||
Int32 i = 0;
|
||||
foreach(DataGridViewRow item in this.dataGridView1.Rows) {
|
||||
if(item.Cells[0].Value is Boolean b) {
|
||||
if(b && Int32.TryParse(item.Cells[4].Value.ToString(), out Int32 c)) {
|
||||
i += c;
|
||||
if(item.Cells[1].Value is Boolean print) {
|
||||
if(print && Double.TryParse(item.Cells[5].Value.ToString(), out Double c)) {
|
||||
if(item.Cells[2].Value is Boolean bag) {
|
||||
i += Convert.ToInt32(bag ? 1 : c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -408,8 +419,11 @@ namespace BlubbFish.Applications.Barcodes.Inventree {
|
||||
if(sender is DataGridView g) {
|
||||
Int32 i = g.CurrentRow.Index;
|
||||
if(this.dataGridView1.Rows.Count >= i) {
|
||||
if(this.dataGridView1.Rows[i].Cells[2].Value is LineItem l) {
|
||||
if(this.dataGridView1.Rows[i].Cells[3].Value is LineItem l) {
|
||||
this.part = l.EciaFormat;
|
||||
if(Double.TryParse(this.dataGridView1.Rows[i].Cells[5].Value.ToString(), out Double c)) {
|
||||
this.part.Quantity = c;
|
||||
}
|
||||
this.DrawPreview();
|
||||
}
|
||||
}
|
||||
@ -418,13 +432,13 @@ namespace BlubbFish.Applications.Barcodes.Inventree {
|
||||
|
||||
private void ButtonAll_Click(Object sender, EventArgs e) {
|
||||
foreach(DataGridViewRow item in this.dataGridView1.Rows) {
|
||||
item.Cells[0].Value = true;
|
||||
item.Cells[1].Value = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonNone_Click(Object sender, EventArgs e) {
|
||||
foreach(DataGridViewRow item in this.dataGridView1.Rows) {
|
||||
item.Cells[0].Value = false;
|
||||
item.Cells[1].Value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,19 +150,63 @@
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>561, 17</value>
|
||||
</metadata>
|
||||
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="Pos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="Print.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="Bag.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="Teil.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="Sku.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Got.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAAAAAAAEAIACECAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAACEtJ
|
||||
REFUeJzt3G+o3XUdwPHP93furm27q6GkQ8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PNBHx
|
||||
VN8nA0eCp5oo8ae2twBa8cem1Ppg21sAbagPNbXWX7W9BtCGelfTe3bf7bXWXturAMNU52b3Td/RXHf1
|
||||
sY9HiTvbXgcYqttvuGbFE01ERK31By0vAwxRr/ZujnjhLwH/9eBffhxRH2l3JWA46t+a//xzd8QLAZia
|
||||
OvlA7cW32l0KGIoa2ycn3zsT8ZLPAvz+rnturBG/aW8rYNBqxH2/++U9Nx38+sUA7Nmzei5mZy6otc60
|
||||
sxowSDXqc/XAcxfs2bN67uBtL/s04M4db7svIi4Z+mbAwNUaF++6YvnLXuW/4uPAO7cu+V5E77vDWwsY
|
||||
tBq963dtXXLd/94+73kAjz1w28U16i2DXwsYtBr1h48/cNu6+e6bNwBTUxO9nVuuOq9X6zWDXQ0YqFqv
|
||||
2rnlqi9PTU3M+9e+/+dEoMvrrq1LLom52U/XWn1kGI4gNeozUec+O7l1yaURl9dXe9whjwSb3L7sp+XZ
|
||||
/ad4SwBHiFpvnX1u5oOTW8d+cqiHjixk3uRVx/w9Ir647rLpm6JpLiulfPJ1Lwn0Wf1Fb3Zu264dy+5a
|
||||
6DMWFICDdm4fuzMi7ly7cXplaZpzo8bZpZSVh70n0Be11gci4mflwNyPJr+57LDP9jisABy0a9vYAxGx
|
||||
PiLWr1n/xIrRZumpUepJUeLEiDJWSln6WuZCC6baXmChaq17a6nPNDX+Wnvl4Zne3ntvvOLtj7W9FwAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAcBj+C5CkvspxjS1oAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>1.1.0</AssemblyVersion>
|
||||
<AssemblyVersion>1.3.1</AssemblyVersion>
|
||||
<FileVersion>$(AssemblyVersion)</FileVersion>
|
||||
<Version>$(AssemblyVersion)</Version>
|
||||
<Authors>BlubbFish</Authors>
|
||||
@ -24,7 +24,10 @@
|
||||
<RepositoryUrl>https://git.blubbfish.net/vs_projects/InventreeBarcodeGenerator.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageReleaseNotes>
|
||||
1.1.0 - 2016-02-14 - Rewrote to DataGridView
|
||||
1.3.1 - 2026-02-32 - Add PackageListNumber
|
||||
1.3.0 - 2026-02-19 - Change DataMatrix to real Json
|
||||
1.2.0 - 2026-02-18 - Fix Quantity on Labels so that you can recieve only partial deliverys
|
||||
1.1.0 - 2026-02-14 - Rewrote to DataGridView
|
||||
1.0.0 - 2025-11-23 - Init
|
||||
</PackageReleaseNotes>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
namespace BlubbFish.Applications.Barcodes.Inventree.Models {
|
||||
using LitJson;
|
||||
|
||||
namespace BlubbFish.Applications.Barcodes.Inventree.Models {
|
||||
internal class Ecia {
|
||||
public String CustomerPO {
|
||||
get; set;
|
||||
}
|
||||
public String PackageId {
|
||||
public String SupplierOrderNumber {
|
||||
get; set;
|
||||
}
|
||||
public String PackingListNumber {
|
||||
get; set;
|
||||
}
|
||||
public String ShipDate {
|
||||
@ -18,7 +23,7 @@
|
||||
public String CustomerPOLine {
|
||||
get; set;
|
||||
}
|
||||
public String Quantity {
|
||||
public Double Quantity {
|
||||
get; set;
|
||||
}
|
||||
public String DateCode {
|
||||
@ -31,17 +36,19 @@
|
||||
get; set;
|
||||
}
|
||||
public override String ToString() => this.Quantity + "x " + this.SKU + " from " + this.CustomerPO;
|
||||
public String ToEciaString() => "{" +
|
||||
"K" + ":" + this.CustomerPO + "," +
|
||||
"4S" + ":" + this.PackageId + "," +
|
||||
"6D" + ":" + this.ShipDate + "," +
|
||||
"P" + ":" + this.SKU + "," +
|
||||
"1P" + ":" + this.MPN + "," +
|
||||
"4K" + ":" + this.CustomerPOLine + "," +
|
||||
"Q" + ":" + this.Quantity + "," +
|
||||
"10D" + ":" + this.DateCode + "," +
|
||||
"1T" + ":" + this.LotCode + "," +
|
||||
"4L" + ":" + this.County +
|
||||
"}";
|
||||
public String ToEciaString() => JsonMapper.ToJson(new Dictionary<String, Object>() {
|
||||
{ "K", this.CustomerPO },
|
||||
{ "1K", this.SupplierOrderNumber },
|
||||
{ "11K", this.PackingListNumber },
|
||||
{ "6D", this.ShipDate },
|
||||
{ "P", this.SKU },
|
||||
{ "1P", this.MPN },
|
||||
{ "4K", this.CustomerPOLine },
|
||||
{ "Q", this.Quantity },
|
||||
{ "10D", this.DateCode },
|
||||
{ "1T", this.LotCode },
|
||||
{ "4L", this.County },
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
71
InventreeBarcodeGenerator/Res/store.py
Normal file
71
InventreeBarcodeGenerator/Res/store.py
Normal file
@ -0,0 +1,71 @@
|
||||
"""The BarcodePlugin is meant to integrate the Barcodes into InvenTree.
|
||||
|
||||
This plugin can currently only match barcodes to supplier parts.
|
||||
"""
|
||||
|
||||
import re
|
||||
import json
|
||||
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from plugin import InvenTreePlugin
|
||||
from plugin.mixins import SettingsMixin, SupplierBarcodeMixin
|
||||
|
||||
|
||||
class ReicheltPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
||||
"""Plugin to integrate the Barcodes into InvenTree."""
|
||||
|
||||
NAME = 'ReicheltBarcodePlugin'
|
||||
SLUG = 'Reicheltplugin'
|
||||
TITLE = _('Supplier Integration - Reichelt')
|
||||
DESCRIPTION = _('Provides support for scanning Reichelt barcodes')
|
||||
VERSION = '1.0.0'
|
||||
AUTHOR = _('BlubbFish')
|
||||
|
||||
DEFAULT_SUPPLIER_NAME = 'Reichelt'
|
||||
SETTINGS = {
|
||||
'SUPPLIER_ID': {
|
||||
'name': _('Supplier'),
|
||||
'description': _("The Supplier which acts as 'Reichelt'"),
|
||||
'model': 'company.company',
|
||||
'model_filters': {'is_supplier': True},
|
||||
}
|
||||
}
|
||||
|
||||
# Custom field mapping for LCSC barcodes
|
||||
BARCODE_FIELDS = {
|
||||
'K': SupplierBarcodeMixin.CUSTOMER_ORDER_NUMBER,
|
||||
'1K': SupplierBarcodeMixin.SUPPLIER_ORDER_NUMBER,
|
||||
'11K': SupplierBarcodeMixin.PACKING_LIST_NUMBER,
|
||||
'6D': SupplierBarcodeMixin.SHIP_DATE,
|
||||
'9D': SupplierBarcodeMixin.DATE_CODE,
|
||||
'10D': SupplierBarcodeMixin.DATE_CODE,
|
||||
'4K': SupplierBarcodeMixin.PURCHASE_ORDER_LINE,
|
||||
'14K': SupplierBarcodeMixin.PURCHASE_ORDER_LINE,
|
||||
'P': SupplierBarcodeMixin.SUPPLIER_PART_NUMBER,
|
||||
'1P': SupplierBarcodeMixin.MANUFACTURER_PART_NUMBER,
|
||||
'30P': SupplierBarcodeMixin.SUPPLIER_PART_NUMBER,
|
||||
'1T': SupplierBarcodeMixin.LOT_CODE,
|
||||
'4L': SupplierBarcodeMixin.COUNTRY_OF_ORIGIN,
|
||||
'1V': SupplierBarcodeMixin.MANUFACTURER,
|
||||
'Q': SupplierBarcodeMixin.QUANTITY,
|
||||
}
|
||||
|
||||
def extract_barcode_fields(self, barcode_data: str) -> dict[str, str]:
|
||||
"""Get supplier_part and barcode_fields from LCSC QR-Code.
|
||||
|
||||
Example QR-Code: {"K":"KA-0077","1K":"028-3720301-6481114","6D":"20260219","P":"B0977HLT4P","1P":"SDCZ48-064G-G46T","4K":"1","Q":0.0,"10D":"2601","1T":"1","4L":"DE"}
|
||||
"""
|
||||
try:
|
||||
jsonData = json.loads(barcode_data)
|
||||
except ValueError as err:
|
||||
return {}
|
||||
|
||||
barcode_fields = {}
|
||||
|
||||
# Map from LCSC field names to standard field names
|
||||
for key, field in self.BARCODE_FIELDS.items():
|
||||
if key in jsonData.keys():
|
||||
barcode_fields[field] = jsonData[key]
|
||||
|
||||
return barcode_fields
|
||||
Loading…
Reference in New Issue
Block a user