From 176446db460f99b3f1b9591c5ba73b1a1e77f8f0 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Sat, 14 Feb 2026 17:32:15 +0100 Subject: [PATCH] init --- .gitignore | 3 + CONTRIBUTING.md | 92 +++ Changelog.md | 15 + InventreeBarcodeGenerator.sln | 43 ++ InventreeBarcodeGenerator/Drawing.cs | 23 + InventreeBarcodeGenerator/Form1.Designer.cs | 565 ++++++++++++++++++ InventreeBarcodeGenerator/Form1.cs | 431 +++++++++++++ InventreeBarcodeGenerator/Form1.resx | 168 ++++++ InventreeBarcodeGenerator/Helpers/DMHelper.cs | 18 + .../Helpers/WebRequest.cs | 51 ++ .../InventreeBarcodeGenerator.csproj | 75 +++ .../InventreeBarcodeGenerator.csproj.user | 8 + InventreeBarcodeGenerator/Models/Ecia.cs | 47 ++ InventreeBarcodeGenerator/Models/LineItem.cs | 23 + InventreeBarcodeGenerator/Models/POList.cs | 20 + InventreeBarcodeGenerator/Printer.cs | 35 ++ InventreeBarcodeGenerator/Program.cs | 16 + .../Properties/Resources.Designer.cs | 83 +++ .../Properties/Resources.resx | 127 ++++ .../Res/arrow_reload.svg | 1 + .../Res/arrow_reload_16.png | Bin 0 -> 523 bytes .../Res/arrow_reload_24.png | Bin 0 -> 643 bytes .../Res/mdi--barcode-scan.ico | Bin 0 -> 2202 bytes .../Res/mdi--barcode-scan.svg | 1 + LICENSE | 165 +++++ README.md | 4 + 26 files changed, 2014 insertions(+) create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 Changelog.md create mode 100644 InventreeBarcodeGenerator.sln create mode 100644 InventreeBarcodeGenerator/Drawing.cs create mode 100644 InventreeBarcodeGenerator/Form1.Designer.cs create mode 100644 InventreeBarcodeGenerator/Form1.cs create mode 100644 InventreeBarcodeGenerator/Form1.resx create mode 100644 InventreeBarcodeGenerator/Helpers/DMHelper.cs create mode 100644 InventreeBarcodeGenerator/Helpers/WebRequest.cs create mode 100644 InventreeBarcodeGenerator/InventreeBarcodeGenerator.csproj create mode 100644 InventreeBarcodeGenerator/InventreeBarcodeGenerator.csproj.user create mode 100644 InventreeBarcodeGenerator/Models/Ecia.cs create mode 100644 InventreeBarcodeGenerator/Models/LineItem.cs create mode 100644 InventreeBarcodeGenerator/Models/POList.cs create mode 100644 InventreeBarcodeGenerator/Printer.cs create mode 100644 InventreeBarcodeGenerator/Program.cs create mode 100644 InventreeBarcodeGenerator/Properties/Resources.Designer.cs create mode 100644 InventreeBarcodeGenerator/Properties/Resources.resx create mode 100644 InventreeBarcodeGenerator/Res/arrow_reload.svg create mode 100644 InventreeBarcodeGenerator/Res/arrow_reload_16.png create mode 100644 InventreeBarcodeGenerator/Res/arrow_reload_24.png create mode 100644 InventreeBarcodeGenerator/Res/mdi--barcode-scan.ico create mode 100644 InventreeBarcodeGenerator/Res/mdi--barcode-scan.svg create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a090d5b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.vs +InventreeBarcodeGenerator/obj +InventreeBarcodeGenerator/bin diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..20ec6e2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# Contributing + +When contributing to this repository, please first discuss the change you wish to make via issue, +email, or any other method with the owners of this repository before making a change. + +Please note we have a code of conduct, please follow it in all your interactions with the project. + +## Pull Request Process + +1. Ensure any install or build dependencies are removed before the end of the layer when doing a + build. +2. Update the README.md with details of changes to the interface, this includes new environment + variables, exposed ports, useful file locations and container parameters. +3. Increase the version numbers in any examples files and the README.md to the new version that this + Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). +4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you + do not have permission to do that, you may request the second reviewer to merge it for you. + +## Code of Conduct + +### Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +### Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +### Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +### Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at git ATTTT blubbfish.net. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +### Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/Changelog.md b/Changelog.md new file mode 100644 index 0000000..c4f8c48 --- /dev/null +++ b/Changelog.md @@ -0,0 +1,15 @@ +# Changelog + +## 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. +### Bugfixes +### Changes + +## 1.0.0 - 2025-11-23 - Init +### New Features +* Create the App +* Can Print Barcodes for Inventree +### Bugfixes +### Changes + diff --git a/InventreeBarcodeGenerator.sln b/InventreeBarcodeGenerator.sln new file mode 100644 index 0000000..67909f5 --- /dev/null +++ b/InventreeBarcodeGenerator.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36414.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InventreeBarcodeGenerator", "InventreeBarcodeGenerator\InventreeBarcodeGenerator.csproj", "{936044F1-E290-49B2-A040-88A5FE4A7784}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataMatrix.net", "..\Librarys\DataMatrix.net\DataMatrix.net\DataMatrix.net.csproj", "{DA8B408B-33AF-F9E9-F8F8-4A09119B06F3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "litjson", "..\Librarys\litjson\litjson\litjson.csproj", "{0B325315-FBCC-8CCC-1659-89CDBE1DBA66}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "..\Utils\Utils\Utils\Utils.csproj", "{B4B46007-9064-6A01-A7C2-CE9285255C63}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {936044F1-E290-49B2-A040-88A5FE4A7784}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {936044F1-E290-49B2-A040-88A5FE4A7784}.Debug|Any CPU.Build.0 = Debug|Any CPU + {936044F1-E290-49B2-A040-88A5FE4A7784}.Release|Any CPU.ActiveCfg = Release|Any CPU + {936044F1-E290-49B2-A040-88A5FE4A7784}.Release|Any CPU.Build.0 = Release|Any CPU + {DA8B408B-33AF-F9E9-F8F8-4A09119B06F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA8B408B-33AF-F9E9-F8F8-4A09119B06F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA8B408B-33AF-F9E9-F8F8-4A09119B06F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA8B408B-33AF-F9E9-F8F8-4A09119B06F3}.Release|Any CPU.Build.0 = Release|Any CPU + {0B325315-FBCC-8CCC-1659-89CDBE1DBA66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B325315-FBCC-8CCC-1659-89CDBE1DBA66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B325315-FBCC-8CCC-1659-89CDBE1DBA66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B325315-FBCC-8CCC-1659-89CDBE1DBA66}.Release|Any CPU.Build.0 = Release|Any CPU + {B4B46007-9064-6A01-A7C2-CE9285255C63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4B46007-9064-6A01-A7C2-CE9285255C63}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4B46007-9064-6A01-A7C2-CE9285255C63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4B46007-9064-6A01-A7C2-CE9285255C63}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D58D5202-B120-483E-A1CF-3D05CEFF9557} + EndGlobalSection +EndGlobal diff --git a/InventreeBarcodeGenerator/Drawing.cs b/InventreeBarcodeGenerator/Drawing.cs new file mode 100644 index 0000000..16c22c3 --- /dev/null +++ b/InventreeBarcodeGenerator/Drawing.cs @@ -0,0 +1,23 @@ +using BlubbFish.Applications.Barcodes.Inventree.Helpers; +using BlubbFish.Applications.Barcodes.Inventree.Models; + +namespace BlubbFish.Applications.Barcodes.Inventree { + internal class Drawing { + public static void GetLabel(Graphics label, Ecia part) { + if(part is not null) { + label.DrawImage(DMHelper.GetDataMatrix(part), 0, 0, 90, 90); + label.DrawString("Reference", new Font("Arial", 6, FontStyle.Regular), Brushes.Black, 100, 2); + label.DrawString(part.CustomerPO, new Font("Arial", 10, FontStyle.Bold), Brushes.Black, 100, 10); + + label.DrawString("SKU", new Font("Arial", 6, FontStyle.Regular), Brushes.Black, 100, 25); + 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("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); + } + } + } +} diff --git a/InventreeBarcodeGenerator/Form1.Designer.cs b/InventreeBarcodeGenerator/Form1.Designer.cs new file mode 100644 index 0000000..50c36f1 --- /dev/null +++ b/InventreeBarcodeGenerator/Form1.Designer.cs @@ -0,0 +1,565 @@ +namespace BlubbFish.Applications.Barcodes.Inventree { + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.pictureBox1 = new PictureBox(); + this.printDocument1 = new System.Drawing.Printing.PrintDocument(); + this._buttonPrintPreview = new Button(); + this.printPreviewDialog1 = new PrintPreviewDialog(); + this._listBox_Printer = new ListBox(); + this.label1 = new Label(); + this._listBox_PaperSize = new ListBox(); + this._listBox_PaperSources = new ListBox(); + this._listBox_PrinterResolution = new ListBox(); + this._buttonPrint = new Button(); + this.label2 = new Label(); + this.label3 = new Label(); + this.label4 = new Label(); + this.label5 = new Label(); + this._textBox_ServerAddress = new TextBox(); + this._textBox_AuthToken = new TextBox(); + this._buttonQueryPo = new Button(); + this.comboBox1 = new ComboBox(); + this.statusStrip1 = new StatusStrip(); + this._statusLabel = new ToolStripStatusLabel(); + this._mainTabBox = new TabControl(); + this.Label = new TabPage(); + this.labelCount = new Label(); + this.buttonNone = new Button(); + this.buttonAll = new Button(); + this.dataGridView1 = new DataGridView(); + this._textServerName = new Label(); + this.label8 = new Label(); + this._textPrinterName = new Label(); + this.label6 = new Label(); + this.Einstellungen = new TabPage(); + this._buttonSaveSettings1 = new Button(); + this.label11 = new Label(); + this.label10 = new Label(); + 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(); + ((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit(); + this.statusStrip1.SuspendLayout(); + this._mainTabBox.SuspendLayout(); + this.Label.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)this.dataGridView1).BeginInit(); + this.Einstellungen.SuspendLayout(); + this.Druckereinstellungen.SuspendLayout(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Location = new Point(907, 104); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new Size(488, 228); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // printDocument1 + // + this.printDocument1.PrintPage += this.PrintDocument1_PrintPage; + // + // _buttonPrintPreview + // + this._buttonPrintPreview.Location = new Point(16, 608); + this._buttonPrintPreview.Name = "_buttonPrintPreview"; + this._buttonPrintPreview.Size = new Size(143, 29); + this._buttonPrintPreview.TabIndex = 1; + this._buttonPrintPreview.Text = "Druckvorschau"; + this._buttonPrintPreview.UseVisualStyleBackColor = true; + this._buttonPrintPreview.Click += this.ButtonPrintPreview_Click; + // + // printPreviewDialog1 + // + this.printPreviewDialog1.AutoScrollMargin = new Size(0, 0); + this.printPreviewDialog1.AutoScrollMinSize = new Size(0, 0); + this.printPreviewDialog1.ClientSize = new Size(400, 300); + this.printPreviewDialog1.Document = this.printDocument1; + this.printPreviewDialog1.Enabled = true; + this.printPreviewDialog1.Icon = (Icon)resources.GetObject("printPreviewDialog1.Icon"); + this.printPreviewDialog1.Name = "Druckvorschau"; + this.printPreviewDialog1.Visible = false; + // + // _listBox_Printer + // + this._listBox_Printer.FormattingEnabled = true; + this._listBox_Printer.Location = new Point(6, 135); + this._listBox_Printer.Name = "_listBox_Printer"; + this._listBox_Printer.Size = new Size(676, 124); + this._listBox_Printer.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new Point(6, 112); + this.label1.Name = "label1"; + this.label1.Size = new Size(63, 20); + this.label1.TabIndex = 4; + this.label1.Text = "Drucker:"; + // + // _listBox_PaperSize + // + this._listBox_PaperSize.FormattingEnabled = true; + this._listBox_PaperSize.Location = new Point(6, 26); + this._listBox_PaperSize.Name = "_listBox_PaperSize"; + this._listBox_PaperSize.Size = new Size(676, 84); + this._listBox_PaperSize.TabIndex = 5; + // + // _listBox_PaperSources + // + this._listBox_PaperSources.FormattingEnabled = true; + this._listBox_PaperSources.Location = new Point(6, 136); + this._listBox_PaperSources.Name = "_listBox_PaperSources"; + this._listBox_PaperSources.Size = new Size(676, 84); + this._listBox_PaperSources.TabIndex = 6; + // + // _listBox_PrinterResolution + // + this._listBox_PrinterResolution.FormattingEnabled = true; + this._listBox_PrinterResolution.Location = new Point(6, 246); + this._listBox_PrinterResolution.Name = "_listBox_PrinterResolution"; + this._listBox_PrinterResolution.Size = new Size(676, 84); + this._listBox_PrinterResolution.TabIndex = 7; + // + // _buttonPrint + // + this._buttonPrint.Location = new Point(1323, 608); + this._buttonPrint.Name = "_buttonPrint"; + this._buttonPrint.Size = new Size(94, 29); + this._buttonPrint.TabIndex = 8; + this._buttonPrint.Text = "Drucken"; + this._buttonPrint.UseVisualStyleBackColor = true; + this._buttonPrint.Click += this.ButtonPrint_Click; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new Point(6, 3); + this.label2.Name = "label2"; + this.label2.Size = new Size(100, 20); + this.label2.TabIndex = 9; + this.label2.Text = "Papiergrößen:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new Point(6, 113); + this.label3.Name = "label3"; + this.label3.Size = new Size(102, 20); + this.label3.TabIndex = 10; + this.label3.Text = "Papierquellen:"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new Point(6, 223); + this.label4.Name = "label4"; + this.label4.Size = new Size(112, 20); + this.label4.TabIndex = 11; + this.label4.Text = "Druckauflösung"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new Point(907, 80); + this.label5.Name = "label5"; + this.label5.Size = new Size(68, 20); + this.label5.TabIndex = 12; + this.label5.Text = "Vorschau"; + // + // _textBox_ServerAddress + // + this._textBox_ServerAddress.Location = new Point(6, 29); + this._textBox_ServerAddress.Name = "_textBox_ServerAddress"; + this._textBox_ServerAddress.Size = new Size(676, 27); + this._textBox_ServerAddress.TabIndex = 13; + // + // _textBox_AuthToken + // + this._textBox_AuthToken.Location = new Point(6, 82); + this._textBox_AuthToken.Name = "_textBox_AuthToken"; + this._textBox_AuthToken.Size = new Size(676, 27); + this._textBox_AuthToken.TabIndex = 14; + // + // _buttonQueryPo + // + this._buttonQueryPo.Image = Properties.Resources.arrow_reload_24; + this._buttonQueryPo.Location = new Point(840, 6); + this._buttonQueryPo.Name = "_buttonQueryPo"; + this._buttonQueryPo.Size = new Size(56, 29); + this._buttonQueryPo.TabIndex = 15; + this._buttonQueryPo.UseVisualStyleBackColor = true; + this._buttonQueryPo.Click += this.ButtonQueryPo_Click; + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Location = new Point(6, 6); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new Size(828, 28); + this.comboBox1.TabIndex = 16; + this.comboBox1.SelectedIndexChanged += this.comboBox1_SelectedIndexChanged; + // + // statusStrip1 + // + this.statusStrip1.ImageScalingSize = new Size(20, 20); + 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.TabIndex = 20; + this.statusStrip1.Text = "statusStrip1"; + // + // _statusLabel + // + this._statusLabel.Name = "_statusLabel"; + this._statusLabel.Size = new Size(151, 20); + this._statusLabel.Text = "toolStripStatusLabel1"; + // + // _mainTabBox + // + this._mainTabBox.Controls.Add(this.Label); + this._mainTabBox.Controls.Add(this.Einstellungen); + this._mainTabBox.Controls.Add(this.Druckereinstellungen); + this._mainTabBox.Location = new Point(12, 12); + this._mainTabBox.Name = "_mainTabBox"; + this._mainTabBox.SelectedIndex = 0; + this._mainTabBox.Size = new Size(1409, 590); + this._mainTabBox.TabIndex = 21; + // + // Label + // + this.Label.Controls.Add(this.labelCount); + this.Label.Controls.Add(this.buttonNone); + this.Label.Controls.Add(this.buttonAll); + this.Label.Controls.Add(this.dataGridView1); + this.Label.Controls.Add(this._textServerName); + this.Label.Controls.Add(this.label8); + this.Label.Controls.Add(this._textPrinterName); + this.Label.Controls.Add(this.label6); + this.Label.Controls.Add(this.label5); + this.Label.Controls.Add(this._buttonQueryPo); + this.Label.Controls.Add(this.comboBox1); + this.Label.Controls.Add(this.pictureBox1); + 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.TabIndex = 0; + this.Label.Text = "Label"; + this.Label.UseVisualStyleBackColor = true; + // + // labelCount + // + this.labelCount.AutoSize = true; + this.labelCount.Location = new Point(677, 526); + this.labelCount.Name = "labelCount"; + this.labelCount.Size = new Size(219, 20); + this.labelCount.TabIndex = 28; + this.labelCount.Text = "Anzahl zu druckender Labels: $x"; + this.labelCount.TextAlign = ContentAlignment.TopRight; + // + // buttonNone + // + this.buttonNone.Location = new Point(106, 522); + this.buttonNone.Name = "buttonNone"; + this.buttonNone.Size = new Size(94, 29); + this.buttonNone.TabIndex = 27; + this.buttonNone.Text = "Keine"; + this.buttonNone.UseVisualStyleBackColor = true; + this.buttonNone.Click += this.ButtonNone_Click; + // + // buttonAll + // + this.buttonAll.Location = new Point(6, 522); + this.buttonAll.Name = "buttonAll"; + this.buttonAll.Size = new Size(94, 29); + this.buttonAll.TabIndex = 26; + this.buttonAll.Text = "Alle"; + this.buttonAll.UseVisualStyleBackColor = true; + this.buttonAll.Click += this.ButtonAll_Click; + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + 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.EditMode = DataGridViewEditMode.EditOnKeystroke; + this.dataGridView1.Location = new Point(6, 40); + this.dataGridView1.MultiSelect = false; + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.RowHeadersVisible = false; + this.dataGridView1.RowHeadersWidth = 51; + this.dataGridView1.ShowEditingIcon = false; + this.dataGridView1.Size = new Size(890, 476); + this.dataGridView1.TabIndex = 25; + this.dataGridView1.CellContentClick += this.DataGridView1_CellContentClick; + this.dataGridView1.CellValueChanged += this.DataGridView1_CellValueChanged; + this.dataGridView1.SelectionChanged += this.DataGridView1_SelectionChanged; + // + // _textServerName + // + this._textServerName.AutoSize = true; + this._textServerName.Location = new Point(1237, 80); + this._textServerName.Name = "_textServerName"; + this._textServerName.Size = new Size(93, 20); + this._textServerName.TabIndex = 23; + this._textServerName.Text = "$servername"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new Point(1237, 60); + this.label8.Name = "label8"; + this.label8.Size = new Size(53, 20); + this.label8.TabIndex = 22; + this.label8.Text = "Server:"; + // + // _textPrinterName + // + this._textPrinterName.AutoSize = true; + this._textPrinterName.Location = new Point(1237, 23); + this._textPrinterName.Name = "_textPrinterName"; + this._textPrinterName.Size = new Size(105, 20); + this._textPrinterName.TabIndex = 21; + this._textPrinterName.Text = "$Druckername"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new Point(1237, 3); + this.label6.Name = "label6"; + this.label6.Size = new Size(63, 20); + this.label6.TabIndex = 20; + this.label6.Text = "Drucker:"; + // + // Einstellungen + // + this.Einstellungen.Controls.Add(this._buttonSaveSettings1); + this.Einstellungen.Controls.Add(this.label11); + this.Einstellungen.Controls.Add(this.label10); + this.Einstellungen.Controls.Add(this._listBox_Printer); + this.Einstellungen.Controls.Add(this.label1); + this.Einstellungen.Controls.Add(this._textBox_AuthToken); + this.Einstellungen.Controls.Add(this._textBox_ServerAddress); + 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.TabIndex = 1; + this.Einstellungen.Text = "Einstellungen"; + this.Einstellungen.UseVisualStyleBackColor = true; + // + // _buttonSaveSettings1 + // + this._buttonSaveSettings1.Location = new Point(6, 338); + this._buttonSaveSettings1.Name = "_buttonSaveSettings1"; + this._buttonSaveSettings1.Size = new Size(227, 29); + this._buttonSaveSettings1.TabIndex = 17; + this._buttonSaveSettings1.Text = "Einstellungen Speichern"; + this._buttonSaveSettings1.UseVisualStyleBackColor = true; + this._buttonSaveSettings1.Click += this.ButtonSaveSettings_Click; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new Point(6, 59); + this.label11.Name = "label11"; + this.label11.Size = new Size(64, 20); + this.label11.TabIndex = 16; + this.label11.Text = "API-Key:"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new Point(6, 3); + this.label10.Name = "label10"; + this.label10.Size = new Size(111, 20); + this.label10.TabIndex = 15; + this.label10.Text = "Server-Adresse:"; + // + // Druckereinstellungen + // + this.Druckereinstellungen.Controls.Add(this._checkBox_Landscape); + this.Druckereinstellungen.Controls.Add(this._buttonSaveSettings2); + this.Druckereinstellungen.Controls.Add(this._listBox_PaperSize); + this.Druckereinstellungen.Controls.Add(this.label2); + this.Druckereinstellungen.Controls.Add(this.label4); + this.Druckereinstellungen.Controls.Add(this.label3); + this.Druckereinstellungen.Controls.Add(this._listBox_PrinterResolution); + this.Druckereinstellungen.Controls.Add(this._listBox_PaperSources); + 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.TabIndex = 2; + this.Druckereinstellungen.Text = "Druckereinstellungen"; + this.Druckereinstellungen.UseVisualStyleBackColor = true; + // + // _checkBox_Landscape + // + this._checkBox_Landscape.AutoSize = true; + this._checkBox_Landscape.Location = new Point(581, 339); + this._checkBox_Landscape.Name = "_checkBox_Landscape"; + this._checkBox_Landscape.Size = new Size(101, 24); + this._checkBox_Landscape.TabIndex = 23; + this._checkBox_Landscape.Text = "Landscape"; + this._checkBox_Landscape.UseVisualStyleBackColor = true; + // + // _buttonSaveSettings2 + // + this._buttonSaveSettings2.Location = new Point(6, 336); + this._buttonSaveSettings2.Name = "_buttonSaveSettings2"; + this._buttonSaveSettings2.Size = new Size(227, 29); + this._buttonSaveSettings2.TabIndex = 22; + this._buttonSaveSettings2.Text = "Einstellungen Speichern"; + this._buttonSaveSettings2.UseVisualStyleBackColor = true; + this._buttonSaveSettings2.Click += this.ButtonSaveSettings_Click; + // + // Column1 + // + 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; + // + // Column4 + // + 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; + // + // Form1 + // + this.AutoScaleDimensions = new SizeF(8F, 20F); + this.AutoScaleMode = AutoScaleMode.Font; + this.ClientSize = new Size(1433, 666); + this.Controls.Add(this._mainTabBox); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this._buttonPrint); + this.Controls.Add(this._buttonPrintPreview); + this.Name = "Form1"; + this.Text = "Inventree PO Label Generator"; + ((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this._mainTabBox.ResumeLayout(false); + this.Label.ResumeLayout(false); + this.Label.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)this.dataGridView1).EndInit(); + this.Einstellungen.ResumeLayout(false); + this.Einstellungen.PerformLayout(); + this.Druckereinstellungen.ResumeLayout(false); + this.Druckereinstellungen.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + } + + #endregion + + private PictureBox pictureBox1; + private System.Drawing.Printing.PrintDocument printDocument1; + private Button _buttonPrintPreview; + private PrintPreviewDialog printPreviewDialog1; + private ListBox _listBox_Printer; + private Label label1; + private ListBox _listBox_PaperSize; + private ListBox _listBox_PaperSources; + private ListBox _listBox_PrinterResolution; + private Button _buttonPrint; + private Label label2; + private Label label3; + private Label label4; + private Label label5; + private TextBox _textBox_ServerAddress; + private TextBox _textBox_AuthToken; + private Button _buttonQueryPo; + private ComboBox comboBox1; + private StatusStrip statusStrip1; + private TabControl _mainTabBox; + private TabPage Label; + private TabPage Einstellungen; + private Label _textServerName; + private Label label8; + private Label _textPrinterName; + private Label label6; + private TabPage Druckereinstellungen; + private Label label11; + private Label label10; + private Button _buttonSaveSettings1; + private Button _buttonSaveSettings2; + private ToolStripStatusLabel _statusLabel; + private CheckBox _checkBox_Landscape; + private DataGridView dataGridView1; + private Button buttonNone; + private Button buttonAll; + private Label labelCount; + private DataGridViewCheckBoxColumn Column1; + private DataGridViewTextBoxColumn Column4; + private DataGridViewTextBoxColumn Column2; + private DataGridViewTextBoxColumn Column3; + private DataGridViewTextBoxColumn Column6; + } +} diff --git a/InventreeBarcodeGenerator/Form1.cs b/InventreeBarcodeGenerator/Form1.cs new file mode 100644 index 0000000..3597f66 --- /dev/null +++ b/InventreeBarcodeGenerator/Form1.cs @@ -0,0 +1,431 @@ +using System.Collections.Generic; +using System.Drawing.Printing; +using System.Net; +using System.Reflection; + +using BlubbFish.Utils; + +using BlubbFish.Applications.Barcodes.Inventree.Helpers; +using BlubbFish.Applications.Barcodes.Inventree.Models; + +using LitJson; + +namespace BlubbFish.Applications.Barcodes.Inventree { + public partial class Form1 : Form { + + private Ecia part; + private Helpers.WebRequest req; + private readonly Queue printList = new(); + + + public Form1() { + this.InitializeComponent(); + + InIReader.SetSearchPath(["/etc/invbarcodegen", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\blubb\\invbarcodegen"]); + + if(!InIReader.ConfigExist("settings")) { + _ = MessageBox.Show("settings.ini nicht gefunden.\nBitte settings.ini anlegen.", "Fehler"); + return; + } + + this.req = new Helpers.WebRequest(); + + this.PrepairForm(); + } + + #region Methods + + private void PrepairForm() { + this._statusLabel.Text = "Nicht Verbunden"; + + if(this.CheckServerConfig()) { + this.CheckPrinterConfig(); + } + + this.GetPOList(); + } + + private void GetPOList() { + try { + String json = this.req.RequestString(this._textBox_ServerAddress.Text + "/api/order/po/"); + JsonData j = JsonMapper.ToObject(json); + this.comboBox1.Items.Clear(); + _ = this.comboBox1.Items.Add(" - Auswahl -"); + foreach(JsonData item in j) { + _ = this.comboBox1.Items.Add(new POList { + Pk = Int32.Parse(item["pk"].ToString()), + Description = item["description"].ToString(), + Reference = item["reference"].ToString(), + SupplierName = item["supplier_name"].ToString(), + SupplierReference = item["supplier_reference"].ToString(), + }); + } + + this.comboBox1.SelectedIndex = 0; + } catch { } + } + + private void CheckPrinterConfig() { + String[] printers = Printer.ListPrinters(); + if(printers.Length == 0) { + _ = MessageBox.Show("Keine Drucker gefunden!", "Fehler"); + return; + } + + String printer = InIReader.GetInstance("settings").GetValue("Printer", "printer"); + String paperSize = InIReader.GetInstance("settings").GetValue("Printer", "papersize"); + String paperSource = InIReader.GetInstance("settings").GetValue("Printer", "papersource"); + String printerResolution = InIReader.GetInstance("settings").GetValue("Printer", "printerresolution"); + String landscape = InIReader.GetInstance("settings").GetValue("Printer", "landscape"); + + this.ListPrinters(printers, printer); + + this.ListPaperSizes(Printer.ListPaperSizes(this.printDocument1.PrinterSettings.PaperSizes), paperSize); + this.ListPaperSources(Printer.ListPaperSources(this.printDocument1.PrinterSettings.PaperSources), paperSource); + this.ListPrinterResolutions(Printer.ListPrinterResolutions(this.printDocument1.PrinterSettings.PrinterResolutions), printerResolution); + this.ListLandscape(landscape); + this._listBox_Printer.SelectedIndexChanged += this.ListBoxPrinter_SelectedIndexChanged; + this._listBox_PaperSize.SelectedIndexChanged += this.ListBoxPaperSize_SelectedIndexChanged; + this._listBox_PaperSources.SelectedIndexChanged += this.ListBoxPaperSources_SelectedIndexChanged; + this._listBox_PrinterResolution.SelectedIndexChanged += this.ListBoxPrinterResolution_SelectedIndexChanged; + this._checkBox_Landscape.CheckedChanged += this.CheckBoxLandscape_CheckedChanged; + + this.DrawPreview(); + } + + private Boolean CheckServerConfig() { + String server = InIReader.GetInstance("settings").GetValue("Inventree", "server"); + String auth = InIReader.GetInstance("settings").GetValue("Inventree", "authtoken"); + if(server is null || auth is null) { + this._mainTabBox.SelectedIndex = 1; + this._statusLabel.Text = "No Server/Authtoken is Set!"; + return false; + } else { + this._textBox_ServerAddress.Text = server; + this._textBox_AuthToken.Text = auth; + this._textServerName.Text = server; + this.req.SetAuthToken(auth); + } + try { + String text = this.req.RequestString(server + "/api/version/"); + JsonData json = JsonMapper.ToObject(text); + if(json.ContainsKey("version") && json["version"].IsObject) { + this._statusLabel.Text = "Verbunden"; + } + } catch { + this._statusLabel.Text = "Fehler beim Verbinden!"; + this._mainTabBox.SelectedIndex = 1; + return false; + } + return true; + } + + private void DrawPreview() { + this.pictureBox1.Size = this.printDocument1.DefaultPageSettings.Landscape + ? new Size((this.printDocument1.DefaultPageSettings.PaperSize.Height * 2) + 2, (this.printDocument1.DefaultPageSettings.PaperSize.Width * 2) + 2) + : new Size((this.printDocument1.DefaultPageSettings.PaperSize.Width * 2) + 2, (this.printDocument1.DefaultPageSettings.PaperSize.Height * 2) + 2); + + Bitmap bmp = new(this.printDocument1.DefaultPageSettings.PaperSize.Width - 2, this.printDocument1.DefaultPageSettings.PaperSize.Height - 2); + Graphics g = Graphics.FromImage(bmp); + Drawing.GetLabel(g, this.part); + Bitmap bigger_bmp = new(bmp, new Size(bmp.Width * 2, bmp.Height * 2)); + Bitmap scaled_prev = new(this.pictureBox1.Size.Width, this.pictureBox1.Size.Height); + Graphics.FromImage(scaled_prev).DrawImage(bigger_bmp, 1, 1); + Graphics.FromImage(scaled_prev).DrawRectangle(new Pen(Brushes.Red), new Rectangle(0, 0, scaled_prev.Width - 1, scaled_prev.Height - 1)); + this.pictureBox1.Image = scaled_prev; + } + + #endregion + + #region Get Printer Settings + + private void ListPrinters(String[] printers, String printer) { + this._listBox_Printer.Items.Clear(); + this._listBox_Printer.Items.AddRange(printers); + if(printer is null) { + this.SetPrinter(printers[0]); + this._listBox_Printer.SelectedIndex = 0; + } else { + Int32 printer_index = Array.IndexOf(printers, printer); + if(printer_index != -1) { + this.SetPrinter(printers[printer_index]); + this._listBox_Printer.SelectedIndex = printer_index; + } else { + this.SetPrinter(printers[0]); + this._listBox_Printer.SelectedIndex = 0; + } + } + } + + private void ListPaperSizes(String[] paperSizes, String papersize) { + this._listBox_PaperSize.Items.Clear(); + if(paperSizes.Length > 0) { + this._listBox_PaperSize.Items.AddRange(paperSizes); + if(papersize is null) { + this.SetPaperSize(0); + this._listBox_PaperSize.SelectedIndex = 0; + } else { + Int32 papersize_index = Array.IndexOf(paperSizes, papersize); + if(papersize_index != -1) { + this.SetPaperSize(papersize_index); + this._listBox_PaperSize.SelectedIndex = papersize_index; + } else { + this.SetPaperSize(0); + this._listBox_PaperSize.SelectedIndex = 0; + } + } + } + } + + private void ListPaperSources(String[] paperSources, String paperSource) { + this._listBox_PaperSources.Items.Clear(); + if(paperSources.Length > 0) { + this._listBox_PaperSources.Items.AddRange(paperSources); + if(paperSource is null) { + this.SetPaperSource(0); + this._listBox_PaperSources.SelectedIndex = 0; + } else { + Int32 papersource_index = Array.IndexOf(paperSources, paperSource); + if(papersource_index != -1) { + this.SetPaperSource(papersource_index); + this._listBox_PaperSources.SelectedIndex = papersource_index; + } else { + this.SetPaperSource(0); + this._listBox_PaperSources.SelectedIndex = 0; + } + } + } + } + + private void ListPrinterResolutions(String[] printerResolutions, String printerResolution) { + this._listBox_PrinterResolution.Items.Clear(); + if(printerResolutions.Length > 0) { + this._listBox_PrinterResolution.Items.AddRange(printerResolutions); + if(printerResolution is null) { + this.SetPrinterResolution(0); + this._listBox_PrinterResolution.SelectedIndex = 0; + } else { + Int32 printerresolution_index = Array.IndexOf(printerResolutions, printerResolution); + if(printerresolution_index != -1) { + this.SetPrinterResolution(printerresolution_index); + this._listBox_PrinterResolution.SelectedIndex = printerresolution_index; + } else { + this.SetPrinterResolution(0); + this._listBox_PrinterResolution.SelectedIndex = 0; + } + } + } + } + + private void ListLandscape(String landscape) { + this._checkBox_Landscape.Checked = this.printDocument1.DefaultPageSettings.Landscape; + if(landscape is not null) { + if(Boolean.TryParse(landscape, out Boolean ls)) { + this.printDocument1.DefaultPageSettings.Landscape = ls; + this._checkBox_Landscape.Checked = ls; + } + } + } + + #endregion + + #region Set Printer Settings + private void SetPrinter(String printer) { + this.printDocument1.PrinterSettings.PrinterName = printer; + this._textPrinterName.Text = printer; + } + + private void SetPaperSize(Int32 papersize) => this.printDocument1.DefaultPageSettings.PaperSize = this.printDocument1.PrinterSettings.PaperSizes[papersize]; + + private void SetPaperSource(Int32 papersource) => this.printDocument1.DefaultPageSettings.PaperSource = this.printDocument1.PrinterSettings.PaperSources[papersource]; + + private void SetPrinterResolution(Int32 printerresolution) => this.printDocument1.DefaultPageSettings.PrinterResolution = this.printDocument1.PrinterSettings.PrinterResolutions[printerresolution]; + + #endregion + + private void PrintDocument1_PrintPage(Object sender, PrintPageEventArgs e) { + if(this.printList.TryDequeue(out Ecia item)) { + Drawing.GetLabel(e.Graphics, item); + e.HasMorePages = this.printList.Count > 0; + } + } + + private void ButtonPrintPreview_Click(Object sender, EventArgs e) { + this.PreparePintList(); + _ = this.printPreviewDialog1.ShowDialog(); + } + + 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); + } + } + } + } + } + } + + private void ButtonPrint_Click(Object sender, EventArgs e) { + this.PreparePintList(); + this.printDocument1.Print(); + } + + private void ButtonQueryPo_Click(Object sender, EventArgs e) => this.GetPOList(); + + private void ButtonSaveSettings_Click(Object sender, EventArgs e) { + InIReader.GetInstance("settings").SetValue("Inventree", "server", this._textBox_ServerAddress.Text); + InIReader.GetInstance("settings").SetValue("Inventree", "authtoken", this._textBox_AuthToken.Text); + InIReader.GetInstance("settings").SetValue("Printer", "printer", this._listBox_Printer.Items[this._listBox_Printer.SelectedIndex].ToString()); + InIReader.GetInstance("settings").SetValue("Printer", "papersize", this._listBox_PaperSize.Items[this._listBox_PaperSize.SelectedIndex].ToString()); + InIReader.GetInstance("settings").SetValue("Printer", "papersource", this._listBox_PaperSources.Items[this._listBox_PaperSources.SelectedIndex].ToString()); + InIReader.GetInstance("settings").SetValue("Printer", "printerresolution", this._listBox_PrinterResolution.Items[this._listBox_PrinterResolution.SelectedIndex].ToString()); + InIReader.GetInstance("settings").SetValue("Printer", "landscape", this._checkBox_Landscape.Checked.ToString()); + this._mainTabBox.SelectedIndex = 0; + this.PrepairForm(); + } + + private void ListBoxPrinter_SelectedIndexChanged(Object sender, EventArgs e) { + if(sender is ListBox and not null) { + ListBox a = sender as ListBox; + this.SetPrinter(a.SelectedItem.ToString()); + this._listBox_PaperSize.SelectedIndexChanged -= this.ListBoxPaperSize_SelectedIndexChanged; + this._listBox_PaperSources.SelectedIndexChanged -= this.ListBoxPaperSources_SelectedIndexChanged; + this._listBox_PrinterResolution.SelectedIndexChanged -= this.ListBoxPrinterResolution_SelectedIndexChanged; + this._checkBox_Landscape.CheckedChanged -= this.CheckBoxLandscape_CheckedChanged; + this.ListPaperSizes(Printer.ListPaperSizes(this.printDocument1.PrinterSettings.PaperSizes), null); + this.ListPaperSources(Printer.ListPaperSources(this.printDocument1.PrinterSettings.PaperSources), null); + this.ListPrinterResolutions(Printer.ListPrinterResolutions(this.printDocument1.PrinterSettings.PrinterResolutions), null); + this._listBox_PaperSize.SelectedIndexChanged += this.ListBoxPaperSize_SelectedIndexChanged; + this._listBox_PaperSources.SelectedIndexChanged += this.ListBoxPaperSources_SelectedIndexChanged; + this._listBox_PrinterResolution.SelectedIndexChanged += this.ListBoxPrinterResolution_SelectedIndexChanged; + this._checkBox_Landscape.CheckedChanged += this.CheckBoxLandscape_CheckedChanged; + this.DrawPreview(); + } + } + + private void ListBoxPaperSize_SelectedIndexChanged(Object sender, EventArgs e) { + if(sender is ListBox and not null) { + ListBox a = sender as ListBox; + this.SetPaperSize(a.SelectedIndex); + this.DrawPreview(); + } + } + + private void ListBoxPaperSources_SelectedIndexChanged(Object sender, EventArgs e) { + if(sender is ListBox and not null) { + ListBox a = sender as ListBox; + this.SetPaperSource(a.SelectedIndex); + this.DrawPreview(); + } + } + + private void ListBoxPrinterResolution_SelectedIndexChanged(Object sender, EventArgs e) { + if(sender is ListBox and not null) { + ListBox a = sender as ListBox; + this.SetPrinterResolution(a.SelectedIndex); + this.DrawPreview(); + } + } + + private void CheckBoxLandscape_CheckedChanged(Object sender, EventArgs e) { + if(sender is CheckBox and not null) { + CheckBox c = sender as CheckBox; + this.printDocument1.DefaultPageSettings.Landscape = c.Checked; + this.DrawPreview(); + } + } + + private void comboBox1_SelectedIndexChanged(Object sender, EventArgs e) { + if(sender is ComboBox c and not null) { + if(c.Items[c.SelectedIndex] is String s) { + if(s == " - Auswahl -") { + return; + } + } else if(c.Items[c.SelectedIndex] is POList po) { + try { + String json = this.req.RequestString(this._textBox_ServerAddress.Text + "/api/order/po-line/?limit=1000&order=" + po.Pk); + JsonData j = JsonMapper.ToObject(json); + this.dataGridView1.Rows.Clear(); + Int32 i = 1; + foreach(JsonData item in j["results"]) { + DataGridViewRow r = new DataGridViewRow(); + r.CreateCells(this.dataGridView1); + + r.Cells[0].Value = true; + r.Cells[1].Value = i; + r.Cells[2].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()), + EciaFormat = new Ecia { + CustomerPO = po.Reference, + PackageId = 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(), + DateCode = DateTime.Now.ToString("yy01"), + LotCode = "1", + County = "DE" + } + }; + r.Cells[3].Value = item["sku"].ToString(); + r.Cells[4].Value = Double.Parse(item["quantity"].ToString()); + + _ = this.dataGridView1.Rows.Add(r); + } + this.CalcLabelCount(); + } catch { } + } + } + } + + private void DataGridView1_CellContentClick(Object sender, DataGridViewCellEventArgs e) => this.dataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit); + + private void DataGridView1_CellValueChanged(Object sender, DataGridViewCellEventArgs e) => this.CalcLabelCount(); + + 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; + } + } + } + this.labelCount.Text = "Anzahl zu druckender Labels: " + i; + } + + private void DataGridView1_SelectionChanged(Object sender, EventArgs e) { + 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) { + this.part = l.EciaFormat; + this.DrawPreview(); + } + } + } + } + + private void ButtonAll_Click(Object sender, EventArgs e) { + foreach(DataGridViewRow item in this.dataGridView1.Rows) { + item.Cells[0].Value = true; + } + } + + private void ButtonNone_Click(Object sender, EventArgs e) { + foreach(DataGridViewRow item in this.dataGridView1.Rows) { + item.Cells[0].Value = false; + } + } + } +} diff --git a/InventreeBarcodeGenerator/Form1.resx b/InventreeBarcodeGenerator/Form1.resx new file mode 100644 index 0000000..0c9b652 --- /dev/null +++ b/InventreeBarcodeGenerator/Form1.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 366, 17 + + + + + AAABAAEAEBAAAAAAIAAoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////APb29v/29vb/9vb2//b29v/29vb/9vb2//b2 + 9v////8A////AP///wD///8A9vb2//b29v/29vb/9vb2//b29v/29vb/QkJC/0JCQv9CQkL/QkJC/0JC + Qv/29vb/////AP///wD///8A////APb29v9CQkL/QkJC/0JCQv9CQkL/9vb2/0JCQv9CQkL/QkJC/0JC + Qv9CQkL/9vb2/////wD///8A////AP///wD29vb/QkJC/0JCQv9CQkL/QkJC//b29v9CQkL/QkJC/0JC + Qv9CQkL/QkJC//b29v////8A////AP///wD///8A9vb2/0JCQv9CQkL/QkJC/0JCQv/29vb/9vb2//b2 + 9v/29vb/9vb2//b29v/29vb/9vb2//b29v////8A////APb29v9CQkL/QkJC/0JCQv9CQkL/9vb2/0JC + Qv9CQkL/QkJC/0JCQv9CQkL/QkJC/0JCQv/29vb/////AP///wD29vb/QkJC/0JCQv9CQkL/QkJC//b2 + 9v9CQkL/QkJC/0JCQv9CQkL/QkJC/0JCQv9CQkL/9vb2/////wD///8A9vb2/0JCQv9CQkL/QkJC/0JC + Qv/29vb/QkJC/0JCQv9CQkL/QkJC/0JCQv9CQkL/QkJC//b29v////8A////APb29v/29vb/9vb2//b2 + 9v/29vb/9vb2/0JCQv9CQkL/QkJC/0JCQv9CQkL/QkJC/0JCQv/29vb/////AP///wD///8A////AP// + /wD///8A////APb29v9CQkL/QkJC/0JCQv9CQkL/QkJC/0JCQv9CQkL/9vb2/////wD///8A////AP// + /wD///8A////AP///wD29vb/QkJC/0JCQv9CQkL/QkJC/0JCQv9CQkL/QkJC//b29v////8A////AP// + /wD///8A////AP///wD///8A9vb2/0JCQv9CQkL/QkJC/0JCQv9CQkL/QkJC/0JCQv/29vb/////AP// + /wD///8A////AP///wD///8A////APb29v/29vb/9vb2//b29v/29vb/9vb2//b29v/29vb/9vb2//// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A + + + + 561, 17 + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/InventreeBarcodeGenerator/Helpers/DMHelper.cs b/InventreeBarcodeGenerator/Helpers/DMHelper.cs new file mode 100644 index 0000000..043c367 --- /dev/null +++ b/InventreeBarcodeGenerator/Helpers/DMHelper.cs @@ -0,0 +1,18 @@ +using DataMatrix.net; + +using BlubbFish.Applications.Barcodes.Inventree.Models; + +namespace BlubbFish.Applications.Barcodes.Inventree.Helpers { + internal class DMHelper { + public static Image GetDataMatrix(Ecia code) { + DmtxImageEncoder encoder = new(); + DmtxImageEncoderOptions options = new() { + ModuleSize = 8, + MarginSize = 4, + BackColor = Color.White, + ForeColor = Color.Black + }; + return encoder.EncodeImage(code.ToEciaString(), options); + } + } +} diff --git a/InventreeBarcodeGenerator/Helpers/WebRequest.cs b/InventreeBarcodeGenerator/Helpers/WebRequest.cs new file mode 100644 index 0000000..63128df --- /dev/null +++ b/InventreeBarcodeGenerator/Helpers/WebRequest.cs @@ -0,0 +1,51 @@ +using System.Net; + +namespace BlubbFish.Applications.Barcodes.Inventree.Helpers { + internal class WebRequest { + private readonly HttpClient client = new(); + + public void SetAuthToken(String token) => this.SetHeader("Authorization", "Token " + token); + + private void SetHeader(String type, String value) { + if(this.client.DefaultRequestHeaders.Contains(type)) { + _ = this.client.DefaultRequestHeaders.Remove(type); + } + this.client.DefaultRequestHeaders.Add(type, value); + } + + public String RequestString(String address, String json = "", Boolean withoutput = true, RequestMethod method = RequestMethod.GET) { + String ret = null; + try { + HttpResponseMessage response = null; + if(method == RequestMethod.POST || method == RequestMethod.PUT) { + HttpContent content = new StringContent(json); + content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); + //content.Headers.Add("Content-Type", "application/json"); + if(method == RequestMethod.POST) { + response = this.client.PostAsync(address, content).Result; + } else if(method == RequestMethod.PUT) { + response = this.client.PutAsync(address, content).Result; + } + content.Dispose(); + } else if(method == RequestMethod.GET) { + response = this.client.GetAsync(address).Result; + } + if(!response.IsSuccessStatusCode) { + throw new Exception(response.StatusCode + ": " + response.ReasonPhrase); + } + if(withoutput && response != null) { + ret = response.Content.ReadAsStringAsync().Result; + } + } catch(Exception e) { + throw new WebException("Error while requesting Resource: \"" + address + "\" Method: " + method + " Data: " + json + " Fehler: " + e.Message); + } + return ret; + } + + public enum RequestMethod { + GET, + POST, + PUT + } + } +} diff --git a/InventreeBarcodeGenerator/InventreeBarcodeGenerator.csproj b/InventreeBarcodeGenerator/InventreeBarcodeGenerator.csproj new file mode 100644 index 0000000..99d7f57 --- /dev/null +++ b/InventreeBarcodeGenerator/InventreeBarcodeGenerator.csproj @@ -0,0 +1,75 @@ + + + + WinExe + net10.0-windows7.0 + true + enable + Res\mdi--barcode-scan.ico + + + + 1.1.0 + $(AssemblyVersion) + $(AssemblyVersion) + BlubbFish + BlubbFish.Applications.Barcodes.Inventree + Create Inventree PO Barcodes + BlubbFish + Inventree.Barcodes.Applications.BlubbFish + Copyright © BlubbFish 2025 - 14.02.2026 + de-DE + LICENSE + https://git.blubbfish.net/vs_projects/InventreeBarcodeGenerator + https://git.blubbfish.net/vs_projects/InventreeBarcodeGenerator.git + git + + 1.1.0 - 2016-02-14 - Rewrote to DataGridView + 1.0.0 - 2025-11-23 - Init + + README.md + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + + + + + + + True + \ + + + True + \ + + + + \ No newline at end of file diff --git a/InventreeBarcodeGenerator/InventreeBarcodeGenerator.csproj.user b/InventreeBarcodeGenerator/InventreeBarcodeGenerator.csproj.user new file mode 100644 index 0000000..f61322e --- /dev/null +++ b/InventreeBarcodeGenerator/InventreeBarcodeGenerator.csproj.user @@ -0,0 +1,8 @@ + + + + + Form + + + diff --git a/InventreeBarcodeGenerator/Models/Ecia.cs b/InventreeBarcodeGenerator/Models/Ecia.cs new file mode 100644 index 0000000..984f288 --- /dev/null +++ b/InventreeBarcodeGenerator/Models/Ecia.cs @@ -0,0 +1,47 @@ +namespace BlubbFish.Applications.Barcodes.Inventree.Models { + internal class Ecia { + public String CustomerPO { + get; set; + } + public String PackageId { + get; set; + } + public String ShipDate { + get; set; + } + public String SKU { + get; set; + } + public String MPN { + get; set; + } + public String CustomerPOLine { + get; set; + } + public String Quantity { + get; set; + } + public String DateCode { + get; set; + } + public String LotCode { + get; set; + } + public String County { + 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 + + "}"; + } +} diff --git a/InventreeBarcodeGenerator/Models/LineItem.cs b/InventreeBarcodeGenerator/Models/LineItem.cs new file mode 100644 index 0000000..1a0faad --- /dev/null +++ b/InventreeBarcodeGenerator/Models/LineItem.cs @@ -0,0 +1,23 @@ +namespace BlubbFish.Applications.Barcodes.Inventree.Models { + internal class LineItem { + public String Name { + get; set; + } + public String SKU { + get; set; + } + public String MPN { + get; set; + } + public Int32 LineNr { + get; set; + } + public Double Quantity { + get; set; + } + public Ecia EciaFormat { + get; set; + } + public override String ToString() => this.Quantity + "x " + this.Name; + } +} diff --git a/InventreeBarcodeGenerator/Models/POList.cs b/InventreeBarcodeGenerator/Models/POList.cs new file mode 100644 index 0000000..dce8244 --- /dev/null +++ b/InventreeBarcodeGenerator/Models/POList.cs @@ -0,0 +1,20 @@ +namespace BlubbFish.Applications.Barcodes.Inventree.Models { + internal class POList { + public String Reference { + get; set; + } + public String SupplierReference { + get; set; + } + public String Description { + get; set; + } + public Int32 Pk { + get; set; + } + public String SupplierName { + get; set; + } + public override String ToString() => this.Reference + " - " + this.Description + " (" + this.SupplierName + ")"; + } +} diff --git a/InventreeBarcodeGenerator/Printer.cs b/InventreeBarcodeGenerator/Printer.cs new file mode 100644 index 0000000..6d8589b --- /dev/null +++ b/InventreeBarcodeGenerator/Printer.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Drawing.Printing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlubbFish.Applications.Barcodes.Inventree { + internal class Printer { + internal static String[] ListPaperSizes(PrinterSettings.PaperSizeCollection paperSizes) { + List list = []; + foreach(PaperSize item in paperSizes) { + list.Add(item.PaperName); + } + return [.. list]; + } + + internal static String[] ListPaperSources(PrinterSettings.PaperSourceCollection paperSources) { + List list = []; + foreach(PaperSource item in paperSources) { + list.Add(item.SourceName); + } + return [.. list]; + } + + internal static String[] ListPrinterResolutions(PrinterSettings.PrinterResolutionCollection printerResolutions) { + List list = []; + foreach(PrinterResolution item in printerResolutions) { + list.Add(item.Kind + " (" + item.X + "," + item.Y + ")"); + } + return [.. list]; + } + internal static String[] ListPrinters() => [.. PrinterSettings.InstalledPrinters.Cast()]; + } +} diff --git a/InventreeBarcodeGenerator/Program.cs b/InventreeBarcodeGenerator/Program.cs new file mode 100644 index 0000000..441e8dc --- /dev/null +++ b/InventreeBarcodeGenerator/Program.cs @@ -0,0 +1,16 @@ +namespace BlubbFish.Applications.Barcodes.Inventree { + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } + } +} \ No newline at end of file diff --git a/InventreeBarcodeGenerator/Properties/Resources.Designer.cs b/InventreeBarcodeGenerator/Properties/Resources.Designer.cs new file mode 100644 index 0000000..4995d53 --- /dev/null +++ b/InventreeBarcodeGenerator/Properties/Resources.Designer.cs @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace BlubbFish.Applications.Barcodes.Inventree.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BlubbFish.Applications.Barcodes.Inventree.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap arrow_reload_16 { + get { + object obj = ResourceManager.GetObject("arrow_reload_16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap arrow_reload_24 { + get { + object obj = ResourceManager.GetObject("arrow_reload_24", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/InventreeBarcodeGenerator/Properties/Resources.resx b/InventreeBarcodeGenerator/Properties/Resources.resx new file mode 100644 index 0000000..9eeb3ea --- /dev/null +++ b/InventreeBarcodeGenerator/Properties/Resources.resx @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Res\arrow_reload_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Res\arrow_reload_24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/InventreeBarcodeGenerator/Res/arrow_reload.svg b/InventreeBarcodeGenerator/Res/arrow_reload.svg new file mode 100644 index 0000000..e6ffc48 --- /dev/null +++ b/InventreeBarcodeGenerator/Res/arrow_reload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/InventreeBarcodeGenerator/Res/arrow_reload_16.png b/InventreeBarcodeGenerator/Res/arrow_reload_16.png new file mode 100644 index 0000000000000000000000000000000000000000..8d11eeb4727cd18a7d5d4fb388a3e96949e1b1fb GIT binary patch literal 523 zcmV+m0`&cfP)|cU=cgvDTKdz)6A!6kY*% zLGXys`zBK<#|z1}O923SDZYWUa_>j@v7FkNDW%pYWKAD|#>m>$OfKWq0Ic*KKnS2g z)LRkrKbyQqZoiikD6iGYUN|J;U>p6-oq?o>JGh*~}XIJ72O_H)TDH*dU% zzET*I_!_`305Lu>!J{sK!_&kw;sUKs!Y N002ovPDHLkV1ll2;pzYY literal 0 HcmV?d00001 diff --git a/InventreeBarcodeGenerator/Res/arrow_reload_24.png b/InventreeBarcodeGenerator/Res/arrow_reload_24.png new file mode 100644 index 0000000000000000000000000000000000000000..af2ba2cc5c44636cc28b88554200365269f725c4 GIT binary patch literal 643 zcmV-}0(||6P)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10uV_= zK~zYI)s??%Q&AMhKj)>P3Q}7aoupe))Xn^|6^V(FB7#YzQa1y-xVY-nzo3hYV#hXv zNeT*LeMy)6@J0WD>Y|foaL^jCU~-RxEzOUYlt?P{J3a0__k7+xhx5Ins_dt%ea-F$ z2;`#0KrUJw7GR`nMVa3D6hwU4$Q2RhQ9{5ZpulI)GHRu(N!wO>*I7Dy5XeRqKrBwH zvV;=s_lJs9JV>gNSle*h@7V)2I4D7sFNi*DTGrXRnHa5`iBZdNPE{TOUj+>rOf{H^ zUK;2I+e(jkf88rxFa2~o99W(m<8b2%s<(j6rfK@#-(3GN2%sgBk`uRQx|c=#*+?3g z1IkXqo^IXmE|E}j1@w@j%9i&oPy;UbS7YJ6H~3fibCHy&ELv)=R+5Fv&;h;l|0nst z0otr0l(`%-V!c+;2i16fX&8XECi_=oVKJrv)Y$S)Ik#VJx*ZDSqQzFv+RfHID{UpJ z-dI~#qyn7a(C??RurOE&U7%eFjA`5fegJd+Go_Wl^6Xe=j1#wKoP;e6!#FCLeoWUn z@a19`Ej2HIqd-mIv7#^Q=Gex`BX#*!Z=CXY^qLy(BOC|51LFWr!j?S&0Oy~Fr#v3d zGuK+Ts|b<;{WuU{N5Nb)qA_loOf dk_X?5{s13y;}3-HLb(6{002ovPDHLkV1iF}Bxe8s literal 0 HcmV?d00001 diff --git a/InventreeBarcodeGenerator/Res/mdi--barcode-scan.ico b/InventreeBarcodeGenerator/Res/mdi--barcode-scan.ico new file mode 100644 index 0000000000000000000000000000000000000000..31c3070d221d5bface39c45e83d90ecb1ed10420 GIT binary patch literal 2202 zcmd^AdsNbS7XO)Ajb^UdsEKCUnl|QRR?K{$sd!8opFIpzB-adV1xHd$RBW6|oKZTP zIfajuA}Ak>DZUWpOlD={D-#nG(n1CeSXYHah1Iiv?U}!J_RqcF^F8<8@8_QHx#!-` zxfcNRw$8Tb0f&I^cLRXMmQ9X{3NtaXHrg^x!cRftw$bgod*_x)%wnbiz;0MLH0Vrj zwR{@KoXNK3EsdxNislSXL;b^$Uun$0Aq?t0jH>vp2KGJPU%lRu^eV^5(ENBu7b)#4 z_)KJ|M?`UoI>=DtJbLe1T{v`&Qu?$J{A$1QIG3Z&C)Sw{UFMAAhey_~a%*RnrT9R? z2lc#-0wUf@@b`jZ4ldgMW5Pri&^vwr;!3-kY`!#%7<{wuVt8OB=*BD8ADjfDYpN^W zO7VtlHp`SrPy9!=KW1h?b~*yn8w0COqV?$LYOaFD z%Pi~Q@`CR;o6(`>W@F^@`(ZQ=MjXQKAGu_@g6*0uZCN)Z%wI69BTlV2r8A~tXw^#_ z!6zFcd>%uq+t9JnH;P9E9g|4h`mp@3gkvi*V3$kQ(O$a8tz-; z$*EG!`1*M+vlm&3T4@M`?(9xhkzf|2o>R!5Jm&^HIGLScgqO4UT?yCoG2No`{9S7}`1AwrixM2uZ!f38iHpd&Fk z={2{~uGYK395^6lkv86?rKT?3qgR9!9szQfo$27P?8@4)E42JJ`Ng7H7kYjp+1W*i zG(ZO(wL_=(bA%#&bWoWZY}V2vhZLPVW_Q%FQbodY{b>FIUDqh#bcXxS9;@G%JbiNC z97euK=UgSprK2S!NE|k0vc2W-M>`AAXFj(2AdVU(j`mP32A=u`IP|q%QNIDO&m8#g z9T0|i?Yi~b`jXoT7C#k|bkBVDXaDKu(}U&hB<=OQR;{jM$mI`w`yZ)*WUKQ>G?2E* zsxFS$)4o;8dOX&f+;BK-P)5Hswdz-12zJmEHsu)uN#x^@)&pg{v6JjD2N)*;}OD-I5iG=Y{`>C~~a#hvH4 zhJTm~|882#o0*yc-f!AH7XDg0u5z{QuOH^D?Z+8x-riX`7%dcc!Qa z^QdpIaQ`vY-ZsV-&&8$!n;-Lnq3{XmJ^W$zfGBRRY14LE8F~RVAVi`rM2MaE)+1oE zr88nD{jl#CROcl|dk276dhzJ31|>`YGMJ`bY<@DEyL0qLUi>&QM=WRak-`Sx*%@h? zI#N8ANLX#5gpvJ($X!-Xgt*SM=jM@6Xw&L0S9kqAu`Cs~Ja^VzPq+F$xzHxo4nuH6 zomdc4bsKm>zp>t3s_)uK`ST7zl95%Zwb02)>}S68_mLeN+GZlQ(X0=Hb3u)!_ZRf7 zOCa918=B|9r>WLFx3o)cO!jbFtF^}|uLb-n4{y2stazW{z7BprY>VT#JGdRtr15wY z)|Sfdl(pALN#EQDo?nOC8WO7HJWDXPYP04p5;BsqW^|$e}Z{YN4b8bySvo9-t(W^Mg#EOYv3A!Xt+@m8Se_fyK)k&dsuNRw}U~c5D zspv^WL8?{xA+H6`SZRP?SN1Eq*-w-4#A$nqLDh8cCx&EdlaUJp!b%XhngZ;6@$G~c zg;~s-<;PM*AJ4wnfH?GaDxS)!Xc)JxDfiE8_b*o9o1wTItgzYkwF2>*r^WuF;vB3U z$J0TP$oV$!B8G~8Ffc{0xO0>1G-}D_?{b*CB;id{j`VeX`gufkq7krZyDWUCZ`Kmv zz-PgA{iS1Rvd6It;jwf5C4V^=0oNergN+{vkf{3fCgSDCBVaErf+(52ClV2HJ#%sj in``;|)eQidR$Aj*4|@l{EptV0 \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f0156c5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b9eebe3 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# BlubbFish.Applications.Barcodes.Inventree (InventreeBarcodeGenerator) +Tool that creates Barcodes to Print on a Printer + +Maybe you find this Repo on Github. This is a mirror from [here](https://git.blubbfish.net/vs_projects/InventreeBarcodeGenerators). \ No newline at end of file