Product Ticket

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Overview

Our customer has a pre-printed A6 sized product ticket with a space for printing the product code, product name, price, barcode and supplier. They want to be able to generate the product ticket so they can attach them to products in their shops.

To implement this, we are going to create a view and a parametrised report based on the view that generates a barcode from the product value. Our product values are alpha numeric so we need to choose a bar code standard that supports characters and numbers and is supported by our bar code scanners.

The solution

Create the View

I am using postgres so I log in to postgres with:

psql -d adempiere -U adempiere

And then create the view with the following code:

create view rv_productticket as SELECT p.m_product_id, p.value, p.name, p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated,
 p.updatedby, pp.pricelist, pp.pricestd, ppo.iscurrentvendor, ppo.upc, pbp.name AS supplier_name, plv.name AS pricelist_name, 
 plv.m_pricelist_version_ id,  pl.issopricelist
  FROM m_product p
  JOIN m_productprice pp ON pp.m_product_id = p.m_product_id
  JOIN m_product_po ppo ON ppo.m_product_id = p.m_product_id
  JOIN c_bpartner pbp ON pbp.c_bpartner_id = ppo.c_bpartner_id
  JOIN m_pricelist_version plv ON plv.m_pricelist_version_id = pp.m_pricelist_version_id
  JOIN m_pricelist pl ON pl.m_pricelist_id = plv.m_pricelist_id;

Add some new font styles

In System Admin->General Rules->Printing->Print Font

Add some new font sizes so you can have larger fonts sizes to print on to the product tickets e.g. sansserif-BOLD-30

Add the page size

Our printed tickets are A6 sized.

In System Admin->General Rules->Printing->Print Paper add a new record.

112.png

Import the View

In Adempiere log in as the SuperUser or System user.

Open the "Tables & Columns" window.

110.png
  1. Create a new table called RV_ProductTicket
  2. Make sure this is marked as a "View"
  3. Create columns from DB

Edit the columns as follows:

111.png

Create the Report

The report requires two parameters, the product and the pricelist. We have also set up a dynamic reference to ensure only sales prices are selected and you might also like to add a parameter for copies in order to print multiple copies.

Report Tab

Create a new report RV_ProductTicket as per the screenshot
113.png

Add the Parameters

M_Product_ID M_Pricelist_Version_ID

Add the Report to the Menu Tree

114.png


Customise the Report

The Final Result