inventree-cab-plugin


Nameinventree-cab-plugin JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/fturati/inventree-cab-plugin
SummaryCab label printer plugin for InvenTree
upload_time2024-01-04 15:24:09
maintainer
docs_urlNone
authorFlorian Turati
requires_python>=3.9
licenseMIT
keywords inventree label printer printing inventory
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # inventree-cab-plugin

A label printing plugin for [InvenTree](https://inventree.org/), which provides support for the [Cab label printers](https://www.cab.de/en/marking/label-printer/).

This plugin supports printing to cab printers using FTP. It was only tested on the MACH 4S model but should work on other models with similar capabilities.

## Installation

Add the following line to `plugins.txt` for automatic installation using the `invoke install` command:

```text
install inventree-cab-plugin
```

Or install manually with:

```shell
pip install inventree-cab-plugin
```

For further development, can also setup an editable install (see InvenTree [documentation](https://docs.inventree.org/en/latest/extend/how_to_plugin/#local-plugin-development)).

An example using the InvenTree docker (see InvenTree [documentation](https://docs.inventree.org/en/latest/start/docker_dev/#docker-development-server)):

```shell
# Setup InvenTree development docker
git clone https://github.com/inventree/InvenTree.git && cd InvenTree
docker compose run inventree-dev-server invoke update
docker compose run inventree-dev-server invoke setup-test --dev
docker compose up -d

# Install plugin inside docker container
docker ps 
# Note the `NAME` or `CONTAINER ID` unique prefix for inventree-dev-server container
docker exec -it inventree-inventree-dev-server-1 /bin/sh
# In shell inside docker
source data/env/bin/activate
# Copy plugin code to data/plugins/ folder on host (same folder is already mounted inside docker)
cd ./data/plugins/inventree-cab-plugin
pip install --editable .
```

## Configuration Options

In InvenTree Web GUI (In docker development environment accessible on http://localhost:8000), go to the settings page and then to the plugin settings section.
If run InvenTree inside docker, should toggle the `Check plugins on startup` setting and restart (`docker compose restart`) if it was not enabled.

Afterward can enable the Cab Labels plugin and access its settings.
The IP Address of the printer should be entered for the plugin to work. The other settings should be modified according to the printer settings.

## Printing Options

When select stock items to print labels for, can select a label template.
On InvenTree administration page can upload new label template e.g., Stock Item Label (in dev. environment at http://localhost:8000/admin/label/stockitemlabel/).

Here can click on `ADD STOCK ITEM LABEL`, give the label a name, select a file and configure the other desired parameters like the width and height, then save.

An example jscript is shown below. Upload it as an html label template to inventree as described above.

For other examples can refer to the Programming cab printer PDF that can be found online e.g. from cab [website](https://www.cab.de/media/pushfile.cfm?file=3963). There is also a jscript programming manual available from cab website.

The variables in `{{ }}` are from the django template language (see django [documentation](https://docs.djangoproject.com/en/5.0/topics/templates/)).

```html
; Set [m]easurements to [m]illimeters
m m

; Create a [J]ob
J

; [S]et Label Size
; S [start detection;] displacement to the right, displacement downwards, height, height + gap, width
; S l1; 0, 0, 30, 32, 60
; using {{ height }} {{ width }} params configured when uploaded template jscript
; S l1; 0, 0, {{ height }}, {{ height|add:2}}, {{ width }}

; W:[refrence;] , x position, y position, rotation, width, height, font, size; text
W:Titlebox; 1, 1, 0, {{ width }}, 6, 3, 3; <HTML>
<h2>Company</h2>
</HTML>


; Barcode
; B [name;] x, y, r, type[+options], size; content
; NOTE: IF write CODE128 will print text of barcode below, but not if write CODE128
; with code128 need to specify height, width smallest bar
B 1, 7, 0, code128, 8, 0.2; {{ qr_data }}

; W: x, y, rotation, width, height, font, size; text
W:Textbox; 1, 15, 0, {{ width }}, 12, 3, 2;<HTML>
<p>SN: {{ serial }}</p>
<p>PN: {{ part.IPN }}</p>
<p>{{ part.name }}</p>
</HTML>

; Print one label
; A 1
; Preview at https://PRINTER_IP/cgi-bin/bitmap
A [preview]
```

If use the preview command `A [preview]` toggle the preview option before printing in inventree.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fturati/inventree-cab-plugin",
    "name": "inventree-cab-plugin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "inventree label printer printing inventory",
    "author": "Florian Turati",
    "author_email": "flo.turati@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/95/03/7f341d883054b8e4655adec703f01e6138e258f99271aa8a2f577952fa7d/inventree-cab-plugin-0.1.0.tar.gz",
    "platform": null,
    "description": "# inventree-cab-plugin\n\nA label printing plugin for [InvenTree](https://inventree.org/), which provides support for the [Cab label printers](https://www.cab.de/en/marking/label-printer/).\n\nThis plugin supports printing to cab printers using FTP. It was only tested on the MACH 4S model but should work on other models with similar capabilities.\n\n## Installation\n\nAdd the following line to `plugins.txt` for automatic installation using the `invoke install` command:\n\n```text\ninstall inventree-cab-plugin\n```\n\nOr install manually with:\n\n```shell\npip install inventree-cab-plugin\n```\n\nFor further development, can also setup an editable install (see InvenTree [documentation](https://docs.inventree.org/en/latest/extend/how_to_plugin/#local-plugin-development)).\n\nAn example using the InvenTree docker (see InvenTree [documentation](https://docs.inventree.org/en/latest/start/docker_dev/#docker-development-server)):\n\n```shell\n# Setup InvenTree development docker\ngit clone https://github.com/inventree/InvenTree.git && cd InvenTree\ndocker compose run inventree-dev-server invoke update\ndocker compose run inventree-dev-server invoke setup-test --dev\ndocker compose up -d\n\n# Install plugin inside docker container\ndocker ps \n# Note the `NAME` or `CONTAINER ID` unique prefix for inventree-dev-server container\ndocker exec -it inventree-inventree-dev-server-1 /bin/sh\n# In shell inside docker\nsource data/env/bin/activate\n# Copy plugin code to data/plugins/ folder on host (same folder is already mounted inside docker)\ncd ./data/plugins/inventree-cab-plugin\npip install --editable .\n```\n\n## Configuration Options\n\nIn InvenTree Web GUI (In docker development environment accessible on http://localhost:8000), go to the settings page and then to the plugin settings section.\nIf run InvenTree inside docker, should toggle the `Check plugins on startup` setting and restart (`docker compose restart`) if it was not enabled.\n\nAfterward can enable the Cab Labels plugin and access its settings.\nThe IP Address of the printer should be entered for the plugin to work. The other settings should be modified according to the printer settings.\n\n## Printing Options\n\nWhen select stock items to print labels for, can select a label template.\nOn InvenTree administration page can upload new label template e.g., Stock Item Label (in dev. environment at http://localhost:8000/admin/label/stockitemlabel/).\n\nHere can click on `ADD STOCK ITEM LABEL`, give the label a name, select a file and configure the other desired parameters like the width and height, then save.\n\nAn example jscript is shown below. Upload it as an html label template to inventree as described above.\n\nFor other examples can refer to the Programming cab printer PDF that can be found online e.g. from cab [website](https://www.cab.de/media/pushfile.cfm?file=3963). There is also a jscript programming manual available from cab website.\n\nThe variables in `{{ }}` are from the django template language (see django [documentation](https://docs.djangoproject.com/en/5.0/topics/templates/)).\n\n```html\n; Set [m]easurements to [m]illimeters\nm m\n\n; Create a [J]ob\nJ\n\n; [S]et Label Size\n; S [start detection;] displacement to the right, displacement downwards, height, height + gap, width\n; S l1; 0, 0, 30, 32, 60\n; using {{ height }} {{ width }} params configured when uploaded template jscript\n; S l1; 0, 0, {{ height }}, {{ height|add:2}}, {{ width }}\n\n; W:[refrence;] , x position, y position, rotation, width, height, font, size; text\nW:Titlebox; 1, 1, 0, {{ width }}, 6, 3, 3; <HTML>\n<h2>Company</h2>\n</HTML>\n\n\n; Barcode\n; B [name;] x, y, r, type[+options], size; content\n; NOTE: IF write CODE128 will print text of barcode below, but not if write CODE128\n; with code128 need to specify height, width smallest bar\nB 1, 7, 0, code128, 8, 0.2; {{ qr_data }}\n\n; W: x, y, rotation, width, height, font, size; text\nW:Textbox; 1, 15, 0, {{ width }}, 12, 3, 2;<HTML>\n<p>SN: {{ serial }}</p>\n<p>PN: {{ part.IPN }}</p>\n<p>{{ part.name }}</p>\n</HTML>\n\n; Print one label\n; A 1\n; Preview at https://PRINTER_IP/cgi-bin/bitmap\nA [preview]\n```\n\nIf use the preview command `A [preview]` toggle the preview option before printing in inventree.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Cab label printer plugin for InvenTree",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/fturati/inventree-cab-plugin"
    },
    "split_keywords": [
        "inventree",
        "label",
        "printer",
        "printing",
        "inventory"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1a889f76a2d88f223942dd694217e9d0d3b7600210416095db17a5195e31c64",
                "md5": "5ab176fe7c3b82f5f508a32e46bb5da0",
                "sha256": "a76d496ffe7b1ee0f197667f684ed344aa6a75a260709cc9bdefc5f8130f15a0"
            },
            "downloads": -1,
            "filename": "inventree_cab_plugin-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5ab176fe7c3b82f5f508a32e46bb5da0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 10294,
            "upload_time": "2024-01-04T15:24:08",
            "upload_time_iso_8601": "2024-01-04T15:24:08.332203Z",
            "url": "https://files.pythonhosted.org/packages/b1/a8/89f76a2d88f223942dd694217e9d0d3b7600210416095db17a5195e31c64/inventree_cab_plugin-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95037f341d883054b8e4655adec703f01e6138e258f99271aa8a2f577952fa7d",
                "md5": "592a07a4db6de1b49f1a37a8ee313a75",
                "sha256": "6d7a12c5c77065a7117d77e217f20d48c4cda794ec690b294fe94322575a0f90"
            },
            "downloads": -1,
            "filename": "inventree-cab-plugin-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "592a07a4db6de1b49f1a37a8ee313a75",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10933,
            "upload_time": "2024-01-04T15:24:09",
            "upload_time_iso_8601": "2024-01-04T15:24:09.660179Z",
            "url": "https://files.pythonhosted.org/packages/95/03/7f341d883054b8e4655adec703f01e6138e258f99271aa8a2f577952fa7d/inventree-cab-plugin-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-04 15:24:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fturati",
    "github_project": "inventree-cab-plugin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "inventree-cab-plugin"
}
        
Elapsed time: 0.15740s