5.0 Source Code

Committing 5.0 Source Code
This commit is contained in:
2023-04-06 18:58:04 +01:00
parent 0f3ede77fa
commit 0282345603
1680 changed files with 241310 additions and 0 deletions
@@ -0,0 +1,72 @@
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.IKeyed;
import com.unicenta.data.loader.ImageUtils;
import com.unicenta.data.loader.SerializerRead;
import java.awt.image.*;
public class CardInfo implements IKeyed {
private static final long serialVersionUID = 1612339444103L;
private String m_sID;
private String m_sCardName;
private double m_Charges;
/** Creates new CategoryInfo */
public CardInfo(String id, String name, double charges) {
m_sID = id;
m_sCardName = name;
m_Charges = charges;
}
@Override
public Object getKey() {
return m_sID;
}
public void setID(String sID) {
m_sID = sID;
}
public String getID() {
return m_sID;
}
public String getName() {
return m_sCardName;
}
public void setName(String sName) {
m_sCardName = sName;
}
@Override
public String toString() {
return m_sCardName;
}
public static SerializerRead getSerializerRead() {
return new SerializerRead() {@Override
public Object readValues(DataRead dr) throws BasicException {
return new CardInfo(dr.getString(1), dr.getString(2), dr.getDouble(3));
}};
}
/**
* @return the m_Charges
*/
public double getM_Charges() {
return m_Charges;
}
/**
* @param m_Charges the m_Charges to set
*/
public void setM_Charges(double m_Charges) {
this.m_Charges = m_Charges;
}
}
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 50]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="1"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jCategory" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,167 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.loader.SerializerWrite;
import com.unicenta.data.loader.SerializerWriteBasic;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.reports.ReportEditorCreator;
import java.awt.Component;
import java.util.List;
/**
*
* @author JG uniCenta
*/
public class CategoryFilter extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
/** Creates new form JQBFProduct */
public CategoryFilter() {
initComponents();
}
/**
*
* @param app
*/
@Override
public void init(AppView app) {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
}
/**
*
* @return
*/
@Override
public SerializerWrite getSerializerWrite() {
return new SerializerWriteBasic(
new Datas[] {
Datas.OBJECT, Datas.STRING
}
);
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
return new Object[] {
m_CategoryModel.getSelectedKey() == null
? QBFCompareEnum.COMP_NONE
: QBFCompareEnum.COMP_EQUALS,
m_CategoryModel.getSelectedKey(),
QBFCompareEnum.COMP_NONE, null };
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
m_jCategory = new javax.swing.JComboBox();
jLabel1 = new javax.swing.JLabel();
setPreferredSize(new java.awt.Dimension(400, 50));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(200, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(150, 30));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JComboBox m_jCategory;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 50]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCategory" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,167 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.loader.SerializerWrite;
import com.unicenta.data.loader.SerializerWriteBasic;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.reports.ReportEditorCreator;
import java.awt.Component;
import java.util.List;
/**
*
* @author JG uniCenta
*/
public class CategoryFilter_1 extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
/** Creates new form JQBFProduct */
public CategoryFilter_1() {
initComponents();
}
/**
*
* @param app
*/
@Override
public void init(AppView app) {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
m_sentcat = dlSales.getCategoriesList_1();
m_CategoryModel = new ComboBoxValModel();
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
}
/**
*
* @return
*/
@Override
public SerializerWrite getSerializerWrite() {
return new SerializerWriteBasic(
new Datas[] {
Datas.OBJECT, Datas.STRING
}
);
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
return new Object[] {
m_CategoryModel.getSelectedKey() == null
? QBFCompareEnum.COMP_NONE
: QBFCompareEnum.COMP_EQUALS,
m_CategoryModel.getSelectedKey(),
QBFCompareEnum.COMP_NONE, null };
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
m_jCategory = new javax.swing.JComboBox();
jLabel1 = new javax.swing.JLabel();
setPreferredSize(new java.awt.Dimension(400, 50));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(200, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(150, 30));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JComboBox m_jCategory;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,172 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.IKeyed;
import com.unicenta.data.loader.ImageUtils;
import com.unicenta.data.loader.SerializerRead;
import java.awt.image.*;
/**
*
* @author Adrian
* @version
*/
public class CategoryInfo implements IKeyed {
private static final long serialVersionUID = 8612449444103L;
private String m_sID;
private String m_sName;
private String m_sTextTip;
private BufferedImage m_Image;
private Boolean m_bCatShowName;
/** Creates new CategoryInfo
* @param id
* @param name
* @param image
* @param texttip
* @param catshowname */
public CategoryInfo(String id, String name, BufferedImage image, String texttip, Boolean catshowname) {
m_sID = id;
m_sName = name;
m_Image = image;
m_sTextTip = texttip;
m_bCatShowName = catshowname;
}
/**
*
* @return
*/
@Override
public Object getKey() {
return m_sID;
}
/**
*
* @param sID
*/
public void setID(String sID) {
m_sID = sID;
}
/**
*
* @return
*/
public String getID() {
return m_sID;
}
/**
*
* @return
*/
public String getName() {
return m_sName;
}
/**
*
* @param sName
*/
public void setName(String sName) {
m_sName = sName;
}
/**
*
* @return
*/
public String getTextTip() {
return m_sTextTip;
}
/**
*
* @param sName
*/
public void setTextTip(String sName) {
m_sTextTip = sName;
}
/**
*
* @return
*/
public Boolean getCatShowName() {
return m_bCatShowName;
}
/**
*
* @param bcatshowname
*/
public void setCatShowName(Boolean bcatshowname) {
m_bCatShowName = bcatshowname;
}
// *******************************
/**
*
* @return
*/
public BufferedImage getImage() {
return m_Image;
}
/**
*
* @param img
*/
public void setImage(BufferedImage img) {
m_Image = img;
}
@Override
public String toString() {
return m_sName;
}
/**
*
* @return
*/
public static SerializerRead getSerializerRead() {
return new SerializerRead() {
@Override
public Object readValues(DataRead dr) throws BasicException {
return new CategoryInfo(dr.getString(1),
dr.getString(2), ImageUtils.readImage(dr.getBytes(3)),
dr.getString(4),dr.getBoolean(5));
}};
}
}
@@ -0,0 +1,97 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.SerializableRead;
import com.unicenta.format.Formats;
import java.util.Date;
/**
*
* @author Mikel irurita
*/
public class FindTicketsInfo implements SerializableRead {
private int ticketid;
private int tickettype;
private Date date;
private String name;
private String customer;
private double total;
private int ticketstatus;
public FindTicketsInfo() {
}
/**
*
* @param dr
* @throws BasicException
*/
@Override
public void readValues(DataRead dr) throws BasicException {
ticketid = dr.getInt(1);
tickettype = dr.getInt(2);
date = dr.getTimestamp(3);
name = dr.getString(4);
customer = dr.getString(5);
total = (dr.getObject(6) == null) ? 0.0 : dr.getDouble(6);
ticketstatus = dr.getInt(7);
}
@Override
public String toString(){
String sCustomer = (customer==null) ? "" : customer;
String sHtml = "<tr><td width=\"75\">"+ "["+ ticketid +"]" +"</td>" +
"<td width=\"75\">"+ Formats.TIMESTAMP.formatValue(date) +"</td>" +
"<td align=\"right\" width=\"100\">"+ Formats.CURRENCY.formatValue(total) +"</td>"+
"<td align=\"left\" width=\"100\">"+ sCustomer +"</td>" +
"<td align=\"left\" width=\"100\">"+ Formats.STRING.formatValue(name) +"</td></tr>";
return sHtml;
}
/**
*
* @return
*/
public int getTicketId(){
return this.ticketid;
}
/**
*
* @return
*/
public int getTicketType(){
return this.tickettype;
}
public int getTicketStatus() {
return this.ticketstatus;
}
}
@@ -0,0 +1,69 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta & previous Openbravo POS works
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JList;
/**
*
* @author Mikel Irurita
*/
public class FindTicketsRenderer extends DefaultListCellRenderer {
private final Icon icoTicketNormal;
private final Icon icoTicketRefund;
private final Icon icoTicketRefunded;
/**
*
*/
public static final int RECEIPT_NORMAL = 0;
public static final int RECEIPT_REFUND = 1;
/** Creates a new instance of TicketRenderer */
public FindTicketsRenderer() {
this.icoTicketNormal = new ImageIcon(getClass().getClassLoader().getResource("com/unicenta/images/pay.png"));
this.icoTicketRefund = new ImageIcon(getClass().getClassLoader().getResource("com/unicenta/images/refundit.png"));
this.icoTicketRefunded = new ImageIcon(getClass().getClassLoader().getResource("com/unicenta/images/cancel.png"));
}
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
int ticketType = ((FindTicketsInfo)value).getTicketType();
int ticketStatus = ((FindTicketsInfo)value).getTicketStatus();
setText("<html><table>" + value.toString() +"</table></html>");
if (ticketType == RECEIPT_NORMAL) {
setIcon(icoTicketNormal);
} else if (ticketType == RECEIPT_REFUND) {
setIcon(icoTicketRefund);
} else if (ticketType == RECEIPT_NORMAL && ticketStatus > 0) {
setIcon(icoTicketRefunded);
}
return this;
}
}
@@ -0,0 +1,76 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.IKeyed;
import com.unicenta.data.loader.SerializerRead;
public class HostInfo implements IKeyed {
//MONEY HOST HOSTSEQUENCE DATESTART DATEEND
//private static final long serialVersionUID = 8612449444103L;
private String m_sMoney;
private String m_sHost;
private String m_Hostsequence;
/** Creates new CategoryInfo
* @param money
* @param host
* @param hostsequence */
public HostInfo(String money, String host, String hostsequence) {
m_sMoney = host; // hack to search by hostname
m_sHost = host;
m_Hostsequence = hostsequence;
}
@Override
public Object getKey() {
return m_sMoney;
}
public String getHostsequence() {
return m_Hostsequence;
}
public void setHostsequence(String m_Hostsequence) {
this.m_Hostsequence = m_Hostsequence;
}
public String getHost() {
return m_sHost;
}
public void setHost(String m_sHost) {
this.m_sHost = m_sHost;
}
public String getMoney() {
return m_sMoney;
}
public void setMoney(String m_sMoney) {
this.m_sMoney = m_sMoney;
}
@Override
public String toString() {
return m_sHost;
}
public static SerializerRead getSerializerRead() {
return new SerializerRead() {
@Override
public Object readValues(DataRead dr) throws BasicException {
return new HostInfo(dr.getString(1), dr.getString(2), dr.getString(3));
}
};
}
}
@@ -0,0 +1,242 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[370, 170]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel3" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" min="-2" pref="150" max="-2" attributes="0"/>
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="m_jPriceSell" min="-2" pref="130" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="m_jtxtBarCode" min="-2" pref="290" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel5" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="m_jtxtName" min="-2" pref="290" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" pref="260" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" min="-2" pref="150" max="-2" attributes="0"/>
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="m_jPriceBuy" min="-2" pref="130" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<Component id="m_jtxtBarCode" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="5" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<Component id="m_jtxtName" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="5" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jCategory" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="5" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jCboPriceBuy" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="m_jPriceBuy" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="5" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jCboPriceSell" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="m_jPriceSell" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodname" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="com.unicenta.editor.JEditorString" name="m_jtxtName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricebuy" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jCboPriceBuyActionPerformed"/>
</Events>
</Component>
<Component class="com.unicenta.editor.JEditorCurrency" name="m_jPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricesell" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="com.unicenta.editor.JEditorCurrency" name="m_jPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="com.unicenta.editor.JEditorString" name="m_jtxtBarCode">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodbarcode" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,288 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import java.util.List;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.ListQBFModelNumber;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.user.EditorCreator;
import com.unicenta.editor.JEditorKeys;
import com.unicenta.editor.JEditorString;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
/**
*
* @author JG uniCenta
*/
public class LocationFilterSales extends javax.swing.JPanel implements EditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
/** Creates new form ProductFilterSales
* @param dlSales
* @param jKeys */
public LocationFilterSales(DataLogicSales dlSales, JEditorKeys jKeys) {
initComponents();
// El modelo de categorias
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
// m_jCboPriceBuy.setModel(new ListQBFModelNumber());
m_jCboPriceBuy.setModel(ListQBFModelNumber.getMandatoryNumber());
m_jPriceBuy.addEditorKeys(jKeys);
// m_jCboPriceSell.setModel(new ListQBFModelNumber());
m_jCboPriceSell.setModel(ListQBFModelNumber.getMandatoryNumber());
m_jPriceSell.addEditorKeys(jKeys);
m_jtxtName.addEditorKeys(jKeys);
m_jtxtBarCode.addEditorKeys(jKeys);
}
/**
*
*/
public void activate() {
m_jtxtBarCode.reset();
m_jtxtBarCode.setEditModeEnum(JEditorString.MODE_123);
m_jtxtName.reset();
m_jPriceBuy.reset();
m_jPriceSell.reset();
m_jtxtName.activate();
try {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
} catch (BasicException eD) {
// no hay validacion
}
}
/**
*
* @return
* @throws BasicException
*/
public Object createValue() throws BasicException {
Object[] afilter = new Object[10];
// Nombre
if (m_jtxtName.getText() == null || m_jtxtName.getText().equals("")) {
afilter[0] = QBFCompareEnum.COMP_NONE;
afilter[1] = null;
} else {
afilter[0] = QBFCompareEnum.COMP_RE;
afilter[1] = "%" + m_jtxtName.getText() + "%";
}
// Precio de compra
afilter[3] = m_jPriceBuy.getDoubleValue();
afilter[2] = afilter[3] == null ? QBFCompareEnum.COMP_NONE : m_jCboPriceBuy.getSelectedItem();
// Precio de venta
afilter[5] = m_jPriceSell.getDoubleValue();
afilter[4] = afilter[5] == null ? QBFCompareEnum.COMP_NONE : m_jCboPriceSell.getSelectedItem();
// Categoria
if (m_CategoryModel.getSelectedKey() == null) {
afilter[6] = QBFCompareEnum.COMP_NONE;
afilter[7] = null;
} else {
afilter[6] = QBFCompareEnum.COMP_EQUALS;
afilter[7] = m_CategoryModel.getSelectedKey();
}
// el codigo de barras
if (m_jtxtBarCode.getText() == null || m_jtxtBarCode.getText().equals("")) {
afilter[8] = QBFCompareEnum.COMP_NONE;
afilter[9] = null;
} else{
afilter[8] = QBFCompareEnum.COMP_RE;
afilter[9] = "%" + m_jtxtBarCode.getText() + "%";
}
return afilter;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel5 = new javax.swing.JLabel();
m_jtxtName = new com.unicenta.editor.JEditorString();
jLabel2 = new javax.swing.JLabel();
m_jCategory = new javax.swing.JComboBox();
jLabel4 = new javax.swing.JLabel();
m_jCboPriceBuy = new javax.swing.JComboBox();
m_jPriceBuy = new com.unicenta.editor.JEditorCurrency();
jLabel3 = new javax.swing.JLabel();
m_jCboPriceSell = new javax.swing.JComboBox();
m_jPriceSell = new com.unicenta.editor.JEditorCurrency();
m_jtxtBarCode = new com.unicenta.editor.JEditorString();
jLabel1 = new javax.swing.JLabel();
setPreferredSize(new java.awt.Dimension(370, 170));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(0, 30));
m_jtxtName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jtxtName.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(0, 30));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.prodpricebuy")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(0, 30));
m_jCboPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceBuy.setPreferredSize(new java.awt.Dimension(0, 30));
m_jCboPriceBuy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jCboPriceBuyActionPerformed(evt);
}
});
m_jPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceBuy.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.prodpricesell")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(0, 30));
m_jCboPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceSell.setPreferredSize(new java.awt.Dimension(0, 30));
m_jPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceSell.setPreferredSize(new java.awt.Dimension(0, 30));
m_jtxtBarCode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jtxtBarCode.setMaximumSize(new java.awt.Dimension(100, 25));
m_jtxtBarCode.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(0, 30));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(m_jtxtBarCode, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(m_jtxtName, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(10, 10, 10)
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jtxtBarCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jtxtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
);
}// </editor-fold>//GEN-END:initComponents
private void m_jCboPriceBuyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jCboPriceBuyActionPerformed
}//GEN-LAST:event_m_jCboPriceBuyActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JComboBox m_jCategory;
private javax.swing.JComboBox m_jCboPriceBuy;
private javax.swing.JComboBox m_jCboPriceSell;
private com.unicenta.editor.JEditorCurrency m_jPriceBuy;
private com.unicenta.editor.JEditorCurrency m_jPriceSell;
private com.unicenta.editor.JEditorString m_jtxtBarCode;
private com.unicenta.editor.JEditorString m_jtxtName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,265 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[976, 125]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" max="-2" attributes="1"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jBarcode" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboName" max="32767" attributes="1"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" min="-2" max="-2" attributes="2"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jPriceBuy" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jPriceSell" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="189" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jCategory" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jPriceBuy" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel5" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jBarcode" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jPriceSell" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel2" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboName" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="12" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodbarcode" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jBarcode">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodname" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[330, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricebuy" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[60, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricesell" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[60, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jBtnReset">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/reload.png"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBtnResetActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,318 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.ListQBFModelNumber;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.loader.SerializerWrite;
import com.unicenta.data.loader.SerializerWriteBasic;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.reports.ReportEditorCreator;
import java.awt.Component;
import java.util.List;
/**
*
* @author JG uniCenta
*/
public class ProductFilter extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
// private SentenceList m_sentsup;
// private ComboBoxValModel m_SupplierModel;
/** Creates new form JQBFProduct */
public ProductFilter() {
initComponents();
}
/**
*
* @param app
*/
@Override
public void init(AppView app) {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
m_jCboName.setModel(ListQBFModelNumber.getMandatoryString());
m_jCboPriceBuy.setModel(ListQBFModelNumber.getMandatoryNumber());
m_jCboPriceSell.setModel(ListQBFModelNumber.getMandatoryNumber());
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
}
/**
*
* @return
*/
@Override
public SerializerWrite getSerializerWrite() {
return new SerializerWriteBasic(
new Datas[] {
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.DOUBLE,
Datas.OBJECT, Datas.DOUBLE,
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING});
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
if (m_jBarcode.getText() == null || m_jBarcode.getText().equals("")) {
return new Object[] {
m_jCboName.getSelectedItem(), m_jName.getText(),
m_jCboPriceBuy.getSelectedItem(), Formats.CURRENCY.parseValue(m_jPriceBuy.getText()),
m_jCboPriceSell.getSelectedItem(), Formats.CURRENCY.parseValue(m_jPriceSell.getText()),
m_CategoryModel.getSelectedKey() == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_EQUALS, m_CategoryModel.getSelectedKey(),
// m_SupplierModel.getSelectedKey() == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_EQUALS, m_SupplierModel.getSelectedKey(),
QBFCompareEnum.COMP_NONE, null
};
} else {
return new Object[] {
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_EQUALS, m_jBarcode.getText()
};
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
m_jCategory = new javax.swing.JComboBox();
jLabel5 = new javax.swing.JLabel();
m_jBarcode = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
m_jCboName = new javax.swing.JComboBox();
m_jName = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
m_jCboPriceBuy = new javax.swing.JComboBox();
m_jPriceBuy = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
m_jCboPriceSell = new javax.swing.JComboBox();
m_jPriceSell = new javax.swing.JTextField();
jBtnReset = new javax.swing.JButton();
setPreferredSize(new java.awt.Dimension(976, 125));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(110, 30));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(250, 30));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(110, 30));
m_jBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jBarcode.setPreferredSize(new java.awt.Dimension(250, 30));
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(110, 30));
m_jCboName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboName.setPreferredSize(new java.awt.Dimension(250, 30));
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(330, 30));
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.prodpricebuy")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(110, 30));
m_jCboPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceBuy.setPreferredSize(new java.awt.Dimension(150, 30));
m_jPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceBuy.setPreferredSize(new java.awt.Dimension(60, 30));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.prodpricesell")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(110, 30));
m_jCboPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceSell.setPreferredSize(new java.awt.Dimension(150, 30));
m_jPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceSell.setPreferredSize(new java.awt.Dimension(60, 30));
jBtnReset.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jBtnReset.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/reload.png"))); // NOI18N
jBtnReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtnResetActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jBarcode, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(2, 2, 2))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboName, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jBtnReset)))
.addContainerGap(189, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(12, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jBtnReset)
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void jBtnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnResetActionPerformed
m_jBarcode.setText(null);
m_jCategory.setSelectedIndex(0);
m_jCboName.setSelectedIndex(0);
m_jCboPriceBuy.setSelectedIndex(0);
m_jCboPriceSell.setSelectedIndex(0);
m_jName.setText(null);
m_jPriceBuy.setText(null);
m_jPriceSell.setText(null);
}//GEN-LAST:event_jBtnResetActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBtnReset;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField m_jBarcode;
private javax.swing.JComboBox m_jCategory;
private javax.swing.JComboBox m_jCboName;
private javax.swing.JComboBox m_jCboPriceBuy;
private javax.swing.JComboBox m_jCboPriceSell;
private javax.swing.JTextField m_jName;
private javax.swing.JTextField m_jPriceBuy;
private javax.swing.JTextField m_jPriceSell;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[946, 50]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboName" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel5" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jBarcode" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboUnits" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jUnits" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCategory" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jBarcode" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboUnits" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jUnits" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="m_jBarcode">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodbarcode" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodname" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.produnits" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboUnits">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jUnits">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jBtnReset">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/reload.png"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBtnResetActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,269 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.ListQBFModelNumber;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.loader.SerializerWrite;
import com.unicenta.data.loader.SerializerWriteBasic;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.reports.ReportEditorCreator;
import java.awt.Component;
import java.util.List;
/**
*
* @author JG uniCenta
*/
public class ProductFilter1 extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
/** Creates new form JQBFProduct */
public ProductFilter1() {
initComponents();
}
/**
*
* @param app
*/
public void init(AppView app) {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
m_jCboName.setModel(ListQBFModelNumber.getMandatoryString());
m_jCboUnits.setModel(ListQBFModelNumber.getMandatoryString());
}
/**
*
* @throws BasicException
*/
public void activate() throws BasicException {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
}
/**
*
* @return
*/
public SerializerWrite getSerializerWrite() {
return new SerializerWriteBasic(
new Datas[] {
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING});
}
/**
*
* @return
*/
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
public Object createValue() throws BasicException {
if (m_jBarcode.getText() == null || m_jBarcode.getText().equals("")) {
return new Object[] {
m_jCboName.getSelectedItem(), m_jName.getText(),
m_CategoryModel.getSelectedKey() == null
? QBFCompareEnum.COMP_NONE
: QBFCompareEnum.COMP_EQUALS, m_CategoryModel.getSelectedKey(),
QBFCompareEnum.COMP_NONE, null,
m_jCboUnits.getSelectedItem(), m_jUnits.getText()
};
} else {
// Filtro por codigo de barras.
return new Object[] {
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_RE, "%" + m_jBarcode.getText() + "%",
QBFCompareEnum.COMP_NONE, null
};
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
m_jBarcode = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
m_jCategory = new javax.swing.JComboBox();
m_jCboName = new javax.swing.JComboBox();
m_jName = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
m_jCboUnits = new javax.swing.JComboBox();
m_jUnits = new javax.swing.JTextField();
jBtnReset = new javax.swing.JButton();
setPreferredSize(new java.awt.Dimension(946, 50));
m_jBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jBarcode.setPreferredSize(new java.awt.Dimension(150, 30));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(70, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(70, 30));
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(70, 30));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(150, 30));
m_jCboName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboName.setPreferredSize(new java.awt.Dimension(150, 30));
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(150, 30));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.produnits")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(50, 30));
m_jCboUnits.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboUnits.setPreferredSize(new java.awt.Dimension(150, 30));
m_jUnits.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jUnits.setPreferredSize(new java.awt.Dimension(50, 30));
jBtnReset.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jBtnReset.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/reload.png"))); // NOI18N
jBtnReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtnResetActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboName, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jBarcode, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboUnits, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jUnits, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBtnReset)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jBtnReset)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboUnits, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jUnits, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void jBtnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnResetActionPerformed
m_jBarcode.setText(null);
m_jCategory.setSelectedIndex(0);
m_jCboName.setSelectedIndex(0);
m_jCboUnits.setSelectedIndex(0);
m_jName.setText(null);
m_jUnits.setText(null);
}//GEN-LAST:event_jBtnResetActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBtnReset;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField m_jBarcode;
private javax.swing.JComboBox m_jCategory;
private javax.swing.JComboBox m_jCboName;
private javax.swing.JComboBox m_jCboUnits;
private javax.swing.JTextField m_jName;
private javax.swing.JTextField m_jUnits;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,278 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[976, 100]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" pref="66" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" pref="46" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" pref="74" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" min="-2" pref="36" max="-2" attributes="2"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jPriceBuy" min="-2" pref="50" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" pref="50" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" min="-2" pref="42" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jPriceSell" min="-2" pref="36" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboName" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jBarcode" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jBtnReset" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jBarcode" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jPriceBuy" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jPriceSell" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCategory" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="12" pref="12" max="-2" attributes="0"/>
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="11" pref="11" max="-2" attributes="0"/>
<Component id="m_jCboName" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="11" pref="11" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="11" pref="11" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="m_jBarcode">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodbarcode" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodname" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricebuy" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricesell" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jBtnReset">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/reload.png"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBtnResetActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,321 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.ListQBFModelNumber;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.loader.SerializerWrite;
import com.unicenta.data.loader.SerializerWriteBasic;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.reports.ReportEditorCreator;
import java.awt.Component;
import java.util.List;
/**
*
* @author JG uniCenta
*/
public class ProductFilter2 extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
/** Creates new form JQBFProduct */
public ProductFilter2() {
initComponents();
}
/**
*
* @param app
*/
public void init(AppView app) {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
m_jCboName.setModel(ListQBFModelNumber.getMandatoryString());
m_jCboPriceBuy.setModel(ListQBFModelNumber.getMandatoryNumber());
m_jCboPriceSell.setModel(ListQBFModelNumber.getMandatoryNumber());
}
/**
*
* @throws BasicException
*/
public void activate() throws BasicException {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
}
/**
*
* @return
*/
public SerializerWrite getSerializerWrite() {
return new SerializerWriteBasic(
new Datas[] {
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.DOUBLE,
Datas.OBJECT, Datas.DOUBLE,
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING});
}
/**
*
* @return
*/
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
public Object createValue() throws BasicException {
if (m_jBarcode.getText() == null || m_jBarcode.getText().equals("")) {
return new Object[] {
m_jCboName.getSelectedItem(), m_jName.getText(),
m_jCboPriceBuy.getSelectedItem(), Formats.CURRENCY.parseValue(m_jPriceBuy.getText()),
m_jCboPriceSell.getSelectedItem(), Formats.CURRENCY.parseValue(m_jPriceSell.getText()),
m_CategoryModel.getSelectedKey() == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_EQUALS, m_CategoryModel.getSelectedKey(),
QBFCompareEnum.COMP_NONE, null
};
} else {
// Filtro por codigo de barras.
return new Object[] {
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_EQUALS, m_jBarcode.getText()
};
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
m_jBarcode = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
m_jCategory = new javax.swing.JComboBox();
m_jCboName = new javax.swing.JComboBox();
m_jName = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
m_jCboPriceBuy = new javax.swing.JComboBox();
m_jCboPriceSell = new javax.swing.JComboBox();
m_jPriceBuy = new javax.swing.JTextField();
m_jPriceSell = new javax.swing.JTextField();
jBtnReset = new javax.swing.JButton();
setPreferredSize(new java.awt.Dimension(976, 100));
m_jBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jBarcode.setPreferredSize(new java.awt.Dimension(150, 30));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(100, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel1.setEnabled(false);
jLabel1.setPreferredSize(new java.awt.Dimension(110, 30));
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(100, 30));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setEnabled(false);
m_jCategory.setPreferredSize(new java.awt.Dimension(250, 30));
m_jCboName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboName.setPreferredSize(new java.awt.Dimension(150, 30));
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(150, 30));
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.prodpricebuy")); // NOI18N
jLabel4.setEnabled(false);
jLabel4.setPreferredSize(new java.awt.Dimension(110, 30));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.prodpricesell")); // NOI18N
jLabel3.setEnabled(false);
jLabel3.setPreferredSize(new java.awt.Dimension(110, 30));
m_jCboPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceBuy.setEnabled(false);
m_jCboPriceBuy.setPreferredSize(new java.awt.Dimension(150, 30));
m_jCboPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceSell.setEnabled(false);
m_jCboPriceSell.setPreferredSize(new java.awt.Dimension(150, 30));
m_jPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceBuy.setEnabled(false);
m_jPriceBuy.setPreferredSize(new java.awt.Dimension(150, 30));
m_jPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceSell.setEnabled(false);
m_jPriceSell.setPreferredSize(new java.awt.Dimension(150, 30));
jBtnReset.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jBtnReset.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/reload.png"))); // NOI18N
jBtnReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtnResetActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jBtnReset)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jBtnReset)
.addComponent(m_jBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(11, 11, 11)
.addComponent(m_jCboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(11, 11, 11)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(11, 11, 11)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void jBtnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnResetActionPerformed
m_jBarcode.setText(null);
m_jCategory.setSelectedIndex(0);
m_jCboName.setSelectedIndex(0);
m_jCboPriceBuy.setSelectedIndex(0);
m_jCboPriceSell.setSelectedIndex(0);
m_jName.setText(null);
m_jPriceBuy.setText(null);
m_jPriceSell.setText(null);
}//GEN-LAST:event_jBtnResetActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBtnReset;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField m_jBarcode;
private javax.swing.JComboBox m_jCategory;
private javax.swing.JComboBox m_jCboName;
private javax.swing.JComboBox m_jCboPriceBuy;
private javax.swing.JComboBox m_jCboPriceSell;
private javax.swing.JTextField m_jName;
private javax.swing.JTextField m_jPriceBuy;
private javax.swing.JTextField m_jPriceSell;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[976, 100]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboName" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jName" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jSupplier" min="-2" max="-2" attributes="1"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jBarcode" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" min="-2" max="-2" attributes="2"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jPriceBuy" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jPriceSell" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="59" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jSupplier" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCategory" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jBarcode" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jPriceBuy" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jPriceSell" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="m_jBarcode">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodbarcode" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodname" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricebuy" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricesell" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[60, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[60, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodsupplier" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jSupplier">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jBtnReset">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/reload.png"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBtnResetActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,344 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.ListQBFModelNumber;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.loader.SerializerWrite;
import com.unicenta.data.loader.SerializerWriteBasic;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.reports.ReportEditorCreator;
import com.unicenta.pos.suppliers.DataLogicSuppliers;
import java.awt.Component;
import java.util.List;
/**
*
* @author JG uniCenta
*/
public class ProductFilter3 extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
private SentenceList m_sentsup;
private ComboBoxValModel m_SupplierModel;
/** Creates new form JQBFProduct */
public ProductFilter3() {
initComponents();
}
/**
*
* @param app
*/
@Override
public void init(AppView app) {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
DataLogicSuppliers dlSuppliers = (DataLogicSuppliers) app.getBean("com.unicenta.pos.suppliers.DataLogicSuppliers");
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
m_sentsup = dlSuppliers.getSupplierList();
m_SupplierModel = new ComboBoxValModel();
m_jCboName.setModel(ListQBFModelNumber.getMandatoryString());
m_jCboPriceBuy.setModel(ListQBFModelNumber.getMandatoryNumber());
m_jCboPriceSell.setModel(ListQBFModelNumber.getMandatoryNumber());
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
List suplist = m_sentsup.list();
suplist.add(0, null);
m_SupplierModel = new ComboBoxValModel(suplist);
m_jSupplier.setModel(m_SupplierModel);
}
/**
*
* @return
*/
@Override
public SerializerWrite getSerializerWrite() {
return new SerializerWriteBasic(
new Datas[] {
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.DOUBLE,
Datas.OBJECT, Datas.DOUBLE,
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING});
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
if (m_jBarcode.getText() == null || m_jBarcode.getText().equals("")) {
return new Object[] {
m_jCboName.getSelectedItem(), m_jName.getText(),
m_jCboPriceBuy.getSelectedItem(), Formats.CURRENCY.parseValue(m_jPriceBuy.getText()),
m_jCboPriceSell.getSelectedItem(), Formats.CURRENCY.parseValue(m_jPriceSell.getText()),
m_CategoryModel.getSelectedKey() == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_EQUALS, m_CategoryModel.getSelectedKey(),
m_SupplierModel.getSelectedKey() == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_EQUALS, m_SupplierModel.getSelectedKey(),
QBFCompareEnum.COMP_NONE, null
};
} else {
return new Object[] {
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_EQUALS, m_jBarcode.getText()
};
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
m_jBarcode = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
m_jCategory = new javax.swing.JComboBox();
m_jCboName = new javax.swing.JComboBox();
m_jName = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
m_jCboPriceBuy = new javax.swing.JComboBox();
m_jCboPriceSell = new javax.swing.JComboBox();
m_jPriceBuy = new javax.swing.JTextField();
m_jPriceSell = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
m_jSupplier = new javax.swing.JComboBox();
jBtnReset = new javax.swing.JButton();
setPreferredSize(new java.awt.Dimension(976, 100));
m_jBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jBarcode.setPreferredSize(new java.awt.Dimension(150, 30));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(100, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(100, 30));
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(100, 30));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(150, 30));
m_jCboName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboName.setPreferredSize(new java.awt.Dimension(150, 30));
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(150, 30));
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.prodpricebuy")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(100, 30));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.prodpricesell")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(100, 30));
m_jCboPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceBuy.setPreferredSize(new java.awt.Dimension(150, 30));
m_jCboPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceSell.setPreferredSize(new java.awt.Dimension(150, 30));
m_jPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceBuy.setPreferredSize(new java.awt.Dimension(60, 30));
m_jPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceSell.setPreferredSize(new java.awt.Dimension(60, 30));
jLabel6.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel6.setText(AppLocal.getIntString("label.prodsupplier")); // NOI18N
jLabel6.setPreferredSize(new java.awt.Dimension(100, 30));
m_jSupplier.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jSupplier.setPreferredSize(new java.awt.Dimension(150, 30));
jBtnReset.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jBtnReset.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/reload.png"))); // NOI18N
jBtnReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtnResetActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jSupplier, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBtnReset)
.addContainerGap(59, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jBtnReset)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jSupplier, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void jBtnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnResetActionPerformed
m_jBarcode.setText(null);
m_jCategory.setSelectedIndex(0);
m_jCboName.setSelectedIndex(0);
m_jCboPriceBuy.setSelectedIndex(0);
m_jCboPriceSell.setSelectedIndex(0);
m_jName.setText(null);
m_jPriceBuy.setText(null);
m_jPriceSell.setText(null);
}//GEN-LAST:event_jBtnResetActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBtnReset;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JTextField m_jBarcode;
private javax.swing.JComboBox m_jCategory;
private javax.swing.JComboBox m_jCboName;
private javax.swing.JComboBox m_jCboPriceBuy;
private javax.swing.JComboBox m_jCboPriceSell;
private javax.swing.JTextField m_jName;
private javax.swing.JTextField m_jPriceBuy;
private javax.swing.JTextField m_jPriceSell;
private javax.swing.JComboBox m_jSupplier;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[946, 50]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboName" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel5" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jBarcode" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCategory" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jBarcode" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="m_jBarcode">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodbarcode" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodname" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jBtnReset">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/reload.png"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBtnResetActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,236 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.ListQBFModelNumber;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.loader.SerializerWrite;
import com.unicenta.data.loader.SerializerWriteBasic;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.reports.ReportEditorCreator;
import java.awt.Component;
import java.util.List;
/**
*
* @author JG uniCenta
*/
public class ProductFilter4 extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
/** Creates new form JQBFProduct */
public ProductFilter4() {
initComponents();
}
/**
*
* @param app
*/
public void init(AppView app) {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
m_jCboName.setModel(ListQBFModelNumber.getMandatoryString());
}
/**
*
* @throws BasicException
*/
public void activate() throws BasicException {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
}
/**
*
* @return
*/
public SerializerWrite getSerializerWrite() {
return new SerializerWriteBasic(
new Datas[] {
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING,
Datas.OBJECT, Datas.STRING});
}
/**
*
* @return
*/
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
public Object createValue() throws BasicException {
if (m_jBarcode.getText() == null || m_jBarcode.getText().equals("")) {
return new Object[] {
m_jCboName.getSelectedItem(), m_jName.getText(),
m_CategoryModel.getSelectedKey() == null
? QBFCompareEnum.COMP_NONE
: QBFCompareEnum.COMP_EQUALS, m_CategoryModel.getSelectedKey(),
QBFCompareEnum.COMP_NONE, null
};
} else {
// Filtro por codigo de barras.
return new Object[] {
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_NONE, null,
QBFCompareEnum.COMP_RE, "%" + m_jBarcode.getText() + "%"
};
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
m_jBarcode = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
m_jCategory = new javax.swing.JComboBox();
m_jCboName = new javax.swing.JComboBox();
m_jName = new javax.swing.JTextField();
jBtnReset = new javax.swing.JButton();
setPreferredSize(new java.awt.Dimension(946, 50));
m_jBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jBarcode.setPreferredSize(new java.awt.Dimension(150, 30));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(100, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(100, 30));
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(100, 30));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(150, 30));
m_jCboName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboName.setPreferredSize(new java.awt.Dimension(150, 30));
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(150, 30));
jBtnReset.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jBtnReset.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/reload.png"))); // NOI18N
jBtnReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtnResetActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboName, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jBarcode, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBtnReset)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jBtnReset)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jBarcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void jBtnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnResetActionPerformed
m_jBarcode.setText(null);
m_jCategory.setSelectedIndex(0);
m_jCboName.setSelectedIndex(0);
m_jName.setText(null);
}//GEN-LAST:event_jBtnResetActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBtnReset;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField m_jBarcode;
private javax.swing.JComboBox m_jCategory;
private javax.swing.JComboBox m_jCboName;
private javax.swing.JTextField m_jName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[410, 200]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jtxtBarCode" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="41" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCategory" min="-2" pref="240" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jtxtName" min="-2" pref="270" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="64" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jPriceBuy" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jPriceSell" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<Component id="m_jtxtBarCode" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jBtnReset" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Component id="m_jtxtName" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="m_jCategory" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="5" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboPriceBuy" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="m_jPriceBuy" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="5" pref="5" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCboPriceSell" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="m_jPriceSell" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodname" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="com.unicenta.editor.JEditorString" name="m_jtxtName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCategory">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricebuy" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jCboPriceBuyActionPerformed"/>
</Events>
</Component>
<Component class="com.unicenta.editor.JEditorCurrency" name="m_jPriceBuy">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodpricesell" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="com.unicenta.editor.JEditorCurrency" name="m_jPriceSell">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 30]"/>
</Property>
</Properties>
</Component>
<Component class="com.unicenta.editor.JEditorString" name="m_jtxtBarCode">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[230, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.prodbarcode" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jBtnReset">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/reload.png"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBtnResetActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,322 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import java.util.List;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.ListQBFModelNumber;
import com.unicenta.data.loader.QBFCompareEnum;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.user.EditorCreator;
import com.unicenta.editor.JEditorKeys;
import com.unicenta.editor.JEditorString;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
/**
*
* @author JG uniCenta
*/
public class ProductFilterSales extends javax.swing.JPanel implements EditorCreator {
private SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
/** Creates new form ProductFilterSales
* @param dlSales
* @param jKeys */
public ProductFilterSales(DataLogicSales dlSales, JEditorKeys jKeys) {
initComponents();
// El modelo de categorias
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
// m_jCboPriceBuy.setModel(new ListQBFModelNumber());
m_jCboPriceBuy.setModel(ListQBFModelNumber.getMandatoryNumber());
m_jPriceBuy.addEditorKeys(jKeys);
// m_jCboPriceSell.setModel(new ListQBFModelNumber());
m_jCboPriceSell.setModel(ListQBFModelNumber.getMandatoryNumber());
m_jPriceSell.addEditorKeys(jKeys);
m_jtxtName.addEditorKeys(jKeys);
m_jtxtBarCode.addEditorKeys(jKeys);
}
/**
*
*/
public void activate() {
m_jtxtBarCode.reset();
m_jtxtBarCode.setEditModeEnum(JEditorString.MODE_123);
m_jtxtName.reset();
m_jPriceBuy.reset();
m_jPriceSell.reset();
m_jtxtName.activate();
try {
List catlist = m_sentcat.list();
catlist.add(0, null);
m_CategoryModel = new ComboBoxValModel(catlist);
m_jCategory.setModel(m_CategoryModel);
} catch (BasicException eD) {
// no hay validacion
}
}
/**
*
* @return
* @throws BasicException
*/
public Object createValue() throws BasicException {
Object[] afilter = new Object[10];
// Nombre
if (m_jtxtName.getText() == null || m_jtxtName.getText().equals("")) {
afilter[0] = QBFCompareEnum.COMP_NONE;
afilter[1] = null;
} else {
afilter[0] = QBFCompareEnum.COMP_RE;
afilter[1] = "%" + m_jtxtName.getText() + "%";
}
// Precio de compra
afilter[3] = m_jPriceBuy.getDoubleValue();
afilter[2] = afilter[3] == null ? QBFCompareEnum.COMP_NONE : m_jCboPriceBuy.getSelectedItem();
// Precio de venta
afilter[5] = m_jPriceSell.getDoubleValue();
afilter[4] = afilter[5] == null ? QBFCompareEnum.COMP_NONE : m_jCboPriceSell.getSelectedItem();
// Categoria
if (m_CategoryModel.getSelectedKey() == null) {
afilter[6] = QBFCompareEnum.COMP_NONE;
afilter[7] = null;
} else {
afilter[6] = QBFCompareEnum.COMP_EQUALS;
afilter[7] = m_CategoryModel.getSelectedKey();
}
// el codigo de barras
if (m_jtxtBarCode.getText() == null || m_jtxtBarCode.getText().equals("")) {
afilter[8] = QBFCompareEnum.COMP_NONE;
afilter[9] = null;
} else{
afilter[8] = QBFCompareEnum.COMP_RE;
afilter[9] = "%" + m_jtxtBarCode.getText() + "%";
}
return afilter;
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel5 = new javax.swing.JLabel();
m_jtxtName = new com.unicenta.editor.JEditorString();
jLabel2 = new javax.swing.JLabel();
m_jCategory = new javax.swing.JComboBox();
jLabel4 = new javax.swing.JLabel();
m_jCboPriceBuy = new javax.swing.JComboBox();
m_jPriceBuy = new com.unicenta.editor.JEditorCurrency();
jLabel3 = new javax.swing.JLabel();
m_jCboPriceSell = new javax.swing.JComboBox();
m_jPriceSell = new com.unicenta.editor.JEditorCurrency();
m_jtxtBarCode = new com.unicenta.editor.JEditorString();
jLabel1 = new javax.swing.JLabel();
jBtnReset = new javax.swing.JButton();
setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
setPreferredSize(new java.awt.Dimension(410, 200));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(110, 30));
m_jtxtName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jtxtName.setPreferredSize(new java.awt.Dimension(250, 30));
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(110, 30));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(250, 30));
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.prodpricebuy")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(110, 30));
m_jCboPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceBuy.setPreferredSize(new java.awt.Dimension(150, 30));
m_jCboPriceBuy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jCboPriceBuyActionPerformed(evt);
}
});
m_jPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceBuy.setPreferredSize(new java.awt.Dimension(150, 30));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.prodpricesell")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(110, 30));
m_jCboPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCboPriceSell.setPreferredSize(new java.awt.Dimension(150, 30));
m_jPriceSell.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jPriceSell.setPreferredSize(new java.awt.Dimension(150, 30));
m_jtxtBarCode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jtxtBarCode.setMaximumSize(new java.awt.Dimension(100, 25));
m_jtxtBarCode.setPreferredSize(new java.awt.Dimension(230, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(110, 30));
jBtnReset.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jBtnReset.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/reload.png"))); // NOI18N
jBtnReset.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtnResetActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jtxtBarCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBtnReset)
.addGap(41, 41, 41))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jtxtName, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(64, 64, 64)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))
.addContainerGap())))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jtxtBarCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jBtnReset)
.addGap(3, 3, 3)
.addComponent(m_jtxtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(m_jPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(5, 5, 5)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCboPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(m_jPriceSell, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void m_jCboPriceBuyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jCboPriceBuyActionPerformed
}//GEN-LAST:event_m_jCboPriceBuyActionPerformed
private void jBtnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnResetActionPerformed
m_jtxtBarCode.setText(null);
m_jCategory.setSelectedIndex(0);
m_jCboPriceBuy.setSelectedIndex(0);
m_jCboPriceSell.setSelectedIndex(0);
m_jtxtName.setText(null);
m_jPriceBuy.setDoubleValue(null);
m_jPriceSell.setDoubleValue(null);
}//GEN-LAST:event_jBtnResetActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBtnReset;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JComboBox m_jCategory;
private javax.swing.JComboBox m_jCboPriceBuy;
private javax.swing.JComboBox m_jCboPriceSell;
private com.unicenta.editor.JEditorCurrency m_jPriceBuy;
private com.unicenta.editor.JEditorCurrency m_jPriceSell;
private com.unicenta.editor.JEditorString m_jtxtBarCode;
private com.unicenta.editor.JEditorString m_jtxtName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,124 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.IKeyed;
import com.unicenta.data.loader.SerializerRead;
/**
*
* @author Jack
* @version
*/
public class ProductInfo implements IKeyed {
private static final long serialVersionUID = 8712449444103L;
private String m_sID;
private String m_sRef;
private String m_sCode;
private String m_sName;
/** Creates new ProductInfo
* @param id
* @param ref
* @param code
* @param name */
public ProductInfo(String id, String ref, String code, String name) {
m_sID = id;
m_sRef = ref;
m_sCode = code;
m_sName = name;
}
/**
*
* @return
*/
@Override
public Object getKey() {
return m_sID;
}
/**
*
* @param sID
*/
public void setID(String sID) {
m_sID = sID;
}
public String getID() {
return m_sID;
}
/**
*
* @return
*/
public String getRef() {
return m_sRef;
}
public void setRef(String sRef) {
m_sRef = sRef;
}
/**
*
* @return
*/
public String getCode() {
return m_sCode;
}
public void setCode(String sCode) {
m_sCode = sCode;
}
/**
*
* @return
*/
public String getName() {
return m_sName;
}
public void setName(String sName) {
m_sName = sName;
}
@Override
public String toString() {
return m_sName;
}
/**
*
* @return
*/
public static SerializerRead getSerializerRead() {
return new SerializerRead() {
@Override
public Object readValues(DataRead dr) throws BasicException {
return new ProductInfo(dr.getString(1), dr.getString(2),
dr.getString(3), dr.getString(4));
}};
}
}
@@ -0,0 +1,207 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import java.awt.image.BufferedImage;
import java.util.Properties;
/**
*
* @author adrianromero
* Created on 21 de marzo de 2007, 21:28
*
*/
public class ProductInfoEdit {
/**
*
*/
protected String m_ID;
protected String m_sRef;
protected String m_sCode;
protected String m_sCodeType;
protected String m_sName;
protected double m_dPriceBuy;
protected double m_dPriceSell;
protected String m_sCategoryID;
protected String m_sTaxID;
protected String attributeuseid;
protected Double m_dStockCost;
protected Double m_dStockVolume;
protected BufferedImage m_Image;
protected boolean m_bCom;
protected boolean m_bScale;
protected boolean m_bKitchen;
protected boolean m_bPrintKB;
protected boolean m_bSendStatus;
protected boolean m_bService;
protected Properties attributes;
protected String m_sDisplay;
protected boolean m_bVprice;
protected boolean m_bVerpatrib;
protected String m_sTextTip;
protected boolean m_bWarranty;
protected double m_dStockUnits;
protected Integer m_iCatalogOrder;
protected String m_sSupplierID;
protected String m_sUomID;
protected String m_sDatePick;
/** Creates a new instance of ProductInfoEdit */
public ProductInfoEdit() {
m_ID = null;
m_sRef = "0000";
m_sCode = "0000";
m_sCodeType = null;
m_sName = null;
m_dPriceBuy = 0.0;
m_dPriceSell = 0.0;
m_sCategoryID = null;
m_sTaxID = null;
attributeuseid = null;
m_dStockCost = null;
m_dStockVolume = null;
m_Image = null;
m_bCom = false;
m_bScale = false;
m_bKitchen = false;
m_bPrintKB = false;
m_bSendStatus = false;
m_bService = false;
attributes = new Properties();
m_sDisplay = null;
m_bVprice = false;
m_bVerpatrib = false;
m_sTextTip = null;
m_bWarranty = false;
m_dStockUnits = 0.0;
m_iCatalogOrder = null;
m_sSupplierID = null;
m_sUomID= null;
m_sDatePick=null;
}
/**
*
* @return
*/
public final String getID() {
return m_ID;
}
public final void setID(String id) {
m_ID = id;
}
public final String getReference(){
return m_sRef;
}
public final void setReference(String sRef){
m_sRef = sRef;
}
public final String getCode(){
return m_sCode;
}
public final void setCode(String sCode){
m_sCode = sCode;
}
public final String getName() {
return m_sName;
}
public final void setName(String sName){
m_sName = sName;
}
public final boolean isCom() {
return m_bCom;
}
public final void setCom(boolean bValue){
m_bCom = bValue;
}
public final boolean isScale() {
return m_bScale;
}
public final void setScale(boolean bValue){
m_bScale = bValue;
}
public final String getCategoryID() {
return m_sCategoryID;
}
public final void setCategoryID(String sCategoryID) {
m_sCategoryID = sCategoryID;
}
public final String getTaxID() {
return m_sTaxID;
}
public final void setTaxID(String sTaxID) {
m_sTaxID = sTaxID;
}
public final String getAttributeUseID() {
return attributeuseid;
}
public final void setAttributeUseID(String value) {
attributeuseid = value;
}
public final double getPriceBuy(){
return m_dPriceBuy;
}
public final void setPriceBuy(double dPrice) {
m_dPriceBuy = dPrice;
}
public final double getPriceSell(){
return m_dPriceSell;
}
public final void setPriceSell(double dPrice) {
m_dPriceSell = dPrice;
}
public BufferedImage getImage() {
return m_Image;
}
public void setImage(BufferedImage img) {
m_Image = img;
}
@Override
public final String toString() {
return m_sRef + " - " + m_sName;
}
public final String getDatePick(){
return m_sDatePick;
}
public final void setDatePick(String sDatePick){
m_sDatePick = sDatePick;
}
}
@@ -0,0 +1,384 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.ImageUtils;
import com.unicenta.data.loader.SerializerRead;
import java.util.Properties;
import com.unicenta.format.Formats;
import java.awt.image.BufferedImage;
import java.util.Date;
/**
*
* @author adrianromero
*
*/
public class ProductInfoExt {
private static final long serialVersionUID = 7587696873036L;
protected String m_ID;
protected String m_sRef;
protected String m_sCode;
protected String m_sCodetype;
protected String m_sName;
protected double m_dPriceBuy;
protected double m_dPriceSell;
protected String categoryid;
protected String taxcategoryid;
protected String attributesetid;
protected double m_stockCost;
protected double m_stockVolume;
protected BufferedImage m_Image;
protected boolean m_bCom;
protected boolean m_bScale;
protected boolean m_bConstant;
protected boolean m_bPrintKB;
protected boolean m_bSendStatus;
private boolean m_bService;
protected Properties attributes;
protected String m_sDisplay;
protected boolean m_bVprice;
protected boolean m_bVerpatrib;
protected String m_sTextTip;
protected boolean m_bWarranty;
public double m_dStockUnits;
public String m_sPrinter;
public String supplierid;
private String uomid;
protected String memodate;
public ProductInfoExt() {
m_ID = null;
m_sRef = "0000";
m_sCode = "0000";
m_sCodetype = null;
m_sName = null;
m_dPriceBuy = 0.0;
m_dPriceSell = 0.0;
categoryid = null;
taxcategoryid = null;
attributesetid = null;
m_stockCost = 0.0;
m_stockVolume = 0.0;
m_Image = null;
m_bCom = false;
m_bScale = false;
m_bConstant = false;
m_bPrintKB = false;
m_bSendStatus = false;
m_bService = false;
attributes = new Properties();
m_sDisplay = null;
m_bVprice = false;
m_bVerpatrib = false;
m_sTextTip = null;
m_bWarranty = false;
m_dStockUnits = 0.0;
m_sPrinter = null;
supplierid = "0";
uomid = "0";
memodate = null;
}
/**
*
* @return
*/
public final String getID() {
return m_ID;
}
public final void setID(String id) {
m_ID = id;
}
public final String getReference() {
return m_sRef;
}
public final void setReference(String sRef) {
m_sRef = sRef;
}
public final String getCode() {
return m_sCode;
}
public final void setCode(String sCode) {
m_sCode = sCode;
}
public final String getCodetype() {
return m_sCodetype;
}
public final void setCodetype(String sCodetype) {
m_sCodetype = sCodetype;
}
public final String getName() {
return m_sName;
}
public final void setName(String sName) {
m_sName = sName;
}
public final double getPriceBuy() {
return m_dPriceBuy;
}
public final void setPriceBuy(double dPrice) {
m_dPriceBuy = dPrice;
}
public final double getPriceSell() {
return m_dPriceSell;
}
public final void setPriceSell(double dPrice) {
m_dPriceSell = dPrice;
}
public final String getCategoryID() {
return categoryid;
}
public final void setCategoryID(String sCategoryID) {
categoryid = sCategoryID;
}
public final String getTaxCategoryID() {
return taxcategoryid;
}
public final void setTaxCategoryID(String value) {
taxcategoryid = value;
}
public final String getAttributeSetID() {
return attributesetid;
}
public final void setAttributeSetID(String value) {
attributesetid = value;
}
public final double getStockCost() {
return m_stockCost;
}
public final void setStockCost(double dPrice) {
m_stockCost = dPrice;
}
public final double getStockVolume() {
return m_stockVolume;
}
public final void setStockVolume(double dStockVolume) {
m_stockVolume = dStockVolume;
}
public BufferedImage getImage() {
return m_Image;
}
public void setImage(BufferedImage img) {
m_Image = img;
}
public final boolean isCom() {
return m_bCom;
}
public final void setCom(boolean bValue) {
m_bCom = bValue;
}
public final boolean isScale() {
return m_bScale;
}
public final void setScale(boolean bValue) {
m_bScale = bValue;
}
public final boolean isConstant() {
return m_bConstant;
}
public final void setConstant(boolean bValue) {
m_bConstant = bValue;
}
public final boolean isPrintKB() {
return m_bPrintKB;
}
public final void setPrintKB(boolean bValue) {
m_bPrintKB = bValue;
}
public final boolean isSendStatus() {
return m_bSendStatus;
}
public final void setSendStatus(boolean bValue) {
m_bSendStatus = bValue;
}
public final boolean isService() {
return m_bService;
}
public final void setService(boolean bValue) {
m_bService = bValue;
}
public String getProperty(String key) {
return attributes.getProperty(key);
}
public String getProperty(String key, String defaultvalue) {
return attributes.getProperty(key, defaultvalue);
}
public void setProperty(String key, String value) {
attributes.setProperty(key, value);
}
public Properties getProperties() {
return attributes;
}
public final String getDisplay() {
return m_sDisplay;
}
public final void setDisplay(String sDisplay) {
m_sDisplay = sDisplay;
}
public final boolean isVprice() {
return m_bVprice;
}
public final boolean isVerpatrib() {
return m_bVerpatrib;
}
public final String getTextTip() {
return m_sTextTip;
}
public final void setTextTip(String value) {
m_sTextTip = value;
}
public final boolean getWarranty() {
return m_bWarranty;
}
public final void setWarranty(boolean bValue) {
m_bWarranty = bValue;
}
public final Double getStockUnits() {
return m_dStockUnits;
}
public final void setStockUnits(double dStockUnits) {
m_dStockUnits = dStockUnits;
}
public String printPriceSell() {
return Formats.CURRENCY.formatValue(getPriceSell());
}
public final double getPriceSellTax(TaxInfo tax) {
return m_dPriceSell * (1.0 + tax.getRate());
}
public String printPriceSellTax(TaxInfo tax) {
return Formats.CURRENCY.formatValue(getPriceSellTax(tax));
}
public final String getPrinter() {
return m_sPrinter;
}
public final void setPrinter(String value) {
m_sPrinter = value;
}
public final String getSupplierID() {
return supplierid;
}
public final void setSupplierID(String sSupplierID) {
supplierid = sSupplierID;
}
public final String getUomID() {
return uomid;
}
public final void setUomID(String sUomID) {
uomid = sUomID;
}
/**
*
* @return memo date string
*/
public String getMemoDate() {
return memodate;
}
public void setMemoDate(String memodate) {
this.memodate = memodate;
}
public String printMemoDate() {
return Formats.STRING.formatValue(memodate);
}
/**
*
* @return
*/
public static SerializerRead getSerializerRead() {
return new SerializerRead() {
@Override
public Object readValues(DataRead dr) throws BasicException {
ProductInfoExt product = new ProductInfoExt();
product.m_ID = dr.getString(1);
product.m_sRef = dr.getString(2);
product.m_sCode = dr.getString(3);
product.m_sCodetype = dr.getString(4);
product.m_sName = dr.getString(5);
product.m_dPriceBuy = dr.getDouble(6);
product.m_dPriceSell = dr.getDouble(7);
product.categoryid = dr.getString(8);
product.taxcategoryid = dr.getString(9);
product.attributesetid = dr.getString(10);
product.m_stockCost = dr.getDouble(11);
product.m_stockVolume = dr.getDouble(12);
product.m_Image = ImageUtils.readImage(dr.getBytes(13));
product.m_bCom = dr.getBoolean(14);
product.m_bScale = dr.getBoolean(15);
product.m_bConstant = dr.getBoolean(16);
product.m_bPrintKB = dr.getBoolean(17);
product.m_bSendStatus = dr.getBoolean(18);
product.m_bService = dr.getBoolean(19);
product.attributes = ImageUtils.readProperties(dr.getBytes(20));
product.m_sDisplay = dr.getString(21);
product.m_bVprice = dr.getBoolean(22);
product.m_bVerpatrib = dr.getBoolean(23);
product.m_sTextTip = dr.getString(24);
product.m_bWarranty = dr.getBoolean(25);
product.m_dStockUnits = dr.getDouble(26);
product.m_sPrinter = dr.getString(27);
product.supplierid = dr.getString(28);
product.uomid = dr.getString(29);
product.memodate = dr.getString(30);
return product;
}
};
}
@Override
public final String toString() {
return m_sRef + " - " + m_sName;
}
}
@@ -0,0 +1,64 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.format.Formats;
import com.unicenta.pos.util.ThumbNailBuilder;
import java.awt.*;
import javax.swing.*;
/**
*
* @author uniCenta 2017
*
*/
public class ProductRenderer extends DefaultListCellRenderer {
ThumbNailBuilder tnbprod;
/** Creates a new instance of ProductRenderer */
public ProductRenderer() {
// tnbprod = new ThumbNailBuilder(48,48, "com/unicenta/images/package.png");
tnbprod = new ThumbNailBuilder(48,48, "com/unicenta/images/null.png");
}
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
ProductInfoExt prod = (ProductInfoExt) value;
if (prod != null) {
setText("<html><center>"
+ prod.getReference()
+ " - "
+ prod.getName() + " - " + Formats.CURRENCY.formatValue(prod.getPriceSell())
// + "<br>" + prod.getStockUnits() + " | " + Formats.DATE.formatValue(prod.getMemoDate()) + " | " + prod.getPriceSellTax(tax)
);
Image img = tnbprod.getThumbNail(prod.getImage());
setIcon(img == null ? null :new ImageIcon(img));
}
return this;
}
}
@@ -0,0 +1,69 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.format.Formats;
import com.unicenta.data.loader.Vectorer;
import com.unicenta.basic.BasicException;
import com.unicenta.pos.forms.AppLocal;
/**
*
* @author adrian
*/
public class ProductVectorer implements Vectorer {
private static String[] m_sHeaders = {
AppLocal.getIntString("label.prodref"),
AppLocal.getIntString("label.prodbarcode"),
AppLocal.getIntString("label.prodname"),
AppLocal.getIntString("label.prodpricebuy"),
AppLocal.getIntString("label.prodpricesell")
};
/** Creates a new instance of ProductVectorer */
public ProductVectorer() {
}
/**
*
* @return
* @throws BasicException
*/
public String[] getHeaders() throws BasicException {
return m_sHeaders;
}
/**
*
* @param obj
* @return
* @throws BasicException
*/
public String[] getValues(Object obj) throws BasicException {
ProductInfoExt myprod = (ProductInfoExt) obj;
String[] m_sValues = new String[5];
m_sValues[0] = Formats.STRING.formatValue(myprod.getReference());
m_sValues[1] = Formats.STRING.formatValue(myprod.getCode());
m_sValues[2] = Formats.STRING.formatValue(myprod.getName());
m_sValues[3] = Formats.CURRENCY.formatValue(new Double(myprod.getPriceBuy()));
m_sValues[4] = Formats.CURRENCY.formatValue(new Double(myprod.getPriceSell()));
return m_sValues;
}
}
@@ -0,0 +1,72 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
/**
*
* @author JG uniCenta
*/
public class ProviderInfo {
private int m_iProviderID;
private String m_sName;
/** Creates new Provider */
public ProviderInfo() {
m_iProviderID = 0;
m_sName = "";
}
/**
*
* @return
*/
public int getProviderID() {
return m_iProviderID;
}
/**
*
* @param iProviderID
*/
public void setProviderID(int iProviderID) {
m_iProviderID = iProviderID;
}
/**
*
* @return
*/
public String getName() {
return m_sName;
}
/**
*
* @param sName
*/
public void setName(String sName) {
m_sName = sName;
}
public String toString(){
return m_sName;
}
}
@@ -0,0 +1,130 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2017
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
//*****************************************************************************
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.IKeyed;
import com.unicenta.data.loader.SerializerRead;
import com.unicenta.format.Formats;
/**
*
* @author Adrian
* @version
*/
public class SalesDetailInfo implements IKeyed {
private static final long serialVersionUID = 8612449444103L;
private String productName;
private int lineNO;
/**
*
* @return
*/
public int getLineNO() {
return lineNO;
}
/**
*
* @param lineNO
*/
public void setLineNO(int lineNO) {
this.lineNO = lineNO;
}
/**
*
* @return
*/
public double getPrice() {
return price;
}
/**
*
* @return
*/
public String printPrice() {
return Formats.CURRENCY.formatValue(price);
}
/**
*
* @param price
*/
public void setPrice(double price) {
this.price = price;
}
/**
*
* @return
*/
public String getProductName() {
return productName;
}
/**
*
* @param productName
*/
public void setProductName(String productName) {
this.productName = productName;
}
private double price;
/** Creates new CategoryInfo
* @param lineNo
* @param productName
* @param price */
public SalesDetailInfo(int lineNo, String productName, double price) {
this.lineNO = lineNo;
this.productName = productName;
this.price = price;
}
/**
*
* @return
*/
public static SerializerRead getSerializerRead() {
return new SerializerRead() {
@Override
public Object readValues(DataRead dr) throws BasicException {
return new SalesDetailInfo(
dr.getInt(1),
dr.getString(2),
dr.getDouble(3));
}};
}
/**
*
* @return
*/
@Override
public Object getKey() {
return getLineNO();
}
}
@@ -0,0 +1,129 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2017
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
//*****************************************************************************
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.IKeyed;
import com.unicenta.data.loader.SerializerRead;
import com.unicenta.format.Formats;
/**
*
* @author Adrian
* @version
*/
public class SalesDetailInfo_1 implements IKeyed {
private static final long serialVersionUID = 8612449444103L;
private String productName;
private int lineNO;
/**
*
* @return
*/
public int getLineNO() {
return lineNO;
}
/**
*
* @param lineNO
*/
public void setLineNO(int lineNO) {
this.lineNO = lineNO;
}
/**
*
* @return
*/
public double getPrice() {
return price;
}
/**
*
* @return
*/
public String printPrice() {
return Formats.CURRENCY.formatValue(price);
}
/**
*
* @param price
*/
public void setPrice(double price) {
this.price = price;
}
/**
*
* @return
*/
public String getProductName() {
return productName;
}
/**
*
* @param productName
*/
public void setProductName(String productName) {
this.productName = productName;
}
private double price;
/** Creates new CategoryInfo
* @param lineNo
* @param productName
* @param price */
public SalesDetailInfo_1(int lineNo, String productName, double price) {
this.lineNO = lineNo;
this.productName = productName;
this.price = price;
}
/**
*
* @return
*/
public static SerializerRead getSerializerRead() {
return new SerializerRead() {@Override
public Object readValues(DataRead dr) throws BasicException {
return new SalesDetailInfo(
dr.getInt(1),
dr.getString(2),
dr.getDouble(3));
}};
}
/**
*
* @return
*/
@Override
public Object getKey() {
return getLineNO();
}
}
@@ -0,0 +1,68 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2017 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import java.util.*;
/**
*
* @author JG uniCenta
*/
public class Signumprovider {
private Set m_positives = new HashSet();
private Set m_negatives = new HashSet();
/** Creates a new instance of Signumprovider */
public Signumprovider() {
}
/**
*
* @param key
*/
public void addPositive(Object key) {
m_positives.add(key);
}
/**
*
* @param key
*/
public void addNegative(Object key) {
m_negatives.add(key);
}
/**
*
* @param key
* @param value
* @return
*/
public Double correctSignum(Object key, Double value) {
if (m_positives.contains(key)) {
return value.doubleValue() < 0.0 ? new Double(-value.doubleValue()) : value;
} else if (m_negatives.contains(key)) {
return value.doubleValue() > 0.0 ? new Double(-value.doubleValue()) : value;
} else {
return value;
}
}
}
@@ -0,0 +1,213 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2017 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.data.loader.IKeyed;
import java.io.Serializable;
/**
*
* @author adrianromero
*/
public class TaxInfo implements Serializable, IKeyed {
private static final long serialVersionUID = -2705212098856473043L;
private String id;
private String name;
private String taxcategoryid; // Product
private String taxcustcategoryid; // Customer
private String parentid;
private double rate;
private boolean cascade;
private Integer order;
/** Creates new TaxInfo
* @param id
* @param name
* @param taxcategoryid
* @param taxcustcategoryid
* @param rate
* @param cascade
* @param parentid
* @param order */
public TaxInfo(String id, String name, String taxcategoryid, String taxcustcategoryid,
String parentid, double rate, boolean cascade, Integer order) {
this.id = id;
this.name = name;
this.taxcategoryid = taxcategoryid;
this.taxcustcategoryid = taxcustcategoryid;
this.parentid = parentid;
this.rate = rate;
this.cascade = cascade;
this.order = order;
}
/**
*
* @return
*/
@Override
public Object getKey() {
return id;
}
/**
*
* @param value
*/
public void setID(String value) {
id = value;
}
/**
*
* @return
*/
public String getId() {
return id;
}
/**
*
* @return
*/
public String getName() {
return name;
}
/**
*
* @param value
*/
public void setName(String value) {
name = value;
}
/**
* The Product's
* @return
*/
public String getTaxCategoryID() {
return taxcategoryid;
}
/**
*
* @param value
*/
public void setTaxCategoryID(String value) {
taxcategoryid = value;
}
/**
* The Customer
* @return
*/
public String getTaxCustCategoryID() {
return taxcustcategoryid;
}
/**
*
* @param value
*/
public void setTaxCustCategoryID(String value) {
taxcustcategoryid = value;
}
/**
*
* @return
*/
public String getParentID() {
return parentid;
}
/**
*
* @param value
*/
public void setParentID(String value) {
parentid = value;
}
/**
*
* @return
*/
public double getRate() {
return rate;
}
/**
*
* @param value
*/
public void setRate(double value) {
rate = value;
}
/**
*
* @return
*/
public boolean isCascade() {
return cascade;
}
/**
*
* @param value
*/
public void setCascade(boolean value) {
cascade = value;
}
/**
*
* @return
*/
public Integer getOrder() {
return order;
}
/**
*
* @return
*/
public Integer getApplicationOrder() {
return order == null ? Integer.MAX_VALUE : order.intValue();
}
/**
*
* @param value
*/
public void setOrder(Integer value) {
order = value;
}
@Override
public String toString(){
return name;
}
}
@@ -0,0 +1,773 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.LocalRes;
import com.unicenta.data.loader.SerializableRead;
import com.unicenta.format.Formats;
import com.unicenta.pos.customers.CustomerInfoExt;
import com.unicenta.pos.forms.AppConfig;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.payment.PaymentInfo;
import com.unicenta.pos.payment.PaymentInfoMagcard;
import com.unicenta.pos.payment.PaymentInfoTicket;
import com.unicenta.pos.util.StringUtils;
import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/**
*
* @author adrianromero
*/
public final class TicketInfo implements SerializableRead, Externalizable {
private static final long serialVersionUID = 2765650092387265178L;
public static final int RECEIPT_NORMAL = 0;
public static final int RECEIPT_REFUND = 1;
public static final int RECEIPT_PAYMENT = 2;
public static final int RECEIPT_NOSALE = 3;
// JG Jun 2017 - contain partial/full refunds
public static final int REFUND_NOT = 0; // is a non-refunded ticket
public static final int REFUND_PARTIAL = 1;
public static final int REFUND_ALL = 2;
private static final DateFormat m_dateformat = new SimpleDateFormat("hh:mm");
private String m_sHost;
private String m_sId;
private int tickettype;
private int m_iTicketId;
private int m_iPickupId;
private java.util.Date m_dDate;
private Properties attributes;
private UserInfo m_User;
private Double multiply;
private CustomerInfoExt m_Customer;
private String m_sActiveCash;
private List<TicketLineInfo> m_aLines;
private List<PaymentInfo> payments;
private List<TicketTaxInfo> taxes;
private final String m_sResponse;
private String loyaltyCardNumber;
private Boolean oldTicket;
private boolean tip;
private PaymentInfoTicket m_paymentInfo;
private boolean m_isProcessed;
private final String m_locked;
private Double nsum;
private int ticketstatus;
private static String Hostname;
public static void setHostname(String name) {
Hostname=name;
}
public static String getHostname() {
return Hostname;
}
/** Creates new TicketModel */
public TicketInfo() {
m_sId = UUID.randomUUID().toString();
tickettype = RECEIPT_NORMAL;
m_iTicketId = 0; // incrementamos
m_dDate = new Date();
attributes = new Properties();
m_User = null;
m_Customer = null;
m_sActiveCash = null;
m_aLines = new ArrayList<>();
payments = new ArrayList<>();
taxes = null;
m_sResponse = null;
oldTicket=false;
AppConfig config = new AppConfig(new File(new File(
System.getProperty("user.home")), AppLocal.APP_ID + ".properties"));
config.load();
tip = Boolean.valueOf(config.getProperty("machine.showTip"));
m_isProcessed = false;
m_locked = null;
ticketstatus = 0;
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(m_sId);
out.writeInt(tickettype);
out.writeInt(m_iTicketId);
out.writeObject(m_Customer);
out.writeObject(m_dDate);
out.writeObject(attributes);
out.writeObject(m_aLines);
out.writeInt(ticketstatus);
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
m_sId = (String) in.readObject();
tickettype = in.readInt();
m_iTicketId = in.readInt();
m_Customer = (CustomerInfoExt) in.readObject();
m_dDate = (Date) in.readObject();
attributes = (Properties) in.readObject();
m_aLines = (List<TicketLineInfo>) in.readObject();
m_User = null;
m_sActiveCash = null;
payments = new ArrayList<>(); // JG June 2102 diamond inference
taxes = null;
ticketstatus = in.readInt();
}
/**
*
* @param dr
* @throws BasicException
*/
@Override
public void readValues(DataRead dr) throws BasicException {
m_sId = dr.getString(1);
tickettype = dr.getInt(2);
m_iTicketId = dr.getInt(3);
m_dDate = dr.getTimestamp(4);
m_sActiveCash = dr.getString(5);
try {
byte[] img = dr.getBytes(6);
if (img != null) {
attributes.loadFromXML(new ByteArrayInputStream(img));
}
} catch (IOException e) {
}
m_User = new UserInfo(dr.getString(7), dr.getString(8));
m_Customer = new CustomerInfoExt(dr.getString(9));
m_aLines = new ArrayList<>();
payments = new ArrayList<>();
taxes = null;
ticketstatus = dr.getInt(10);
}
/**
*
* @return
*/
public TicketInfo copyTicket() {
TicketInfo t = new TicketInfo();
t.tickettype = tickettype;
t.m_iTicketId = m_iTicketId;
t.m_dDate = m_dDate;
t.m_sActiveCash = m_sActiveCash;
t.attributes = (Properties) attributes.clone();
t.m_User = m_User;
t.m_Customer = m_Customer;
t.m_aLines = new ArrayList<>(); // JG June 2102 diamond inference
m_aLines.forEach((l) -> {
t.m_aLines.add(l.copyTicketLine());
});
t.refreshLines();
t.payments = new LinkedList<>(); // JG June 2102 diamond inference
payments.forEach((p) -> {
t.payments.add(p.copyPayment());
});
t.oldTicket=oldTicket;
// taxes are not copied, must be calculated again.
t.ticketstatus = ticketstatus;
return t;
}
public String getId() {
return m_sId;
}
public int getTicketType() {
return tickettype;
}
public void setTicketType(int tickettype) {
this.tickettype = tickettype;
}
public int getTicketId() {
return m_iTicketId;
}
public void setTicketId(int iTicketId) {
m_iTicketId = iTicketId;
}
public int getTicketStatus() {
return ticketstatus;
}
public void setTicketStatus(int ticketstatus) {
if (m_iTicketId >0) {
this.ticketstatus = m_iTicketId;
}else{
this.ticketstatus = ticketstatus;
}
}
public void setPickupId(int iTicketId) {
m_iPickupId = iTicketId;
}
public int getPickupId() {
return m_iPickupId;
}
public String getName(Object info) {
// JG Aug 2014 - Add User info
List<String> name = new ArrayList<>();
String nameprop = getProperty("name");
if (nameprop != null) {
name.add(nameprop);
}
if (m_User != null) {
name.add(m_User.getName());
}
if (info == null) {
if (m_iTicketId == 0) {
name.add("(" + m_dateformat.format(m_dDate) + " "
+ Long.toString(m_dDate.getTime() % 1000) + ")");
} else {
name.add(Integer.toString(m_iTicketId));
}
} else {
name.add(info.toString());
}
if (m_Customer != null) {
name.add(m_Customer.getName());
}
return org.apache.commons.lang.StringUtils.join(name, " - ");
}
public String getName() {
return getName(null);
}
public java.util.Date getDate() {
return m_dDate;
}
public void setDate(java.util.Date dDate) {
m_dDate = dDate;
}
public String getHost() {
AppConfig m_config_host = new AppConfig(new File((System.getProperty("user.home")),
AppLocal.APP_ID + ".properties"));
m_config_host.load();
String machineHostname =(m_config_host.getProperty("machine.hostname"));
m_config_host = null;
return machineHostname;
}
public UserInfo getUser() {
return m_User;
}
public void setUser(UserInfo value) {
m_User = value;
}
public CustomerInfoExt getCustomer() {
return m_Customer;
}
public void setCustomer(CustomerInfoExt value) {
m_Customer = value;
}
public String getCustomerId() {
if (m_Customer == null) {
return null;
} else {
return m_Customer.getId();
}
}
public String getTransactionID(){
return (getPayments().size()>0)
? ( getPayments().get(getPayments().size()-1) ).getTransactionID()
: StringUtils.getCardNumber(); //random transaction ID
}
public String getReturnMessage(){
return ( (getPayments().get(getPayments().size()-1)) instanceof PaymentInfoMagcard )
? ((PaymentInfoMagcard)(getPayments().get(getPayments().size()-1))).getReturnMessage()
: LocalRes.getIntString("button.OK");
}
public void setActiveCash(String value) {
m_sActiveCash = value;
}
public String getActiveCash() {
return m_sActiveCash;
}
public String getProperty(String key) {
return attributes.getProperty(key);
}
public String getProperty(String key, String defaultvalue) {
return attributes.getProperty(key, defaultvalue);
}
public void setProperty(String key, String value) {
attributes.setProperty(key, value);
}
public Properties getProperties() {
return attributes;
}
public TicketLineInfo getLine(int index) {
return m_aLines.get(index);
}
public void addLine(TicketLineInfo oLine) {
oLine.setTicket(m_sId, m_aLines.size());
m_aLines.add(oLine);
}
public void insertLine(int index, TicketLineInfo oLine) {
m_aLines.add(index, oLine);
refreshLines();
}
public void setLine(int index, TicketLineInfo oLine) {
oLine.setTicket(m_sId, index);
m_aLines.set(index, oLine);
}
public void removeLine(int index) {
m_aLines.remove(index);
refreshLines();
}
public void refreshLines() {
for (int i = 0; i < m_aLines.size(); i++) {
getLine(i).setTicket(m_sId, i);
}
}
public int getLinesCount() {
return m_aLines.size();
}
public double getArticlesCount() {
double dArticles = 0.0;
TicketLineInfo oLine;
for (Iterator<TicketLineInfo> i = m_aLines.iterator(); i.hasNext();) {
oLine = i.next();
dArticles += oLine.getMultiply();
}
return dArticles;
}
public double getSubTotal() {
double sum = 0.0;
sum = m_aLines.stream().map((line) ->
line.getSubValue()).reduce(sum, (accumulator, _item) ->
accumulator + _item);
return sum;
}
public double getTax() {
double sum = 0.0;
if (hasTaxesCalculated()) {
for (TicketTaxInfo tax : taxes) {
sum += tax.getTax(); // Taxes are already rounded...
nsum = sum;
}
} else {
sum = m_aLines.stream().map((line) ->
line.getTax()).reduce(sum, (accumulator, _item) ->
accumulator + _item);
}
return sum;
}
public double getTotal() {
return getSubTotal() + getTax();
}
public double getServiceCharge() {
return (getTotal() + getTax());
}
public double getTotalPaid() {
double sum = 0.0;
sum = payments.stream().filter((p) ->
(!"debtpaid".equals(p.getName()))).map((p) ->
p.getTotal()).reduce(sum, (accumulator, _item) ->
accumulator + _item);
return sum;
}
public double getTendered() {
return getTotalPaid();
}
public List<TicketLineInfo> getLines() {
return m_aLines;
}
public void setLines(List<TicketLineInfo> l) {
m_aLines = l;
}
public List<PaymentInfo> getPayments() {
return payments;
}
public void setPayments(List<PaymentInfo> l) {
payments = l;
}
public void resetPayments() {
payments = new ArrayList<>(); // JG June 2102 diamond inference
}
public List<TicketTaxInfo> getTaxes() {
return taxes;
}
public boolean hasTaxesCalculated() {
return taxes != null;
}
public void setTaxes(List<TicketTaxInfo> l) {
taxes = l;
}
public void resetTaxes() {
taxes = null;
}
public void setTip(boolean tips) {
tip = tips;
}
public boolean hasTip() {
return tip;
}
public void setIsProcessed(boolean isP) {
m_isProcessed = isP;
}
public TicketTaxInfo getTaxLine(TaxInfo tax) {
for (TicketTaxInfo taxline : taxes) {
if (tax.getId().equals(taxline.getTaxInfo().getId())) {
return taxline;
}
}
return new TicketTaxInfo(tax);
}
public TicketTaxInfo[] getTaxLines() {
Map<String, TicketTaxInfo> m = new HashMap<>();
TicketLineInfo oLine;
for (Iterator<TicketLineInfo> i = m_aLines.iterator(); i.hasNext();) {
oLine = i.next();
TicketTaxInfo t = m.get(oLine.getTaxInfo().getId());
if (t == null) {
t = new TicketTaxInfo(oLine.getTaxInfo());
m.put(t.getTaxInfo().getId(), t);
}
t.add(oLine.getSubValue());
}
// return dSuma;
Collection<TicketTaxInfo> avalues = m.values();
return avalues.toArray(new TicketTaxInfo[avalues.size()]);
}
public String printId() {
AppConfig m_config = new AppConfig(new File(
(System.getProperty("user.home")), AppLocal.APP_ID + ".properties"));
m_config.load();
String receiptSize =(m_config.getProperty("till.receiptsize"));
String receiptPrefix =(m_config.getProperty("till.receiptprefix"));
m_config =null;
if (m_iTicketId > 0) {
String tmpTicketId=Integer.toString(m_iTicketId);
if (receiptSize == null || (Integer.parseInt(receiptSize) <= tmpTicketId.length())){
if (receiptPrefix != null){
tmpTicketId=receiptPrefix+tmpTicketId;
}
return tmpTicketId;
}
while (tmpTicketId.length()<Integer.parseInt(receiptSize)){
tmpTicketId="0"+tmpTicketId;
}
if (receiptPrefix != null){
tmpTicketId=receiptPrefix+tmpTicketId;
}
return tmpTicketId;
} else {
return "";
}
}
public String printDate() {
return Formats.TIMESTAMP.formatValue(m_dDate);
}
public String printUser() {
return m_User == null ? "" : m_User.getName();
}
public String printHost() {
return m_sHost;
}
// Added JDL 28.05.13 for loyalty card functions
/**
*
*/
public void clearCardNumber(){
loyaltyCardNumber=null;
}
/**
*
* @param cardNumber
*/
public void setLoyaltyCardNumber(String cardNumber){
loyaltyCardNumber=cardNumber;
}
/**
*
* @return
*/
public String getLoyaltyCardNumber(){
return (loyaltyCardNumber);
}
public String printCustomer() {
return m_Customer == null ? "" : m_Customer.getName();
}
public String printPhone1() {
return m_Customer == null ? "" : m_Customer.getPhone1();
}
public String printArticlesCount() {
return Formats.DOUBLE.formatValue(getArticlesCount());
}
public String printSubTotal() {
return Formats.CURRENCY.formatValue(getSubTotal());
}
public String printTax() {
return Formats.CURRENCY.formatValue(getTax());
}
public String printTotal() {
return Formats.CURRENCY.formatValue(getTotal());
}
public String printTotalPaid() {
return Formats.CURRENCY.formatValue(getTotalPaid());
}
public String printTendered() {
return Formats.CURRENCY.formatValue(getTendered());
}
public String VoucherReturned(){
return Formats.CURRENCY.formatValue(getTotalPaid()- getTotal());
}
public boolean getOldTicket() {
return (oldTicket);
}
public void setOldTicket(Boolean otState) {
oldTicket = otState;
}
public String getTicketHeaderFooterData(String data) {
AppConfig m_config = new AppConfig(new File((System.getProperty("user.home"))
, AppLocal.APP_ID + ".properties"));
m_config.load();
String row =(m_config.getProperty("tkt."+data));
return row;
}
public String printTicketHeaderLine1() {
String lineData = getTicketHeaderFooterData("header1");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketHeaderLine2() {
String lineData = getTicketHeaderFooterData("header2");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketHeaderLine3() {
String lineData = getTicketHeaderFooterData("header3");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketHeaderLine4() {
String lineData = getTicketHeaderFooterData("header4");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketHeaderLine5() {
String lineData = getTicketHeaderFooterData("header5");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketHeaderLine6() {
String lineData = getTicketHeaderFooterData("header6");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketFooterLine1() {
String lineData = getTicketHeaderFooterData("footer1");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketFooterLine2() {
String lineData = getTicketHeaderFooterData("footer2");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketFooterLine3() {
String lineData = getTicketHeaderFooterData("footer3");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketFooterLine4() {
String lineData = getTicketHeaderFooterData("footer4");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketFooterLine5() {
String lineData = getTicketHeaderFooterData("footer5");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
public String printTicketFooterLine6() {
String lineData = getTicketHeaderFooterData("footer6");
if(lineData != null) {
return lineData;
} else {
return "";
}
}
}
@@ -0,0 +1,484 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.DataWrite;
import com.unicenta.data.loader.SerializableRead;
import com.unicenta.data.loader.SerializableWrite;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.util.StringUtils;
import java.io.*;
import java.util.Properties;
/**
*
* @author adrianromero
*/
public class TicketLineInfo implements SerializableWrite, SerializableRead, Serializable {
private static final long serialVersionUID = 6608012948284450199L;
private String m_sTicket;
private int m_iLine;
private double multiply;
private double price;
private TaxInfo tax;
private Properties attributes;
private String productid;
private String attsetinstid;
private Boolean updated = false;
private double newprice = 0.0;
/** Creates new TicketLineInfo
* @param productid
* @param dMultiply
* @param dPrice
* @param tax
* @param props */
public TicketLineInfo(String productid, double dMultiply, double dPrice, TaxInfo tax, Properties props) {
init(productid, null, dMultiply, dPrice, tax, props);
}
/**
*
* @param productid
* @param dMultiply
* @param dPrice
* @param tax
*/
public TicketLineInfo(String productid, double dMultiply, double dPrice, TaxInfo tax) {
init(productid, null, dMultiply, dPrice, tax, new Properties());
}
/**
* Example: Call from script.TotalDiscount event
* @param productid
* @param productname
* @param producttaxcategory
* @param productprinter
* @param dMultiply
* @param dPrice
* @param tax
*/
public TicketLineInfo(String productid, String productname, String producttaxcategory, String productprinter, double dMultiply, double dPrice, TaxInfo tax) {
Properties props = new Properties();
props.setProperty("product.name", productname);
props.setProperty("product.taxcategoryid", producttaxcategory);
props.setProperty("product.printer", productprinter); //added to props as may introduce printer redirect
init(productid, null, dMultiply, dPrice, tax, props);
}
/**
* Example: Call from script.LineDiscount event
* @param productname
* @param producttaxcategory
* @param productprinter //added to props as may introduce printer redirect
* @param dMultiply
* @param dPrice
* @param tax
*/
public TicketLineInfo(String productname, String producttaxcategory, String productprinter, double dMultiply, double dPrice, TaxInfo tax) {
Properties props = new Properties();
props.setProperty("product.name", productname);
props.setProperty("product.taxcategoryid", producttaxcategory);
props.setProperty("product.printer", productprinter);
init(null, null, dMultiply, dPrice, tax, props);
}
/**
*
*/
public TicketLineInfo() {
init(null, null, 0.0, 0.0, null, new Properties());
}
/**
*
* @param product
* @param dMultiply
* @param dPrice
* @param tax
* @param attributes
*/
public TicketLineInfo(ProductInfoExt product, double dMultiply, double dPrice, TaxInfo tax, Properties attributes) {
String pid;
if (product == null) {
pid = null;
tax = null;
} else {
pid = product.getID();
attributes.setProperty("product.name", product.getName());
attributes.setProperty("product.reference", product.getReference());
attributes.setProperty("product.code", product.getCode());
if (product.getMemoDate() == null) {
attributes.setProperty("product.memodate", "1900-01-01 00:00:01");
} else {
attributes.setProperty("product.memodate", product.getMemoDate());
}
attributes.setProperty("product.com", product.isCom() ? "true" : "false");
attributes.setProperty("product.constant", product.isConstant() ? "true" : "false");
if (product.getPrinter() != null) {
attributes.setProperty("product.printer", product.getPrinter());
} else {
attributes.setProperty("product.printer", "1");
}
attributes.setProperty("product.service", product.isService() ? "true" : "false");
attributes.setProperty("product.vprice", product.isVprice() ? "true" : "false");
attributes.setProperty("product.verpatrib", product.isVerpatrib() ? "true" : "false");
if (product.getTextTip() != null) {
attributes.setProperty("product.texttip", product.getTextTip());
}
attributes.setProperty("product.warranty", product.getWarranty()? "true" : "false");
if (product.getAttributeSetID() != null) {
attributes.setProperty("product.attsetid", product.getAttributeSetID());
}
attributes.setProperty("product.taxcategoryid", product.getTaxCategoryID());
if (product.getCategoryID() != null) {
attributes.setProperty("product.categoryid", product.getCategoryID());
}
if ("true".equals(attributes.getProperty("ticket.updated"))) {
attributes.setProperty("ticket.updated", "false");
} else {
attributes.setProperty("ticket.updated", "true");
}
}
init(pid, null, dMultiply, dPrice, tax, attributes);
}
/**
*
* @param oProduct
* @param dPrice
* @param tax
* @param attributes
*/
public TicketLineInfo(ProductInfoExt oProduct, double dPrice, TaxInfo tax, Properties attributes) {
this(oProduct, 1.0, dPrice, tax, attributes);
}
/**
*
* @param line
*/
public TicketLineInfo(TicketLineInfo line) {
init(line.productid, line.attsetinstid, line.multiply, line.price,
line.tax, (Properties) line.attributes.clone());
}
private void init(String productid, String attsetinstid, double dMultiply, double dPrice, TaxInfo tax, Properties attributes) {
this.productid = productid;
this.attsetinstid = attsetinstid;
multiply = dMultiply;
price = dPrice;
this.tax = tax;
this.attributes = attributes;
m_sTicket = null;
m_iLine = -1;
}
void setTicket(String ticket, int line) {
m_sTicket = ticket;
m_iLine = line;
}
/**
*
* @param dp
* @throws BasicException
*/
@Override
public void writeValues(DataWrite dp) throws BasicException {
dp.setString(1, m_sTicket);
dp.setInt(2, m_iLine);
dp.setString(3, productid);
dp.setString(4, attsetinstid);
dp.setDouble(5, multiply);
dp.setDouble(6, price);
dp.setString(7, tax.getId());
try {
ByteArrayOutputStream o = new ByteArrayOutputStream();
attributes.storeToXML(o, AppLocal.APP_NAME, "UTF-8");
dp.setBytes(8, o.toByteArray());
} catch (IOException e) {
dp.setBytes(8, null);
}
}
/**
*
* @param dr
* @throws BasicException
*/
@Override
public void readValues(DataRead dr) throws BasicException {
m_sTicket = dr.getString(1);
m_iLine = dr.getInt(2);
productid = dr.getString(3);
attsetinstid = dr.getString(4);
multiply = dr.getDouble(5);
price = dr.getDouble(6);
tax = new TaxInfo(
dr.getString(7),
dr.getString(8),
dr.getString(9),
dr.getString(10),
dr.getString(11),
dr.getDouble(12),
dr.getBoolean(13),
dr.getInt(14));
attributes = new Properties();
try {
byte[] img = dr.getBytes(15);
if (img != null) {
attributes.loadFromXML(new ByteArrayInputStream(img));
}
} catch (IOException e) {
}
}
/**
*
* @return
*/
public TicketLineInfo copyTicketLine() {
TicketLineInfo l = new TicketLineInfo();
l.productid = productid;
l.attsetinstid = attsetinstid;
l.multiply = multiply;
l.price = price;
l.tax = tax;
l.attributes = (Properties) attributes.clone();
return l;
}
/**
*
* @return
*/
public int getTicketLine() {
return m_iLine;
}
// These are the Lookups
public String getProductID() {
return productid;
}
public String getProductCategoryID() {
return (attributes.getProperty("product.categoryid"));
}
public String getProductAttSetId() {
return attributes.getProperty("product.attsetid");
}
public String getProductAttSetInstId() {
return attsetinstid;
}
public String getProductAttSetInstDesc() {
return attributes.getProperty("product.attsetdesc", "");
}
public String getProductTaxCategoryID() {
return (attributes.getProperty("product.taxcategoryid"));
}
public String getTicketUpdated() {
return (attributes.getProperty("ticket.updated"));
}
public TaxInfo getTaxInfo() {
return tax;
}
public void setTaxInfo(TaxInfo oTaxInfo) {
tax = oTaxInfo;
}
// These appear on Printed TicketLine
public String getProductName() {
return attributes.getProperty("product.name");
}
public String getProductMemoDate() {
return attributes.getProperty("product.memodate");
}
public double getPrice() {
return price;
}
public double getMultiply() {
return multiply;
}
public double getTaxRate() {
return tax == null ? 0.0 : tax.getRate();
}
public double getNewPrice() {
newprice = price * (1.0 + getTaxRate());
return price;
}
public String getProductPrinter() {
return attributes.getProperty("product.printer");
}
// These are the Summaries
public double getPriceTax() {
return price * (1.0 + getTaxRate());
}
public Properties getProperties() {
return attributes;
}
public String getProperty(String key) {
return attributes.getProperty(key);
}
public String getProperty(String key, String defaultvalue) {
return attributes.getProperty(key, defaultvalue);
}
// These are Ticket Totals
public double getTax() {
return price * multiply * getTaxRate();
}
public double getValue() {
return price * multiply * (1.0 + getTaxRate());
}
public double getSubValue() {
return price * multiply;
}
// SETTERS
public void setPrice(double dValue) {
price = dValue;
}
public void setPriceTax(double dValue) {
price = dValue / (1.0 + getTaxRate());
}
public void setMultiply(double dValue) {
multiply = dValue;
}
public void setProperty(String key, String value) {
attributes.setProperty(key, value);
}
public void setProductTaxCategoryID(String taxID){
attributes.setProperty("product.taxcategoryid",taxID);
}
public void setProductAttSetInstId(String value) {
attsetinstid = value;
}
public void setProductAttSetInstDesc(String value) {
if (value == null) {
attributes.remove(value);
} else {
attributes.setProperty("product.attsetdesc", value);
}
}
public void setTicketUpdated(String key, String value){
attributes.setProperty("ticket.updated",value);
}
public void setProductPrinter(String value) {
if (value == null) {
attributes.remove(value);
} else {
attributes.setProperty("product.printer", value);
}
}
/**
*
* @return
*/
// Print to actual ${ticketline
public String printReference() {
return StringUtils.encodeXML(attributes.getProperty("product.reference"));
}
public String printCode() {
return StringUtils.encodeXML(attributes.getProperty("product.code"));
}
public String printName() {
return StringUtils.encodeXML(attributes.getProperty("product.name"));
}
public String printProductMemoDate() {
return StringUtils.encodeXML(attributes.getProperty("product.memodate"));
}
public String printPrice() {
return Formats.CURRENCY.formatValue(getPrice());
}
public String printPriceTax() {
return Formats.CURRENCY.formatValue(getPriceTax());
}
public String printMultiply() {
return Formats.DOUBLE.formatValue(multiply);
}
public String printValue() {
return Formats.CURRENCY.formatValue(getValue());
}
public String printTaxRate() {
return Formats.PERCENT.formatValue(getTaxRate());
}
public String printSubValue() {
return Formats.CURRENCY.formatValue(getSubValue());
}
public String printTax() {
return Formats.CURRENCY.formatValue(getTax());
}
public String printTextTip() {
return attributes.getProperty("product.texttip");
}
public String printPrinter() {
return StringUtils.encodeXML(attributes.getProperty("product.printer"));
}
public boolean isProductCom() {
return "true".equals(attributes.getProperty("product.com"));
}
public boolean isProductService() {
return "true".equals(attributes.getProperty("product.service"));
}
public boolean isProductVprice() {
return "true".equals(attributes.getProperty("product.vprice"));
}
public boolean isProductVerpatrib() {
return "true".equals(attributes.getProperty("product.verpatrib"));
}
public boolean isProductWarranty() {
return "true".equals(attributes.getProperty("product.warranty"));
}
public boolean getUpdated() {
return "true".equals(attributes.getProperty("ticket.updated"));
}
public void setUpdated(Boolean value) {
updated = value;
}
}
@@ -0,0 +1,637 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2017 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.DataWrite;
import com.unicenta.data.loader.SerializableRead;
import com.unicenta.data.loader.SerializableWrite;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.util.StringUtils;
import java.io.*;
import java.util.Properties;
/**
*
* @author adrianromero
*/
public class TicketLineInfo1 implements SerializableWrite, SerializableRead, Serializable {
private static final long serialVersionUID = 6608012948284450199L;
private String m_sTicket;
private int m_iLine;
private double multiply;
private double price;
private TaxInfo tax;
private Properties attributes;
private String productid;
private String attsetinstid;
/** Creates new TicketLineInfo
* @param productid
* @param dMultiply
* @param dPrice
* @param tax
* @param props */
public TicketLineInfo1(String productid, double dMultiply, double dPrice, TaxInfo tax, Properties props) {
init(productid, null, dMultiply, dPrice, tax, props);
}
/**
*
* @param productid
* @param dMultiply
* @param dPrice
* @param tax
*/
public TicketLineInfo1(String productid, double dMultiply, double dPrice, TaxInfo tax) {
init(productid, null, dMultiply, dPrice, tax, new Properties());
}
/**
*
* @param productid
* @param productname
* @param producttaxcategory
* @param dMultiply
* @param dPrice
* @param tax
*/
public TicketLineInfo1(String productid, String productname, String producttaxcategory, double dMultiply, double dPrice, TaxInfo tax) {
Properties props = new Properties();
props.setProperty("product.name", productname);
props.setProperty("product.taxcategoryid", producttaxcategory);
init(productid, null, dMultiply, dPrice, tax, props);
}
/**
*
* @param productname
* @param producttaxcategory
* @param dMultiply
* @param dPrice
* @param tax
*/
public TicketLineInfo1(String productname, String producttaxcategory, double dMultiply, double dPrice, TaxInfo tax) {
Properties props = new Properties();
props.setProperty("product.name", productname);
props.setProperty("product.taxcategoryid", producttaxcategory);
init(null, null, dMultiply, dPrice, tax, props);
}
/**
*
*/
public TicketLineInfo1() {
init(null, null, 0.0, 0.0, null, new Properties());
}
/**
*
* @param product
* @param dMultiply
* @param dPrice
* @param tax
* @param attributes
*/
public TicketLineInfo1(ProductInfoExt product, double dMultiply, double dPrice, TaxInfo tax, Properties attributes) {
String pid;
if (product == null) {
pid = null;
} else {
pid = product.getID();
attributes.setProperty("product.name", product.getName());
attributes.setProperty("product.com", product.isCom() ? "true" : "false");
attributes.setProperty("product.constant", product.isConstant() ? "true" : "false");
attributes.setProperty("product.printer", product.getPrinter());
attributes.setProperty("product.service", product.isService() ? "true" : "false");
attributes.setProperty("product.vprice", product.isVprice() ? "true" : "false");
attributes.setProperty("product.verpatrib", product.isVerpatrib() ? "true" : "false");
if (product.getTextTip() != null) {
attributes.setProperty("product.texttip", product.getTextTip());
}
attributes.setProperty("product.warranty", product.getWarranty()? "true" : "false");
if (product.getAttributeSetID() != null) {
attributes.setProperty("product.attsetid", product.getAttributeSetID());
}
attributes.setProperty("product.taxcategoryid", product.getTaxCategoryID());
if (product.getCategoryID() != null) {
attributes.setProperty("product.categoryid", product.getCategoryID());
}
}
init(pid, null, dMultiply, dPrice, tax, attributes);
}
/**
*
* @param oProduct
* @param dPrice
* @param tax
* @param attributes
*/
public TicketLineInfo1(ProductInfoExt oProduct, double dPrice, TaxInfo tax, Properties attributes) {
this(oProduct, 1.0, dPrice, tax, attributes);
}
/**
*
* @param line
*/
public TicketLineInfo1(TicketLineInfo1 line) {
init(line.productid, line.attsetinstid, line.multiply, line.price, line.tax, (Properties) line.attributes.clone());
}
private void init(String productid, String attsetinstid, double dMultiply, double dPrice, TaxInfo tax, Properties attributes) {
this.productid = productid;
this.attsetinstid = attsetinstid;
multiply = dMultiply;
price = dPrice;
this.tax = tax;
this.attributes = attributes;
m_sTicket = null;
m_iLine = -1;
}
void setTicket(String ticket, int line) {
m_sTicket = ticket;
m_iLine = line;
}
/**
*
* @param dp
* @throws BasicException
*/
@Override
public void writeValues(DataWrite dp) throws BasicException {
dp.setString(1, m_sTicket);
dp.setInt(2, new Integer(m_iLine));
dp.setString(3, productid);
dp.setString(4, attsetinstid);
dp.setDouble(5, new Double(multiply));
dp.setDouble(6, new Double(price));
dp.setString(7, tax.getId());
try {
ByteArrayOutputStream o = new ByteArrayOutputStream();
attributes.storeToXML(o, AppLocal.APP_NAME, "UTF-8");
dp.setBytes(8, o.toByteArray());
} catch (IOException e) {
dp.setBytes(8, null);
}
}
/**
*
* @param dr
* @throws BasicException
*/
@Override
public void readValues(DataRead dr) throws BasicException {
m_sTicket = dr.getString(1);
m_iLine = dr.getInt(2).intValue();
productid = dr.getString(3);
attsetinstid = dr.getString(4);
multiply = dr.getDouble(5);
price = dr.getDouble(6);
tax = new TaxInfo(
dr.getString(7),
dr.getString(8),
dr.getString(9),
dr.getString(10),
dr.getString(11),
dr.getDouble(12),
dr.getBoolean(13),
dr.getInt(14));
attributes = new Properties();
try {
byte[] img = dr.getBytes(15);
if (img != null) {
attributes.loadFromXML(new ByteArrayInputStream(img));
}
} catch (IOException e) {
}
}
/**
*
* @return
*/
public TicketLineInfo1 copyTicketLine() {
TicketLineInfo1 l = new TicketLineInfo1();
l.productid = productid;
l.attsetinstid = attsetinstid;
l.multiply = multiply;
l.price = price;
l.tax = tax;
l.attributes = (Properties) attributes.clone();
return l;
}
/**
*
* @return
*/
public int getTicketLine() {
return m_iLine;
}
/**
*
* @return
*/
public String getProductID() {
return productid;
}
/**
*
* @return
*/
public String getProductName() {
return attributes.getProperty("product.name");
}
/**
*
* @return
*/
public String getProductPrinter() {
return attributes.getProperty("product.printer");
}
/**
*
* @return
*/
public String getProductAttSetId() {
return attributes.getProperty("product.attsetid");
}
/**
*
* @return
*/
public String getProductAttSetInstDesc() {
return attributes.getProperty("product.attsetdesc", "");
}
/**
*
* @param value
*/
public void setProductAttSetInstDesc(String value) {
if (value == null) {
attributes.remove(value);
} else {
attributes.setProperty("product.attsetdesc", value);
}
}
/**
*
* @return
*/
public String getProductAttSetInstId() {
return attsetinstid;
}
/**
*
* @param value
*/
public void setProductAttSetInstId(String value) {
attsetinstid = value;
}
/**
*
* @return
*/
public boolean isProductCom() {
return "true".equals(attributes.getProperty("product.com"));
}
/**
*
* @return
*/
public String getProductTaxCategoryID() {
return (attributes.getProperty("product.taxcategoryid"));
}
/**
*
* @param taxID
*/
public void setProductTaxCategoryID(String taxID){
attributes.setProperty("product.taxcategoryid",taxID);
}
/**
*
* @return
*/
public String getProductCategoryID() {
return (attributes.getProperty("product.categoryid"));
}
/**
*
* @return
*/
public double getMultiply() {
return multiply;
}
/**
*
* @param dValue
*/
public void setMultiply(double dValue) {
multiply = dValue;
}
/**
*
* @return
*/
public double getPrice() {
return price;
}
/**
*
* @param dValue
*/
public void setPrice(double dValue) {
price = dValue;
}
/**
*
* @return
*/
public double getPriceTax() {
return price * (1.0 + getTaxRate());
}
/**
*
* @param dValue
*/
public void setPriceTax(double dValue) {
price = dValue / (1.0 + getTaxRate());
}
/**
*
* @return
*/
public TaxInfo getTaxInfo() {
return tax;
}
/**
*
* @param value
*/
public void setTaxInfo(TaxInfo value) {
tax = value;
}
/**
*
* @param key
* @return
*/
public String getProperty(String key) {
return attributes.getProperty(key);
}
/**
*
* @param key
* @param defaultvalue
* @return
*/
public String getProperty(String key, String defaultvalue) {
return attributes.getProperty(key, defaultvalue);
}
/**
*
* @param key
* @param value
*/
public void setProperty(String key, String value) {
attributes.setProperty(key, value);
}
/**
*
* @return
*/
public Properties getProperties() {
return attributes;
}
/**
*
* @return
*/
public double getTaxRate() {
return tax == null ? 0.0 : tax.getRate();
}
/**
*
* @return
*/
public double getSubValue() {
return price * multiply;
}
/**
*
* @return
*/
public double getTax() {
return price * multiply * getTaxRate();
}
/**
*
* @return
*/
public double getValue() {
return price * multiply * (1.0 + getTaxRate());
}
/**
*
* @return
*/
public String printName() {
return StringUtils.encodeXML(attributes.getProperty("product.name"));
}
/**
*
* @return
*/
public String printPrinter() {
return StringUtils.encodeXML(attributes.getProperty("product.printer"));
}
/**
*
* @return
*/
public String printMultiply() {
return Formats.DOUBLE.formatValue(multiply);
}
/**
*
* @return
*/
public String printPrice() {
return Formats.CURRENCY.formatValue(getPrice());
}
/**
*
* @return
*/
public String printPriceTax() {
return Formats.CURRENCY.formatValue(getPriceTax());
}
/**
*
* @return
*/
public String printTax() {
return Formats.CURRENCY.formatValue(getTax());
}
/**
*
* @return
*/
public String printTaxRate() {
return Formats.PERCENT.formatValue(getTaxRate());
}
/**
*
* @return
*/
public String printSubValue() {
return Formats.CURRENCY.formatValue(getSubValue());
}
/**
*
* @return
*/
public String printValue() {
return Formats.CURRENCY.formatValue(getValue());
}
// ADDED JG 20.12.10 - Kitchen Print
/**
*
* @return
*/
public boolean isProductConstant() {
return "true".equals(attributes.getProperty("product.constant"));
}
// ***
// ADDED JG 25.06.11 - Is Service
/**
*
* @return
*/
public boolean isProductService() {
return "true".equals(attributes.getProperty("product.service"));
}
// Added JDL 19.12.12 - Variable price product
/**
*
* @return
*/
public boolean isProductVprice() {
return "true".equals(attributes.getProperty("product.vprice"));
//
}
// Added JDL 09.02.13 for Chris
/**
*
* @return
*/
public boolean isProductVerpatrib() {
return "true".equals(attributes.getProperty("product.verpatrib"));
//
}
// Added JDL 09.04.12 - Variable price product
/**
*
* @return
*/
public String printTextTip() {
return attributes.getProperty("product.texttip");
//
}
// Added JDL 09.02.13
/**
*
* @return
*/
public boolean isProductWarranty() {
return "true".equals(attributes.getProperty("product.warranty"));
//
}
}
@@ -0,0 +1,108 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2017 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import com.unicenta.format.Formats;
/**
*
* @author JG uniCenta
*/
public class TicketTaxInfo {
private TaxInfo tax;
private double subtotal;
private double taxtotal;
/** Creates a new instance of TicketTaxInfo
* @param tax */
public TicketTaxInfo(TaxInfo tax) {
this.tax = tax;
subtotal = 0.0;
taxtotal = 0.0;
}
/**
*
* @return
*/
public TaxInfo getTaxInfo() {
return tax;
}
/**
*
* @param dValue
*/
public void add(double dValue) {
subtotal += dValue;
taxtotal = subtotal * tax.getRate();
}
/**
*
* @return
*/
public double getSubTotal() {
return subtotal;
}
/**
*
* @return
*/
public double getTax() {
return taxtotal;
}
/**
*
* @return
*/
public double getTotal() {
return subtotal + taxtotal;
}
/**
*
* @return
*/
public String printSubTotal() {
return Formats.CURRENCY.formatValue(getSubTotal());
}
/**
*
* @return
*/
public String printTax() {
return Formats.CURRENCY.formatValue(getTax());
}
/**
*
* @return
*/
public String printTotal() {
return Formats.CURRENCY.formatValue(getTotal());
}
}
@@ -0,0 +1,56 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2017 uniCenta
// https://unicenta.com
//
// This file is part of uniCenta oPOS
//
// uniCenta oPOS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// uniCenta oPOS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with uniCenta oPOS. If not, see <http://www.gnu.org/licenses/>.
package com.unicenta.pos.ticket;
import java.io.Serializable;
/**
*
* @author adrianromero
*/
public class UserInfo implements Serializable {
private static final long serialVersionUID = 7537578737839L;
private String m_sId;
private String m_sName;
/** Creates a new instance of UserInfoBasic
* @param id
* @param name */
public UserInfo(String id, String name) {
m_sId = id;
m_sName = name;
}
/**
*
* @return
*/
public String getId() {
return m_sId;
}
/**
*
* @return
*/
public String getName() {
return m_sName;
}
}