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,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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="jLabel8" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jAttr" min="-2" pref="220" max="-2" attributes="0"/>
<EmptySpace min="-2" 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="0" max="-2" attributes="0">
<Component id="jAttr" max="32767" attributes="0"/>
<Component id="jLabel8" max="32767" attributes="0"/>
</Group>
<EmptySpace pref="17" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel8">
<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.attribute" 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="jAttr">
<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="[220, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jAttrActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,177 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.loader.*;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.reports.ReportEditorCreator;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.util.List;
/**
*
* @author adrianromero
*/
public class AttributeFilter extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList attsent;
private ComboBoxValModel attmodel;
/** Creates new form AttributeUseFilter */
public AttributeFilter() {
initComponents();
}
/**
*
* @param app
*/
@Override
public void init(AppView app) {
attsent = new StaticSentence(app.getSession()
, "SELECT ID, NAME FROM attribute ORDER BY NAME"
, null
, new SerializerRead() {@Override
public Object readValues(DataRead dr) throws BasicException {
return new AttributeInfo(dr.getString(1), dr.getString(2));
}});
attmodel = new ComboBoxValModel();
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
List a = attsent.list();
attmodel = new ComboBoxValModel(a);
attmodel.setSelectedFirst();
jAttr.setModel(attmodel);
}
/**
*
* @return
*/
@Override
public SerializerWrite getSerializerWrite() {
return SerializerWriteString.INSTANCE;
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
* @param l
*/
public void addActionListener(ActionListener l) {
jAttr.addActionListener(l);
}
/**
*
* @param l
*/
public void removeActionListener(ActionListener l) {
jAttr.removeActionListener(l);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
AttributeInfo att = (AttributeInfo) attmodel.getSelectedItem();
return att == null ? null : att.getId();
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel8 = new javax.swing.JLabel();
jAttr = new javax.swing.JComboBox();
jLabel8.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel8.setText(AppLocal.getIntString("label.attribute")); // NOI18N
jLabel8.setPreferredSize(new java.awt.Dimension(110, 30));
jAttr.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jAttr.setPreferredSize(new java.awt.Dimension(220, 30));
jAttr.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jAttrActionPerformed(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(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jAttr, javax.swing.GroupLayout.PREFERRED_SIZE, 220, 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.LEADING, false)
.addComponent(jAttr, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(17, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void jAttrActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAttrActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jAttrActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JComboBox jAttr;
private javax.swing.JLabel jLabel8;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,62 @@
// 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.inventory;
import com.unicenta.data.loader.IKeyed;
/**
*
* @author adrianromero
*/
public class AttributeInfo implements IKeyed {
private String id;
private String name;
/** Creates new CategoryInfo
* @param id
* @param name */
public AttributeInfo(String id, String name) {
this.id = id;
this.name = name;
}
/**
*
* @return
*/
@Override
public Object getKey() {
return id;
}
/**
*
* @return
*/
public String getId() {
return id;
}
@Override
public String toString() {
return name;
}
}
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[354, 61]"/>
</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="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jAttrSet" min="-2" max="-2" attributes="0"/>
<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="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jAttrSet" alignment="3" max="32767" attributes="0"/>
</Group>
<EmptySpace pref="20" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel8">
<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.attributeset" 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="jAttrSet">
<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="[220, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,170 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.loader.*;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.reports.ReportEditorCreator;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.util.List;
/**
*
* @author adrianromero
*/
public class AttributeSetFilter extends javax.swing.JPanel implements ReportEditorCreator {
private SentenceList attusesent;
private ComboBoxValModel attusemodel;
/** Creates new form AttributeUseFilter */
public AttributeSetFilter() {
initComponents();
}
/**
*
* @param app
*/
@Override
public void init(AppView app) {
attusesent = new StaticSentence(app.getSession()
, "SELECT ID, NAME FROM attributeset ORDER BY NAME"
, null
, new SerializerRead() {@Override
public Object readValues(DataRead dr) throws BasicException {
return new AttributeSetInfo(dr.getString(1), dr.getString(2));
}});
attusemodel = new ComboBoxValModel();
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
List a = attusesent.list();
attusemodel = new ComboBoxValModel(a);
attusemodel.setSelectedFirst();
jAttrSet.setModel(attusemodel);
}
/**
*
* @return
*/
@Override
public SerializerWrite getSerializerWrite() {
return SerializerWriteString.INSTANCE;
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
* @param l
*/
public void addActionListener(ActionListener l) {
jAttrSet.addActionListener(l);
}
/**
*
* @param l
*/
public void removeActionListener(ActionListener l) {
jAttrSet.removeActionListener(l);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
AttributeSetInfo attset = (AttributeSetInfo) attusemodel.getSelectedItem();
return attset == null ? null : attset.getId();
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel8 = new javax.swing.JLabel();
jAttrSet = new javax.swing.JComboBox();
setPreferredSize(new java.awt.Dimension(354, 61));
jLabel8.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel8.setText(AppLocal.getIntString("label.attributeset")); // NOI18N
jLabel8.setPreferredSize(new java.awt.Dimension(110, 30));
jAttrSet.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jAttrSet.setPreferredSize(new java.awt.Dimension(220, 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(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jAttrSet, 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(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jAttrSet, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(20, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JComboBox jAttrSet;
private javax.swing.JLabel jLabel8;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,72 @@
// 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.inventory;
import com.unicenta.data.loader.IKeyed;
/**
*
* @author adrianromero
*/
public class AttributeSetInfo implements IKeyed {
private String id;
private String name;
/**
*
* @param id
* @param name
*/
public AttributeSetInfo(String id, String name) {
this.id = id;
this.name = name;
}
/**
*
* @return
*/
@Override
public Object getKey() {
return id;
}
/**
*
* @return
*/
public String getId() {
return id;
}
/**
*
* @return
*/
public String getName() {
return name;
}
@Override
public String toString() {
return name;
}
}
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
<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="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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.namem" 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_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="[220, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,179 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import java.awt.Component;
import java.util.UUID;
import javax.swing.JOptionPane;
/**
*
* @author adrianromero
*/
public final class AttributeSetsEditor extends javax.swing.JPanel implements EditorRecord {
private Object id;
/** Creates new form AttributesEditor
* @param dirty */
public AttributeSetsEditor(DirtyManager dirty) {
initComponents();
m_jName.getDocument().addDocumentListener(dirty);
writeValueEOF();
}
/**
*
*/
@Override
public void writeValueEOF() {
id = null;
m_jName.setText(null);
m_jName.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
id = UUID.randomUUID().toString();
m_jName.setText(null);
m_jName.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] attrset = (Object[]) value;
id = attrset[0];
m_jName.setText(Formats.STRING.formatValue(attrset[1]));
m_jName.setEnabled(false);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] attrset = (Object[]) value;
id = attrset[0];
m_jName.setText(Formats.STRING.formatValue(attrset[1]));
m_jName.setEnabled(true);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] attrset = new Object[2];
attrset[0] = id;
attrset[1] = m_jName.getText();
if (m_jName.getText().contains("&")) {
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.ampersand"));
}
return attrset;
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
*/
@Override
public void refresh() {
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
m_jName = new javax.swing.JTextField();
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.namem")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(110, 30));
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(220, 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(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jName, 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(jLabel2, 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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField m_jName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,80 @@
// 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.inventory;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.model.*;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.panels.JPanelTable2;
/**
*
* @author adrianromero
*/
public class AttributeSetsPanel extends JPanelTable2 {
private EditorRecord editor;
/** Creates a new instance of JPanelCategories */
public AttributeSetsPanel() {
}
/**
*
*/
@Override
protected void init() {
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field(AppLocal.getIntString("label.name"), Datas.STRING, Formats.STRING, true, true, true)
);
Table table = new Table(
"attributeset",
new PrimaryKey("ID"),
new Column("NAME"));
lpr = row.getListProvider(app.getSession(), table);
spr = row.getSaveProvider(app.getSession(), table);
editor = new AttributeSetsEditor(dirty);
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return editor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.AttributeSets");
}
}
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</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" alignment="0" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLineno" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jAttribute" min="-2" pref="170" max="-2" attributes="0"/>
</Group>
</Group>
<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="jLabel3" alignment="3" min="-2" pref="25" max="-2" attributes="0"/>
<Component id="jLineno" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jAttribute" alignment="3" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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.order" 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="jLineno">
<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="[110, 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.attribute" 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="jAttribute">
<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>
</SubComponents>
</Form>
@@ -0,0 +1,261 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.loader.SerializerRead;
import com.unicenta.data.loader.StaticSentence;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import java.awt.Component;
import java.util.UUID;
/**
*
* @author adrianromero
*/
public class AttributeUseEditor extends javax.swing.JPanel implements EditorRecord {
private SentenceList attributesent;
private ComboBoxValModel attributemodel;
private Object id;
private Object attuseid;
private Object insertid;
/** Creates new form AttributeSetEditor
* @param app
* @param dirty */
public AttributeUseEditor(AppView app, DirtyManager dirty) {
attributesent = new StaticSentence(app.getSession()
, "SELECT ID, NAME FROM attribute ORDER BY NAME"
, null
, new SerializerRead() {@Override
public Object readValues(DataRead dr) throws BasicException {
return new AttributeInfo(dr.getString(1), dr.getString(2));
}}
);
attributemodel = new ComboBoxValModel();
initComponents();
jLineno.getDocument().addDocumentListener(dirty);
jAttribute.addActionListener(dirty);
}
/**
*
* @param insertid
*/
public void setInsertId(String insertid) {
this.insertid = insertid;
}
/**
*
* @throws BasicException
*/
public void activate() throws BasicException {
attributemodel = new ComboBoxValModel(attributesent.list());
jAttribute.setModel(attributemodel);
}
/**
*
*/
@Override
public void refresh() {
}
/**
*
*/
@Override
public void writeValueEOF() {
id = null;
attuseid = null;
attributemodel.setSelectedKey(null);
jLineno.setText(null);
jAttribute.setEnabled(false);
jLineno.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
id = UUID.randomUUID().toString();
attuseid = insertid;
attributemodel.setSelectedKey(null);
jLineno.setText(null);
jAttribute.setEnabled(true);
jLineno.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] obj = (Object[]) value;
id = obj[0];
attuseid = obj[1];
attributemodel.setSelectedKey(obj[2]);
jLineno.setText(Formats.INT.formatValue(obj[3]));
jAttribute.setEnabled(true);
jLineno.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] obj = (Object[]) value;
id = obj[0];
attuseid = obj[1];
attributemodel.setSelectedKey(obj[2]);
jLineno.setText(Formats.INT.formatValue(obj[3]));
jAttribute.setEnabled(false);
jLineno.setEnabled(false);
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] value = new Object[5];
value[0] = id;
value[1] = attuseid;
value[2] = attributemodel.getSelectedKey();
value[3] = Formats.INT.parseValue(jLineno.getText());
value[4] = attributemodel.getSelectedText();
return value;
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel3 = new javax.swing.JLabel();
jLineno = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jAttribute = new javax.swing.JComboBox();
setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.order")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(110, 30));
jLineno.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLineno.setPreferredSize(new java.awt.Dimension(110, 30));
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.attribute")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(110, 30));
jAttribute.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jAttribute.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, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLineno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.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.UNRELATED)
.addComponent(jAttribute, javax.swing.GroupLayout.PREFERRED_SIZE, 170, 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(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLineno, 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(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jAttribute, javax.swing.GroupLayout.DEFAULT_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.JComboBox jAttribute;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField jLineno;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,134 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.model.*;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.panels.JPanelTable2;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
*
* @author adrianromero
*/
public class AttributeUsePanel extends JPanelTable2 {
private AttributeUseEditor editor;
private AttributeSetFilter filter;
/**
*
*/
@Override
protected void init() {
filter = new AttributeSetFilter();
filter.init(app);
filter.addActionListener(new ReloadActionListener());
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field("ATRIBUTESET_ID", Datas.STRING, Formats.STRING),
new Field("ATTRIBUTE_ID", Datas.STRING, Formats.STRING),
new Field(AppLocal.getIntString("label.order"), Datas.INT, Formats.INT, false, true, true),
new Field(AppLocal.getIntString("label.name"), Datas.STRING, Formats.STRING, true, true, true)
);
Table table = new Table(
"attributeuse",
new PrimaryKey("ID"),
new Column("attributeset_ID"),
new Column("ATTRIBUTE_ID"),
new Column("LINENO"));
lpr = row.getListProvider(app.getSession(),
"SELECT ATTUSE.ID, ATTUSE.attributeset_ID, ATTUSE.ATTRIBUTE_ID, ATTUSE.LINENO, ATT.NAME " +
"FROM attributeuse ATTUSE, attribute ATT " +
"WHERE ATTUSE.ATTRIBUTE_ID = ATT.ID AND ATTUSE.attributeset_ID = ? ORDER BY LINENO", filter);
spr = row.getSaveProvider(app.getSession(), table);
editor = new AttributeUseEditor(app, dirty);
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
filter.activate();
editor.activate();
//super.activate();
startNavigation();
reload();
}
/**
*
* @return
*/
@Override
public Component getFilter(){
return filter.getComponent();
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return editor;
}
private void reload() throws BasicException {
String attsetid = (String) filter.createValue();
editor.setInsertId(attsetid); // must be set before load
bd.setEditable(attsetid != null);
bd.actionLoad();
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.AttributeUse");
}
private class ReloadActionListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
try {
reload();
} catch (BasicException w) {
}
}
}
}
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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" pref="80" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jValue" min="-2" pref="200" max="-2" attributes="0"/>
<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="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jValue" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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.value" 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="jValue">
<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="[220, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,196 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import java.awt.Component;
import java.util.UUID;
/**
*
* @author adrian
*/
public class AttributeValuesEditor extends javax.swing.JPanel implements EditorRecord {
private Object id;
private Object attid;
private Object insertid;
/** Creates new form AttributesValuesEditor
* @param dirty */
public AttributeValuesEditor(DirtyManager dirty) {
initComponents();
jValue.getDocument().addDocumentListener(dirty);
}
/**
*
* @param insertid
*/
public void setInsertId(String insertid) {
this.insertid = insertid;
}
/**
*
*/
@Override
public void refresh() {
}
/**
*
*/
@Override
public void writeValueEOF() {
id = null;
attid = null;
jValue.setText(null);
jValue.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
id = UUID.randomUUID().toString();
attid = insertid;
jValue.setText(null);
jValue.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] obj = (Object[]) value;
id = obj[0];
attid = obj[1];
jValue.setText(Formats.STRING.formatValue(obj[2]));
jValue.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] obj = (Object[]) value;
id = obj[0];
attid = obj[1];
jValue.setText(Formats.STRING.formatValue(obj[2]));
jValue.setEnabled(false);
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
return new Object[] {
id,
attid,
Formats.STRING.formatValue(jValue.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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
jValue = new javax.swing.JTextField();
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.value")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(110, 30));
jValue.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jValue.setPreferredSize(new java.awt.Dimension(220, 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(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jValue, javax.swing.GroupLayout.PREFERRED_SIZE, 200, 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(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jValue, 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 jLabel2;
private javax.swing.JTextField jValue;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,128 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.model.*;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.panels.JPanelTable2;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
*
* @author adrianromero
*/
public class AttributeValuesPanel extends JPanelTable2 {
private AttributeValuesEditor editor;
private AttributeFilter filter;
/**
*
*/
@Override
protected void init() {
filter = new AttributeFilter();
filter.init(app);
filter.addActionListener(new ReloadActionListener());
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field("ATTRIBUTE_ID", Datas.STRING, Formats.STRING),
new Field(AppLocal.getIntString("label.value"), Datas.STRING, Formats.STRING, true, true, true)
);
Table table = new Table(
"attributevalue",
new PrimaryKey("ID"),
new Column("ATTRIBUTE_ID"),
new Column("VALUE"));
lpr = row.getListProvider(app.getSession(),
"SELECT ID, ATTRIBUTE_ID, VALUE FROM attributevalue WHERE ATTRIBUTE_ID = ? ORDER BY VALUE ", filter);
spr = row.getSaveProvider(app.getSession(), table);
editor = new AttributeValuesEditor(dirty);
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
filter.activate();
//super.activate();
startNavigation();
reload();
}
/**
*
* @return
*/
@Override
public Component getFilter(){
return filter.getComponent();
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return editor;
}
private void reload() throws BasicException {
String attid = (String) filter.createValue();
editor.setInsertId(attid); // must be set before load
bd.setEditable(attid != null);
bd.actionLoad();
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.AttributeValues");
}
private class ReloadActionListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
try {
reload();
} catch (BasicException w) {
}
}
}
}
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
<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="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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.name" 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_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="[220, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,179 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import java.awt.Component;
import java.util.UUID;
import javax.swing.JOptionPane;
/**
*
* @author adrian
*/
public final class AttributesEditor extends javax.swing.JPanel implements EditorRecord {
private Object id;
/** Creates new form AttributesEditor
* @param dirty */
public AttributesEditor(DirtyManager dirty) {
initComponents();
m_jName.getDocument().addDocumentListener(dirty);
writeValueEOF();
}
/**
*
*/
@Override
public void writeValueEOF() {
id = null;
m_jName.setText(null);
m_jName.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
id = UUID.randomUUID().toString();
m_jName.setText(null);
m_jName.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] attr = (Object[]) value;
id = attr[0];
m_jName.setText(Formats.STRING.formatValue(attr[1]));
m_jName.setEnabled(false);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] attr = (Object[]) value;
id = attr[0];
m_jName.setText(Formats.STRING.formatValue(attr[1]));
m_jName.setEnabled(true);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] attr = new Object[2];
attr[0] = id;
attr[1] = m_jName.getText();
if (m_jName.getText().contains("&")) {
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.ampersand"));
}
return attr;
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
*/
@Override
public void refresh() {
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
m_jName = new javax.swing.JTextField();
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.name")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(110, 30));
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(220, 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(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jName, 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(jLabel2, 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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField m_jName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,80 @@
// 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.inventory;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.model.*;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.panels.JPanelTable2;
/**
*
* @author adrian
*/
public class AttributesPanel extends JPanelTable2 {
private EditorRecord editor;
/** Creates a new instance of JPanelCategories */
public AttributesPanel() {
}
/**
*
*/
@Override
protected void init() {
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field(AppLocal.getIntString("label.name"), Datas.STRING, Formats.STRING, true, true, true)
);
Table table = new Table(
"attribute",
new PrimaryKey("ID"),
new Column("NAME"));
lpr = row.getListProvider(app.getSession(), table);
spr = row.getSaveProvider(app.getSession(), table);
editor = new AttributesEditor(dirty);
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return editor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.Attributes");
}
}
@@ -0,0 +1,206 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[700, 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">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="m_jProduct" min="-2" pref="264" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jSearch" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="m_jBarcode" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jEnter2" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="m_jReference" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jEnter1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<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="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jReference" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jEnter1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jEnter2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jBarcode" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jSearch" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="m_jProduct" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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.prodref" 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_jReference">
<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_jReferenceActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jEnter1">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/ok.png"/>
</Property>
<Property name="text" type="java.lang.String" value=" "/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEnter1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jEnter2">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/barcode.png"/>
</Property>
<Property name="text" type="java.lang.String" value=" "/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEnter2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jSearch">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/search24.png"/>
</Property>
<Property name="text" type="java.lang.String" value=" "/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jSearchActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="m_jProduct">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<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_jProductActionPerformed"/>
</Events>
</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="[150, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jBarcodeActionPerformed"/>
</Events>
</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.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.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>
</SubComponents>
</Form>
@@ -0,0 +1,427 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.MessageInf;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
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.panels.JProductFinder;
import com.unicenta.pos.ticket.ProductInfoExt;
import java.awt.Component;
import java.awt.Toolkit;
import java.util.UUID;
/**
*
* @author jaroslawwozniak
*/
public class AuxiliarEditor extends javax.swing.JPanel implements EditorRecord {
private DataLogicSales m_dlSales;
private Object id;
private Object product;
private Object product2;
private Object name;
private Object insertproduct;
/** Creates new form AuxiliarEditor
* @param app
* @param dirty */
public AuxiliarEditor(AppView app, DirtyManager dirty) {
m_dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
initComponents();
m_jProduct.getDocument().addDocumentListener(dirty);
}
/**
*
* @param prod
*/
public void setInsertProduct(ProductInfoExt prod) {
if (prod == null) {
insertproduct = null;
} else {
insertproduct = prod.getID();
}
}
/**
*
*/
@Override
public void refresh() {
}
/**
*
*/
@Override
public void writeValueEOF() {
id = null;
product = null;
product2 = null;
name = null;
m_jReference.setText(null);
m_jBarcode.setText(null);
m_jProduct.setText(null);
m_jReference.setEnabled(false);
m_jBarcode.setEnabled(false);
m_jProduct.setEnabled(false);
m_jEnter1.setEnabled(false);
m_jEnter2.setEnabled(false);
m_jSearch.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
id = UUID.randomUUID().toString();
product = insertproduct;
product2 = null;
name = null;
m_jReference.setText(null);
m_jBarcode.setText(null);
m_jProduct.setText(null);
m_jReference.setEnabled(true);
m_jBarcode.setEnabled(true);
m_jProduct.setEnabled(true);
m_jEnter1.setEnabled(true);
m_jEnter2.setEnabled(true);
m_jSearch.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] obj = (Object[]) value;
id = obj[0];
product = obj[1];
product2 = obj[2];
name = obj[5];
m_jReference.setText(Formats.STRING.formatValue(obj[3]));
m_jBarcode.setText(Formats.STRING.formatValue(obj[4]));
m_jProduct.setText(Formats.STRING.formatValue(obj[3]) + " - " + Formats.STRING.formatValue(obj[5]));
m_jReference.setEnabled(true);
m_jBarcode.setEnabled(true);
m_jProduct.setEnabled(true);
m_jEnter1.setEnabled(true);
m_jEnter2.setEnabled(true);
m_jSearch.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] obj = (Object[]) value;
id = obj[0];
product = obj[1];
product2 = obj[2];
name = obj[5];
m_jReference.setText(Formats.STRING.formatValue(obj[3]));
m_jBarcode.setText(Formats.STRING.formatValue(obj[4]));
m_jProduct.setText(Formats.STRING.formatValue(obj[3]) + " - " + Formats.STRING.formatValue(obj[5]));
m_jReference.setEnabled(false);
m_jBarcode.setEnabled(false);
m_jProduct.setEnabled(false);
m_jEnter1.setEnabled(false);
m_jEnter2.setEnabled(false);
m_jSearch.setEnabled(false);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
return new Object[] {
id,
product,
product2,
m_jReference.getText(),
m_jBarcode.getText(),
name,
};
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
private void assignProduct(ProductInfoExt prod) {
if (m_jSearch.isEnabled()) {
if (prod == null) {
product2 = null;
m_jReference.setText(null);
m_jBarcode.setText(null);
m_jProduct.setText(null);
name = null;
} else {
product2 = prod.getID();
m_jReference.setText(prod.getReference());
m_jBarcode.setText(prod.getCode());
m_jProduct.setText(prod.getReference() + " - " + prod.getName());
name = prod.getName();
}
}
}
private void assignProductByCode() {
try {
ProductInfoExt prod = m_dlSales.getProductInfoByCode(m_jBarcode.getText());
assignProduct(prod);
if (prod == null) {
Toolkit.getDefaultToolkit().beep();
}
} catch (BasicException eData) {
assignProduct(null);
MessageInf msg = new MessageInf(eData);
msg.show(this);
}
}
private void assignProductByReference() {
try {
ProductInfoExt prod = m_dlSales.getProductInfoByReference(m_jReference.getText());
assignProduct(prod);
if (prod == null) {
Toolkit.getDefaultToolkit().beep();
}
} catch (BasicException eData) {
assignProduct(null);
MessageInf msg = new MessageInf(eData);
msg.show(this);
}
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel3 = new javax.swing.JLabel();
m_jReference = new javax.swing.JTextField();
m_jEnter1 = new javax.swing.JButton();
m_jEnter2 = new javax.swing.JButton();
m_jSearch = new javax.swing.JButton();
m_jProduct = new javax.swing.JTextField();
m_jBarcode = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
setPreferredSize(new java.awt.Dimension(700, 100));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.prodref")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(110, 30));
m_jReference.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jReference.setPreferredSize(new java.awt.Dimension(150, 30));
m_jReference.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jReferenceActionPerformed(evt);
}
});
m_jEnter1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/ok.png"))); // NOI18N
m_jEnter1.setText(" ");
m_jEnter1.setPreferredSize(new java.awt.Dimension(80, 45));
m_jEnter1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jEnter1ActionPerformed(evt);
}
});
m_jEnter2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/barcode.png"))); // NOI18N
m_jEnter2.setText(" ");
m_jEnter2.setPreferredSize(new java.awt.Dimension(80, 45));
m_jEnter2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jEnter2ActionPerformed(evt);
}
});
m_jSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/search24.png"))); // NOI18N
m_jSearch.setText(" ");
m_jSearch.setPreferredSize(new java.awt.Dimension(80, 45));
m_jSearch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jSearchActionPerformed(evt);
}
});
m_jProduct.setEditable(false);
m_jProduct.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jProduct.setPreferredSize(new java.awt.Dimension(150, 30));
m_jProduct.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jProductActionPerformed(evt);
}
});
m_jBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jBarcode.setPreferredSize(new java.awt.Dimension(150, 30));
m_jBarcode.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jBarcodeActionPerformed(evt);
}
});
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(110, 30));
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));
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)
.addComponent(jLabel4, 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(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(m_jProduct, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.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(m_jEnter2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(m_jReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jEnter1, 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(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jEnter1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jEnter2, 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(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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_jSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(m_jProduct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void m_jSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jSearchActionPerformed
assignProduct(JProductFinder.showMessage(this, m_dlSales, JProductFinder.PRODUCT_AUXILIAR));
}//GEN-LAST:event_m_jSearchActionPerformed
private void m_jReferenceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jReferenceActionPerformed
this.assignProductByReference();
}//GEN-LAST:event_m_jReferenceActionPerformed
private void m_jEnter2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEnter2ActionPerformed
this.assignProductByCode();
}//GEN-LAST:event_m_jEnter2ActionPerformed
private void m_jEnter1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEnter1ActionPerformed
this.assignProductByReference();
}//GEN-LAST:event_m_jEnter1ActionPerformed
private void m_jBarcodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jBarcodeActionPerformed
this.assignProductByCode();
}//GEN-LAST:event_m_jBarcodeActionPerformed
private void m_jProductActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jProductActionPerformed
}//GEN-LAST:event_m_jProductActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField m_jBarcode;
private javax.swing.JButton m_jEnter1;
private javax.swing.JButton m_jEnter2;
private javax.swing.JTextField m_jProduct;
private javax.swing.JTextField m_jReference;
private javax.swing.JButton m_jSearch;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,134 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.model.*;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.panels.AuxiliarFilter;
import com.unicenta.pos.panels.JPanelTable2;
import com.unicenta.pos.ticket.ProductInfoExt;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
*
* @author jaroslawwozniak
* @author adrianromero
*/
public class AuxiliarPanel extends JPanelTable2 {
private AuxiliarEditor editor;
private AuxiliarFilter filter;
/**
*
*/
@Override
protected void init() {
filter = new AuxiliarFilter();
filter.init(app);
filter.addActionListener(new ReloadActionListener());
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field("PRODUCT1", Datas.STRING, Formats.STRING),
new Field("PRODUCT2", Datas.STRING, Formats.STRING),
new Field(AppLocal.getIntString("label.prodref"), Datas.STRING, Formats.STRING, true, true, true),
new Field(AppLocal.getIntString("label.prodbarcode"), Datas.STRING, Formats.STRING, false, true, true),
new Field(AppLocal.getIntString("label.prodname"), Datas.STRING, Formats.STRING, true, true, true)
);
Table table = new Table(
"products_com",
new PrimaryKey("ID"),
new Column("PRODUCT"),
new Column("PRODUCT2"));
lpr = row.getListProvider(app.getSession(),
"SELECT COM.ID, COM.PRODUCT, COM.PRODUCT2, P.REFERENCE, P.CODE, P.NAME " +
"FROM products_com COM, products P " +
"WHERE COM.PRODUCT2 = P.ID AND COM.PRODUCT = ?", filter);
spr = row.getSaveProvider(app.getSession(), table);
editor = new AuxiliarEditor(app, dirty);
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
filter.activate();
//super.activate();
startNavigation();
reload(filter);
}
/**
*
* @return
*/
@Override
public Component getFilter(){
return filter.getComponent();
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return editor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.Auxiliar");
}
private void reload(AuxiliarFilter filter) throws BasicException {
ProductInfoExt prod = filter.getProductInfoExt();
editor.setInsertProduct(prod); // must be set before load
bd.setEditable(prod != null);
bd.actionLoad();
}
private class ReloadActionListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
try {
reload((AuxiliarFilter) e.getSource());
} catch (BasicException w) {
}
}
}
}
@@ -0,0 +1,207 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[700, 120]"/>
</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" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jBarcode" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jReference" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="m_jEnter1" max="32767" attributes="0"/>
<Component id="m_jEnter2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="m_jQuantity" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel1" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="m_jProduct" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="m_jSearch" min="-2" max="-2" attributes="0"/>
<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="2" attributes="0">
<Component id="jLabel3" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jReference" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jEnter1" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jProduct" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jSearch" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="m_jBarcode" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jEnter2" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="m_jQuantity" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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.prodref" 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.JTextField" name="m_jReference">
<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_jReferenceActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jEnter1">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/ok.png"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEnter1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jEnter2">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/barcode.png"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEnter2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jSearch">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/search24.png"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jSearchActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="m_jProduct">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jProductActionPerformed"/>
</Events>
</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="[150, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jBarcodeActionPerformed"/>
</Events>
</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.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" value="Quantity"/>
<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_jQuantity">
<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="[100, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,412 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2013 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.MessageInf;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
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.panels.JProductFinder;
import com.unicenta.pos.ticket.ProductInfoExt;
import java.awt.Component;
import java.awt.Toolkit;
import java.util.UUID;
/**
*
* @author jaroslawwozniak
*/
public class BundleEditor extends javax.swing.JPanel implements EditorRecord {
private DataLogicSales m_dlSales;
private Object id;
private Object product;
private Object productBundle;
private Object name;
private Object quantity;
private Object insertproduct;
/** Creates new form BundleEditor */
public BundleEditor(AppView app, DirtyManager dirty) {
m_dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
initComponents();
m_jProduct.getDocument().addDocumentListener(dirty);
m_jQuantity.getDocument().addDocumentListener(dirty);
}
public void setInsertProduct(ProductInfoExt prod) {
if (prod == null) {
insertproduct = null;
} else {
insertproduct = prod.getID();
}
}
@Override
public void refresh() {
}
@Override
public void writeValueEOF() {
id = null;
product = null;
productBundle = null;
quantity = null;
name = null;
m_jReference.setText(null);
m_jBarcode.setText(null);
m_jProduct.setText(null);
m_jQuantity.setText(null);
m_jReference.setEnabled(false);
m_jBarcode.setEnabled(false);
m_jProduct.setEnabled(false);
m_jQuantity.setEnabled(false);
m_jEnter1.setEnabled(false);
m_jEnter2.setEnabled(false);
m_jSearch.setEnabled(false);
}
@Override
public void writeValueInsert() {
id = UUID.randomUUID().toString();
product = insertproduct;
productBundle = null;
name = null;
quantity = null;
m_jReference.setText(null);
m_jBarcode.setText(null);
m_jProduct.setText(null);
m_jQuantity.setText(null);
m_jReference.setEnabled(true);
m_jBarcode.setEnabled(true);
m_jProduct.setEnabled(true);
m_jQuantity.setEnabled(true);
m_jEnter1.setEnabled(true);
m_jEnter2.setEnabled(true);
m_jSearch.setEnabled(true);
}
@Override
public void writeValueEdit(Object value) {
Object[] obj = (Object[]) value;
id = obj[0];
product = obj[1];
productBundle = obj[2];
quantity = obj[3];
name = obj[6];
m_jReference.setText(Formats.STRING.formatValue(obj[4]));
m_jBarcode.setText(Formats.STRING.formatValue(obj[5]));
m_jProduct.setText(Formats.STRING.formatValue(obj[4]) + " - " + Formats.STRING.formatValue(obj[6]));
m_jQuantity.setText(Formats.DOUBLE.formatValue(obj[3]));
m_jReference.setEnabled(true);
m_jBarcode.setEnabled(true);
m_jProduct.setEnabled(true);
m_jQuantity.setEnabled(true);
m_jEnter1.setEnabled(true);
m_jEnter2.setEnabled(true);
m_jSearch.setEnabled(true);
}
@Override
public void writeValueDelete(Object value) {
Object[] obj = (Object[]) value;
id = obj[0];
product = obj[1];
productBundle = obj[2];
quantity = obj[3];
name = obj[6];
m_jReference.setText(Formats.STRING.formatValue(obj[4]));
m_jBarcode.setText(Formats.STRING.formatValue(obj[5]));
m_jProduct.setText(Formats.STRING.formatValue(obj[4]) + " - " + Formats.STRING.formatValue(obj[6]));
m_jQuantity.setText(Formats.DOUBLE.formatValue(obj[3]));
m_jReference.setEnabled(false);
m_jBarcode.setEnabled(false);
m_jProduct.setEnabled(false);
m_jEnter1.setEnabled(false);
m_jEnter2.setEnabled(false);
m_jSearch.setEnabled(false);
}
@Override
public Object createValue() throws BasicException {
return new Object[] {
id,
product,
productBundle,
Formats.DOUBLE.parseValue(m_jQuantity.getText()),
m_jReference.getText(),
m_jBarcode.getText(),
name,
};
}
@Override
public Component getComponent() {
return this;
}
private void assignProduct(ProductInfoExt prod) {
if (m_jSearch.isEnabled()) {
if (prod == null) {
productBundle = null;
quantity = null;
m_jReference.setText(null);
m_jBarcode.setText(null);
m_jProduct.setText(null);
name = null;
} else {
productBundle = prod.getID();
quantity = null;
m_jReference.setText(prod.getReference());
m_jBarcode.setText(prod.getCode());
m_jProduct.setText(prod.getReference() + " - " + prod.getName());
name = prod.getName();
}
}
}
private void assignProductByCode() {
try {
ProductInfoExt prod = m_dlSales.getProductInfoByCode(m_jBarcode.getText());
assignProduct(prod);
if (prod == null) {
Toolkit.getDefaultToolkit().beep();
}
} catch (BasicException eData) {
assignProduct(null);
MessageInf msg = new MessageInf(eData);
msg.show(this);
}
}
private void assignProductByReference() {
try {
ProductInfoExt prod = m_dlSales.getProductInfoByReference(m_jReference.getText());
assignProduct(prod);
if (prod == null) {
Toolkit.getDefaultToolkit().beep();
}
} catch (BasicException eData) {
assignProduct(null);
MessageInf msg = new MessageInf(eData);
msg.show(this);
}
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel3 = new javax.swing.JLabel();
m_jReference = new javax.swing.JTextField();
m_jEnter1 = new javax.swing.JButton();
m_jEnter2 = new javax.swing.JButton();
m_jSearch = new javax.swing.JButton();
m_jProduct = new javax.swing.JTextField();
m_jBarcode = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
m_jQuantity = new javax.swing.JTextField();
setPreferredSize(new java.awt.Dimension(700, 120));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.prodref")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(100, 30));
m_jReference.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jReference.setPreferredSize(new java.awt.Dimension(150, 30));
m_jReference.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jReferenceActionPerformed(evt);
}
});
m_jEnter1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/ok.png"))); // NOI18N
m_jEnter1.setPreferredSize(new java.awt.Dimension(80, 45));
m_jEnter1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jEnter1ActionPerformed(evt);
}
});
m_jEnter2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/barcode.png"))); // NOI18N
m_jEnter2.setPreferredSize(new java.awt.Dimension(80, 45));
m_jEnter2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jEnter2ActionPerformed(evt);
}
});
m_jSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/search24.png"))); // NOI18N
m_jSearch.setPreferredSize(new java.awt.Dimension(80, 45));
m_jSearch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jSearchActionPerformed(evt);
}
});
m_jProduct.setEditable(false);
m_jProduct.setPreferredSize(new java.awt.Dimension(200, 30));
m_jProduct.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jProductActionPerformed(evt);
}
});
m_jBarcode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jBarcode.setPreferredSize(new java.awt.Dimension(150, 30));
m_jBarcode.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jBarcodeActionPerformed(evt);
}
});
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(100, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText("Quantity");
jLabel1.setPreferredSize(new java.awt.Dimension(110, 30));
m_jQuantity.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jQuantity.setPreferredSize(new java.awt.Dimension(100, 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(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jBarcode, 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.UNRELATED)
.addComponent(m_jReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(10, 10, 10)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(m_jEnter1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(m_jEnter2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(m_jQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addComponent(m_jProduct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jSearch, 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.CENTER)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jEnter1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jProduct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(m_jBarcode, 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_jEnter2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jQuantity, 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
private void m_jSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jSearchActionPerformed
assignProduct(JProductFinder.showMessage(this, m_dlSales, JProductFinder.PRODUCT_BUNDLE));
}//GEN-LAST:event_m_jSearchActionPerformed
private void m_jReferenceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jReferenceActionPerformed
this.assignProductByReference();
}//GEN-LAST:event_m_jReferenceActionPerformed
private void m_jEnter2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEnter2ActionPerformed
this.assignProductByCode();
}//GEN-LAST:event_m_jEnter2ActionPerformed
private void m_jEnter1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEnter1ActionPerformed
this.assignProductByReference();
}//GEN-LAST:event_m_jEnter1ActionPerformed
private void m_jBarcodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jBarcodeActionPerformed
this.assignProductByCode();
}//GEN-LAST:event_m_jBarcodeActionPerformed
private void m_jProductActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jProductActionPerformed
}//GEN-LAST:event_m_jProductActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField m_jBarcode;
private javax.swing.JButton m_jEnter1;
private javax.swing.JButton m_jEnter2;
private javax.swing.JTextField m_jProduct;
private javax.swing.JTextField m_jQuantity;
private javax.swing.JTextField m_jReference;
private javax.swing.JButton m_jSearch;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,118 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.Datas;
import com.unicenta.data.model.*;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.panels.BundleFilter;
import com.unicenta.pos.panels.JPanelTable2;
import com.unicenta.pos.ticket.ProductInfoExt;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
*
* @author Jack
*/
public class BundlePanel extends JPanelTable2 {
private BundleEditor editor;
private BundleFilter filter;
@Override
protected void init() {
filter = new BundleFilter();
filter.init(app);
filter.addActionListener(new ReloadActionListener());
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field("PRODUCT", Datas.STRING, Formats.STRING),
new Field("PRODUCT_BUNDLE", Datas.STRING, Formats.STRING),
new Field("QUANTITY", Datas.DOUBLE, Formats.DOUBLE),
new Field(AppLocal.getIntString("label.prodref"), Datas.STRING, Formats.STRING, true, true, true),
new Field(AppLocal.getIntString("label.prodbarcode"), Datas.STRING, Formats.STRING, false, true, true),
new Field(AppLocal.getIntString("label.prodname"), Datas.STRING, Formats.STRING, true, true, true)
);
Table table = new Table(
"products_bundle",
new PrimaryKey("ID"),
new Column("PRODUCT"),
new Column("PRODUCT_BUNDLE"),
new Column("QUANTITY"));
lpr = row.getListProvider(app.getSession(),
"SELECT "
+ "B.ID, B.PRODUCT, "
+ "B.PRODUCT_BUNDLE, B.QUANTITY, "
+ "P.REFERENCE, P.CODE, P.NAME " +
"FROM products_bundle B, products P " +
"WHERE B.PRODUCT_BUNDLE = P.ID AND B.PRODUCT = ?", filter);
spr = row.getSaveProvider(app.getSession(), table);
editor = new BundleEditor(app, dirty);
}
@Override
public void activate() throws BasicException {
filter.activate();
startNavigation();
reload(filter);
}
@Override
public Component getFilter(){
return filter.getComponent();
}
@Override
public EditorRecord getEditor() {
return editor;
}
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.Bundle");
}
private void reload(BundleFilter filter) throws BasicException {
ProductInfoExt prod = filter.getProductInfoExt();
editor.setInsertProduct(prod);
bd.setEditable(prod != null);
bd.actionLoad();
}
private class ReloadActionListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
try {
reload((BundleFilter) e.getSource());
} catch (BasicException w) {
}
}
}
}
@@ -0,0 +1,383 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
<Container class="javax.swing.JInternalFrame" name="jInternalFrame1">
<Properties>
<Property name="visible" type="boolean" value="true"/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
</NonVisualComponents>
<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="[750, 500]"/>
</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"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane2" min="-2" pref="657" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLblInCat" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="webSwtch_InCatalog" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLblName" min="-2" max="-2" attributes="0"/>
<Component id="jLblCategory" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLblTextTip" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
<Component id="m_jTextTip" min="-2" max="-2" attributes="0"/>
<Component id="m_jCategory" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLblCatShowName" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="m_jCatNameShow" min="-2" pref="30" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLblCatOrder" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCatOrder" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jBtnShowTrans" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLblProdCount" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jImage" min="-2" pref="270" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="26" 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="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLblName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<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="jLblCategory" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jTextTip" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLblTextTip" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLblInCat" min="-2" max="-2" attributes="0"/>
<Component id="webSwtch_InCatalog" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLblCatShowName" min="-2" max="-2" attributes="0"/>
<Component id="m_jCatNameShow" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLblCatOrder" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCatOrder" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jLblProdCount" max="32767" attributes="0"/>
<Component id="jBtnShowTrans" alignment="0" pref="32" max="32767" attributes="0"/>
</Group>
</Group>
<Component id="m_jImage" max="32767" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jScrollPane2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLblName">
<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/info.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.namem" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[125, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLblNameMouseClicked"/>
</Events>
</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="[250, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLblCategory">
<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="[125, 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="jLblTextTip">
<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.texttip" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[125, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jTextTip">
<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="jLblCatShowName">
<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.subcategorytitle" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</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.JCheckBox" name="m_jCatNameShow">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[30, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLblCatOrder">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="4"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.ccatorder" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</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_jCatOrder">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<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="jLblInCat">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.CatalogueStatusYes" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="horizontalTextPosition" type="int" value="2"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[125, 30]"/>
</Property>
</Properties>
</Component>
<Component class="com.alee.extended.button.WebSwitch" name="webSwtch_InCatalog">
<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="[80, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="webSwtch_InCatalogActionPerformed"/>
</Events>
</Component>
<Component class="com.unicenta.data.gui.JImageEditor" name="m_jImage">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[270, 200]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jBtnShowTrans">
<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="button.CatProds" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[140, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBtnShowTransActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLblProdCount">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="opaque" type="boolean" value="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[237, 30]"/>
</Property>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<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="[650, 300]"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="com.alee.laf.table.WebTable" name="jTableCategoryStock">
<Properties>
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="2" rowCount="20">
<Column editable="true" title="Name" type="java.lang.Object"/>
<Column editable="true" title="Barcode" type="java.lang.Object"/>
</Table>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0">
<Column maxWidth="-1" minWidth="-1" prefWidth="250" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
</TableColumnModel>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="gridColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="cc" red="66" type="rgb"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[310, 500]"/>
</Property>
<Property name="rowHeight" type="int" value="25"/>
<Property name="selectionBackground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="d7" green="78" red="0" type="rgb"/>
</Property>
<Property name="showVerticalLines" type="boolean" value="false"/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,675 @@
// 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.inventory;
import com.alee.extended.time.ClockType;
import com.alee.extended.time.WebClock;
import com.alee.managers.notification.NotificationIcon;
import com.alee.managers.notification.NotificationManager;
import com.alee.managers.notification.WebNotification;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.JMessageDialog;
import com.unicenta.data.gui.MessageInf;
import com.unicenta.data.loader.SentenceExec;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.catalog.CategoryStock;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import lombok.extern.slf4j.Slf4j;
import javax.swing.*;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.JTableHeader;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* @author adrianromero
*/
@Slf4j
public final class CategoriesEditor extends JPanel implements EditorRecord {
private Object m_oId;
private Object m_id;
public String cId;
private final SentenceList m_sentcat;
private ComboBoxValModel m_CategoryModel;
private final SentenceExec m_sentadd;
private final SentenceExec m_sentdel;
private List<CategoryStock> categoryStockList;
private CategoriesEditor.StockTableModel stockModel;
private final DataLogicSales dlSales;
/**
* Creates new form JPanelCategories
*
* @param app
* @param dirty
*/
public CategoriesEditor(AppView app, DirtyManager dirty) {
// DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
initComponents();
// El modelo de categorias
m_sentcat = dlSales.getCategoriesList();
m_CategoryModel = new ComboBoxValModel();
m_sentadd = dlSales.getCatalogCategoryAdd();
m_sentdel = dlSales.getCatalogCategoryDel();
m_jName.getDocument().addDocumentListener(dirty);
m_jCategory.addActionListener(dirty);
m_jImage.addPropertyChangeListener("image", dirty);
m_jCatNameShow.addActionListener(dirty);
m_jTextTip.getDocument().addDocumentListener(dirty);
m_jCatOrder.getDocument().addDocumentListener(dirty);
webSwtch_InCatalog.addActionListener(dirty);
writeValueEOF();
}
/**
*
*/
@Override
public void refresh() {
List a;
try {
a = m_sentcat.list();
} catch (BasicException eD) {
MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotloadlists"), eD);
msg.show(this);
a = new ArrayList();
}
a.add(0, null);
m_CategoryModel = new ComboBoxValModel(a);
m_jCategory.setModel(m_CategoryModel);
jLblProdCount.setText(null);
}
/**
*
*/
@Override
public void writeValueEOF() {
m_id = null;
m_jName.setText(null);
m_CategoryModel.setSelectedKey(null);
m_jImage.setImage(null);
m_jName.setEnabled(false);
m_jCategory.setEnabled(false);
m_jImage.setEnabled(false);
webSwtch_InCatalog.isSelected();
m_jTextTip.setText(null);
m_jTextTip.setEnabled(false);
m_jCatNameShow.setSelected(false);
m_jCatNameShow.setEnabled(false);
// Added JG Feb 2017
m_jCatOrder.setText(null);
m_jCatOrder.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
m_id = UUID.randomUUID().toString();
m_jName.setText(null);
m_CategoryModel.setSelectedKey(null);
m_jImage.setImage(null);
m_jName.setEnabled(true);
m_jCategory.setEnabled(true);
m_jImage.setEnabled(true);
webSwtch_InCatalog.setEnabled(false);
m_jTextTip.setText(null);
m_jTextTip.setEnabled(true);
m_jCatNameShow.setSelected(true);
m_jCatNameShow.setEnabled(true);
// Added JG Feb 2017
m_jCatOrder.setText(null);
m_jCatOrder.setEnabled(true);
}
/**
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] cat = (Object[]) value;
m_id = cat[0];
m_jName.setText(Formats.STRING.formatValue(cat[1]));
m_CategoryModel.setSelectedKey(cat[2]);
m_jImage.setImage((BufferedImage) cat[3]);
m_jTextTip.setText(Formats.STRING.formatValue(cat[4]));
m_jCatNameShow.setSelected(((Boolean) cat[5]).booleanValue());
m_jCatOrder.setText(Formats.STRING.formatValue(cat[6]));
m_jName.setEnabled(false);
m_jCategory.setEnabled(false);
m_jImage.setEnabled(false);
webSwtch_InCatalog.setEnabled(false);
m_jTextTip.setEnabled(false);
m_jCatNameShow.setEnabled(false);
m_jCatOrder.setEnabled(false);
stockModel = new CategoriesEditor.StockTableModel(getProductOfName((String) m_oId));
}
/**
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] cat = (Object[]) value;
m_id = cat[0];
m_jName.setText(Formats.STRING.formatValue(cat[1]));
m_CategoryModel.setSelectedKey(cat[2]);
m_jImage.setImage((BufferedImage) cat[3]);
m_jTextTip.setText(Formats.STRING.formatValue(cat[4]));
m_jCatNameShow.setSelected(((Boolean) cat[5]));
if (m_jCatOrder.getText().length() == 0) {
m_jCatOrder.setText(null);
}
m_jCatOrder.setText(Formats.STRING.formatValue(cat[6]));
m_jName.setEnabled(true);
m_jCategory.setEnabled(true);
m_jImage.setEnabled(true);
webSwtch_InCatalog.setEnabled(true);
m_jTextTip.setEnabled(true);
m_jCatNameShow.setEnabled(true);
// Added JG Feb 2017
m_jCatOrder.setEnabled(true);
resetTranxTable();
}
/**
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] cat = new Object[8];
cat[0] = m_id;
cat[1] = m_jName.getText();
cat[2] = m_CategoryModel.getSelectedKey();
cat[3] = m_jImage.getImage();
cat[4] = m_jTextTip.getText();
cat[5] = m_jCatNameShow.isSelected();
if (m_jCatOrder.getText().length() == 0) {
m_jCatOrder.setText(null);
}
cat[6] = m_jCatOrder.getText();
if (m_jName.getText().contains("&")) {
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.ampersand"));
}
return cat;
}
/**
* @return
*/
@Override
public Component getComponent() {
return this;
}
public void resetTranxTable() {
jTableCategoryStock.getColumnModel().getColumn(0).setPreferredWidth(250);
// set font for headers
Font f = new Font("Arial", Font.BOLD, 14);
JTableHeader header = jTableCategoryStock.getTableHeader();
header.setFont(f);
jTableCategoryStock.getTableHeader().setReorderingAllowed(true);
jTableCategoryStock.setAutoCreateRowSorter(true);
jTableCategoryStock.repaint();
}
private List<CategoryStock> getProductOfName(String pId) {
try {
categoryStockList = dlSales.getCategorysProductList(pId);
} catch (BasicException ex) {
log.error(ex.getMessage());
}
List<CategoryStock> categoryList = new ArrayList<>();
for (CategoryStock categoryStock : categoryStockList) {
String categoryId = categoryStock.getCategoryId();
if (categoryId.equals(pId)) {
categoryList.add(categoryStock);
}
}
repaint();
refresh();
return categoryList;
}
class StockTableModel extends AbstractTableModel {
String nam = AppLocal.getIntString("label.prodname");
String cod = AppLocal.getIntString("label.prodbarcode");
List<CategoryStock> stockList;
String[] columnNames = {nam, cod};
public StockTableModel(List<CategoryStock> list) {
stockList = list;
}
@Override
public int getColumnCount() {
return 2;
}
@Override
public int getRowCount() {
return stockList.size();
}
@Override
public Object getValueAt(int row, int column) {
CategoryStock categoryStock = stockList.get(row);
switch (column) {
case 0:
return categoryStock.getProductName();
case 1:
return categoryStock.getProductCode();
case 2:
return categoryStock.getProductId();
default:
return "";
}
}
@Override
public String getColumnName(int col) {
return columnNames[col];
}
}
public void Notify(String msg) {
final WebNotification notification = new WebNotification();
notification.setIcon(NotificationIcon.information);
notification.setDisplayTime(4000);
final WebClock clock = new WebClock();
clock.setClockType(ClockType.timer);
clock.setTimeLeft(5000);
clock.setTimePattern(msg);
notification.setContent(clock);
NotificationManager.showNotification(notification);
clock.start();
}
/**
* 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() {
jInternalFrame1 = new javax.swing.JInternalFrame();
jLblName = new javax.swing.JLabel();
m_jName = new javax.swing.JTextField();
jLblCategory = new javax.swing.JLabel();
m_jCategory = new javax.swing.JComboBox();
jLblTextTip = new javax.swing.JLabel();
m_jTextTip = new javax.swing.JTextField();
jLblCatShowName = new javax.swing.JLabel();
m_jCatNameShow = new javax.swing.JCheckBox();
jLblCatOrder = new javax.swing.JLabel();
m_jCatOrder = new javax.swing.JTextField();
jLblInCat = new javax.swing.JLabel();
webSwtch_InCatalog = new com.alee.extended.button.WebSwitch();
m_jImage = new com.unicenta.data.gui.JImageEditor();
jBtnShowTrans = new javax.swing.JButton();
jLblProdCount = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
jTableCategoryStock = new com.alee.laf.table.WebTable();
jInternalFrame1.setVisible(true);
setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
setPreferredSize(new java.awt.Dimension(750, 500));
jLblName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblName.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/info.png"))); // NOI18N
jLblName.setText(AppLocal.getIntString("label.namem")); // NOI18N
jLblName.setPreferredSize(new java.awt.Dimension(125, 30));
jLblName.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLblNameMouseClicked(evt);
}
});
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(250, 30));
jLblCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblCategory.setText(AppLocal.getIntString("label.prodcategory")); // NOI18N
jLblCategory.setPreferredSize(new java.awt.Dimension(125, 30));
m_jCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCategory.setPreferredSize(new java.awt.Dimension(250, 30));
jLblTextTip.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("pos_messages"); // NOI18N
jLblTextTip.setText(bundle.getString("label.texttip")); // NOI18N
jLblTextTip.setPreferredSize(new java.awt.Dimension(125, 30));
m_jTextTip.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jTextTip.setPreferredSize(new java.awt.Dimension(250, 30));
jLblCatShowName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblCatShowName.setText(bundle.getString("label.subcategorytitle")); // NOI18N
jLblCatShowName.setPreferredSize(new java.awt.Dimension(150, 30));
m_jCatNameShow.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCatNameShow.setSelected(true);
m_jCatNameShow.setPreferredSize(new java.awt.Dimension(30, 30));
jLblCatOrder.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblCatOrder.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLblCatOrder.setText(bundle.getString("label.ccatorder")); // NOI18N
jLblCatOrder.setPreferredSize(new java.awt.Dimension(60, 30));
m_jCatOrder.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCatOrder.setHorizontalAlignment(javax.swing.JTextField.CENTER);
m_jCatOrder.setPreferredSize(new java.awt.Dimension(60, 30));
jLblInCat.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblInCat.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jLblInCat.setText(bundle.getString("label.CatalogueStatusYes")); // NOI18N
jLblInCat.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
jLblInCat.setPreferredSize(new java.awt.Dimension(125, 30));
webSwtch_InCatalog.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
webSwtch_InCatalog.setPreferredSize(new java.awt.Dimension(80, 30));
webSwtch_InCatalog.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
webSwtch_InCatalogActionPerformed(evt);
}
});
m_jImage.setPreferredSize(new java.awt.Dimension(270, 200));
jBtnShowTrans.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jBtnShowTrans.setText(bundle.getString("button.CatProds")); // NOI18N
jBtnShowTrans.setToolTipText("");
jBtnShowTrans.setPreferredSize(new java.awt.Dimension(140, 30));
jBtnShowTrans.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBtnShowTransActionPerformed(evt);
}
});
jLblProdCount.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblProdCount.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLblProdCount.setOpaque(true);
jLblProdCount.setPreferredSize(new java.awt.Dimension(237, 30));
jScrollPane2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jScrollPane2.setPreferredSize(new java.awt.Dimension(650, 300));
jTableCategoryStock.setAutoCreateRowSorter(true);
jTableCategoryStock.setModel(new javax.swing.table.DefaultTableModel(
new Object[][]{
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null},
{null, null}
},
new String[]{
"Name", "Barcode"
}
));
jTableCategoryStock.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jTableCategoryStock.setGridColor(new java.awt.Color(102, 204, 255));
jTableCategoryStock.setPreferredSize(new java.awt.Dimension(310, 500));
jTableCategoryStock.setRowHeight(25);
jTableCategoryStock.setSelectionBackground(new java.awt.Color(0, 120, 215));
jTableCategoryStock.setShowVerticalLines(false);
jScrollPane2.setViewportView(jTableCategoryStock);
if (jTableCategoryStock.getColumnModel().getColumnCount() > 0) {
jTableCategoryStock.getColumnModel().getColumn(0).setPreferredWidth(250);
}
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)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 657, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLblInCat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(webSwtch_InCatalog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLblName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLblCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLblTextTip, javax.swing.GroupLayout.Alignment.LEADING, 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)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jTextTip, 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()
.addComponent(jLblCatShowName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(m_jCatNameShow, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLblCatOrder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jCatOrder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jBtnShowTrans, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLblProdCount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addComponent(m_jImage, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(26, 26, 26))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLblName, 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(m_jCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLblCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jTextTip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLblTextTip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLblInCat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(webSwtch_InCatalog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLblCatShowName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCatNameShow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLblCatOrder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(m_jCatOrder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLblProdCount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jBtnShowTrans, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE)))
.addComponent(m_jImage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void webSwtch_InCatalogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webSwtch_InCatalogActionPerformed
if (webSwtch_InCatalog.isSelected()) {
try {
Object param = m_id;
m_sentdel.exec(param);
m_sentadd.exec(param);
jLblInCat.setText(AppLocal.getIntString("label.CatalogueStatusYes"));
Notify(AppLocal.getIntString("notify.added"));
} catch (BasicException e) {
JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotexecute"), e));
}
} else {
try {
m_sentdel.exec(m_id);
jLblInCat.setText(AppLocal.getIntString("label.CatalogueStatusNo"));
Notify(AppLocal.getIntString("notify.removed"));
} catch (BasicException e) {
JMessageDialog.showMessage(this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotexecute"), e));
}
}
}//GEN-LAST:event_webSwtch_InCatalogActionPerformed
private void jLblNameMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLblNameMouseClicked
if (evt.getClickCount() == 2) {
String uuidString = m_id.toString();
StringSelection stringSelection = new StringSelection(uuidString);
Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
clpbrd.setContents(stringSelection, null);
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.uuidcopy"));
}
}//GEN-LAST:event_jLblNameMouseClicked
private void jBtnShowTransActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnShowTransActionPerformed
String pId = m_id.toString();
if (pId != null) {
stockModel = new CategoriesEditor.StockTableModel(getProductOfName(pId));
jTableCategoryStock.setModel(stockModel);
if (stockModel.getRowCount() > 0) {
jTableCategoryStock.setVisible(true);
String ProdCount = String.valueOf(stockModel.getRowCount());
jLblProdCount.setText(ProdCount + " for " + m_jName.getText());
} else {
jTableCategoryStock.setVisible(false);
JOptionPane.showMessageDialog(null,
"No Products for this Category", "Products", JOptionPane.INFORMATION_MESSAGE);
}
resetTranxTable();
}
}//GEN-LAST:event_jBtnShowTransActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBtnShowTrans;
private javax.swing.JInternalFrame jInternalFrame1;
private javax.swing.JLabel jLblCatOrder;
private javax.swing.JLabel jLblCatShowName;
private javax.swing.JLabel jLblCategory;
private javax.swing.JLabel jLblInCat;
private javax.swing.JLabel jLblName;
private javax.swing.JLabel jLblProdCount;
private javax.swing.JLabel jLblTextTip;
private javax.swing.JScrollPane jScrollPane2;
private com.alee.laf.table.WebTable jTableCategoryStock;
private javax.swing.JCheckBox m_jCatNameShow;
private javax.swing.JTextField m_jCatOrder;
private javax.swing.JComboBox m_jCategory;
private com.unicenta.data.gui.JImageEditor m_jImage;
private javax.swing.JTextField m_jName;
private javax.swing.JTextField m_jTextTip;
private com.alee.extended.button.WebSwitch webSwtch_InCatalog;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,120 @@
// 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.inventory;
import com.unicenta.data.gui.ListCellRendererBasic;
import com.unicenta.data.loader.ComparatorCreator;
import com.unicenta.data.loader.TableDefinition;
import com.unicenta.data.loader.Vectorer;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProvider;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.panels.JPanelTable;
import javax.swing.ListCellRenderer;
/**
*
* @author adrianromero
*/
public class CategoriesPanel extends JPanelTable {
private TableDefinition tcategories;
private CategoriesEditor jeditor;
/** Creates a new instance of JPanelCategories */
public CategoriesPanel() {
}
/**
*
*/
@Override
protected void init() {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
tcategories = dlSales.getTableCategories();
jeditor = new CategoriesEditor(app, dirty);
}
/**
*
* @return
*/
@Override
public ListProvider getListProvider() {
return new ListProviderCreator(tcategories);
}
/**
*
* @return
*/
@Override
public SaveProvider getSaveProvider() {
return new SaveProvider(tcategories);
}
/**
*
* @return
*/
@Override
public Vectorer getVectorer() {
return tcategories.getVectorerBasic(new int[]{1});
}
/**
*
* @return
*/
@Override
public ComparatorCreator getComparatorCreator() {
return tcategories.getComparatorCreator(new int[]{1});
}
/**
*
* @return
*/
@Override
public ListCellRenderer getListCellRenderer() {
return new ListCellRendererBasic(tcategories.getRenderStringBasic(new int[]{1}));
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.Categories");
}
}
@@ -0,0 +1,75 @@
// 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.inventory;
import com.unicenta.data.loader.IKeyed;
/**
*
* @author adrianromero
*/
public class CodeType implements IKeyed {
/**
*
*/
public static final CodeType EAN13 = new CodeType("EAN13", "EAN13");
/**
*
*/
public static final CodeType CODE128 = new CodeType("CODE128", "CODE128");
/**
*
*/
protected String m_sKey;
/**
*
*/
protected String m_sValue;
private CodeType(String key, String value) {
m_sKey = key;
m_sValue = value;
}
/**
*
* @return
*/
@Override
public Object getKey() {
return m_sKey;
}
/**
*
* @return
*/
public String getValue() {
return m_sValue;
}
@Override
public String toString() {
return m_sValue;
}
}
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<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 min="-2" pref="25" max="-2" attributes="0"/>
<Component id="webLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="webButtonCancel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="webButtonOK" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="webTxtPriceBuy" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="27" 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 min="-2" pref="27" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="webLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="webTxtPriceBuy" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="webButtonOK" min="-2" pref="45" max="-2" attributes="0"/>
<Component id="webButtonCancel" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="19" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="com.alee.laf.label.WebLabel" name="webLabel1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.invline" replaceFormat="AppLocal.getIntString(&quot;button.exit&quot;)"/>
</Property>
<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="[130, 30]"/>
</Property>
</Properties>
</Component>
<Component class="com.alee.laf.text.WebTextField" name="webTxtPriceBuy">
<Properties>
<Property name="text" type="java.lang.String" value="webTextField1"/>
<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="com.alee.laf.button.WebButton" name="webButtonOK">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/ok.png"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="webButtonOKActionPerformed"/>
</Events>
</Component>
<Component class="com.alee.laf.button.WebButton" name="webButtonCancel">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/cancel.png"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="webButtonCancelActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,137 @@
// 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.inventory;
import com.unicenta.pos.forms.AppLocal;
import com.alee.laf.*;
/**
*
* @author jack
*/
public class InvEditLine extends javax.swing.JDialog {
private boolean ok;
/**
* Creates new form InvEditLine
* @param parent
* @param modal
*/
public InvEditLine(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
public boolean isOK() {
boolean ok = false;
return ok;
}
/**
* 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
webLabel1 = new com.alee.laf.label.WebLabel();
webTxtPriceBuy = new com.alee.laf.text.WebTextField();
webButtonOK = new com.alee.laf.button.WebButton();
webButtonCancel = new com.alee.laf.button.WebButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
webLabel1.setText(AppLocal.getIntString("button.exit")); // NOI18N
webLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
webLabel1.setPreferredSize(new java.awt.Dimension(130, 30));
webTxtPriceBuy.setText("webTextField1");
webTxtPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
webTxtPriceBuy.setPreferredSize(new java.awt.Dimension(200, 30));
webButtonOK.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/ok.png"))); // NOI18N
webButtonOK.setPreferredSize(new java.awt.Dimension(80, 45));
webButtonOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
webButtonOKActionPerformed(evt);
}
});
webButtonCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/cancel.png"))); // NOI18N
webButtonCancel.setPreferredSize(new java.awt.Dimension(80, 45));
webButtonCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
webButtonCancelActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(25, 25, 25)
.addComponent(webLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(webButtonCancel, 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(webButtonOK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(webTxtPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(27, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(webLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(webTxtPriceBuy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(webButtonOK, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(webButtonCancel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(19, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void webButtonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webButtonOKActionPerformed
ok = true;
String invlinevalue = (String)webTxtPriceBuy.getText();
dispose();
}//GEN-LAST:event_webButtonOKActionPerformed
private void webButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webButtonCancelActionPerformed
dispose();
}//GEN-LAST:event_webButtonCancelActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private com.alee.laf.button.WebButton webButtonCancel;
private com.alee.laf.button.WebButton webButtonOK;
private com.alee.laf.label.WebLabel webLabel1;
private com.alee.laf.text.WebTextField webTxtPriceBuy;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,212 @@
// 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.inventory;
import com.unicenta.format.Formats;
import com.unicenta.pos.ticket.ProductInfoExt;
import com.unicenta.pos.util.StringUtils;
/**
*
* @author adrianromero
*/
public class InventoryLine {
private double m_dMultiply;
private double m_dPrice;
private String m_sProdID;
private String m_sProdName;
private String attsetid;
private String attsetinstid;
private String attsetinstdesc;
/** Creates a new instance of InventoryLine
* @param oProduct */
public InventoryLine(ProductInfoExt oProduct) {
m_sProdID = oProduct.getID();
m_sProdName = oProduct.getName();
m_dMultiply = 1.0;
m_dPrice = oProduct.getPriceBuy();
attsetid = oProduct.getAttributeSetID();
attsetinstid = null;
attsetinstdesc = null;
}
/**
*
* @param oProduct
* @param dpor
* @param dprice
*/
public InventoryLine(ProductInfoExt oProduct, double dpor, double dprice) {
m_sProdID = oProduct.getID();
m_sProdName = oProduct.getName();
m_dMultiply = dpor;
m_dPrice = dprice;
attsetid = oProduct.getAttributeSetID();
attsetinstid = null;
attsetinstdesc = null;
}
/**
*
* @return
*/
public String getProductID() {
return m_sProdID;
}
/**
*
* @return
*/
public String getProductName() {
return m_sProdName;
}
/**
*
* @param sValue
*/
public void setProductName(String sValue) {
if (m_sProdID == null) {
m_sProdName = sValue;
}
}
/**
*
* @return
*/
public double getMultiply() {
return m_dMultiply;
}
/**
*
* @param dValue
*/
public void setMultiply(double dValue) {
m_dMultiply = dValue;
}
/**
*
* @return
*/
public double getPrice() {
return m_dPrice;
}
/**
*
* @param dValue
*/
public void setPrice(double dValue) {
m_dPrice = dValue;
}
/**
*
* @return
*/
public double getSubValue() {
return m_dMultiply * m_dPrice;
}
/**
*
* @return
*/
public String getProductAttSetInstId() {
return attsetinstid;
}
/**
*
* @param value
*/
public void setProductAttSetInstId(String value) {
attsetinstid = value;
}
/**
*
* @return
*/
public String getProductAttSetId() {
return attsetid;
}
/**
*
* @return
*/
public String getProductAttSetInstDesc() {
return attsetinstdesc;
}
/**
*
* @param value
*/
public void setProductAttSetInstDesc(String value) {
attsetinstdesc = value;
}
/**
*
* @return
*/
public String printName() {
return StringUtils.encodeXML(m_sProdName);
}
/**
*
* @return
*/
public String printPrice() {
if (m_dMultiply == 1.0) {
return "";
} else {
return Formats.CURRENCY.formatValue(new Double(getPrice()));
}
}
/**
*
* @return
*/
public String printMultiply() {
return Formats.DOUBLE.formatValue(new Double(m_dMultiply));
}
/**
*
* @return
*/
public String printSubValue() {
return Formats.CURRENCY.formatValue(new Double(getSubValue()));
}
}
@@ -0,0 +1,204 @@
// 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.inventory;
import com.unicenta.format.Formats;
import com.unicenta.pos.suppliers.SupplierInfo;
import com.unicenta.pos.util.StringUtils;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
/**
*
* @author adrianromero
*/
public class InventoryRecord {
private final Date m_dDate;
private final MovementReason m_reason;
private final LocationInfo m_locationOri;
private final List<InventoryLine> m_invlines;
private final String user;
private final SupplierInfo m_Supplier;
private final String m_SupplierDoc;
/** Creates a new instance of InventoryRecord
* @param d
* @param reason
* @param location
* @param invlines
* @param currentUser
* @param supplier
* @param supplierdoc
*/
public InventoryRecord(Date d, MovementReason reason,
LocationInfo location, String currentUser,
SupplierInfo supplier,
List<InventoryLine> invlines, String supplierdoc) {
m_dDate = d;
m_reason = reason;
m_locationOri = location;
m_invlines = invlines;
user = currentUser;
m_Supplier = supplier;
m_SupplierDoc = supplierdoc;
}
/**
*
* @return
*/
public Date getDate() {
return m_dDate;
}
/**
*
* @return
*/
public String printDate() {
return Formats.TIMESTAMP.formatValue(m_dDate);
}
/**
*
* @return
*/
public MovementReason getReason() {
return m_reason;
}
/**
*
* @return
*/
public String printReason() {
return StringUtils.encodeXML(m_reason.toString());
}
/**
*
* @return
*/
public String getUser() {
return user;
}
public String printUser() {
return StringUtils.encodeXML(user.toString());
}
/**
*
* @return
*/
public LocationInfo getLocation() {
return m_locationOri;
}
/**
*
* @return
*/
public String printLocation() {
return StringUtils.encodeXML(m_locationOri.toString());
}
/**
*
* @return
*/
public SupplierInfo getSupplier() {
return m_Supplier;
}
public String printSupplier() {
return StringUtils.encodeXML(m_Supplier.toString());
}
/**
*
* @return
*/
public String getSupplierDoc() {
return m_SupplierDoc;
}
public String printSupplierDoc() {
return StringUtils.encodeXML(m_SupplierDoc.toString());
}
/**
*
* @return
*/
public List<InventoryLine> getLines() {
return m_invlines;
}
/**
*
* @return
*/
public boolean isInput() {
return m_reason.isInput();
}
/**
*
* @return
*/
public double getSubTotal() {
double dSuma = 0.0;
InventoryLine oLine;
for (Iterator<InventoryLine> i = m_invlines.iterator(); i.hasNext();) {
oLine = i.next();
dSuma += oLine.getSubValue();
}
return dSuma;
}
/**
*
* @return
*/
public String printSubTotal() {
return Formats.CURRENCY.formatValue(getSubTotal());
}
/**
*
* @return
*/
public double getTotalArticles() {
double dSum = 0.0;
InventoryLine oLine;
for (Iterator<InventoryLine> i = m_invlines.iterator(); i.hasNext();) {
oLine = i.next();
dSum += oLine.getMultiply();
}
return dSum;
}
/**
*
* @return
*/
public String printTotalArticles() {
return Formats.DOUBLE.formatValue(getTotalArticles());
}
}
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="caption.upload" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="resizable" type="boolean" value="false"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-95,0,0,1,-38"/>
<SyntheticProperty name="formSizePolicy" type="int" value="0"/>
<SyntheticProperty name="generateSize" type="boolean" value="true"/>
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
</SyntheticProperties>
<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_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 class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="South"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
<Property name="alignment" type="int" value="2"/>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="jcmdCancel">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/cancel.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="button.cancel" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jcmdCancelActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jcmdOK">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/ok.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="button.OK" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jcmdOKActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</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="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="message.preparescanner" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[450, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="0" y="20" width="460" height="-1"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,212 @@
// 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.inventory;
import com.unicenta.data.gui.MessageInf;
import com.unicenta.data.user.BrowsableEditableData;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.scanpal2.DeviceScanner;
import com.unicenta.pos.scanpal2.DeviceScannerException;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.Window;
import javax.swing.JFrame;
import javax.swing.ListModel;
/**
*
* @author adrianromero
*/
public class JDlgUploadProducts extends javax.swing.JDialog {
// private AppView m_App;
private DeviceScanner m_scanner;
private BrowsableEditableData m_bd;
/** Creates new form JDlgUploadProducts */
private JDlgUploadProducts(java.awt.Frame parent, boolean modal) {
super(parent, modal);
}
/** Creates new form JDlgUploadProducts */
private JDlgUploadProducts(java.awt.Dialog parent, boolean modal) {
super(parent, modal);
}
private void init(DeviceScanner scanner, BrowsableEditableData bd) {
initComponents();
getRootPane().setDefaultButton(jcmdOK);
m_scanner = scanner;
m_bd = bd;
//show();
setVisible(true);
// return;
}
private static Window getWindow(Component parent) {
if (parent == null) {
return new JFrame();
} else if (parent instanceof Frame || parent instanceof Dialog) {
return (Window)parent;
} else {
return getWindow(parent.getParent());
}
}
/**
*
* @param parent
* @param scanner
* @param bd
*/
public static void showMessage(Component parent, DeviceScanner scanner, BrowsableEditableData bd) {
Window window = getWindow(parent);
JDlgUploadProducts myMsg;
if (window instanceof Frame) {
myMsg = new JDlgUploadProducts((Frame) window, true);
} else {
myMsg = new JDlgUploadProducts((Dialog) window, true);
}
myMsg.init(scanner, bd);
}
/** 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() {
jPanel2 = new javax.swing.JPanel();
jcmdCancel = new javax.swing.JButton();
jcmdOK = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle(AppLocal.getIntString("caption.upload")); // NOI18N
setResizable(false);
jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
jcmdCancel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jcmdCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/cancel.png"))); // NOI18N
jcmdCancel.setText(AppLocal.getIntString("button.cancel")); // NOI18N
jcmdCancel.setPreferredSize(new java.awt.Dimension(110, 45));
jcmdCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jcmdCancelActionPerformed(evt);
}
});
jPanel2.add(jcmdCancel);
jcmdOK.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jcmdOK.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/ok.png"))); // NOI18N
jcmdOK.setText(AppLocal.getIntString("button.OK")); // NOI18N
jcmdOK.setPreferredSize(new java.awt.Dimension(110, 45));
jcmdOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jcmdOKActionPerformed(evt);
}
});
jPanel2.add(jcmdOK);
getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
jPanel1.setLayout(null);
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText(AppLocal.getIntString("message.preparescanner")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(450, 30));
jPanel1.add(jLabel1);
jLabel1.setBounds(0, 20, 460, 30);
getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
setSize(new java.awt.Dimension(474, 161));
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void jcmdCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmdCancelActionPerformed
dispose();
}//GEN-LAST:event_jcmdCancelActionPerformed
private void jcmdOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmdOKActionPerformed
// Ponemos el estado de leyendo productos
String stext = jLabel1.getText();
jLabel1.setText(AppLocal.getIntString("label.uploadingproducts"));
jcmdOK.setEnabled(false);
jcmdCancel.setEnabled(false);
// Ejecutamos la descarga...
try {
m_scanner.connectDevice();
m_scanner.startUploadProduct();
ListModel l = m_bd.getListModel();
for (int i = 0; i < l.getSize(); i++) {
Object[] myprod = (Object[]) l.getElementAt(i);
m_scanner.sendProduct(
(String) myprod[3], // name
(String) myprod[2], // barcode
(Double) myprod[6] // buy price
);
}
m_scanner.stopUploadProduct();
MessageInf msg = new MessageInf(MessageInf.SGN_SUCCESS, AppLocal.getIntString("message.scannerok"));
msg.show(this);
} catch (DeviceScannerException e) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.scannerfail"), e);
msg.show(this);
} finally {
m_scanner.disconnectDevice();
}
// Deshacemos el estado de leyendo productos
jLabel1.setText(stext);
jcmdOK.setEnabled(true);
jcmdCancel.setEnabled(true);
dispose();
}//GEN-LAST:event_jcmdOKActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JButton jcmdCancel;
private javax.swing.JButton jcmdOK;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,61 @@
<?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>
</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_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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[455, 402]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="m_tableinventory">
<Properties>
<Property name="autoCreateColumnsFromModel" type="boolean" value="false"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="autoResizeMode" type="int" value="0"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="selectionBackground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="cc" green="99" red="0" type="rgb"/>
</Property>
<Property name="showVerticalLines" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="m_tableinventoryMousePressed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,362 @@
// 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.inventory;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import java.awt.Component;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
/**
*
* @author adrianromero
*/
public class JInventoryLines extends javax.swing.JPanel {
private InventoryTableModel m_inventorylines;
/** Creates new form JInventoryLines */
public JInventoryLines() {
initComponents();
DefaultTableColumnModel columns = new DefaultTableColumnModel();
TableColumn c;
c = new TableColumn(0, 150
, new DataCellRenderer(javax.swing.SwingConstants.LEFT)
, new DefaultCellEditor(new JTextField()));
c.setHeaderValue(AppLocal.getIntString("label.item"));
columns.addColumn(c);
c = new TableColumn(1, 75
, new DataCellRenderer(javax.swing.SwingConstants.RIGHT)
, new DefaultCellEditor(new JTextField()));
c.setHeaderValue(AppLocal.getIntString("label.units2"));
columns.addColumn(c);
c = new TableColumn(2, 100
, new DataCellRenderer(javax.swing.SwingConstants.RIGHT)
, new DefaultCellEditor(new JTextField()));
c.setHeaderValue(AppLocal.getIntString("label.price"));
columns.addColumn(c);
c = new TableColumn(3, 100
, new DataCellRenderer(javax.swing.SwingConstants.RIGHT)
, new DefaultCellEditor(new JTextField()));
c.setHeaderValue(AppLocal.getIntString("label.prodvaluebuy"));
columns.addColumn(c);
m_tableinventory.setColumnModel(columns);
m_tableinventory.getTableHeader().setReorderingAllowed(false);
m_tableinventory.setRowHeight(30);
m_tableinventory.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
m_tableinventory.setIntercellSpacing(new java.awt.Dimension(0, 1));
m_inventorylines = new InventoryTableModel();
m_tableinventory.setModel(m_inventorylines);
}
/**
*
*/
public void clear() {
m_inventorylines.clear();
}
/**
*
* @param i
*/
public void addLine(InventoryLine i) {
m_inventorylines.addRow(i);
setSelectedIndex(m_inventorylines.getRowCount() - 1);
}
/**
*
* @param index
*/
public void deleteLine(int index) {
m_inventorylines.removeRow(index);
// Escojo una a seleccionar
if (index >= m_inventorylines.getRowCount()) {
index = m_inventorylines.getRowCount() - 1;
}
if ((index >= 0) && (index < m_inventorylines.getRowCount())) {
// Solo seleccionamos si podemos.
setSelectedIndex(index);
}
}
/**
*
* @param index
* @param i
*/
public void setLine(int index, InventoryLine i) {
m_inventorylines.setRow(index, i);
setSelectedIndex(index);
}
/**
*
* @param index
* @return
*/
public InventoryLine getLine(int index) {
return m_inventorylines.getRow(index);
}
/**
*
* @return
*/
public List<InventoryLine> getLines() {
return m_inventorylines.getLines();
}
/**
*
* @return
*/
public int getCount() {
return m_inventorylines.getRowCount();
}
/**
*
* @return
*/
public int getSelectedRow() {
return m_tableinventory.getSelectedRow();
}
/**
*
* @param i
*/
public void setSelectedIndex(int i){
// Seleccionamos
m_tableinventory.getSelectionModel().setSelectionInterval(i, i);
// Hacemos visible la seleccion.
Rectangle oRect = m_tableinventory.getCellRect(i, 0, true);
m_tableinventory.scrollRectToVisible(oRect);
}
/**
*
*/
public void goDown() {
int i = m_tableinventory.getSelectionModel().getMaxSelectionIndex();
if (i < 0){
i = 0; // No hay ninguna seleccionada
} else {
i ++;
if (i >= m_inventorylines.getRowCount()) {
i = m_inventorylines.getRowCount() - 1;
}
}
if ((i >= 0) && (i < m_inventorylines.getRowCount())) {
// Solo seleccionamos si podemos.
setSelectedIndex(i);
}
}
/**
*
*/
public void goUp() {
int i = m_tableinventory.getSelectionModel().getMinSelectionIndex();
if (i < 0){
i = m_inventorylines.getRowCount() - 1; // No hay ninguna seleccionada
} else {
i --;
if (i < 0) {
i = 0;
}
}
if ((i >= 0) && (i < m_inventorylines.getRowCount())) {
// Solo seleccionamos si podemos.
setSelectedIndex(i);
}
}
private static class InventoryTableModel extends AbstractTableModel {
// JG 16 May 2013 use diamond inference
private final ArrayList<InventoryLine> m_rows = new ArrayList<>();
@Override
public int getRowCount() {
return m_rows.size();
}
@Override
public int getColumnCount() {
return 4;
}
@Override
public String getColumnName(int column) {
//return AppLocal.getIntString(m_acolumns[column].name);
return "a";
}
@Override
public Object getValueAt(int row, int column) {
InventoryLine i = m_rows.get(row);
switch (column) {
case 0: return "<html>" + i.getProductName() + (
i.getProductAttSetInstDesc() == null
? ""
: "<br>" + i.getProductAttSetInstDesc());
case 1: return "x" + Formats.DOUBLE.formatValue(i.getMultiply());
case 2: return Formats.CURRENCY.formatValue(i.getPrice());
case 3: return Formats.CURRENCY.formatValue(i.getSubValue());
default: return null;
}
}
@Override
public boolean isCellEditable(int row, int column) {
return false;
}
public void clear() {
int old = getRowCount();
if (old > 0) {
m_rows.clear();
fireTableRowsDeleted(0, old - 1);
}
}
public List<InventoryLine> getLines() {
return m_rows;
}
public InventoryLine getRow(int index) {
return m_rows.get(index);
}
public void setRow(int index, InventoryLine oLine){
m_rows.set(index, oLine);
fireTableRowsUpdated(index, index);
}
public void addRow(InventoryLine oLine) {
insertRow(m_rows.size(), oLine);
}
public void insertRow(int index, InventoryLine oLine) {
m_rows.add(index, oLine);
fireTableRowsInserted(index, index);
}
public void removeRow(int row) {
m_rows.remove(row);
fireTableRowsDeleted(row, row);
}
}
private static class DataCellRenderer extends DefaultTableCellRenderer {
private int m_iAlignment;
public DataCellRenderer(int align) {
m_iAlignment = align;
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column){
JLabel aux = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
aux.setVerticalAlignment(javax.swing.SwingConstants.TOP);
aux.setHorizontalAlignment(m_iAlignment);
if (!isSelected) {
aux.setBackground(javax.swing.UIManager.getDefaults().getColor("TextField.disabledBackground"));
}
return aux;
}
}
/** 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() {
jScrollPane1 = new javax.swing.JScrollPane();
m_tableinventory = new javax.swing.JTable();
setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
setLayout(new java.awt.BorderLayout());
jScrollPane1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jScrollPane1.setPreferredSize(new java.awt.Dimension(455, 402));
m_tableinventory.setAutoCreateColumnsFromModel(false);
m_tableinventory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_tableinventory.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
m_tableinventory.setFocusable(false);
m_tableinventory.setRequestFocusEnabled(false);
m_tableinventory.setSelectionBackground(new java.awt.Color(0, 153, 204));
m_tableinventory.setShowVerticalLines(false);
m_tableinventory.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
m_tableinventoryMousePressed(evt);
}
});
jScrollPane1.setViewportView(m_tableinventory);
add(jScrollPane1, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents
private void m_tableinventoryMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_m_tableinventoryMousePressed
}//GEN-LAST:event_m_tableinventoryMousePressed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable m_tableinventory;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,117 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.IKeyed;
import com.unicenta.data.loader.SerializableRead;
/**
*
* @author adrianromero
* Created on February 13, 2007, 10:13 AM
*
*/
public class LocationInfo implements SerializableRead, IKeyed {
private static final long serialVersionUID = 9032683595230L;
private String m_sID;
private String m_sName;
private String m_sAddress;
/** Creates a new instance of LocationInfo */
public LocationInfo() {
m_sID = null;
m_sName = null;
m_sAddress = null;
}
/**
*
* @return
*/
public Object getKey() {
return m_sID;
}
/**
*
* @param dr
* @throws BasicException
*/
public void readValues(DataRead dr) throws BasicException {
m_sID = dr.getString(1);
m_sName = dr.getString(2);
m_sAddress = dr.getString(3);
}
/**
*
* @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 getAddress() {
return m_sAddress;
}
/**
*
* @param sAddress
*/
public void setAddress(String sAddress) {
m_sAddress = sAddress;
}
public String toString(){
return m_sName;
}
}
@@ -0,0 +1,120 @@
// 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.inventory;
import com.unicenta.data.gui.ListCellRendererBasic;
import com.unicenta.data.loader.ComparatorCreator;
import com.unicenta.data.loader.TableDefinition;
import com.unicenta.data.loader.Vectorer;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProvider;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.panels.JPanelTable;
import javax.swing.ListCellRenderer;
/**
*
* @author adrianromero
*/
public class LocationsPanel extends JPanelTable {
private TableDefinition tlocations;
private LocationsView jeditor;
/** Creates a new instance of LocationsPanel */
public LocationsPanel() {
}
/**
*
*/
@Override
protected void init() {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
tlocations = dlSales.getTableLocations();
jeditor = new LocationsView(dirty);
}
/**
*
* @return
*/
@Override
public ListProvider getListProvider() {
return new ListProviderCreator(tlocations);
}
/**
*
* @return
*/
@Override
public SaveProvider getSaveProvider() {
return new SaveProvider(tlocations);
}
/**
*
* @return
*/
@Override
public Vectorer getVectorer() {
return tlocations.getVectorerBasic(new int[]{1, 2});
}
/**
*
* @return
*/
@Override
public ComparatorCreator getComparatorCreator() {
return tlocations.getComparatorCreator(new int[] {1, 2});
}
/**
*
* @return
*/
@Override
public ListCellRenderer getListCellRenderer() {
return new ListCellRendererBasic(tlocations.getRenderStringBasic(new int[]{1}));
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.Locations");
}
}
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="m_jAddress" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<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_jName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jAddress" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/info.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.locationname" 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>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel2MouseClicked"/>
</Events>
</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="[220, 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.locationaddress" 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_jAddress">
<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="[220, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,227 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import java.awt.Component;
import java.awt.datatransfer.StringSelection;
import java.util.UUID;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import javax.swing.JOptionPane;
/**
*
* @author adrianromero
*/
public final class LocationsView extends javax.swing.JPanel implements EditorRecord {
// private DirtyManager m_Dirty = new DirtyManager();
private String m_sID;
/** Creates new form LocationsEditor
* @param dirty */
public LocationsView(DirtyManager dirty) {
initComponents();
m_jName.getDocument().addDocumentListener(dirty);
m_jAddress.getDocument().addDocumentListener(dirty);
writeValueEOF();
}
/**
*
*/
@Override
public void writeValueEOF() {
m_sID = null;
m_jName.setText(null);
m_jAddress.setText(null);
m_jName.setEnabled(false);
m_jAddress.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
m_sID = UUID.randomUUID().toString();
m_jName.setText(null);
m_jAddress.setText(null);
m_jName.setEnabled(true);
m_jAddress.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] location = (Object[]) value;
m_sID = Formats.STRING.formatValue(location[0]);
m_jName.setText(Formats.STRING.formatValue(location[1]));
m_jAddress.setText(Formats.STRING.formatValue(location[2]));
m_jName.setEnabled(false);
m_jAddress.setEnabled(false);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] location = (Object[]) value;
m_sID = Formats.STRING.formatValue(location[0]);
m_jName.setText(Formats.STRING.formatValue(location[1]));
m_jAddress.setText(Formats.STRING.formatValue(location[2]));
m_jName.setEnabled(true);
m_jAddress.setEnabled(true);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] location = new Object[3];
location[0] = m_sID;
location[1] = m_jName.getText();
location[2] = m_jAddress.getText();
return location;
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
*/
@Override
public void refresh() {
}
/** 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() {
jLabel2 = new javax.swing.JLabel();
m_jName = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
m_jAddress = new javax.swing.JTextField();
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/info.png"))); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.locationname")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(110, 30));
jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel2MouseClicked(evt);
}
});
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(220, 30));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.locationaddress")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(110, 30));
m_jAddress.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jAddress.setPreferredSize(new java.awt.Dimension(220, 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)
.addComponent(jLabel3, 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))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(m_jAddress, 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())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jName, 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))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(m_jAddress, 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)))
);
}// </editor-fold>//GEN-END:initComponents
private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseClicked
if (evt.getClickCount() == 2) {
String uuidString = m_sID;
StringSelection stringSelection = new StringSelection(uuidString);
Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
clpbrd.setContents(stringSelection, null);
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.uuidcopy"));
}
}//GEN-LAST:event_jLabel2MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField m_jAddress;
private javax.swing.JTextField m_jName;
// 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="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[32767, 160]"/>
</Property>
<Property name="opaque" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[500, 160]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</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_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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,123,0,0,2,101"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout">
<Property name="axis" type="int" value="1"/>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="By Form">
<ResourceString PropertyName="titleX" bundle="pos_messages.properties" key="label.byform" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</TitledBorder>
</Border>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[32767, 140]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[500, 140]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<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="12" 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>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="20" y="50" width="130" height="25"/>
</Constraint>
</Constraints>
</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>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="150" y="20" width="150" height="25"/>
</Constraint>
</Constraints>
</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="12" style="0"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="310" y="20" width="180" height="25"/>
</Constraint>
</Constraints>
</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="12" style="0"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="310" y="50" width="60" height="25"/>
</Constraint>
</Constraints>
</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>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="150" y="50" width="150" height="25"/>
</Constraint>
</Constraints>
</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="12" 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>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="20" y="20" width="130" height="25"/>
</Constraint>
</Constraints>
</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="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.stockproduct" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="20" y="80" width="130" height="25"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="m_jCboProduct">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="150" y="80" width="220" height="25"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,164 @@
// Opentpv is a point of sales application designed for touch screens.
// Copyright (c) 2009-20162008 Open Sistemas de Información Internet, S.L.
// Copyright (c) 2009-20162007-2008 Openbravo, S.L.
// http://www.opensistemas.com
// e-mail: imasd@opensistemas.com
//
// This program 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 2 of the License, or
// (at your option) any later version.
//
// This program 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 this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.unicenta.pos.inventory;
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.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
/**
*
* @author Luis Ig. Bacas Riveiro lbacas@opensistemas.com
* @author Pablo J. Urbano Santos purbano@opensistemas.com
*/
public class MaterialFilter extends javax.swing.JPanel implements EditorCreator {
private SentenceList m_sentprods;
private ComboBoxValModel m_ProdsModel;
/** Creates new form JQBFProduct
* @param dlSales */
public MaterialFilter(DataLogicSales dlSales) {
initComponents();
//El modelo de productos
m_sentprods = dlSales.getProductList();
m_ProdsModel = new ComboBoxValModel();
m_jCboName.setModel(new ListQBFModelNumber());
m_jCboPriceBuy.setModel(new ListQBFModelNumber());
}
/**
*
* @throws BasicException
*/
public void activate() throws BasicException {
java.util.List prodlist = m_sentprods.list();
prodlist.add(0, null);
m_ProdsModel.refresh(prodlist);
m_jCboProduct.setModel(m_ProdsModel);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
return new Object[] {
m_jCboName.getSelectedItem(), m_jName.getText(),
m_jCboPriceBuy.getSelectedItem(), Formats.CURRENCY.parseValue(m_jPriceBuy.getText()),
m_ProdsModel.getSelectedKey() == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_EQUALS, m_ProdsModel.getSelectedKey()
};
}
/** 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() {
jPanel1 = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
m_jCboName = new javax.swing.JComboBox();
m_jName = new javax.swing.JTextField();
m_jPriceBuy = new javax.swing.JTextField();
m_jCboPriceBuy = new javax.swing.JComboBox();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
m_jCboProduct = new javax.swing.JComboBox();
setMaximumSize(new java.awt.Dimension(32767, 160));
setOpaque(false);
setPreferredSize(new java.awt.Dimension(500, 160));
setRequestFocusEnabled(false);
setLayout(new javax.swing.BoxLayout(this, javax.swing.BoxLayout.Y_AXIS));
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(AppLocal.getIntString("label.byform"))); // NOI18N
jPanel1.setMaximumSize(new java.awt.Dimension(32767, 140));
jPanel1.setPreferredSize(new java.awt.Dimension(500, 140));
jPanel1.setRequestFocusEnabled(false);
jPanel1.setLayout(null);
jLabel4.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.prodpricebuy")); // NOI18N
jPanel1.add(jLabel4);
jLabel4.setBounds(20, 50, 130, 25);
m_jCboName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jPanel1.add(m_jCboName);
m_jCboName.setBounds(150, 20, 150, 25);
m_jName.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jPanel1.add(m_jName);
m_jName.setBounds(310, 20, 180, 25);
m_jPriceBuy.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jPanel1.add(m_jPriceBuy);
m_jPriceBuy.setBounds(310, 50, 60, 25);
m_jCboPriceBuy.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jPanel1.add(m_jCboPriceBuy);
m_jCboPriceBuy.setBounds(150, 50, 150, 25);
jLabel2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jPanel1.add(jLabel2);
jLabel2.setBounds(20, 20, 130, 25);
jLabel3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.stockproduct")); // NOI18N
jPanel1.add(jLabel3);
jLabel3.setBounds(20, 80, 130, 25);
m_jCboProduct.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jPanel1.add(m_jCboProduct);
m_jCboProduct.setBounds(150, 80, 220, 25);
add(jPanel1);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JComboBox m_jCboName;
private javax.swing.JComboBox m_jCboPriceBuy;
private javax.swing.JComboBox m_jCboProduct;
private javax.swing.JTextField m_jName;
private javax.swing.JTextField m_jPriceBuy;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,169 @@
// Openbravo POS is a point of sales application designed for touch screens.
// Copyright (c) 2009-20162008 Open Sistemas de Información Internet, S.L.
// http://www.opensistemas.com
// http://sourceforge.net/projects/openbravopos
//
// This program 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 2 of the License, or
// (at your option) any later version.
//
// This program 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 this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.unicenta.pos.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.IKeyed;
import com.unicenta.data.loader.SerializableRead;
import com.unicenta.pos.ticket.ProductInfoExt;
/**
* Clase para la gestion de los materiales de un producto (escandallo)
* @author Luis Ig. Bacas Riveiro lbacas@opensistemas.com
* @author Pablo J. Urbano Santos purbano@opensistemas.com
*/
public class MaterialProdInfo implements SerializableRead, IKeyed {
private String m_sID;
private String m_sName;
private double m_dPriceBuy;
private double m_dAmount;
private String m_sUnit;
/**
*
*/
public MaterialProdInfo() {
m_sID = null;
m_sName = null;
m_dPriceBuy = 0.0;
m_dAmount = 0.0;
m_sUnit = null;
}
/**
*
* @param p
*/
public MaterialProdInfo(ProductInfoExt p) {
m_sID = p.getID();
m_sName = p.getName();
m_dPriceBuy = p.getPriceBuy();
m_dAmount = 1.0;
}
/**
*
* @param dr
* @throws BasicException
*/
@Override
public void readValues(DataRead dr) throws BasicException {
m_sID = dr.getString(1);
m_sName = dr.getString(2);
m_dPriceBuy = dr.getDouble(3).doubleValue();
m_dAmount = (dr.getDouble(4) == null) ? 1.0 : dr.getDouble(4).doubleValue();
m_sUnit = dr.getString(5);
}
/**
*
* @param id
*/
public void setID (String id) {
m_sID = id;
}
/**
*
* @return
*/
public String getID() {
return m_sID;
}
/**
*
* @param name
*/
public void setName (String name) {
m_sName = name;
}
/**
*
* @return
*/
public String getName() {
return m_sName;
}
/**
*
* @param price
*/
public void setPriceBuy (double price) {
m_dPriceBuy = price;
}
/**
*
* @return
*/
public double getPriceBuy() {
return m_dPriceBuy;
}
/**
*
* @param amount
*/
public void setAmount (double amount) {
m_dAmount = amount;
}
/**
*
* @return
*/
public double getAmount() {
return m_dAmount;
}
/**
*
* @param unit
*/
public void setUnit (String unit) {
m_sUnit = unit;
}
/**
*
* @return
*/
public String getUnit() {
return m_sUnit;
}
/**
*
* @return
*/
@Override
public Object getKey() {
return m_sID;
}
@Override
public final String toString() {
return (m_sName +" - "+m_dAmount+" "+m_sUnit);
}
}
@@ -0,0 +1,85 @@
// 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.inventory;
import com.unicenta.pos.panels.ComboItemLocal;
/**
*
* @author adrianromero
*/
public class MovementReason extends ComboItemLocal {
// IN values
public static final MovementReason IN_PURCHASE = new MovementReason(+1, "stock.in.purchase");
public static final MovementReason IN_REFUND = new MovementReason(+2, "stock.in.refund");
public static final MovementReason IN_MOVEMENT = new MovementReason(+4, "stock.in.movement");
// OUT values
public static final MovementReason OUT_SALE = new MovementReason(-1, "stock.out.sale");
public static final MovementReason OUT_REFUND = new MovementReason(-2, "stock.out.refund");
public static final MovementReason OUT_BREAK = new MovementReason(-3, "stock.out.break");
public static final MovementReason OUT_MOVEMENT = new MovementReason(-4, "stock.out.movement");
public static final MovementReason OUT_SAMPLE = new MovementReason(-5, "stock.out.sample");
public static final MovementReason OUT_FREE = new MovementReason(-6, "stock.out.free");
public static final MovementReason OUT_USED = new MovementReason(-7, "stock.out.used");
public static final MovementReason OUT_SUBTRACT = new MovementReason(-8, "stock.out.subtract");
// TRANSFER
public static final MovementReason OUT_CROSSING = new MovementReason(1000, "stock.out.crossing");
private MovementReason(Integer iKey, String sKeyValue) {
super(iKey, sKeyValue);
}
public boolean isInput() {
return m_iKey.intValue() > 0;
}
public Double samesignum(Double d) {
if (d == null || m_iKey == null) {
return d;
} else if ((m_iKey.intValue() > 0 && d.doubleValue() < 0.0) ||
(m_iKey.intValue() < 0 && d.doubleValue() > 0.0)) {
return -d.doubleValue();
} else {
return d;
}
}
/**
*
* @param dBuyPrice
* @param dSellPrice
* @return
*/
public Double getPrice(Double dBuyPrice, Double dSellPrice) {
if (this == IN_PURCHASE || this == OUT_REFUND || this == OUT_BREAK) {
return dBuyPrice;
} else if (this == OUT_SALE || this == IN_REFUND) {
return dSellPrice;
} else {
return null;
}
}
}
@@ -0,0 +1,148 @@
// uniCenta oPOS - Touch Friendly Point Of Sale
// Copyright (c) 2009-2018 uniCenta
// Portions Contributed by: John D L 2013
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.EditorListener;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.panels.JPanelTable2;
import com.unicenta.pos.ticket.ProductFilter;
import java.awt.Component;
import javax.swing.JButton;
/**
*
* @author adrianromero
* Created on 1 de marzo de 2007, 22:15
*
*/
public class PriceImportPanel extends JPanelTable2 implements EditorListener {
private ProductsEditor jeditor;
private ProductFilter jproductfilter;
private DataLogicSales m_dlSales = null;
/** Creates a new instance of ProductsPanel2 */
public PriceImportPanel() {
}
/**
*
*/
@Override
protected void init() {
m_dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
// el panel del filtro
jproductfilter = new ProductFilter();
jproductfilter.init(app);
row = m_dlSales.getProductsRow();
lpr = new ListProviderCreator(m_dlSales.getProductCatQBF(), jproductfilter);
spr = new SaveProvider(
m_dlSales.getProductCatUpdate(),
m_dlSales.getProductCatInsert(),
m_dlSales.getProductCatDelete());
// el panel del editor
jeditor = new ProductsEditor(app, dirty);
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @return
*/
@Override
public Component getFilter() {
return jproductfilter.getComponent();
}
/**
*
* @return
*/
@Override
public Component getToolbarExtras() {
JButton btnScanPal = new JButton();
btnScanPal.setText("ScanPal");
btnScanPal.setVisible(app.getDeviceScanner() != null);
btnScanPal.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnScanPalActionPerformed(evt);
}
});
return btnScanPal;
}
private void btnScanPalActionPerformed(java.awt.event.ActionEvent evt) {
JDlgUploadProducts.showMessage(this, app.getDeviceScanner(), bd);
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.StockImport");
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
jeditor.activate();
jproductfilter.activate();
super.activate();
}
/**
*
* @param value
*/
@Override
public void updateValue(Object value) {
}
}
@@ -0,0 +1,186 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.SerializerRead;
import java.util.Date;
/**
*
* @author JG uniCenta May 15
* Used in Product stock tab to display all this Product's
* location values
*/
public class ProductStock {
String pId;
String location;
Double units;
Double minimum;
Double maximum;
Double pricebuy;
Double pricesell;
Date memodate;
/**
* Main method to return a product's "live" stock position
*/
public ProductStock() {
}
/**
*
* @param pId
* @param location
* @param units
* @param minimum
* @param maximum
* @param pricebuy
* @param pricesell
* @param memodate
*/
public ProductStock(String pId, String location, Double units, Double minimum,
Double maximum, Double pricebuy, Double pricesell, Date memodate) {
this.pId = pId;
this.location = location;
this.units = units;
this.minimum = minimum;
this.maximum = maximum;
this.pricebuy = pricebuy;
this.pricesell = pricesell;
this.memodate = memodate;
}
/**
*
* @return product id string
*/
public String getProductId() {
return pId;
}
public void setProductId(String pId) {
this.pId = pId;
}
/**
*
* @return product's location string
*/
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
/**
*
* @return product's quantity string value
*/
public Double getUnits() {
return units;
}
public void setUnits(Double units) {
this.units = units;
}
/**
*
* @return
*/
public Double getMinimum() {
return minimum;
}
public void setMinimum(Double minimum) {
this.minimum = minimum;
}
/**
*
* @return maximum value
*/
public Double getMaximum() {
return maximum;
}
public void setMaximum(Double maximum) {
this.maximum = maximum;
}
/**
*
* @return price buy
*/
public Double getPriceBuy() {
return pricebuy;
}
public void setPriceBuy(Double pricebuy) {
this.pricebuy = pricebuy;
}
/**
*
* @return price sell
*/
public Double getPriceSell() {
return pricesell;
}
public void setPriceSell(Double pricesell) {
this.pricesell = pricesell;
}
/**
*
* @return memodate Date value
*/
public Date getMemoDate() {
return memodate;
}
public void setMemoDate(Date memodate) {
this.memodate = memodate;
}
/**
*
* @return stock for this product
*/
public static SerializerRead getSerializerRead() {
return new SerializerRead() {
@Override
public Object readValues(DataRead dr) throws BasicException {
String pId = dr.getString(1);
String location = dr.getString(2);
Double units = dr.getDouble(3);
Double minimum = dr.getDouble(4);
Double maximum = dr.getDouble(5);
Double pricebuy = dr.getDouble(6);
Double pricesell = dr.getDouble(7);
Date memodate = dr.getTimestamp(8);
return
new ProductStock(pId, location, units, minimum, maximum, pricebuy, pricesell, memodate);
}
};
}
}
@@ -0,0 +1,92 @@
// 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.inventory;
import com.unicenta.data.loader.DataRead;
import com.unicenta.data.loader.SerializerRead;
/**
*
* @author Jack G
*/
public class ProductsBundleInfo {
private static final long serialVersionUID = 7587646873036L;
protected String id;
protected String productId;
protected String productBundleId;
protected Double quantity;
/**
*
* @param id
* @param productId
* @param productBundleId
* @param quantity
*/
public ProductsBundleInfo(String id, String productId, String productBundleId, Double quantity) {
this.id = id;
this.productId = productId;
this.productBundleId = productBundleId;
this.quantity = quantity;
}
public void setM_ID(String id) {
this.id = id;
}
public void setM_sProduct(String productId) {
this.productId = productId;
}
public void setM_sProductBundle(String productBundleId) {
this.productBundleId = productBundleId;
}
public void setM_dQuantity(Double m_dQuantity) {
this.quantity = quantity;
}
public String getId() {
return id;
}
public String getProductId() {
return productId;
}
public String getProductBundleId() {
return productBundleId;
}
public Double getQuantity() {
return quantity;
}
public static SerializerRead getSerializerRead() {
return (DataRead dr) -> new ProductsBundleInfo(dr.getString(1)
, dr.getString(2)
, dr.getString(3)
, dr.getDouble(4));
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,144 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.EditorListener;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.panels.JPanelTable2;
import com.unicenta.pos.ticket.ProductFilter;
import java.awt.Component;
import javax.swing.JButton;
/**
*
* @author JG uniCenta
*
*/
public class ProductsPanel extends JPanelTable2 implements EditorListener {
private ProductsEditor jeditor;
private ProductFilter jproductfilter;
private DataLogicSales m_dlSales = null;
public ProductsPanel() {
}
/**
*
*/
@Override
protected void init() {
m_dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
jproductfilter = new ProductFilter();
jproductfilter.init(app);
row = m_dlSales.getProductsRow();
lpr = new ListProviderCreator(m_dlSales.getProductCatQBF(), jproductfilter);
spr = new SaveProvider(
m_dlSales.getProductCatUpdate(),
m_dlSales.getProductCatInsert(),
m_dlSales.getProductCatDelete());
jeditor = new ProductsEditor(app, dirty);
}
/**
*
* @return value
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @return value
*/
@Override
public Component getFilter() {
return jproductfilter.getComponent();
}
/**
*
* @return btnScanPal
*/
@Override
public Component getToolbarExtras() {
JButton btnScanPal = new JButton();
btnScanPal.setText("ScanPal");
btnScanPal.setVisible(app.getDeviceScanner() != null);
btnScanPal.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnScanPalActionPerformed(evt);
}
});
return btnScanPal;
}
private void btnScanPalActionPerformed(java.awt.event.ActionEvent evt) {
JDlgUploadProducts.showMessage(this, app.getDeviceScanner(), bd);
}
/**
*
* @return value
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.Products");
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
jeditor.activate();
jproductfilter.activate();
super.activate();
}
/**
*
* @param value
*/
@Override
public void updateValue(Object value) {
}
}
@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jMinimum" min="-2" pref="80" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jMaximum" min="-2" pref="80" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jQuantity" min="-2" pref="80" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jTitle" min="-2" pref="314" max="-2" attributes="0"/>
</Group>
</Group>
<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="0" attributes="0">
<Component id="m_jTitle" min="-2" pref="30" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jQuantity" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jMinimum" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jMaximum" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="m_jTitle">
<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="[300, 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.units" 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_jQuantity">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="4"/>
<Property name="enabled" type="boolean" value="false"/>
<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.minimum" 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_jMinimum">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="4"/>
<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="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.maximum" 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_jMaximum">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="4"/>
<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,271 @@
// 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/>.
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-130
package com.unicenta.pos.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import java.awt.Component;
/**
*
* @author adrianromero
*/
public class ProductsWarehouseEditor extends javax.swing.JPanel implements EditorRecord {
/**
*
*/
public Object id;
public Object prodid;
public Object prodref;
public Object prodname;
public Object location;
/** Creates new form ProductsWarehouseEditor
* @param dirty */
public ProductsWarehouseEditor(DirtyManager dirty) {
initComponents();
m_jMinimum.getDocument().addDocumentListener(dirty);
m_jMaximum.getDocument().addDocumentListener(dirty);
}
public ProductsWarehouseEditor() {
throw new UnsupportedOperationException("Not supported yet.");
}
/**
*
*/
@Override
public void writeValueEOF() {
m_jTitle.setText(AppLocal.getIntString("label.recordeof"));
id = null;
prodid = null;
prodref = null;
prodname = null;
location = null;
m_jQuantity.setText(null);
m_jMinimum.setText(null);
m_jMaximum.setText(null);
m_jMinimum.setEnabled(false);
m_jMaximum.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
m_jTitle.setText(AppLocal.getIntString("label.recordnew"));
id = null;
prodid = null;
prodref = null;
prodname = null;
location = null;
m_jQuantity.setText(null);
m_jMinimum.setText(null);
m_jMaximum.setText(null);
m_jMinimum.setEnabled(true);
m_jMaximum.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] myprod = (Object[]) value;
id = myprod[0];
prodid = myprod[1];
prodref = myprod[2];
prodname = myprod[3];
location = myprod[4];
m_jTitle.setText(Formats.STRING.formatValue(myprod[2]) + " - " + Formats.STRING.formatValue(myprod[3]));
m_jQuantity.setText(Formats.DOUBLE.formatValue(myprod[7]));
m_jMinimum.setText(Formats.DOUBLE.formatValue(myprod[5]));
m_jMaximum.setText(Formats.DOUBLE.formatValue(myprod[6]));
m_jMinimum.setEnabled(true);
m_jMaximum.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] myprod = (Object[]) value;
id = myprod[0];
prodid = myprod[1];
prodref = myprod[2];
prodname = myprod[3];
location = myprod[4];
m_jTitle.setText(Formats.STRING.formatValue(myprod[2]) + " - " + Formats.STRING.formatValue(myprod[3]));
m_jQuantity.setText(Formats.DOUBLE.formatValue(myprod[7]));
m_jMinimum.setText(Formats.DOUBLE.formatValue(myprod[5]));
m_jMaximum.setText(Formats.DOUBLE.formatValue(myprod[6]));
m_jMinimum.setEnabled(false);
m_jMaximum.setEnabled(false);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
return new Object[] {
id,
prodid,
prodref,
prodname,
location,
Formats.DOUBLE.parseValue(m_jMinimum.getText()),
Formats.DOUBLE.parseValue(m_jMaximum.getText()),
Formats.DOUBLE.parseValue(m_jQuantity.getText())
};
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
*/
@Override
public void refresh() {
}
/** 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_jTitle = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
m_jQuantity = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
m_jMinimum = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
m_jMaximum = new javax.swing.JTextField();
m_jTitle.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jTitle.setPreferredSize(new java.awt.Dimension(300, 30));
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.units")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(110, 30));
m_jQuantity.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jQuantity.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
m_jQuantity.setEnabled(false);
m_jQuantity.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.minimum")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(110, 30));
m_jMinimum.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jMinimum.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
m_jMinimum.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.maximum")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(110, 30));
m_jMaximum.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jMaximum.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
m_jMaximum.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(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jMinimum, javax.swing.GroupLayout.PREFERRED_SIZE, 80, 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.UNRELATED)
.addComponent(m_jMaximum, javax.swing.GroupLayout.PREFERRED_SIZE, 80, 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.UNRELATED)
.addComponent(m_jQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 314, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(m_jTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.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_jQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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_jMinimum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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_jMaximum, 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 jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField m_jMaximum;
private javax.swing.JTextField m_jMinimum;
private javax.swing.JTextField m_jQuantity;
private javax.swing.JLabel m_jTitle;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,173 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.loader.*;
import com.unicenta.data.model.Field;
import com.unicenta.data.model.Row;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.panels.JPanelTable2;
import com.unicenta.pos.reports.JParamsLocation;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.UUID;
/**
*
* @author adrianromero
*/
public class ProductsWarehousePanel extends JPanelTable2 {
private JParamsLocation m_paramslocation;
private ProductsWarehouseEditor jeditor;
/** Creates a new instance of ProductsWarehousePanel */
public ProductsWarehousePanel() {
}
/**
*
*/
@Override
protected void init() {
m_paramslocation = new JParamsLocation();
m_paramslocation.init(app);
m_paramslocation.addActionListener(new ReloadActionListener());
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field("PRODUCT_ID", Datas.STRING, Formats.STRING),
new Field(AppLocal.getIntString("label.prodref"), Datas.STRING, Formats.STRING, true, true, true),
new Field(AppLocal.getIntString("label.prodname"), Datas.STRING, Formats.STRING, true, true, true),
new Field("LOCATION", Datas.STRING, Formats.STRING),
new Field("STOCKSECURITY", Datas.DOUBLE, Formats.DOUBLE),
new Field("STOCKMAXIMUM", Datas.DOUBLE, Formats.DOUBLE),
new Field("UNITS", Datas.DOUBLE, Formats.DOUBLE)
);
lpr = new ListProviderCreator(new PreparedSentence(app.getSession(),
"SELECT L.ID, P.ID, P.REFERENCE, P.NAME," +
"L.STOCKSECURITY, L.STOCKMAXIMUM, COALESCE(S.SUMUNITS, 0) " +
"FROM products P " +
"LEFT OUTER JOIN (SELECT ID, PRODUCT, LOCATION, STOCKSECURITY, STOCKMAXIMUM "
+ "FROM stocklevel WHERE LOCATION = ?) L ON P.ID = L.PRODUCT " +
"LEFT OUTER JOIN (SELECT PRODUCT, SUM(UNITS) AS SUMUNITS "
+ "FROM stockcurrent WHERE LOCATION = ? GROUP BY PRODUCT) S ON P.ID = S.PRODUCT " +
"ORDER BY P.NAME",
new SerializerWriteBasicExt(new Datas[] {Datas.OBJECT, Datas.STRING}, new int[]{1, 1}),
new WarehouseSerializerRead()
),
m_paramslocation);
SentenceExec updatesent = new SentenceExecTransaction(app.getSession()) {
@Override
public int execInTransaction(Object params) throws BasicException {
Object[] values = (Object[]) params;
if (values[0] == null) {
// INSERT
values[0] = UUID.randomUUID().toString();
return new PreparedSentence(app.getSession()
, "INSERT INTO stocklevel (ID, LOCATION, PRODUCT, STOCKSECURITY, STOCKMAXIMUM) VALUES (?, ?, ?, ?, ?)"
, new SerializerWriteBasicExt(row.getDatas(), new int[] {0, 4, 1, 5, 6})).exec(params);
} else {
// UPDATE
return new PreparedSentence(app.getSession()
, "UPDATE stocklevel SET STOCKSECURITY = ?, STOCKMAXIMUM = ? WHERE ID = ?"
, new SerializerWriteBasicExt(row.getDatas(), new int[] {5, 6, 0})).exec(params);
}
}
};
spr = new SaveProvider(updatesent, null, null);
jeditor = new ProductsWarehouseEditor(dirty);
}
/**
*
* @return
*/
@Override
public Component getFilter() {
return m_paramslocation.getComponent();
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
m_paramslocation.activate();
super.activate();
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.ProductsWarehouse");
}
private class ReloadActionListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
try {
ProductsWarehousePanel.this.bd.actionLoad();
} catch (BasicException w) {
}
}
}
private class WarehouseSerializerRead implements SerializerRead {
@Override
public Object readValues(DataRead dr) throws BasicException {
return new Object[] {
dr.getString(1),
dr.getString(2),
dr.getString(3),
dr.getString(4),
((Object[]) m_paramslocation.createValue())[1],
dr.getDouble(5),
dr.getDouble(6),
dr.getDouble(7)
};
}
}
}
@@ -0,0 +1,665 @@
<?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="12" style="0"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[550, 250]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[1000, 550]"/>
</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="2"/>
<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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,38,0,0,3,-24"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[2147483647, 2147483647]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[780, 260]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 600]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="First"/>
</Constraint>
</Constraints>
<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="jLblDate" min="-2" pref="110" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jdate" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jbtndate" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLblReason" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLblLocation" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="m_jreason" alignment="0" max="-2" attributes="0"/>
<Component id="m_jLocation" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jLblMoveTo" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLblLocation1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="m_jLocationDes" alignment="0" max="-2" attributes="0"/>
<Component id="m_jSupplier" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLblAtt" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jattributes" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jEditAttributes" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLBCode" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jcodebar" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jEnter" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLblUnits" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_junits" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLblPrice" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jprice" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLblName" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLblRef" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jreference" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="114" pref="114" max="-2" attributes="0"/>
<Component id="jproduct" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="m_jEnter1" min="-2" max="-2" attributes="0"/>
<Component id="jEditProduct" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="catcontainer" pref="612" max="32767" attributes="0"/>
<EmptySpace max="-2" 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">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jdate" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLblDate" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="m_jbtndate" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jreason" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLblReason" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jLocation" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLblLocation" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLblMoveTo" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jLocationDes" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jSupplier" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLblLocation1" alignment="3" 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="jLblName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jproduct" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jEditProduct" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="m_jreference" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLblRef" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="m_jEnter1" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="jattributes" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLblAtt" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jEditAttributes" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="m_jEnter" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="m_jcodebar" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLBCode" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLblUnits" min="-2" max="-2" attributes="0"/>
<Component id="m_junits" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLblPrice" min="-2" max="-2" attributes="0"/>
<Component id="m_jprice" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace min="0" pref="47" max="32767" attributes="0"/>
</Group>
<Component id="catcontainer" max="32767" attributes="0"/>
</Group>
<EmptySpace pref="48" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLblDate">
<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.stockdate" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[23, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[23, 20]"/>
</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_jdate">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="m_jbtndate">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/date.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Open Calendar"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[64, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jbtndateActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLblReason">
<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.stockreason" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[36, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[36, 20]"/>
</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_jreason">
<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="[170, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jreasonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLblName">
<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="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</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="jproduct">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<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" value=" "/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jproductActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jEditProduct">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/search24.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Search Product List"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[64, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jEditProductActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLblLocation">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="text" type="java.lang.String" value="Location"/>
<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_jLocation">
<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="[170, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLBCode">
<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="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</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_jcodebar">
<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="[170, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jcodebarActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jEnter">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/barcode.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Get Barcode"/>
<Property name="focusPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[54, 33]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[54, 33]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[64, 45]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEnterActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLblRef">
<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.prodref" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</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_jreference">
<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="[170, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jreferenceActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jEnter1">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/products.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Enter Product ID"/>
<Property name="focusPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[64, 33]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[64, 33]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[64, 45]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEnter1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLblAtt">
<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.attributes" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[48, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[48, 20]"/>
</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="jattributes">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<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="[170, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jattributesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jEditAttributes">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/attributes.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Product Attributes"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[65, 33]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[65, 33]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[64, 45]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jEditAttributesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLblUnits">
<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.units" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 20]"/>
</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_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="horizontalAlignment" type="int" value="4"/>
<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="jLblPrice">
<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.price" 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_jprice">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="4"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 30]"/>
</Property>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="catcontainer">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[2147483647, 2147483647]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 250]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[600, 0]"/>
</Property>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleParent" type="javax.accessibility.Accessible" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="jPanel1"/>
</Property>
</AccessibilityProperties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
<Component class="javax.swing.JComboBox" name="m_jLocationDes">
<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="[170, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jLocationDesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLblMoveTo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.moveto" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&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_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="[170, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLblLocation1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.suppliername" replaceFormat="AppLocal.getIntString(&quot;button.exit&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[110, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,993 @@
// 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.inventory;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.forms.DataLogicSystem;
import com.unicenta.pos.suppliers.DataLogicSuppliers;
import com.unicenta.pos.panels.JProductFinder;
import java.awt.Component;
import com.unicenta.basic.BasicException;
import com.unicenta.beans.DateUtils;
import com.unicenta.beans.JCalendarDialog;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.MessageInf;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.format.Formats;
import com.unicenta.pos.catalog.CatalogSelector;
import com.unicenta.pos.catalog.JCatalog;
import com.unicenta.pos.printer.TicketParser;
import com.unicenta.pos.sales.JProductAttEdit;
import com.unicenta.pos.ticket.ProductInfoExt;
import java.awt.BorderLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;
import java.util.UUID;
import javax.swing.JOptionPane;
public final class StockDiaryEditor extends javax.swing.JPanel implements EditorRecord {
private final AppView m_App;
private final DataLogicSystem m_dlSystem;
private final DataLogicSales m_dlSales;
private final DataLogicSuppliers m_dlSuppliers;
private final TicketParser m_TTP;
private final CatalogSelector m_cat;
private final ComboBoxValModel m_ReasonModel;
private final SentenceList m_sentlocations;
private ComboBoxValModel m_LocationsModel;
private ComboBoxValModel m_LocationsModelDes;
private final SentenceList m_sentsuppliers;
private ComboBoxValModel m_SuppliersModel;
private String m_sID;
private String productid;
private String productref;
private String productcode;
private String productname;
private String attsetid;
private String attsetinstid;
private String attsetinstdesc;
private String sAppUser;
private final String user;
/** Creates new form StockDiaryEditor
* @param app
* @param dirty */
public StockDiaryEditor(AppView app, DirtyManager dirty) {
m_App = app;
m_dlSystem = (DataLogicSystem) m_App.getBean("com.unicenta.pos.forms.DataLogicSystem");
m_dlSales = (DataLogicSales) m_App.getBean("com.unicenta.pos.forms.DataLogicSales");
m_dlSuppliers = (DataLogicSuppliers) m_App.getBean("com.unicenta.pos.suppliers.DataLogicSuppliers");
m_TTP = new TicketParser(m_App.getDeviceTicket(), m_dlSystem);
initComponents();
user = m_App.getAppUserView().getUser().getName();
m_sentlocations = m_dlSales.getLocationsList();
m_LocationsModel = new ComboBoxValModel();
m_LocationsModel = new ComboBoxValModel();
m_LocationsModelDes = new ComboBoxValModel();
m_sentsuppliers = m_dlSuppliers.getSupplierList();
m_SuppliersModel = new ComboBoxValModel();
m_ReasonModel = new ComboBoxValModel();
m_ReasonModel.add(MovementReason.IN_PURCHASE);
m_ReasonModel.add(MovementReason.IN_REFUND);
m_ReasonModel.add(MovementReason.IN_MOVEMENT);
m_ReasonModel.add(MovementReason.OUT_SALE);
m_ReasonModel.add(MovementReason.OUT_REFUND);
m_ReasonModel.add(MovementReason.OUT_BREAK);
m_ReasonModel.add(MovementReason.OUT_MOVEMENT);
m_ReasonModel.add(MovementReason.OUT_CROSSING);
m_jreason.setModel(m_ReasonModel);
m_cat = new JCatalog(m_dlSales);
m_cat.addActionListener(new CatalogListener());
catcontainer.add(m_cat.getComponent(), BorderLayout.CENTER);
m_jdate.getDocument().addDocumentListener(dirty);
m_jreason.addActionListener(dirty);
m_jLocation.addActionListener(dirty);
m_jLocationDes.addActionListener(dirty);
jproduct.getDocument().addDocumentListener(dirty);
jattributes.getDocument().addDocumentListener(dirty);
m_junits.getDocument().addDocumentListener(dirty);
m_jprice.getDocument().addDocumentListener(dirty);
m_jSupplier.addActionListener(dirty);
writeValueEOF();
}
/**
*
* @throws BasicException
*/
public void activate() throws BasicException {
m_cat.loadCatalog();
java.util.List l = m_sentlocations.list();
m_LocationsModel = new ComboBoxValModel(m_sentlocations.list());
m_jLocation.setModel(m_LocationsModel);
m_LocationsModelDes = new ComboBoxValModel(l);
m_jLocationDes.setModel(m_LocationsModelDes);
java.util.List sl = m_sentsuppliers.list();
m_SuppliersModel = new ComboBoxValModel(m_sentsuppliers.list());
m_jSupplier.setModel(m_SuppliersModel);
}
/**
*
*/
@Override
public void refresh() {
}
/**
*
*/
@Override
public void writeValueEOF() {
m_sID = null;
m_jdate.setText(null);
m_ReasonModel.setSelectedKey(null);
m_LocationsModel.setSelectedKey(m_App.getInventoryLocation());
m_LocationsModelDes.setSelectedKey(m_App.getInventoryLocation());
m_SuppliersModel.setSelectedKey(null);
productid = null;
productref = null;
productcode = null;
productname = null;
m_jreference.setText(null);
m_jcodebar.setText(null);
jproduct.setText(null);
attsetid = null;
attsetinstid = null;
attsetinstdesc = null;
jattributes.setText(null);
m_junits.setText(null);
m_jprice.setText(null);
m_jdate.setEnabled(false);
m_jbtndate.setEnabled(false);
m_jreason.setEnabled(false);
m_jreference.setEnabled(false);
m_jEnter1.setEnabled(false);
m_jcodebar.setEnabled(false);
m_jEnter.setEnabled(false);
m_jLocation.setEnabled(false);
jproduct.setEnabled(false);
jEditProduct.setEnabled(false);
jattributes.setEnabled(false);
jEditAttributes.setEnabled(false);
m_junits.setEnabled(false);
m_jprice.setEnabled(false);
m_cat.setComponentEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
m_sID = UUID.randomUUID().toString();
m_jdate.setText(Formats.TIMESTAMP.formatValue(DateUtils.getTodayMinutes()));
m_ReasonModel.setSelectedItem(MovementReason.IN_PURCHASE);
m_LocationsModel.setSelectedKey(m_App.getInventoryLocation());
m_LocationsModelDes.setSelectedKey(m_App.getInventoryLocation());
m_SuppliersModel.setSelectedKey(null);
productid = null;
productref = null;
productcode = null;
productname = null;
m_jreference.setText(null);
m_jcodebar.setText(null);
jproduct.setText(null);
attsetid = null;
attsetinstid = null;
attsetinstdesc = null;
jattributes.setText(null);
m_jcodebar.setText(null);
m_junits.setText(null);
m_jprice.setText(null);
m_jdate.setEnabled(true);
m_jbtndate.setEnabled(true);
m_jreason.setEnabled(true);
m_jreference.setEnabled(true);
m_jEnter1.setEnabled(true);
m_jcodebar.setEnabled(true);
m_jEnter.setEnabled(true);
m_jLocation.setEnabled(true);
m_jSupplier.setEnabled(true);
jproduct.setEnabled(true);
jEditProduct.setEnabled(true);
jattributes.setEnabled(true);
jEditAttributes.setEnabled(true);
m_junits.setEnabled(true);
m_jprice.setEnabled(true);
m_cat.setComponentEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] diary = (Object[]) value;
m_sID = (String) diary[0];
m_jdate.setText(Formats.TIMESTAMP.formatValue(diary[1]));
m_ReasonModel.setSelectedKey(diary[2]);
m_LocationsModel.setSelectedKey(diary[3]);
productid = (String) diary[4];
attsetinstid = (String) diary[5];
m_junits.setText(Formats.DOUBLE.formatValue(signum((Double) diary[6], (Integer) diary[2])));
m_jprice.setText(Formats.CURRENCY.formatValue(diary[7]));
productref = (String) diary[8];
productcode = (String) diary[9];
productname =(String) diary[10];
attsetid = (String) diary[11];
attsetinstdesc = (String) diary[12];
m_SuppliersModel.setSelectedKey(diary[13]);
m_jreference.setText(productref);
m_jcodebar.setText(productcode);
jproduct.setText(productname);
jattributes.setText(attsetinstdesc);
m_jdate.setEnabled(false);
m_jbtndate.setEnabled(false);
m_jreason.setEnabled(false);
m_jreference.setEnabled(false);
m_jEnter1.setEnabled(false);
m_jcodebar.setEnabled(false);
m_jEnter.setEnabled(false);
m_jLocation.setEnabled(false);
m_jLocationDes.setEnabled(false);
m_jSupplier.setEnabled(false);
jproduct.setEnabled(false);
jEditProduct.setEnabled(false);
jattributes.setEnabled(false);
jEditAttributes.setEnabled(false);
m_junits.setEnabled(false);
m_jprice.setEnabled(false);
m_cat.setComponentEnabled(false);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] diary = (Object[]) value;
m_sID = (String) diary[0];
m_jdate.setText(Formats.TIMESTAMP.formatValue(diary[1]));
m_ReasonModel.setSelectedKey(diary[2]);
m_LocationsModel.setSelectedKey(diary[3]);
productid = (String) diary[4];
attsetinstid = (String) diary[5];
m_junits.setText(Formats.DOUBLE.formatValue(signum((Double) diary[6], (Integer) diary[2])));
m_jprice.setText(Formats.CURRENCY.formatValue(diary[7]));
sAppUser = (String) diary[8];
productref = (String) diary[9];
productcode = (String) diary[10];
productname =(String) diary[11];
attsetid = (String) diary[12];
attsetinstdesc = (String) diary[13];
m_SuppliersModel.setSelectedKey(diary[14]);
m_jreference.setText(productref);
m_jcodebar.setText(productcode);
jproduct.setText(productname);
jattributes.setText(attsetinstdesc);
m_jdate.setEnabled(false);
m_jbtndate.setEnabled(false);
m_jreason.setEnabled(false);
m_jreference.setEnabled(false);
m_jEnter1.setEnabled(false);
m_jcodebar.setEnabled(false);
m_jEnter.setEnabled(false);
m_jLocation.setEnabled(false);
m_jLocationDes.setEnabled(false);
m_jSupplier.setEnabled(false);
jproduct.setEnabled(true);
jEditProduct.setEnabled(true);
jattributes.setEnabled(false);
jEditAttributes.setEnabled(false);
m_junits.setEnabled(false);
m_jprice.setEnabled(false);
m_cat.setComponentEnabled(false);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
return new Object[] {
m_sID,
Formats.TIMESTAMP.parseValue(m_jdate.getText()),
m_ReasonModel.getSelectedKey(),
m_LocationsModel.getSelectedKey(),
productid,
attsetinstid,
samesignum((Double) Formats.DOUBLE.parseValue(m_junits.getText()), (Integer) m_ReasonModel.getSelectedKey()),
Formats.CURRENCY.parseValue(m_jprice.getText()),
m_App.getAppUserView().getUser().getName(),
productref,
productcode,
productname,
attsetid,
attsetinstdesc,
// m_SuppliersModel.getSelectedKey()
};
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
// private ProductInfoExt getProduct(String id) {
// try {
// return m_dlSales.getProductInfo(id);
// } catch (BasicException e) {
// return null;
// }
// }
private Double signum(Double d, Integer i) {
if (d == null || i == null) {
return d;
} else if (i < 0) {
return -d;
} else {
return d;
}
}
private Double samesignum(Double d, Integer i) {
if (d == null || i == null) {
return d;
} else if ((i > 0 && d < 0.0) ||
(i < 0 && d > 0.0)) {
return -d;
} else {
return d;
}
}
private void assignProduct(ProductInfoExt prod) {
if (jproduct.isEnabled()) {
if (prod == null) {
productid = null;
productref = null;
productcode = null;
productname = null;
attsetid = null;
attsetinstid = null;
attsetinstdesc = null;
jproduct.setText(null);
m_jcodebar.setText(null);
m_jreference.setText(null);
jattributes.setText(null);
// m_jSupplier = null;
} else {
productid = prod.getID();
productref = prod.getReference();
productcode = prod.getCode();
productname = prod.toString();
attsetid = prod.getAttributeSetID();
attsetinstid = null;
attsetinstdesc = null;
jproduct.setText(productname);
m_jcodebar.setText(productcode);
m_jreference.setText(productref);
jattributes.setText(null);
// calculo el precio sugerido para la entrada.
MovementReason reason = (MovementReason) m_ReasonModel.getSelectedItem();
Double dPrice = reason.getPrice(prod.getPriceBuy(), prod.getPriceSell());
m_jprice.setText(Formats.CURRENCY.formatValue(dPrice));
}
}
}
private void assignProductByCode() {
try {
ProductInfoExt oProduct = m_dlSales.getProductInfoByCode(m_jcodebar.getText());
if (oProduct == null) {
assignProduct(null);
Toolkit.getDefaultToolkit().beep();
} else {
assignProduct(oProduct);
}
} catch (BasicException eData) {
assignProduct(null);
MessageInf msg = new MessageInf(eData);
msg.show(this);
}
}
private void assignProductByReference() {
try {
ProductInfoExt oProduct = m_dlSales.getProductInfoByReference(m_jreference.getText());
if (oProduct == null) {
assignProduct(null);
Toolkit.getDefaultToolkit().beep();
} else {
assignProduct(oProduct);
}
} catch (BasicException eData) {
assignProduct(null);
MessageInf msg = new MessageInf(eData);
msg.show(this);
}
}
private class CatalogListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
assignProduct((ProductInfoExt) e.getSource());
}
}
/** 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() {
jPanel1 = new javax.swing.JPanel();
jLblDate = new javax.swing.JLabel();
m_jdate = new javax.swing.JTextField();
m_jbtndate = new javax.swing.JButton();
jLblReason = new javax.swing.JLabel();
m_jreason = new javax.swing.JComboBox();
jLblName = new javax.swing.JLabel();
jproduct = new javax.swing.JTextField();
jEditProduct = new javax.swing.JButton();
jLblLocation = new javax.swing.JLabel();
m_jLocation = new javax.swing.JComboBox();
jLBCode = new javax.swing.JLabel();
m_jcodebar = new javax.swing.JTextField();
m_jEnter = new javax.swing.JButton();
jLblRef = new javax.swing.JLabel();
m_jreference = new javax.swing.JTextField();
m_jEnter1 = new javax.swing.JButton();
jLblAtt = new javax.swing.JLabel();
jattributes = new javax.swing.JTextField();
jEditAttributes = new javax.swing.JButton();
jLblUnits = new javax.swing.JLabel();
m_junits = new javax.swing.JTextField();
jLblPrice = new javax.swing.JLabel();
m_jprice = new javax.swing.JTextField();
catcontainer = new javax.swing.JPanel();
m_jLocationDes = new javax.swing.JComboBox();
jLblMoveTo = new javax.swing.JLabel();
m_jSupplier = new javax.swing.JComboBox();
jLblLocation1 = new javax.swing.JLabel();
setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
setMinimumSize(new java.awt.Dimension(550, 250));
setPreferredSize(new java.awt.Dimension(1000, 550));
setLayout(new java.awt.BorderLayout());
jPanel1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jPanel1.setMaximumSize(new java.awt.Dimension(2147483647, 2147483647));
jPanel1.setMinimumSize(new java.awt.Dimension(780, 260));
jPanel1.setPreferredSize(new java.awt.Dimension(400, 600));
jLblDate.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblDate.setText(AppLocal.getIntString("label.stockdate")); // NOI18N
jLblDate.setMaximumSize(new java.awt.Dimension(23, 20));
jLblDate.setMinimumSize(new java.awt.Dimension(23, 20));
jLblDate.setPreferredSize(new java.awt.Dimension(110, 30));
m_jdate.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jdate.setMinimumSize(new java.awt.Dimension(40, 20));
m_jdate.setPreferredSize(new java.awt.Dimension(170, 30));
m_jbtndate.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/date.png"))); // NOI18N
m_jbtndate.setToolTipText("Open Calendar");
m_jbtndate.setPreferredSize(new java.awt.Dimension(64, 45));
m_jbtndate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jbtndateActionPerformed(evt);
}
});
jLblReason.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblReason.setText(AppLocal.getIntString("label.stockreason")); // NOI18N
jLblReason.setMaximumSize(new java.awt.Dimension(36, 20));
jLblReason.setMinimumSize(new java.awt.Dimension(36, 20));
jLblReason.setPreferredSize(new java.awt.Dimension(110, 30));
m_jreason.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jreason.setPreferredSize(new java.awt.Dimension(170, 30));
m_jreason.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jreasonActionPerformed(evt);
}
});
jLblName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblName.setText(AppLocal.getIntString("label.prodname")); // NOI18N
jLblName.setMaximumSize(new java.awt.Dimension(40, 20));
jLblName.setMinimumSize(new java.awt.Dimension(40, 20));
jLblName.setPreferredSize(new java.awt.Dimension(110, 30));
jproduct.setEditable(false);
jproduct.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jproduct.setText(" ");
jproduct.setPreferredSize(new java.awt.Dimension(170, 30));
jproduct.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jproductActionPerformed(evt);
}
});
jEditProduct.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/search24.png"))); // NOI18N
jEditProduct.setToolTipText("Search Product List");
jEditProduct.setPreferredSize(new java.awt.Dimension(64, 45));
jEditProduct.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jEditProductActionPerformed(evt);
}
});
jLblLocation.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblLocation.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jLblLocation.setText("Location");
jLblLocation.setPreferredSize(new java.awt.Dimension(110, 30));
m_jLocation.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jLocation.setPreferredSize(new java.awt.Dimension(170, 30));
jLBCode.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLBCode.setText(AppLocal.getIntString("label.prodbarcode")); // NOI18N
jLBCode.setMaximumSize(new java.awt.Dimension(40, 20));
jLBCode.setMinimumSize(new java.awt.Dimension(40, 20));
jLBCode.setPreferredSize(new java.awt.Dimension(110, 30));
m_jcodebar.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jcodebar.setPreferredSize(new java.awt.Dimension(170, 30));
m_jcodebar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jcodebarActionPerformed(evt);
}
});
m_jEnter.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/barcode.png"))); // NOI18N
m_jEnter.setToolTipText("Get Barcode");
m_jEnter.setFocusPainted(false);
m_jEnter.setFocusable(false);
m_jEnter.setMaximumSize(new java.awt.Dimension(54, 33));
m_jEnter.setMinimumSize(new java.awt.Dimension(54, 33));
m_jEnter.setPreferredSize(new java.awt.Dimension(64, 45));
m_jEnter.setRequestFocusEnabled(false);
m_jEnter.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jEnterActionPerformed(evt);
}
});
jLblRef.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblRef.setText(AppLocal.getIntString("label.prodref")); // NOI18N
jLblRef.setMaximumSize(new java.awt.Dimension(40, 20));
jLblRef.setMinimumSize(new java.awt.Dimension(40, 20));
jLblRef.setPreferredSize(new java.awt.Dimension(110, 30));
m_jreference.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jreference.setPreferredSize(new java.awt.Dimension(170, 30));
m_jreference.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jreferenceActionPerformed(evt);
}
});
m_jEnter1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/products.png"))); // NOI18N
m_jEnter1.setToolTipText("Enter Product ID");
m_jEnter1.setFocusPainted(false);
m_jEnter1.setFocusable(false);
m_jEnter1.setMaximumSize(new java.awt.Dimension(64, 33));
m_jEnter1.setMinimumSize(new java.awt.Dimension(64, 33));
m_jEnter1.setPreferredSize(new java.awt.Dimension(64, 45));
m_jEnter1.setRequestFocusEnabled(false);
m_jEnter1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jEnter1ActionPerformed(evt);
}
});
jLblAtt.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblAtt.setText(AppLocal.getIntString("label.attributes")); // NOI18N
jLblAtt.setMaximumSize(new java.awt.Dimension(48, 20));
jLblAtt.setMinimumSize(new java.awt.Dimension(48, 20));
jLblAtt.setPreferredSize(new java.awt.Dimension(110, 30));
jattributes.setEditable(false);
jattributes.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jattributes.setPreferredSize(new java.awt.Dimension(170, 30));
jattributes.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jattributesActionPerformed(evt);
}
});
jEditAttributes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/attributes.png"))); // NOI18N
jEditAttributes.setToolTipText("Product Attributes");
jEditAttributes.setMaximumSize(new java.awt.Dimension(65, 33));
jEditAttributes.setMinimumSize(new java.awt.Dimension(65, 33));
jEditAttributes.setPreferredSize(new java.awt.Dimension(64, 45));
jEditAttributes.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jEditAttributesActionPerformed(evt);
}
});
jLblUnits.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblUnits.setText(AppLocal.getIntString("label.units")); // NOI18N
jLblUnits.setMaximumSize(new java.awt.Dimension(40, 20));
jLblUnits.setMinimumSize(new java.awt.Dimension(40, 20));
jLblUnits.setPreferredSize(new java.awt.Dimension(110, 30));
m_junits.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_junits.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
m_junits.setPreferredSize(new java.awt.Dimension(100, 30));
jLblPrice.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblPrice.setText(AppLocal.getIntString("label.price")); // NOI18N
jLblPrice.setPreferredSize(new java.awt.Dimension(110, 30));
m_jprice.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jprice.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
m_jprice.setPreferredSize(new java.awt.Dimension(170, 30));
catcontainer.setBackground(new java.awt.Color(255, 255, 255));
catcontainer.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
catcontainer.setMaximumSize(new java.awt.Dimension(2147483647, 2147483647));
catcontainer.setMinimumSize(new java.awt.Dimension(0, 250));
catcontainer.setPreferredSize(new java.awt.Dimension(600, 0));
catcontainer.setLayout(new java.awt.BorderLayout());
m_jLocationDes.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jLocationDes.setEnabled(false);
m_jLocationDes.setPreferredSize(new java.awt.Dimension(170, 30));
m_jLocationDes.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
m_jLocationDesActionPerformed(evt);
}
});
jLblMoveTo.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblMoveTo.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("pos_messages"); // NOI18N
jLblMoveTo.setText(bundle.getString("label.moveto")); // NOI18N
jLblMoveTo.setEnabled(false);
jLblMoveTo.setPreferredSize(new java.awt.Dimension(110, 30));
m_jSupplier.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jSupplier.setPreferredSize(new java.awt.Dimension(170, 30));
jLblLocation1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLblLocation1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jLblLocation1.setText(AppLocal.getIntString("button.exit")); // NOI18N
jLblLocation1.setPreferredSize(new java.awt.Dimension(110, 30));
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(jLblDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 110, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(m_jdate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(m_jbtndate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jLblReason, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jPanel1Layout.createSequentialGroup()
.add(jLblLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(m_jreason, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(m_jLocation, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(jLblMoveTo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jPanel1Layout.createSequentialGroup()
.add(jLblLocation1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(m_jLocationDes, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(m_jSupplier, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(jPanel1Layout.createSequentialGroup()
.add(jLblAtt, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jattributes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jEditAttributes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jPanel1Layout.createSequentialGroup()
.add(jLBCode, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(m_jcodebar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(m_jEnter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jPanel1Layout.createSequentialGroup()
.add(jLblUnits, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(m_junits, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jPanel1Layout.createSequentialGroup()
.add(jLblPrice, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(m_jprice, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jPanel1Layout.createSequentialGroup()
.add(jLblRef, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(m_jreference, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jPanel1Layout.createSequentialGroup()
.add(114, 114, 114)
.add(jproduct, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(m_jEnter1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jEditProduct, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(catcontainer, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 612, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(m_jdate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLblDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(m_jbtndate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(m_jreason, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLblReason, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(m_jLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLblLocation, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLblMoveTo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(m_jLocationDes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(m_jSupplier, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLblLocation1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLblName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jproduct, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jEditProduct, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(m_jreference, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLblRef, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(m_jEnter1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jattributes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLblAtt, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(jEditAttributes, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(m_jEnter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jPanel1Layout.createSequentialGroup()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(m_jcodebar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(jLBCode, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(18, 18, 18)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLblUnits, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(m_junits, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(18, 18, 18)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLblPrice, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(m_jprice, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
.add(0, 47, Short.MAX_VALUE))
.add(catcontainer, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(48, Short.MAX_VALUE))
);
catcontainer.getAccessibleContext().setAccessibleParent(jPanel1);
add(jPanel1, java.awt.BorderLayout.PAGE_START);
}// </editor-fold>//GEN-END:initComponents
private void m_jEnter1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEnter1ActionPerformed
assignProductByReference();
}//GEN-LAST:event_m_jEnter1ActionPerformed
private void m_jreferenceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jreferenceActionPerformed
assignProductByReference();
}//GEN-LAST:event_m_jreferenceActionPerformed
private void m_jcodebarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jcodebarActionPerformed
assignProductByCode();
}//GEN-LAST:event_m_jcodebarActionPerformed
private void m_jEnterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEnterActionPerformed
assignProductByCode();
}//GEN-LAST:event_m_jEnterActionPerformed
private void jEditAttributesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEditAttributesActionPerformed
if (productid == null) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.productnotselected"));
msg.show(this);
} else {
try {
JProductAttEdit attedit = JProductAttEdit.getAttributesEditor(this, m_App.getSession());
attedit.editAttributes(attsetid, attsetinstid);
attedit.setVisible(true);
if (attedit.isOK()) {
attsetinstid = attedit.getAttributeSetInst();
attsetinstdesc = attedit.getAttributeSetInstDescription();
jattributes.setText(attsetinstdesc);
}
} catch (BasicException ex) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindattributes"), ex);
msg.show(this);
}
}
}//GEN-LAST:event_jEditAttributesActionPerformed
private void m_jbtndateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jbtndateActionPerformed
Date date;
try {
date = (Date) Formats.TIMESTAMP.parseValue(m_jdate.getText());
} catch (BasicException e) {
date = null;
}
date = JCalendarDialog.showCalendarTime(this, date);
if (date != null) {
m_jdate.setText(Formats.TIMESTAMP.formatValue(date));
}
}//GEN-LAST:event_m_jbtndateActionPerformed
private void jEditProductActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEditProductActionPerformed
assignProduct(JProductFinder.showMessage(this, m_dlSales));
}//GEN-LAST:event_jEditProductActionPerformed
private void jattributesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jattributesActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jattributesActionPerformed
private void m_jLocationDesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jLocationDesActionPerformed
}//GEN-LAST:event_m_jLocationDesActionPerformed
private void jproductActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jproductActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jproductActionPerformed
private void m_jreasonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jreasonActionPerformed
/*
* JG May 2017 for FUTURE - moved out of StockManagement
* for time being just let's show a message
if (m_ReasonModel.getSelectedItem() == MovementReason.OUT_CROSSING) {
m_jLocationDes.setEnabled(true);
jLblMoveTo.setEnabled(true);
}else{
m_jLocationDes.setEnabled(false);
jLblMoveTo.setEnabled(false);
}
*/
if (m_ReasonModel.getSelectedItem() == MovementReason.OUT_CROSSING) {
JOptionPane.showMessageDialog(this, "Transfer option in development. Please us (In) + (Out) Movement options");
}
}//GEN-LAST:event_m_jreasonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel catcontainer;
private javax.swing.JButton jEditAttributes;
private javax.swing.JButton jEditProduct;
private javax.swing.JLabel jLBCode;
private javax.swing.JLabel jLblAtt;
private javax.swing.JLabel jLblDate;
private javax.swing.JLabel jLblLocation;
private javax.swing.JLabel jLblLocation1;
private javax.swing.JLabel jLblMoveTo;
private javax.swing.JLabel jLblName;
private javax.swing.JLabel jLblPrice;
private javax.swing.JLabel jLblReason;
private javax.swing.JLabel jLblRef;
private javax.swing.JLabel jLblUnits;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jattributes;
private javax.swing.JTextField jproduct;
private javax.swing.JButton m_jEnter;
private javax.swing.JButton m_jEnter1;
private javax.swing.JComboBox m_jLocation;
private javax.swing.JComboBox m_jLocationDes;
private javax.swing.JComboBox m_jSupplier;
private javax.swing.JButton m_jbtndate;
private javax.swing.JTextField m_jcodebar;
private javax.swing.JTextField m_jdate;
private javax.swing.JTextField m_jprice;
private javax.swing.JComboBox m_jreason;
private javax.swing.JTextField m_jreference;
private javax.swing.JTextField m_junits;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,104 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProvider;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
//import com.unicenta.pos.suppliers.DataLogicSuppliers;
import com.unicenta.pos.panels.JPanelTable;
import com.unicenta.pos.suppliers.DataLogicSuppliers;
/**
*
* @author adrianromero
*/
public class StockDiaryPanel extends JPanelTable {
private StockDiaryEditor jeditor;
private DataLogicSales m_dlSales;
// private DataLogicSuppliers m_dlSuppliers;
/** Creates a new instance of JPanelDiaryEditor */
public StockDiaryPanel() {
}
/**
*
*/
@Override
protected void init() {
m_dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
// DataLogicSuppliers m_dlSuppliers = (DataLogicSuppliers) app.getBean("com.unicenta.pos.suppliers.DataLogicSuppliers");
jeditor = new StockDiaryEditor(app, dirty);
}
/**
*
* @return
*/
@Override
public ListProvider getListProvider() {
return null;
}
/**
*
* @return
*/
@Override
public SaveProvider getSaveProvider() {
return new SaveProvider(null
, m_dlSales.getStockDiaryInsert()
, m_dlSales.getStockDiaryDelete());
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.StockDiary");
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
jeditor.activate(); // primero activo el editor
super.activate(); // segundo activo el padre
}
}
@@ -0,0 +1,828 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.5" 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="12" style="0"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[550, 250]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[1000, 350]"/>
</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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,50,0,0,3,-24"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel8">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[1020, 320]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="First"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="false"/>
</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.stockdate" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="5" y="5" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="m_jdate">
<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="[160, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="90" y="5" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="m_jbtndate">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/date.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Open Calendar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jbtndateActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="50" y="5" width="40" height="30"/>
</Constraint>
</Constraints>
</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.stockreason" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="5" y="40" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="m_jreason">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="maximumRowCount" type="int" value="13"/>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[160, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jreasonActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="90" y="40" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<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.locationplace" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="5" y="75" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="m_jLocation">
<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="[160, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jLocationActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="90" y="75" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="m_jLocationDes">
<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="[160, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="90" y="110" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<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.supplier" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="5" y="145" width="-1" height="-1"/>
</Constraint>
</Constraints>
</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="[160, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jSupplierActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="90" y="145" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<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.supplierdocment" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="" replaceFormat="AppLocal.getIntString(&quot;button.exit&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[40, 25]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="5" y="180" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="m_jSupplierDoc">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="tooltip.supplierdocument" replaceFormat="AppLocal.getIntString(&quot;button.exit&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[160, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="90" y="180" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JPanel" name="jPanel5">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder>
<Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/>
</LineBorder>
</Border>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[455, 245]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="250" y="5" width="-1" height="190"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
<Component class="javax.swing.JLabel" name="m_jcodebar">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="1"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ed" green="c5" red="4c" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="4"/>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.CompoundBorderInfo">
<CompoundBorder>
<Border PropertyName="outside" info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder/>
</Border>
<Border PropertyName="inside" info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder/>
</Border>
</CompoundBorder>
</Border>
</Property>
<Property name="opaque" type="boolean" value="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[130, 25]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="m_jcodebarMouseClicked"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="780" y="270" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="m_jEnter">
<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/barcode.png"/>
</Property>
<Property name="focusPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[54, 45]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEnterActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="920" y="260" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="jTextField1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ee" green="ee" id="Panel.background" palette="3" red="ee" type="palette"/>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="caretColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ee" green="ee" id="Panel.background" palette="3" red="ee" type="palette"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[1, 1]"/>
</Property>
</Properties>
<Events>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jTextField1KeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="1" y="1" width="-1" height="0"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
<EmptyBorder bottom="0" left="5" right="5" top="0"/>
</Border>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[70, 250]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="705" y="0" width="-1" height="-1"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
<Property name="columns" type="int" value="1"/>
<Property name="horizontalGap" type="int" value="5"/>
<Property name="rows" type="int" value="0"/>
<Property name="verticalGap" type="int" value="5"/>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="m_jDelete">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/editdelete.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="tooltip.saleremoveline" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="focusPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[8, 14, 8, 14]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[42, 36]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[42, 36]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 45]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jDeleteActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jList">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/search32.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="tooltip.saleproductfind" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="focusPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[8, 14, 8, 14]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[42, 36]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[42, 36]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 45]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jListActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jEditLine">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/sale_editline.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="tooltip.saleeditline" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="focusPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[8, 14, 8, 14]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[42, 36]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[42, 36]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 45]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEditLineActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jEditAttributes">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/attributes.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="tooltip.saleattributes" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="focusPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[8, 14, 8, 14]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[42, 36]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[42, 36]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 45]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jEditAttributesActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="m_jBtnDelete">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/sale_delete.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="button.deleteticket" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Delete current Ticket"/>
<Property name="focusPainted" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
<Insets value="[0, 4, 0, 4]"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 40]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[50, 40]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[80, 45]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jBtnDeleteActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[150, 250]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 250]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="760" y="0" width="230" height="260"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="230" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="10" max="32767" attributes="0"/>
<Component id="jNumberKeys" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="10" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="260" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jNumberKeys" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="com.unicenta.beans.JNumberKeys" name="jNumberKeys">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[210, 240]"/>
</Property>
</Properties>
<Events>
<EventHandler event="keyPerformed" listener="com.unicenta.beans.JNumberEventListener" parameters="com.unicenta.beans.JNumberEvent" handler="jNumberKeysKeyPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="5" y="220" width="650" height="70"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="com.alee.laf.table.WebTable" name="jTableProductStock">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="6" rowCount="8">
<Column editable="true" title="Location" type="java.lang.Object"/>
<Column editable="true" title="Current" type="java.lang.Object"/>
<Column editable="true" title="Maximum" type="java.lang.Object"/>
<Column editable="true" title="Minimum" type="java.lang.Object"/>
<Column editable="true" title="PriceSell" type="java.lang.Object"/>
<Column editable="true" title="PriceValue" type="java.lang.Object"/>
</Table>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0">
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
<Title/>
<Editor/>
<Renderer/>
</Column>
</TableColumnModel>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="rowHeight" type="int" value="25"/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="m_jBtnShowStock">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/pay.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="tooltip.salecheckstock" replaceFormat="AppLocal.getIntString(&quot;tooltip.salecheckstock&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="m_jBtnShowStockActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="660" y="250" width="40" height="40"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="lblTotalQtyValue">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="horizontalTextPosition" type="int" value="2"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="118" y="290" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="lbTotalValue">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="14" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="horizontalTextPosition" type="int" value="2"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[100, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="547" y="290" width="-1" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="com.alee.laf.label.WebLabel" name="webLblQty">
<Properties>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.stock.quantity" replaceFormat="AppLocal.getIntString(&quot;label.stock.quantity&quot;)"/>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="1"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[90, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="5" y="290" width="100" height="-1"/>
</Constraint>
</Constraints>
</Component>
<Component class="com.alee.laf.label.WebLabel" name="webLblValue">
<Properties>
<Property name="horizontalAlignment" type="int" value="4"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.stock.value" replaceFormat="AppLocal.getIntString(&quot;label.stock.value&quot;)"/>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="1"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[180, 30]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="355" y="290" width="170" height="-1"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="catcontainer">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Arial" size="12" style="0"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 250]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 250]"/>
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleParent" type="javax.accessibility.Accessible" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="jPanel8"/>
</Property>
</AccessibilityProperties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
</SubComponents>
</Form>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,73 @@
// 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/>.
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-130
package com.unicenta.pos.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.BrowsableData;
import com.unicenta.format.Formats;
import javax.swing.table.AbstractTableModel;
/**
*
* @author adrianromero
*/
public class StockModel extends AbstractTableModel {
private BrowsableData m_bd;
private Formats[] m_formats;
private boolean[] m_bedit;
/** Creates a new instance of StockModel
* @param bd
* @param f
* @param bedit */
public StockModel(BrowsableData bd, Formats[] f, boolean[] bedit) {
m_bd = bd;
m_formats = f;
m_bedit = bedit;
}
@Override
public int getRowCount() {
return m_bd.getSize();
}
@Override
public int getColumnCount() {
return m_formats.length;
}
@Override
public Object getValueAt(int row, int column) {
return m_formats[column].formatValue(
((Object[]) m_bd.getElementAt(row))[column]);
}
@Override
public boolean isCellEditable(int row, int column) {
return m_bedit[column];
}
@Override
public void setValueAt(Object aValue, int row, int column) {
Object[] record = (Object[]) m_bd.getElementAt(row);
try {
record[column] = m_formats[column].parseValue((String) aValue);
m_bd.updateRecord(row, record);
} catch (BasicException e) {
}
}
}
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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="jLabel2" min="-2" pref="80" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jName" min="-2" pref="200" max="-2" attributes="0"/>
<EmptySpace min="-2" 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="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/info.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.name" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[34, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel2MouseClicked"/>
</Events>
</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="[34, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,197 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import java.awt.Component;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.util.UUID;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
*
* @author JG uniCenta
*/
public final class TaxCategoriesEditor extends JPanel implements EditorRecord {
private Object m_oId;
/** Creates new form taxEditor
* @param dirty */
public TaxCategoriesEditor(DirtyManager dirty) {
initComponents();
m_jName.getDocument().addDocumentListener(dirty);
writeValueEOF();
}
/**
*
*/
@Override
public void writeValueEOF() {
m_oId = null;
m_jName.setText(null);
m_jName.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
m_oId = UUID.randomUUID().toString();
m_jName.setText(null);
m_jName.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] taxcustcat = (Object[]) value;
m_oId = taxcustcat[0];
m_jName.setText(Formats.STRING.formatValue(taxcustcat[1]));
m_jName.setEnabled(false);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] taxcustcat = (Object[]) value;
m_oId = taxcustcat[0];
m_jName.setText(Formats.STRING.formatValue(taxcustcat[1]));
m_jName.setEnabled(true);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] taxcustcat = new Object[2];
taxcustcat[0] = m_oId;
taxcustcat[1] = m_jName.getText();
return taxcustcat;
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
*/
@Override
public void refresh() {
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
m_jName = new javax.swing.JTextField();
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/info.png"))); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.name")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(34, 30));
jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel2MouseClicked(evt);
}
});
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(34, 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(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, 200, 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(jLabel2, 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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseClicked
if (evt.getClickCount() == 2) {
String uuidString = m_oId.toString();
StringSelection stringSelection = new StringSelection(uuidString);
Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
clpbrd.setContents(stringSelection, null);
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.uuidcopy"));
}
}//GEN-LAST:event_jLabel2MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField m_jName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,120 @@
// 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.inventory;
import com.unicenta.data.gui.ListCellRendererBasic;
import com.unicenta.data.loader.ComparatorCreator;
import com.unicenta.data.loader.TableDefinition;
import com.unicenta.data.loader.Vectorer;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProvider;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.panels.JPanelTable;
import javax.swing.ListCellRenderer;
/**
*
* @author adrianromero
*/
public class TaxCategoriesPanel extends JPanelTable {
private TableDefinition ttaxcategories;
private TaxCustCategoriesEditor jeditor;
/** Creates a new instance of JPanelDuty */
public TaxCategoriesPanel() {
}
/**
*
*/
@Override
protected void init() {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
ttaxcategories = dlSales.getTableTaxCategories();
jeditor = new TaxCustCategoriesEditor(dirty);
}
/**
*
* @return
*/
@Override
public ListProvider getListProvider() {
return new ListProviderCreator(ttaxcategories);
}
/**
*
* @return
*/
@Override
public SaveProvider getSaveProvider() {
return new SaveProvider(ttaxcategories);
}
/**
*
* @return
*/
@Override
public Vectorer getVectorer() {
return ttaxcategories.getVectorerBasic(new int[]{1});
}
/**
*
* @return
*/
@Override
public ComparatorCreator getComparatorCreator() {
return ttaxcategories.getComparatorCreator(new int[] {1});
}
/**
*
* @return
*/
@Override
public ListCellRenderer getListCellRenderer() {
return new ListCellRendererBasic(ttaxcategories.getRenderStringBasic(new int[]{1}));
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.TaxCategories");
}
}
@@ -0,0 +1,91 @@
// 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.inventory;
import com.unicenta.data.loader.IKeyed;
import java.io.Serializable;
/**
*
* @author adrianromero
* @version
*/
public class TaxCategoryInfo implements Serializable, IKeyed {
private static final long serialVersionUID = 8959679342805L;
private String m_sID;
private String m_sName;
/**
*
* @param sID
* @param sName
*/
public TaxCategoryInfo(String sID, String sName) {
m_sID = sID;
m_sName = sName;
}
/**
*
* @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;
}
@Override
public String toString(){
return m_sName;
}
}
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<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="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/info.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.name" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel2MouseClicked"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="20" y="20" width="80" height="25"/>
</Constraint>
</Constraints>
</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="12" style="0"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="100" y="20" width="200" height="25"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,182 @@
// 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/>.
/// Foundation, Inc., 51 Franklin Street, Fifth floor, Boston, MA 02110-1301 USA
package com.unicenta.pos.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import java.awt.Component;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.util.UUID;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
*
* @author JG uniCenta
*/
public final class TaxCustCategoriesEditor extends JPanel implements EditorRecord {
private Object m_oId;
/** Creates new form taxEditor
* @param dirty */
public TaxCustCategoriesEditor(DirtyManager dirty) {
initComponents();
m_jName.getDocument().addDocumentListener(dirty);
writeValueEOF();
}
/**
*
*/
@Override
public void writeValueEOF() {
m_oId = null;
m_jName.setText(null);
m_jName.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
m_oId = UUID.randomUUID().toString();
m_jName.setText(null);
m_jName.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] taxcustcat = (Object[]) value;
m_oId = taxcustcat[0];
m_jName.setText(Formats.STRING.formatValue(taxcustcat[1]));
m_jName.setEnabled(false);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] taxcustcat = (Object[]) value;
m_oId = taxcustcat[0];
m_jName.setText(Formats.STRING.formatValue(taxcustcat[1]));
m_jName.setEnabled(true);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] taxcustcat = new Object[2];
taxcustcat[0] = m_oId;
taxcustcat[1] = m_jName.getText();
return taxcustcat;
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/**
*
*/
@Override
public void refresh() {
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
m_jName = new javax.swing.JTextField();
setLayout(null);
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/info.png"))); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.name")); // NOI18N
jLabel2.setToolTipText("");
jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel2MouseClicked(evt);
}
});
add(jLabel2);
jLabel2.setBounds(20, 20, 80, 25);
m_jName.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
add(m_jName);
m_jName.setBounds(100, 20, 200, 25);
}// </editor-fold>//GEN-END:initComponents
private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseClicked
if (evt.getClickCount() == 2) {
String uuidString = m_oId.toString();
StringSelection stringSelection = new StringSelection(uuidString);
Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
clpbrd.setContents(stringSelection, null);
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.uuidcopy"));
}
}//GEN-LAST:event_jLabel2MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField m_jName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,120 @@
// 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.inventory;
import com.unicenta.data.gui.ListCellRendererBasic;
import com.unicenta.data.loader.ComparatorCreator;
import com.unicenta.data.loader.TableDefinition;
import com.unicenta.data.loader.Vectorer;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProvider;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.panels.JPanelTable;
import javax.swing.ListCellRenderer;
/**
*
* @author adrianromero
*/
public class TaxCustCategoriesPanel extends JPanelTable {
private TableDefinition ttaxcategories;
private TaxCustCategoriesEditor jeditor;
/** Creates a new instance of JPanelDuty */
public TaxCustCategoriesPanel() {
}
/**
*
*/
@Override
protected void init() {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
ttaxcategories = dlSales.getTableTaxCustCategories();
jeditor = new TaxCustCategoriesEditor(dirty);
}
/**
*
* @return
*/
@Override
public ListProvider getListProvider() {
return new ListProviderCreator(ttaxcategories);
}
/**
*
* @return
*/
@Override
public SaveProvider getSaveProvider() {
return new SaveProvider(ttaxcategories);
}
/**
*
* @return
*/
@Override
public Vectorer getVectorer() {
return ttaxcategories.getVectorerBasic(new int[]{1});
}
/**
*
* @return
*/
@Override
public ComparatorCreator getComparatorCreator() {
return ttaxcategories.getComparatorCreator(new int[] {1});
}
/**
*
* @return
*/
@Override
public ListCellRenderer getListCellRenderer() {
return new ListCellRendererBasic(ttaxcategories.getRenderStringBasic(new int[]{1}));
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.TaxCustCategories");
}
}
@@ -0,0 +1,88 @@
// 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.inventory;
import com.unicenta.data.loader.IKeyed;
/**
*
* @author adrianromero
* @version
*/
public class TaxCustCategoryInfo implements IKeyed {
private static final long serialVersionUID = 8936482715929L;
private String m_sID;
private String m_sName;
/** Creates new TaxCustCategoryInfo
* @param id
* @param name */
public TaxCustCategoryInfo(String id, String name) {
m_sID = id;
m_sName = name;
}
/**
*
* @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;
}
@Override
public String toString(){
return m_sName;
}
}
@@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jTaxCategory" min="-2" pref="200" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jCustTaxCategory" min="-2" pref="200" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="m_jTaxParent" min="-2" pref="200" max="-2" 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_jRate" min="-2" pref="60" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
<Component id="jCascade" min="-2" pref="110" 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_jName" min="-2" pref="200" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jOrder" min="-2" pref="60" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="50" 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="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" 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_jTaxCategory" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jCustTaxCategory" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="m_jTaxParent" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" 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_jRate" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jCascade" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jOrder" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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="[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="horizontalAlignment" type="int" value="2"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/info.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.name" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 30]"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel2MouseClicked"/>
</Events>
</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.dutyrate" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="m_jRate">
<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="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.taxcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 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.custtaxcategory" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 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.taxparent" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="jCascade">
<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.cascade" 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_jTaxCategory">
<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.JComboBox" name="m_jTaxParent">
<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.JComboBox" name="m_jCustTaxCategory">
<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="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.order" replaceFormat="AppLocal.getIntString(&quot;{key}&quot;)"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[170, 30]"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jOrder">
<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>
</SubComponents>
</Form>
@@ -0,0 +1,428 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ComboBoxValModel;
import com.unicenta.data.gui.MessageInf;
import com.unicenta.data.loader.SentenceList;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSales;
import java.awt.Component;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
*
* @author JG uniCenta
*/
public class TaxEditor extends JPanel implements EditorRecord {
private Object m_oId;
private SentenceList taxcatsent;
private ComboBoxValModel taxcatmodel;
private SentenceList taxcustcatsent;
private ComboBoxValModel taxcustcatmodel;
private SentenceList taxparentsent;
private ComboBoxValModel taxparentmodel;
/** Creates new form taxEditor
* @param app
* @param dirty */
public TaxEditor(AppView app, DirtyManager dirty) {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
initComponents();
taxcatsent = dlSales.getTaxCategoriesList();
taxcatmodel = new ComboBoxValModel();
taxcustcatsent = dlSales.getTaxCustCategoriesList();
taxcustcatmodel = new ComboBoxValModel();
taxparentsent = dlSales.getTaxList();
taxparentmodel = new ComboBoxValModel();
m_jName.getDocument().addDocumentListener(dirty);
m_jTaxCategory.addActionListener(dirty);
m_jCustTaxCategory.addActionListener(dirty);
m_jTaxParent.addActionListener(dirty);
m_jRate.getDocument().addDocumentListener(dirty);
jCascade.addActionListener(dirty);
jOrder.getDocument().addDocumentListener(dirty);
writeValueEOF();
}
/**
*
* @throws BasicException
*/
public void activate() throws BasicException {
List a = taxcatsent.list();
taxcatmodel = new ComboBoxValModel(a);
m_jTaxCategory.setModel(taxcatmodel);
a = taxcustcatsent.list();
a.add(0, null); // The null item
taxcustcatmodel = new ComboBoxValModel(a);
m_jCustTaxCategory.setModel(taxcustcatmodel);
}
/**
*
*/
@Override
public void refresh() {
List a;
try {
a = taxparentsent.list();
} catch (BasicException eD) {
MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotloadlists"), eD);
msg.show(this);
a = new ArrayList();
}
a.add(0, null); // The null item
taxparentmodel = new ComboBoxValModel(a);
m_jTaxParent.setModel(taxparentmodel);
}
/**
*
*/
@Override
public void writeValueEOF() {
m_oId = null;
m_jName.setText(null);
taxcatmodel.setSelectedKey(null);
taxcustcatmodel.setSelectedKey(null);
taxparentmodel.setSelectedKey(null);
m_jRate.setText(null);
jCascade.setSelected(false);
jOrder.setText(null);
m_jName.setEnabled(false);
m_jTaxCategory.setEnabled(false);
m_jCustTaxCategory.setEnabled(false);
m_jTaxParent.setEnabled(false);
m_jRate.setEnabled(false);
jCascade.setEnabled(false);
jOrder.setEnabled(false);
}
/**
*
*/
@Override
public void writeValueInsert() {
m_oId = UUID.randomUUID().toString();
m_jName.setText(null);
taxcatmodel.setSelectedKey(null);
taxcustcatmodel.setSelectedKey(null);
taxparentmodel.setSelectedKey(null);
m_jRate.setText(null);
jCascade.setSelected(false);
jOrder.setText(null);
m_jName.setEnabled(true);
m_jTaxCategory.setEnabled(true);
m_jCustTaxCategory.setEnabled(true);
m_jTaxParent.setEnabled(true);
m_jRate.setEnabled(true);
jCascade.setEnabled(true);
jOrder.setEnabled(true);
}
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] tax = (Object[]) value;
m_oId = tax[0];
m_jName.setText(Formats.STRING.formatValue(tax[1]));
taxcatmodel.setSelectedKey(tax[2]);
taxcustcatmodel.setSelectedKey(tax[3]);
taxparentmodel.setSelectedKey(tax[4]);
m_jRate.setText(Formats.PERCENT.formatValue(tax[5]));
jCascade.setSelected((Boolean) tax[6]);
jOrder.setText(Formats.INT.formatValue(tax[7]));
m_jName.setEnabled(false);
m_jTaxCategory.setEnabled(false);
m_jCustTaxCategory.setEnabled(false);
m_jTaxParent.setEnabled(false);
m_jRate.setEnabled(false);
jCascade.setEnabled(false);
jOrder.setEnabled(false);
}
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] tax = (Object[]) value;
m_oId = tax[0];
m_jName.setText(Formats.STRING.formatValue(tax[1]));
taxcatmodel.setSelectedKey(tax[2]);
taxcustcatmodel.setSelectedKey(tax[3]);
taxparentmodel.setSelectedKey(tax[4]);
m_jRate.setText(Formats.PERCENT.formatValue(tax[5]));
jCascade.setSelected((Boolean) tax[6]);
jOrder.setText(Formats.INT.formatValue(tax[7]));
m_jName.setEnabled(true);
m_jTaxCategory.setEnabled(true);
m_jCustTaxCategory.setEnabled(true);
m_jTaxParent.setEnabled(true);
m_jRate.setEnabled(true);
jCascade.setEnabled(true);
jOrder.setEnabled(true);
}
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] tax = new Object[8];
tax[0] = m_oId;
tax[1] = m_jName.getText();
tax[2] = taxcatmodel.getSelectedKey();
tax[3] = taxcustcatmodel.getSelectedKey();
tax[4] = taxparentmodel.getSelectedKey();
tax[5] = Formats.PERCENT.parseValue(m_jRate.getText());
tax[6] = Boolean.valueOf(jCascade.isSelected());
tax[7] = Formats.INT.parseValue(jOrder.getText());
return tax;
}
/**
*
* @return
*/
@Override
public Component getComponent() {
return this;
}
/** 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_jName = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
m_jRate = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jCascade = new javax.swing.JCheckBox();
m_jTaxCategory = new javax.swing.JComboBox();
m_jTaxParent = new javax.swing.JComboBox();
m_jCustTaxCategory = new javax.swing.JComboBox();
jLabel6 = new javax.swing.JLabel();
jOrder = new javax.swing.JTextField();
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/info.png"))); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.name")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(170, 30));
jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel2MouseClicked(evt);
}
});
jLabel3.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel3.setText(AppLocal.getIntString("label.dutyrate")); // NOI18N
jLabel3.setPreferredSize(new java.awt.Dimension(170, 30));
m_jRate.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jRate.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel1.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel1.setText(AppLocal.getIntString("label.taxcategory")); // NOI18N
jLabel1.setPreferredSize(new java.awt.Dimension(170, 30));
jLabel4.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel4.setText(AppLocal.getIntString("label.custtaxcategory")); // NOI18N
jLabel4.setPreferredSize(new java.awt.Dimension(170, 30));
jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel5.setText(AppLocal.getIntString("label.taxparent")); // NOI18N
jLabel5.setPreferredSize(new java.awt.Dimension(170, 30));
jCascade.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jCascade.setText(AppLocal.getIntString("label.cascade")); // NOI18N
jCascade.setPreferredSize(new java.awt.Dimension(0, 30));
m_jTaxCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jTaxCategory.setPreferredSize(new java.awt.Dimension(0, 30));
m_jTaxParent.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jTaxParent.setPreferredSize(new java.awt.Dimension(0, 30));
m_jCustTaxCategory.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jCustTaxCategory.setPreferredSize(new java.awt.Dimension(0, 30));
jLabel6.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel6.setText(AppLocal.getIntString("label.order")); // NOI18N
jLabel6.setPreferredSize(new java.awt.Dimension(170, 30));
jOrder.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jOrder.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(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(m_jTaxCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
.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_jCustTaxCategory, javax.swing.GroupLayout.PREFERRED_SIZE, 200, 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_jTaxParent, javax.swing.GroupLayout.PREFERRED_SIZE, 200, 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_jRate, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(16, 16, 16)
.addComponent(jCascade, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
.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_jName, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jOrder, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(50, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.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_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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_jTaxCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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_jCustTaxCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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_jTaxParent, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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_jRate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jCascade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.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(jOrder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
);
}// </editor-fold>//GEN-END:initComponents
private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseClicked
if (evt.getClickCount() == 2) {
String uuidString = m_oId.toString();
StringSelection stringSelection = new StringSelection(uuidString);
Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
clpbrd.setContents(stringSelection, null);
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.uuidcopy"));
}
}//GEN-LAST:event_jLabel2MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox jCascade;
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 jOrder;
private javax.swing.JComboBox m_jCustTaxCategory;
private javax.swing.JTextField m_jName;
private javax.swing.JTextField m_jRate;
private javax.swing.JComboBox m_jTaxCategory;
private javax.swing.JComboBox m_jTaxParent;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,132 @@
// 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.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.gui.ListCellRendererBasic;
import com.unicenta.data.loader.ComparatorCreator;
import com.unicenta.data.loader.TableDefinition;
import com.unicenta.data.loader.Vectorer;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProvider;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.panels.JPanelTable;
import javax.swing.ListCellRenderer;
/**
*
* @author adrianromero
*/
public class TaxPanel extends JPanelTable {
private TableDefinition ttaxes;
private TaxEditor jeditor;
/** Creates a new instance of JPanelDuty */
public TaxPanel() {
}
/**
*
*/
@Override
protected void init() {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
ttaxes = dlSales.getTableTaxes();
jeditor = new TaxEditor(app, dirty);
}
/**
*
* @throws BasicException
*/
@Override
public void activate() throws BasicException {
jeditor.activate();
super.activate();
}
/**
*
* @return
*/
@Override
public ListProvider getListProvider() {
return new ListProviderCreator(ttaxes);
}
/**
*
* @return
*/
@Override
public SaveProvider getSaveProvider() {
return new SaveProvider(ttaxes);
}
/**
*
* @return
*/
@Override
public Vectorer getVectorer() {
return ttaxes.getVectorerBasic(new int[]{1, 5, 7});
}
/**
*
* @return
*/
@Override
public ComparatorCreator getComparatorCreator() {
return ttaxes.getComparatorCreator(new int[] {1, 5, 7});
}
/**
*
* @return
*/
@Override
public ListCellRenderer getListCellRenderer() {
return new ListCellRendererBasic(ttaxes.getRenderStringBasic(new int[]{1}));
}
/**
*
* @return
*/
@Override
public EditorRecord getEditor() {
return jeditor;
}
/**
*
* @return
*/
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.Taxes");
}
}
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7" 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="12" style="0"/>
</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 min="-2" pref="36" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="m_jName" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="54" 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 min="-2" pref="25" 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_jName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="35" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<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="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/unicenta/images/info.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="pos_messages.properties" key="label.name" 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>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel2MouseClicked"/>
</Events>
</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="[200, 30]"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,158 @@
package com.unicenta.pos.inventory;
import com.unicenta.basic.BasicException;
import com.unicenta.data.user.DirtyManager;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.format.Formats;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.AppView;
import java.awt.Component;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.util.UUID;
import javax.swing.JOptionPane;
public final class UomEditor extends javax.swing.JPanel implements EditorRecord {
private Object m_id;
/** Creates new form JPanelUnits Of Measure
* @param app
* @param dirty */
public UomEditor(AppView app, DirtyManager dirty) {
initComponents();
m_jName.getDocument().addDocumentListener(dirty);
writeValueEOF();
}
/** 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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
m_jName = new javax.swing.JTextField();
setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
jLabel2.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/unicenta/images/info.png"))); // NOI18N
jLabel2.setText(AppLocal.getIntString("label.name")); // NOI18N
jLabel2.setPreferredSize(new java.awt.Dimension(100, 30));
jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel2MouseClicked(evt);
}
});
m_jName.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
m_jName.setPreferredSize(new java.awt.Dimension(200, 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()
.addGap(36, 36, 36)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(m_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(54, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(25, 25, 25)
.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_jName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(35, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseClicked
if (evt.getClickCount() == 2) {
String uuidString = m_id.toString();
StringSelection stringSelection = new StringSelection(uuidString);
Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
clpbrd.setContents(stringSelection, null);
JOptionPane.showMessageDialog(null,
AppLocal.getIntString("message.uuidcopy"));
}
}//GEN-LAST:event_jLabel2MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField m_jName;
// End of variables declaration//GEN-END:variables
@Override
public void writeValueEOF() {
m_id = null;
m_jName.setText(null);
m_jName.setEnabled(false);
}
@Override
public void writeValueInsert() {
m_id = UUID.randomUUID().toString();
m_jName.setText(null);
m_jName.setEnabled(true);
}
@Override
public void writeValueEdit(Object value) {
Object[] obj = (Object[]) value;
m_id = obj[0];
m_jName.setText(Formats.STRING.formatValue(obj[1]));
m_jName.setEnabled(true);
}
@Override
public void writeValueDelete(Object value) {
Object[] obj = (Object[]) value;
m_id = obj[0];
m_jName.setText(Formats.STRING.formatValue(obj[1]));
m_jName.setEnabled(false);
}
@Override
public void refresh() {
}
@Override
public Component getComponent() {
return this;
}
@Override
public Object createValue() throws BasicException {
Object[] obj = new Object[2];
obj[0] = m_id;
obj[1] = m_jName.getText();
return obj;
}
public boolean isDataValid() {
return true;
}
}
@@ -0,0 +1,59 @@
package com.unicenta.pos.inventory;
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 UomInfo implements IKeyed {
private String m_sID;
private String m_sName;
/** Creates new CategoryInfo
* @param id
* @param name */
public UomInfo(String id, String name) {
m_sID = id;
m_sName = name;
}
public void setID(String sID) {
m_sID = sID;
}
public String getID() {
return m_sID;
}
public String getName() {
return m_sName;
}
public void setName(String sName) {
m_sName = sName;
}
@Override
public Object getKey() {
return m_sID;
}
@Override
public String toString() {
return m_sName;
}
public static SerializerRead getSerializerRead() {
return new SerializerRead() {@Override
public Object readValues(DataRead dr) throws BasicException {
return new UomInfo(dr.getString(1), dr.getString(2));
}};
}
}
@@ -0,0 +1,59 @@
package com.unicenta.pos.inventory;
import com.unicenta.data.gui.ListCellRendererBasic;
import com.unicenta.data.loader.ComparatorCreator;
import com.unicenta.data.loader.TableDefinition;
import com.unicenta.data.loader.Vectorer;
import com.unicenta.data.user.EditorRecord;
import com.unicenta.data.user.ListProvider;
import com.unicenta.data.user.ListProviderCreator;
import com.unicenta.data.user.SaveProvider;
import com.unicenta.pos.forms.AppLocal;
import com.unicenta.pos.forms.DataLogicSales;
import com.unicenta.pos.panels.JPanelTable;
import javax.swing.ListCellRenderer;
public class UomPanel extends JPanelTable {
private TableDefinition tuom;
private UomEditor jeditor;
@Override
protected void init() {
DataLogicSales dlSales = (DataLogicSales) app.getBean("com.unicenta.pos.forms.DataLogicSales");
tuom = dlSales.getTableUom();
jeditor = new UomEditor(app, dirty);
}
@Override
public EditorRecord getEditor() {
return jeditor;
}
@Override
public ListProvider getListProvider() {
return new ListProviderCreator(tuom);
}
@Override
public SaveProvider getSaveProvider() {
return new SaveProvider(tuom);
}
@Override
public Vectorer getVectorer() {
return tuom.getVectorerBasic(new int[]{1});
}
@Override
public ListCellRenderer getListCellRenderer() {
return new ListCellRendererBasic(tuom.getRenderStringBasic(new int[]{1}));
}
@Override
public String getTitle() {
return AppLocal.getIntString("Menu.Uom");
}
}