updated transaction interface
This commit is contained in:
		
							parent
							
								
									4eae82c7e1
								
							
						
					
					
						commit
						95ac6ebee3
					
				
					 2 changed files with 432 additions and 74 deletions
				
			
		|  | @ -1,6 +1,6 @@ | ||||||
| <?xml version="1.0" encoding="UTF-8" ?> | <?xml version="1.0" encoding="UTF-8" ?> | ||||||
| 
 | 
 | ||||||
| <Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> | <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> | ||||||
|   <Properties> |   <Properties> | ||||||
|     <Property name="defaultCloseOperation" type="int" value="0"/> |     <Property name="defaultCloseOperation" type="int" value="0"/> | ||||||
|     <Property name="title" type="java.lang.String" value="POSware Lite: Transaction"/> |     <Property name="title" type="java.lang.String" value="POSware Lite: Transaction"/> | ||||||
|  | @ -39,7 +39,7 @@ | ||||||
| 
 | 
 | ||||||
|       <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> |       <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> | ||||||
|       <SubComponents> |       <SubComponents> | ||||||
|         <Component class="javax.swing.JComboBox" name="jComboBox1"> |         <Component class="javax.swing.JComboBox" name="jComboBox_Payment"> | ||||||
|           <Properties> |           <Properties> | ||||||
|             <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> |             <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> | ||||||
|               <StringArray count="4"> |               <StringArray count="4"> | ||||||
|  | @ -59,10 +59,27 @@ | ||||||
|             </Constraint> |             </Constraint> | ||||||
|           </Constraints> |           </Constraints> | ||||||
|         </Component> |         </Component> | ||||||
|         <Component class="javax.swing.JLabel" name="jLabel1"> |         <Component class="javax.swing.JLabel" name="jLabel_Status"> | ||||||
|           <Properties> |           <Properties> | ||||||
|             <Property name="text" type="java.lang.String" value="jLabel1"/> |             <Property name="horizontalAlignment" type="int" value="0"/> | ||||||
|  |             <Property name="text" type="java.lang.String" value="Store"/> | ||||||
|           </Properties> |           </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> | ||||||
|  |         </Component> | ||||||
|  |         <Component class="javax.swing.JToggleButton" name="jToggleButton_Discard"> | ||||||
|  |           <Properties> | ||||||
|  |             <Property name="text" type="java.lang.String" value="Discard"/> | ||||||
|  |           </Properties> | ||||||
|  |           <Events> | ||||||
|  |             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jToggleButton_DiscardActionPerformed"/> | ||||||
|  |           </Events> | ||||||
|  |           <AuxValues> | ||||||
|  |             <AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="jToggleButton_Discard.setVisible(interface_adjust_clear());"/> | ||||||
|  |           </AuxValues> | ||||||
|           <Constraints> |           <Constraints> | ||||||
|             <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> |             <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> | ||||||
|               <BorderConstraints direction="Before"/> |               <BorderConstraints direction="Before"/> | ||||||
|  | @ -129,7 +146,7 @@ | ||||||
|                   <SubComponents> |                   <SubComponents> | ||||||
|                     <Component class="javax.swing.JLabel" name="jLabel_price_VAT"> |                     <Component class="javax.swing.JLabel" name="jLabel_price_VAT"> | ||||||
|                       <Properties> |                       <Properties> | ||||||
|                         <Property name="text" type="java.lang.String" value="VAT"/> |                         <Property name="text" type="java.lang.String" value="Tax"/> | ||||||
|                       </Properties> |                       </Properties> | ||||||
|                       <Constraints> |                       <Constraints> | ||||||
|                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  | @ -168,6 +185,14 @@ | ||||||
|                       </Constraints> |                       </Constraints> | ||||||
|                     </Component> |                     </Component> | ||||||
|                     <Component class="javax.swing.JSpinner" name="jSpinner_price_tip_value"> |                     <Component class="javax.swing.JSpinner" name="jSpinner_price_tip_value"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> | ||||||
|  |                           <Connection code="model_price" type="code"/> | ||||||
|  |                         </Property> | ||||||
|  |                       </Properties> | ||||||
|  |                       <AuxValues> | ||||||
|  |                         <AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="jSpinner_price_tip_value.addChangeListener(new ChangeListener() {
    public void stateChanged(ChangeEvent e) {
        cart_tip_add();
    }
});"/> | ||||||
|  |                       </AuxValues> | ||||||
|                       <Constraints> |                       <Constraints> | ||||||
|                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|                           <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/> |                           <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/> | ||||||
|  | @ -177,7 +202,7 @@ | ||||||
|                     <Component class="javax.swing.JTextField" name="jTextField_price_VAT_value"> |                     <Component class="javax.swing.JTextField" name="jTextField_price_VAT_value"> | ||||||
|                       <Properties> |                       <Properties> | ||||||
|                         <Property name="editable" type="boolean" value="false"/> |                         <Property name="editable" type="boolean" value="false"/> | ||||||
|                         <Property name="text" type="java.lang.String" value="0"/> |                         <Property name="horizontalAlignment" type="int" value="11"/> | ||||||
|                       </Properties> |                       </Properties> | ||||||
|                       <Constraints> |                       <Constraints> | ||||||
|                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  | @ -188,6 +213,7 @@ | ||||||
|                     <Component class="javax.swing.JTextField" name="jTextField_price_subtotal_value"> |                     <Component class="javax.swing.JTextField" name="jTextField_price_subtotal_value"> | ||||||
|                       <Properties> |                       <Properties> | ||||||
|                         <Property name="editable" type="boolean" value="false"/> |                         <Property name="editable" type="boolean" value="false"/> | ||||||
|  |                         <Property name="horizontalAlignment" type="int" value="11"/> | ||||||
|                         <Property name="text" type="java.lang.String" value="0"/> |                         <Property name="text" type="java.lang.String" value="0"/> | ||||||
|                       </Properties> |                       </Properties> | ||||||
|                       <Constraints> |                       <Constraints> | ||||||
|  | @ -202,8 +228,8 @@ | ||||||
|                         <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> |                         <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> | ||||||
|                           <Font name="Dialog" size="20" style="1"/> |                           <Font name="Dialog" size="20" style="1"/> | ||||||
|                         </Property> |                         </Property> | ||||||
|  |                         <Property name="horizontalAlignment" type="int" value="11"/> | ||||||
|                         <Property name="text" type="java.lang.String" value="0"/> |                         <Property name="text" type="java.lang.String" value="0"/> | ||||||
|                         <Property name="dragEnabled" type="boolean" value="false"/> |  | ||||||
|                       </Properties> |                       </Properties> | ||||||
|                       <Constraints> |                       <Constraints> | ||||||
|                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  | @ -211,26 +237,6 @@ | ||||||
|                         </Constraint> |                         </Constraint> | ||||||
|                       </Constraints> |                       </Constraints> | ||||||
|                     </Component> |                     </Component> | ||||||
|                     <Component class="javax.swing.JComboBox" name="jComboBox_information_discount_selections"> |  | ||||||
|                       <Properties> |  | ||||||
|                         <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> |  | ||||||
|                           <StringArray count="4"> |  | ||||||
|                             <StringItem index="0" value="Item 1"/> |  | ||||||
|                             <StringItem index="1" value="Item 2"/> |  | ||||||
|                             <StringItem index="2" value="Item 3"/> |  | ||||||
|                             <StringItem index="3" value="Item 4"/> |  | ||||||
|                           </StringArray> |  | ||||||
|                         </Property> |  | ||||||
|                       </Properties> |  | ||||||
|                       <AuxValues> |  | ||||||
|                         <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> |  | ||||||
|                       </AuxValues> |  | ||||||
|                       <Constraints> |  | ||||||
|                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |  | ||||||
|                           <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> |  | ||||||
|                         </Constraint> |  | ||||||
|                       </Constraints> |  | ||||||
|                     </Component> |  | ||||||
|                     <Component class="javax.swing.JLabel" name="jLabel2_information_discount"> |                     <Component class="javax.swing.JLabel" name="jLabel2_information_discount"> | ||||||
|                       <Properties> |                       <Properties> | ||||||
|                         <Property name="text" type="java.lang.String" value="Discount"/> |                         <Property name="text" type="java.lang.String" value="Discount"/> | ||||||
|  | @ -241,6 +247,17 @@ | ||||||
|                         </Constraint> |                         </Constraint> | ||||||
|                       </Constraints> |                       </Constraints> | ||||||
|                     </Component> |                     </Component> | ||||||
|  |                     <Component class="javax.swing.JTextField" name="jTextField_price_discounted"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="editable" type="boolean" value="false"/> | ||||||
|  |                         <Property name="horizontalAlignment" type="int" value="11"/> | ||||||
|  |                       </Properties> | ||||||
|  |                       <Constraints> | ||||||
|  |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  |                           <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/> | ||||||
|  |                         </Constraint> | ||||||
|  |                       </Constraints> | ||||||
|  |                     </Component> | ||||||
|                   </SubComponents> |                   </SubComponents> | ||||||
|                 </Container> |                 </Container> | ||||||
|               </SubComponents> |               </SubComponents> | ||||||
|  | @ -259,14 +276,14 @@ | ||||||
| 
 | 
 | ||||||
|           <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> |           <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> | ||||||
|           <SubComponents> |           <SubComponents> | ||||||
|             <Container class="javax.swing.JPanel" name="jPanel2"> |             <Container class="javax.swing.JPanel" name="jPanel_Inventory"> | ||||||
| 
 | 
 | ||||||
|               <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> |               <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/> | ||||||
|               <SubComponents> |               <SubComponents> | ||||||
|                 <Container class="javax.swing.JPanel" name="jPanel_Inventory_Actions"> |                 <Container class="javax.swing.JPanel" name="jPanel_Inventory_Actions"> | ||||||
|                   <Constraints> |                   <Constraints> | ||||||
|                     <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> |                     <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|                       <BorderConstraints direction="South"/> |                       <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/> | ||||||
|                     </Constraint> |                     </Constraint> | ||||||
|                   </Constraints> |                   </Constraints> | ||||||
| 
 | 
 | ||||||
|  | @ -289,6 +306,11 @@ | ||||||
|                       </Constraints> |                       </Constraints> | ||||||
|                     </Component> |                     </Component> | ||||||
|                     <Component class="javax.swing.JSpinner" name="jSpinner_item_quantity"> |                     <Component class="javax.swing.JSpinner" name="jSpinner_item_quantity"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> | ||||||
|  |                           <Connection code="model_counting" type="code"/> | ||||||
|  |                         </Property> | ||||||
|  |                       </Properties> | ||||||
|                       <Constraints> |                       <Constraints> | ||||||
|                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> | ||||||
|                           <BorderConstraints direction="Center"/> |                           <BorderConstraints direction="Center"/> | ||||||
|  | @ -318,8 +340,8 @@ | ||||||
|                     <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> |                     <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> | ||||||
|                   </AuxValues> |                   </AuxValues> | ||||||
|                   <Constraints> |                   <Constraints> | ||||||
|                     <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> |                     <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|                       <BorderConstraints direction="Center"/> |                       <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/> | ||||||
|                     </Constraint> |                     </Constraint> | ||||||
|                   </Constraints> |                   </Constraints> | ||||||
| 
 | 
 | ||||||
|  | @ -327,22 +349,93 @@ | ||||||
|                   <SubComponents> |                   <SubComponents> | ||||||
|                     <Component class="javax.swing.JList" name="jList1_Inventory"> |                     <Component class="javax.swing.JList" name="jList1_Inventory"> | ||||||
|                       <Properties> |                       <Properties> | ||||||
|                         <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor"> |                         <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> | ||||||
|                           <StringArray count="5"> |                           <Connection code="refresh_inventory_list()" type="code"/> | ||||||
|                             <StringItem index="0" value="Item 1"/> |  | ||||||
|                             <StringItem index="1" value="Item 2"/> |  | ||||||
|                             <StringItem index="2" value="Item 3"/> |  | ||||||
|                             <StringItem index="3" value="Item 4"/> |  | ||||||
|                             <StringItem index="4" value="Item 5"/> |  | ||||||
|                           </StringArray> |  | ||||||
|                         </Property> |                         </Property> | ||||||
|                       </Properties> |                       </Properties> | ||||||
|  |                       <Events> | ||||||
|  |                         <EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="jList1_InventoryValueChanged"/> | ||||||
|  |                       </Events> | ||||||
|                       <AuxValues> |                       <AuxValues> | ||||||
|                         <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> |                         <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> | ||||||
|                       </AuxValues> |                       </AuxValues> | ||||||
|                     </Component> |                     </Component> | ||||||
|                   </SubComponents> |                   </SubComponents> | ||||||
|                 </Container> |                 </Container> | ||||||
|  |                 <Container class="javax.swing.JPanel" name="jPanel_ItemDetails"> | ||||||
|  |                   <Constraints> | ||||||
|  |                     <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  |                       <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/> | ||||||
|  |                     </Constraint> | ||||||
|  |                   </Constraints> | ||||||
|  | 
 | ||||||
|  |                   <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/> | ||||||
|  |                   <SubComponents> | ||||||
|  |                     <Component class="javax.swing.JLabel" name="jLabel_ItemDetails_SKU"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="text" type="java.lang.String" value="SKU"/> | ||||||
|  |                       </Properties> | ||||||
|  |                       <Constraints> | ||||||
|  |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  |                           <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> | ||||||
|  |                         </Constraint> | ||||||
|  |                       </Constraints> | ||||||
|  |                     </Component> | ||||||
|  |                     <Component class="javax.swing.JTextField" name="jTextField_ItemDetails_SKU"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="editable" type="boolean" value="false"/> | ||||||
|  |                         <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> | ||||||
|  |                           <Font name="Dialog" size="18" style="0"/> | ||||||
|  |                         </Property> | ||||||
|  |                       </Properties> | ||||||
|  |                       <Constraints> | ||||||
|  |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  |                           <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/> | ||||||
|  |                         </Constraint> | ||||||
|  |                       </Constraints> | ||||||
|  |                     </Component> | ||||||
|  |                     <Component class="javax.swing.JLabel" name="jLabel_ItemDetails_UnitPrice"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="text" type="java.lang.String" value="Unit Price"/> | ||||||
|  |                       </Properties> | ||||||
|  |                       <Constraints> | ||||||
|  |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  |                           <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> | ||||||
|  |                         </Constraint> | ||||||
|  |                       </Constraints> | ||||||
|  |                     </Component> | ||||||
|  |                     <Component class="javax.swing.JTextField" name="jTextField_ItemDetails_UnitPrice"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="editable" type="boolean" value="false"/> | ||||||
|  |                       </Properties> | ||||||
|  |                       <Constraints> | ||||||
|  |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  |                           <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/> | ||||||
|  |                         </Constraint> | ||||||
|  |                       </Constraints> | ||||||
|  |                     </Component> | ||||||
|  |                     <Component class="javax.swing.JLabel" name="jLabel_ItemDetails_Discount"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="text" type="java.lang.String" value="Discount"/> | ||||||
|  |                       </Properties> | ||||||
|  |                       <Constraints> | ||||||
|  |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  |                           <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> | ||||||
|  |                         </Constraint> | ||||||
|  |                       </Constraints> | ||||||
|  |                     </Component> | ||||||
|  |                     <Component class="javax.swing.JTextField" name="jTextField_ItemDetails_Discount"> | ||||||
|  |                       <Properties> | ||||||
|  |                         <Property name="editable" type="boolean" value="false"/> | ||||||
|  |                       </Properties> | ||||||
|  |                       <Constraints> | ||||||
|  |                         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> | ||||||
|  |                           <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/> | ||||||
|  |                         </Constraint> | ||||||
|  |                       </Constraints> | ||||||
|  |                     </Component> | ||||||
|  |                   </SubComponents> | ||||||
|  |                 </Container> | ||||||
|               </SubComponents> |               </SubComponents> | ||||||
|             </Container> |             </Container> | ||||||
|           </SubComponents> |           </SubComponents> | ||||||
|  |  | ||||||
|  | @ -3,8 +3,13 @@ | ||||||
|  * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template |  * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template | ||||||
|  */ |  */ | ||||||
| package tech.iBeans.POSware.Lite; | package tech.iBeans.POSware.Lite; | ||||||
|  | import java.util.*; | ||||||
|  | import javax.swing.*; | ||||||
|  | import javax.swing.event.*; | ||||||
| import tech.iBeans.POSware.Lite.transaction; | import tech.iBeans.POSware.Lite.transaction; | ||||||
|  | import tech.iBeans.POSware.Lite.transact; | ||||||
| import tech.iBeans.POSware.Lite.WindowManagement; | import tech.iBeans.POSware.Lite.WindowManagement; | ||||||
|  | import tech.iBeans.POSware.Lite.receipt; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
|  | @ -16,6 +21,7 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|      * Creates new form OnTransact |      * Creates new form OnTransact | ||||||
|      */ |      */ | ||||||
|     private OnTransact() { |     private OnTransact() { | ||||||
|  |         transact.init(); | ||||||
|         initComponents(); |         initComponents(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -30,8 +36,9 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         java.awt.GridBagConstraints gridBagConstraints; |         java.awt.GridBagConstraints gridBagConstraints; | ||||||
| 
 | 
 | ||||||
|         jPanel_statusinfo = new javax.swing.JPanel(); |         jPanel_statusinfo = new javax.swing.JPanel(); | ||||||
|         jComboBox1 = new javax.swing.JComboBox<>(); |         jComboBox_Payment = new javax.swing.JComboBox<>(); | ||||||
|         jLabel1 = new javax.swing.JLabel(); |         jLabel_Status = new javax.swing.JLabel(); | ||||||
|  |         jToggleButton_Discard = new javax.swing.JToggleButton(); | ||||||
|         jPanel_Main = new javax.swing.JPanel(); |         jPanel_Main = new javax.swing.JPanel(); | ||||||
|         jPanel_Items = new javax.swing.JPanel(); |         jPanel_Items = new javax.swing.JPanel(); | ||||||
|         jScrollPane1 = new javax.swing.JScrollPane(); |         jScrollPane1 = new javax.swing.JScrollPane(); | ||||||
|  | @ -46,16 +53,23 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         jTextField_price_VAT_value = new javax.swing.JTextField(); |         jTextField_price_VAT_value = new javax.swing.JTextField(); | ||||||
|         jTextField_price_subtotal_value = new javax.swing.JTextField(); |         jTextField_price_subtotal_value = new javax.swing.JTextField(); | ||||||
|         jTextField_price_total_value = new javax.swing.JTextField(); |         jTextField_price_total_value = new javax.swing.JTextField(); | ||||||
|         jComboBox_information_discount_selections = new javax.swing.JComboBox<>(); |  | ||||||
|         jLabel2_information_discount = new javax.swing.JLabel(); |         jLabel2_information_discount = new javax.swing.JLabel(); | ||||||
|  |         jTextField_price_discounted = new javax.swing.JTextField(); | ||||||
|         jToolBar_Inventory = new javax.swing.JToolBar(); |         jToolBar_Inventory = new javax.swing.JToolBar(); | ||||||
|         jPanel2 = new javax.swing.JPanel(); |         jPanel_Inventory = new javax.swing.JPanel(); | ||||||
|         jPanel_Inventory_Actions = new javax.swing.JPanel(); |         jPanel_Inventory_Actions = new javax.swing.JPanel(); | ||||||
|         jButton_item_void = new javax.swing.JButton(); |         jButton_item_void = new javax.swing.JButton(); | ||||||
|         jSpinner_item_quantity = new javax.swing.JSpinner(); |         jSpinner_item_quantity = new javax.swing.JSpinner(); | ||||||
|         jButton_item_add = new javax.swing.JButton(); |         jButton_item_add = new javax.swing.JButton(); | ||||||
|         jScrollPane_Inventory = new javax.swing.JScrollPane(); |         jScrollPane_Inventory = new javax.swing.JScrollPane(); | ||||||
|         jList1_Inventory = new javax.swing.JList<>(); |         jList1_Inventory = new javax.swing.JList<>(); | ||||||
|  |         jPanel_ItemDetails = new javax.swing.JPanel(); | ||||||
|  |         jLabel_ItemDetails_SKU = new javax.swing.JLabel(); | ||||||
|  |         jTextField_ItemDetails_SKU = new javax.swing.JTextField(); | ||||||
|  |         jLabel_ItemDetails_UnitPrice = new javax.swing.JLabel(); | ||||||
|  |         jTextField_ItemDetails_UnitPrice = new javax.swing.JTextField(); | ||||||
|  |         jLabel_ItemDetails_Discount = new javax.swing.JLabel(); | ||||||
|  |         jTextField_ItemDetails_Discount = new javax.swing.JTextField(); | ||||||
| 
 | 
 | ||||||
|         setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); |         setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); | ||||||
|         setTitle("POSware Lite: Transaction"); |         setTitle("POSware Lite: Transaction"); | ||||||
|  | @ -68,11 +82,21 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
| 
 | 
 | ||||||
|         jPanel_statusinfo.setLayout(new java.awt.BorderLayout()); |         jPanel_statusinfo.setLayout(new java.awt.BorderLayout()); | ||||||
| 
 | 
 | ||||||
|         jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); |         jComboBox_Payment.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); | ||||||
|         jPanel_statusinfo.add(jComboBox1, java.awt.BorderLayout.EAST); |         jPanel_statusinfo.add(jComboBox_Payment, java.awt.BorderLayout.EAST); | ||||||
| 
 | 
 | ||||||
|         jLabel1.setText("jLabel1"); |         jLabel_Status.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); | ||||||
|         jPanel_statusinfo.add(jLabel1, java.awt.BorderLayout.LINE_START); |         jLabel_Status.setText("Store"); | ||||||
|  |         jPanel_statusinfo.add(jLabel_Status, java.awt.BorderLayout.CENTER); | ||||||
|  | 
 | ||||||
|  |         jToggleButton_Discard.setText("Discard"); | ||||||
|  |         jToggleButton_Discard.addActionListener(new java.awt.event.ActionListener() { | ||||||
|  |             public void actionPerformed(java.awt.event.ActionEvent evt) { | ||||||
|  |                 jToggleButton_DiscardActionPerformed(evt); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |         jPanel_statusinfo.add(jToggleButton_Discard, java.awt.BorderLayout.LINE_START); | ||||||
|  |         jToggleButton_Discard.setVisible(interface_adjust_clear()); | ||||||
| 
 | 
 | ||||||
|         getContentPane().add(jPanel_statusinfo, java.awt.BorderLayout.PAGE_END); |         getContentPane().add(jPanel_statusinfo, java.awt.BorderLayout.PAGE_END); | ||||||
| 
 | 
 | ||||||
|  | @ -92,7 +116,7 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
| 
 | 
 | ||||||
|         jPanel_Information.setLayout(new java.awt.GridBagLayout()); |         jPanel_Information.setLayout(new java.awt.GridBagLayout()); | ||||||
| 
 | 
 | ||||||
|         jLabel_price_VAT.setText("VAT"); |         jLabel_price_VAT.setText("Tax"); | ||||||
|         gridBagConstraints = new java.awt.GridBagConstraints(); |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|         gridBagConstraints.gridx = 0; |         gridBagConstraints.gridx = 0; | ||||||
|         gridBagConstraints.gridy = 0; |         gridBagConstraints.gridy = 0; | ||||||
|  | @ -116,15 +140,22 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         gridBagConstraints.gridy = 1; |         gridBagConstraints.gridy = 1; | ||||||
|         gridBagConstraints.gridheight = 2; |         gridBagConstraints.gridheight = 2; | ||||||
|         jPanel_Information.add(jLabel_price_total, gridBagConstraints); |         jPanel_Information.add(jLabel_price_total, gridBagConstraints); | ||||||
|  | 
 | ||||||
|  |         jSpinner_price_tip_value.setModel(model_price); | ||||||
|         gridBagConstraints = new java.awt.GridBagConstraints(); |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|         gridBagConstraints.gridx = 1; |         gridBagConstraints.gridx = 1; | ||||||
|         gridBagConstraints.gridy = 1; |         gridBagConstraints.gridy = 1; | ||||||
|         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; | ||||||
|         gridBagConstraints.weightx = 1.0; |         gridBagConstraints.weightx = 1.0; | ||||||
|         jPanel_Information.add(jSpinner_price_tip_value, gridBagConstraints); |         jPanel_Information.add(jSpinner_price_tip_value, gridBagConstraints); | ||||||
|  |         jSpinner_price_tip_value.addChangeListener(new ChangeListener() { | ||||||
|  |             public void stateChanged(ChangeEvent e) { | ||||||
|  |                 cart_tip_add(); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
| 
 | 
 | ||||||
|         jTextField_price_VAT_value.setEditable(false); |         jTextField_price_VAT_value.setEditable(false); | ||||||
|         jTextField_price_VAT_value.setText("0"); |         jTextField_price_VAT_value.setHorizontalAlignment(javax.swing.JTextField.TRAILING); | ||||||
|         gridBagConstraints = new java.awt.GridBagConstraints(); |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|         gridBagConstraints.gridx = 1; |         gridBagConstraints.gridx = 1; | ||||||
|         gridBagConstraints.gridy = 0; |         gridBagConstraints.gridy = 0; | ||||||
|  | @ -133,6 +164,7 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         jPanel_Information.add(jTextField_price_VAT_value, gridBagConstraints); |         jPanel_Information.add(jTextField_price_VAT_value, gridBagConstraints); | ||||||
| 
 | 
 | ||||||
|         jTextField_price_subtotal_value.setEditable(false); |         jTextField_price_subtotal_value.setEditable(false); | ||||||
|  |         jTextField_price_subtotal_value.setHorizontalAlignment(javax.swing.JTextField.TRAILING); | ||||||
|         jTextField_price_subtotal_value.setText("0"); |         jTextField_price_subtotal_value.setText("0"); | ||||||
|         gridBagConstraints = new java.awt.GridBagConstraints(); |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|         gridBagConstraints.gridx = 3; |         gridBagConstraints.gridx = 3; | ||||||
|  | @ -143,8 +175,8 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
| 
 | 
 | ||||||
|         jTextField_price_total_value.setEditable(false); |         jTextField_price_total_value.setEditable(false); | ||||||
|         jTextField_price_total_value.setFont(new java.awt.Font("Dialog", 1, 20)); // NOI18N |         jTextField_price_total_value.setFont(new java.awt.Font("Dialog", 1, 20)); // NOI18N | ||||||
|  |         jTextField_price_total_value.setHorizontalAlignment(javax.swing.JTextField.TRAILING); | ||||||
|         jTextField_price_total_value.setText("0"); |         jTextField_price_total_value.setText("0"); | ||||||
|         jTextField_price_total_value.setDragEnabled(false); |  | ||||||
|         gridBagConstraints = new java.awt.GridBagConstraints(); |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|         gridBagConstraints.gridx = 3; |         gridBagConstraints.gridx = 3; | ||||||
|         gridBagConstraints.gridy = 1; |         gridBagConstraints.gridy = 1; | ||||||
|  | @ -153,19 +185,21 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         gridBagConstraints.weightx = 1.0; |         gridBagConstraints.weightx = 1.0; | ||||||
|         jPanel_Information.add(jTextField_price_total_value, gridBagConstraints); |         jPanel_Information.add(jTextField_price_total_value, gridBagConstraints); | ||||||
| 
 | 
 | ||||||
|         jComboBox_information_discount_selections.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); |  | ||||||
|         gridBagConstraints = new java.awt.GridBagConstraints(); |  | ||||||
|         gridBagConstraints.gridx = 1; |  | ||||||
|         gridBagConstraints.gridy = 2; |  | ||||||
|         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |  | ||||||
|         jPanel_Information.add(jComboBox_information_discount_selections, gridBagConstraints); |  | ||||||
| 
 |  | ||||||
|         jLabel2_information_discount.setText("Discount"); |         jLabel2_information_discount.setText("Discount"); | ||||||
|         gridBagConstraints = new java.awt.GridBagConstraints(); |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|         gridBagConstraints.gridx = 0; |         gridBagConstraints.gridx = 0; | ||||||
|         gridBagConstraints.gridy = 2; |         gridBagConstraints.gridy = 2; | ||||||
|         jPanel_Information.add(jLabel2_information_discount, gridBagConstraints); |         jPanel_Information.add(jLabel2_information_discount, gridBagConstraints); | ||||||
| 
 | 
 | ||||||
|  |         jTextField_price_discounted.setEditable(false); | ||||||
|  |         jTextField_price_discounted.setHorizontalAlignment(javax.swing.JTextField.TRAILING); | ||||||
|  |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 1; | ||||||
|  |         gridBagConstraints.gridy = 2; | ||||||
|  |         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; | ||||||
|  |         gridBagConstraints.weightx = 1.0; | ||||||
|  |         jPanel_Information.add(jTextField_price_discounted, gridBagConstraints); | ||||||
|  | 
 | ||||||
|         jToolBar_Information.add(jPanel_Information); |         jToolBar_Information.add(jPanel_Information); | ||||||
| 
 | 
 | ||||||
|         jPanel_Items.add(jToolBar_Information, java.awt.BorderLayout.SOUTH); |         jPanel_Items.add(jToolBar_Information, java.awt.BorderLayout.SOUTH); | ||||||
|  | @ -174,7 +208,7 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
| 
 | 
 | ||||||
|         jToolBar_Inventory.setRollover(true); |         jToolBar_Inventory.setRollover(true); | ||||||
| 
 | 
 | ||||||
|         jPanel2.setLayout(new java.awt.BorderLayout()); |         jPanel_Inventory.setLayout(new java.awt.GridBagLayout()); | ||||||
| 
 | 
 | ||||||
|         jPanel_Inventory_Actions.setLayout(new java.awt.BorderLayout()); |         jPanel_Inventory_Actions.setLayout(new java.awt.BorderLayout()); | ||||||
| 
 | 
 | ||||||
|  | @ -188,6 +222,8 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|         jPanel_Inventory_Actions.add(jButton_item_void, java.awt.BorderLayout.LINE_START); |         jPanel_Inventory_Actions.add(jButton_item_void, java.awt.BorderLayout.LINE_START); | ||||||
|  | 
 | ||||||
|  |         jSpinner_item_quantity.setModel(model_counting); | ||||||
|         jPanel_Inventory_Actions.add(jSpinner_item_quantity, java.awt.BorderLayout.CENTER); |         jPanel_Inventory_Actions.add(jSpinner_item_quantity, java.awt.BorderLayout.CENTER); | ||||||
| 
 | 
 | ||||||
|         jButton_item_add.setText("Add"); |         jButton_item_add.setText("Add"); | ||||||
|  | @ -201,18 +237,82 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         }); |         }); | ||||||
|         jPanel_Inventory_Actions.add(jButton_item_add, java.awt.BorderLayout.LINE_END); |         jPanel_Inventory_Actions.add(jButton_item_add, java.awt.BorderLayout.LINE_END); | ||||||
| 
 | 
 | ||||||
|         jPanel2.add(jPanel_Inventory_Actions, java.awt.BorderLayout.SOUTH); |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 0; | ||||||
|  |         gridBagConstraints.gridy = 2; | ||||||
|  |         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; | ||||||
|  |         gridBagConstraints.weightx = 1.0; | ||||||
|  |         jPanel_Inventory.add(jPanel_Inventory_Actions, gridBagConstraints); | ||||||
| 
 | 
 | ||||||
|         jList1_Inventory.setModel(new javax.swing.AbstractListModel<String>() { |         jList1_Inventory.setModel(refresh_inventory_list()); | ||||||
|             String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; |         jList1_Inventory.addListSelectionListener(new javax.swing.event.ListSelectionListener() { | ||||||
|             public int getSize() { return strings.length; } |             public void valueChanged(javax.swing.event.ListSelectionEvent evt) { | ||||||
|             public String getElementAt(int i) { return strings[i]; } |                 jList1_InventoryValueChanged(evt); | ||||||
|  |             } | ||||||
|         }); |         }); | ||||||
|         jScrollPane_Inventory.setViewportView(jList1_Inventory); |         jScrollPane_Inventory.setViewportView(jList1_Inventory); | ||||||
| 
 | 
 | ||||||
|         jPanel2.add(jScrollPane_Inventory, java.awt.BorderLayout.CENTER); |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 0; | ||||||
|  |         gridBagConstraints.gridy = 0; | ||||||
|  |         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; | ||||||
|  |         gridBagConstraints.weightx = 1.0; | ||||||
|  |         gridBagConstraints.weighty = 1.0; | ||||||
|  |         jPanel_Inventory.add(jScrollPane_Inventory, gridBagConstraints); | ||||||
| 
 | 
 | ||||||
|         jToolBar_Inventory.add(jPanel2); |         jPanel_ItemDetails.setLayout(new java.awt.GridBagLayout()); | ||||||
|  | 
 | ||||||
|  |         jLabel_ItemDetails_SKU.setText("SKU"); | ||||||
|  |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 0; | ||||||
|  |         gridBagConstraints.gridy = 0; | ||||||
|  |         jPanel_ItemDetails.add(jLabel_ItemDetails_SKU, gridBagConstraints); | ||||||
|  | 
 | ||||||
|  |         jTextField_ItemDetails_SKU.setEditable(false); | ||||||
|  |         jTextField_ItemDetails_SKU.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N | ||||||
|  |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 1; | ||||||
|  |         gridBagConstraints.gridy = 0; | ||||||
|  |         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; | ||||||
|  |         gridBagConstraints.weightx = 1.0; | ||||||
|  |         jPanel_ItemDetails.add(jTextField_ItemDetails_SKU, gridBagConstraints); | ||||||
|  | 
 | ||||||
|  |         jLabel_ItemDetails_UnitPrice.setText("Unit Price"); | ||||||
|  |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 0; | ||||||
|  |         gridBagConstraints.gridy = 1; | ||||||
|  |         jPanel_ItemDetails.add(jLabel_ItemDetails_UnitPrice, gridBagConstraints); | ||||||
|  | 
 | ||||||
|  |         jTextField_ItemDetails_UnitPrice.setEditable(false); | ||||||
|  |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 1; | ||||||
|  |         gridBagConstraints.gridy = 1; | ||||||
|  |         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; | ||||||
|  |         gridBagConstraints.weightx = 1.0; | ||||||
|  |         jPanel_ItemDetails.add(jTextField_ItemDetails_UnitPrice, gridBagConstraints); | ||||||
|  | 
 | ||||||
|  |         jLabel_ItemDetails_Discount.setText("Discount"); | ||||||
|  |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 0; | ||||||
|  |         gridBagConstraints.gridy = 2; | ||||||
|  |         jPanel_ItemDetails.add(jLabel_ItemDetails_Discount, gridBagConstraints); | ||||||
|  | 
 | ||||||
|  |         jTextField_ItemDetails_Discount.setEditable(false); | ||||||
|  |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 1; | ||||||
|  |         gridBagConstraints.gridy = 2; | ||||||
|  |         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; | ||||||
|  |         gridBagConstraints.weightx = 1.0; | ||||||
|  |         jPanel_ItemDetails.add(jTextField_ItemDetails_Discount, gridBagConstraints); | ||||||
|  | 
 | ||||||
|  |         gridBagConstraints = new java.awt.GridBagConstraints(); | ||||||
|  |         gridBagConstraints.gridx = 0; | ||||||
|  |         gridBagConstraints.gridy = 1; | ||||||
|  |         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; | ||||||
|  |         gridBagConstraints.weightx = 1.0; | ||||||
|  |         jPanel_Inventory.add(jPanel_ItemDetails, gridBagConstraints); | ||||||
|  | 
 | ||||||
|  |         jToolBar_Inventory.add(jPanel_Inventory); | ||||||
| 
 | 
 | ||||||
|         jPanel_Main.add(jToolBar_Inventory, java.awt.BorderLayout.EAST); |         jPanel_Main.add(jToolBar_Inventory, java.awt.BorderLayout.EAST); | ||||||
| 
 | 
 | ||||||
|  | @ -222,17 +322,17 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|     }// </editor-fold>//GEN-END:initComponents |     }// </editor-fold>//GEN-END:initComponents | ||||||
| 
 | 
 | ||||||
|     private void jButton_item_voidActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_item_voidActionPerformed |     private void jButton_item_voidActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_item_voidActionPerformed | ||||||
|         // TODO add your handling code here: |         cart_remove(); | ||||||
|     }//GEN-LAST:event_jButton_item_voidActionPerformed |     }//GEN-LAST:event_jButton_item_voidActionPerformed | ||||||
| 
 | 
 | ||||||
|     private void jButton_item_addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_item_addActionPerformed |     private void jButton_item_addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_item_addActionPerformed | ||||||
|         // TODO add your handling code here: |         cart_add(); | ||||||
|     }//GEN-LAST:event_jButton_item_addActionPerformed |     }//GEN-LAST:event_jButton_item_addActionPerformed | ||||||
| 
 | 
 | ||||||
|     private void transaction_check(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_transaction_check |     private void transaction_check(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_transaction_check | ||||||
|         boolean CLOSING_STATE = false;  |         boolean CLOSING_STATE = false;  | ||||||
|          |          | ||||||
|         if (transaction.items_count.size() <= 0) { |         if (transact.items.size() <= 0) { | ||||||
|             CLOSING_STATE = true; |             CLOSING_STATE = true; | ||||||
|         } else { |         } else { | ||||||
|             CLOSING_STATE = confirm_discard(); |             CLOSING_STATE = confirm_discard(); | ||||||
|  | @ -241,6 +341,15 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         if (CLOSING_STATE) {evt.getWindow().dispose();}; |         if (CLOSING_STATE) {evt.getWindow().dispose();}; | ||||||
|     }//GEN-LAST:event_transaction_check |     }//GEN-LAST:event_transaction_check | ||||||
| 
 | 
 | ||||||
|  |     private void jList1_InventoryValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1_InventoryValueChanged | ||||||
|  |         // TODO add your handling code here: | ||||||
|  |         product_information_refresh(); | ||||||
|  |     }//GEN-LAST:event_jList1_InventoryValueChanged | ||||||
|  | 
 | ||||||
|  |     private void jToggleButton_DiscardActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton_DiscardActionPerformed | ||||||
|  |         init(); | ||||||
|  |     }//GEN-LAST:event_jToggleButton_DiscardActionPerformed | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * @param args the command line arguments |      * @param args the command line arguments | ||||||
|      */ |      */ | ||||||
|  | @ -282,6 +391,9 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         display(); |         display(); | ||||||
|     } |     } | ||||||
|      |      | ||||||
|  |     private SpinnerNumberModel model_price = new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, .01); | ||||||
|  |     private SpinnerNumberModel model_counting = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1); | ||||||
|  |      | ||||||
|     private static boolean confirm_discard() { |     private static boolean confirm_discard() { | ||||||
|         /* Confirm discarding items.  |         /* Confirm discarding items.  | ||||||
|          |          | ||||||
|  | @ -293,21 +405,169 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|         return (USER_CHOICE); |         return (USER_CHOICE); | ||||||
|     }; |     }; | ||||||
|      |      | ||||||
|  |     private boolean interface_adjust_clear() { | ||||||
|  |         /* Adjust the ability to reset.  | ||||||
|  |          | ||||||
|  |         Returns: (boolean) the new state of the appearance | ||||||
|  |         */ | ||||||
|  |          | ||||||
|  |         boolean CLEARABLE_STATE = (transact.items.size() > 0);  | ||||||
|  |         jToggleButton_Discard.setVisible(CLEARABLE_STATE); | ||||||
|  |         return (jToggleButton_Discard.isVisible()); | ||||||
|  |     }; | ||||||
|  |      | ||||||
|  |     private AbstractListModel<String> refresh_inventory_list() { | ||||||
|  |         /* Pull the list from inventory.  | ||||||
|  |         */ | ||||||
|  |          | ||||||
|  |         AbstractListModel<String> INVENTORY_LIST = new javax.swing.AbstractListModel<String>() { | ||||||
|  |             String[] strings = ((ArrayList<String>)inventory.collate()).toArray(new String[0]); | ||||||
|  |             public int getSize() { return strings.length; } | ||||||
|  |             public String getElementAt(int i) { return strings[i]; } | ||||||
|  |         }; | ||||||
|  |          | ||||||
|  |         return(INVENTORY_LIST); | ||||||
|  |     }; | ||||||
|  |      | ||||||
|  |     private void cart_calculation_refresh() { | ||||||
|  |         /* Refresh the cart's details, such as the total cost. */ | ||||||
|  |         Dictionary<String, String> prices = transact.calculate();  | ||||||
|  |          | ||||||
|  |         // TODO fix text formatting. Perhaps to be done in a different function, not here.   | ||||||
|  |          | ||||||
|  |         jTextField_price_subtotal_value.setText(String.valueOf(prices.get("subtotal"))); | ||||||
|  |         jTextField_price_total_value.setText(String.valueOf(prices.get("total"))); | ||||||
|  |         jTextField_price_discounted.setText(String.valueOf(prices.get("discount"))); | ||||||
|  |         jTextField_price_VAT_value.setText(String.valueOf(prices.get("tax"))); | ||||||
|  |          | ||||||
|  |         interface_adjust_clear(); | ||||||
|  |     }; | ||||||
|  |      | ||||||
|  |     private boolean product_information_refresh() { | ||||||
|  |         /* Refresh the select product information's details. */ | ||||||
|  |         Integer ITEM_SELECTED = jList1_Inventory.getSelectedIndex(); | ||||||
|  |          | ||||||
|  |         if (ITEM_SELECTED == null) {return false;}; | ||||||
|  |          | ||||||
|  |         Dictionary<String, String> ITEM_SELECTED_DETAILS_PROCESSED = new Hashtable<>(); | ||||||
|  |          | ||||||
|  |         // Get the selected details.  | ||||||
|  |         Dictionary ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED); | ||||||
|  |         if (ITEM_SELECTED_DETAILS == null) {return (false);}; | ||||||
|  |         ITEM_SELECTED_DETAILS_PROCESSED.put("SKU", inventory.list().get(ITEM_SELECTED).toString()); | ||||||
|  |          | ||||||
|  |         // Get the unit price.  | ||||||
|  |         ITEM_SELECTED_DETAILS_PROCESSED.put("Unit Price", String.valueOf(ITEM_SELECTED_DETAILS.get("Price"))); | ||||||
|  |          | ||||||
|  |         // Get the discount.  | ||||||
|  |         if (ITEM_SELECTED_DETAILS.get("Discount") != null) { | ||||||
|  |             if ((int) ITEM_SELECTED_DETAILS.get("Discount") != 0) { | ||||||
|  |                 ITEM_SELECTED_DETAILS_PROCESSED.put("Discount", (String.valueOf((int) ITEM_SELECTED_DETAILS.get("Discount"))).concat("%")); | ||||||
|  |             }; | ||||||
|  |         } else { | ||||||
|  |             ITEM_SELECTED_DETAILS_PROCESSED.put("Discount",""); | ||||||
|  |         }; | ||||||
|  |          | ||||||
|  |         // Place the corresponding information.  | ||||||
|  |         jTextField_ItemDetails_SKU.setText(ITEM_SELECTED_DETAILS_PROCESSED.get("SKU")); | ||||||
|  |         jTextField_ItemDetails_UnitPrice.setText(ITEM_SELECTED_DETAILS_PROCESSED.get("Unit Price")); | ||||||
|  |         jTextField_ItemDetails_Discount.setText(ITEM_SELECTED_DETAILS_PROCESSED.get("Discount")); | ||||||
|  |         return (true); | ||||||
|  |     }; | ||||||
|  |       | ||||||
|  |     private void cart_tip_add() { | ||||||
|  |         /* Add a tip. */ | ||||||
|  |          | ||||||
|  |         transact.price.put("tip", (double) jSpinner_price_tip_value.getValue()); | ||||||
|  |         transact.calculate(); | ||||||
|  |         cart_calculation_refresh(); | ||||||
|  |     }; | ||||||
|  |      | ||||||
|  |     private boolean cart_add() { | ||||||
|  |         /* Add the item to the cart.  | ||||||
|  |          | ||||||
|  |         Returns: (boolean) whether the item had been successfully added to the cart or not | ||||||
|  |         */ | ||||||
|  |         boolean state = false;  | ||||||
|  |          | ||||||
|  |         int ITEM_SELECTED = jList1_Inventory.getSelectedIndex(); | ||||||
|  |         int ITEM_SELECTED_QUANTITY = (int) jSpinner_item_quantity.getValue(); | ||||||
|  |          | ||||||
|  |         if (ITEM_SELECTED >= 0) { | ||||||
|  |             // Get the selected details.  | ||||||
|  |             Dictionary ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED); | ||||||
|  |             if (ITEM_SELECTED_DETAILS == null) {return (false);}; | ||||||
|  |             String ITEM_SELECTED_SKU = inventory.list().get(ITEM_SELECTED).toString(); | ||||||
|  | 
 | ||||||
|  |             // Add to cart.  | ||||||
|  |             state = transact.add(ITEM_SELECTED_SKU, ITEM_SELECTED_QUANTITY); | ||||||
|  | 
 | ||||||
|  |             // Refresh the data.  | ||||||
|  |             cart_calculation_refresh(); | ||||||
|  |         }; | ||||||
|  |         return(state); | ||||||
|  |     }; | ||||||
|  |      | ||||||
|  |     private boolean cart_remove() { | ||||||
|  |         /* Remove the item to the cart.  | ||||||
|  |          | ||||||
|  |         Returns: (boolean) whether the item had been successfully removed from the cart or not | ||||||
|  |         */ | ||||||
|  |         boolean state = false;  | ||||||
|  |          | ||||||
|  |         int ITEM_SELECTED = jList1_Inventory.getSelectedIndex(); | ||||||
|  |         int ITEM_SELECTED_QUANTITY = (int) jSpinner_item_quantity.getValue(); | ||||||
|  |          | ||||||
|  |         if (ITEM_SELECTED >= 0) { | ||||||
|  |             // Get the selected details.  | ||||||
|  |             Dictionary ITEM_SELECTED_DETAILS = inventory.find(ITEM_SELECTED); | ||||||
|  |             if (ITEM_SELECTED_DETAILS == null) {return (false);}; | ||||||
|  |             String ITEM_SELECTED_SKU = inventory.list().get(ITEM_SELECTED).toString(); | ||||||
|  | 
 | ||||||
|  |             // Add to cart.  | ||||||
|  |             state = transact.remove(ITEM_SELECTED_SKU, ITEM_SELECTED_QUANTITY); | ||||||
|  | 
 | ||||||
|  |             // Refresh the data.  | ||||||
|  |             cart_calculation_refresh(); | ||||||
|  |         }; | ||||||
|  |         return(state); | ||||||
|  |     }; | ||||||
|  |      | ||||||
|  |     private void init() { | ||||||
|  |         Boolean DISCARD_STATE = confirm_discard(); | ||||||
|  |         if (DISCARD_STATE) { | ||||||
|  |             transact.init(); | ||||||
|  |             refresh_inventory_list(); | ||||||
|  |             cart_calculation_refresh(); | ||||||
|  |             receipt.init(); | ||||||
|  |             receipt.headers(); | ||||||
|  |             receipt_refresh(); | ||||||
|  |         }; | ||||||
|  |     }; | ||||||
|  |      | ||||||
|  |      | ||||||
|  |     private void receipt_refresh() { | ||||||
|  |         jTextArea1.setText(receipt.content); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|     // Variables declaration - do not modify//GEN-BEGIN:variables |     // Variables declaration - do not modify//GEN-BEGIN:variables | ||||||
|     private javax.swing.JButton jButton_item_add; |     private javax.swing.JButton jButton_item_add; | ||||||
|     private javax.swing.JButton jButton_item_void; |     private javax.swing.JButton jButton_item_void; | ||||||
|     private javax.swing.JComboBox<String> jComboBox1; |     private javax.swing.JComboBox<String> jComboBox_Payment; | ||||||
|     private javax.swing.JComboBox<String> jComboBox_information_discount_selections; |  | ||||||
|     private javax.swing.JLabel jLabel1; |  | ||||||
|     private javax.swing.JLabel jLabel2_information_discount; |     private javax.swing.JLabel jLabel2_information_discount; | ||||||
|  |     private javax.swing.JLabel jLabel_ItemDetails_Discount; | ||||||
|  |     private javax.swing.JLabel jLabel_ItemDetails_SKU; | ||||||
|  |     private javax.swing.JLabel jLabel_ItemDetails_UnitPrice; | ||||||
|  |     private javax.swing.JLabel jLabel_Status; | ||||||
|     private javax.swing.JLabel jLabel_price_VAT; |     private javax.swing.JLabel jLabel_price_VAT; | ||||||
|     private javax.swing.JLabel jLabel_price_subtotal; |     private javax.swing.JLabel jLabel_price_subtotal; | ||||||
|     private javax.swing.JLabel jLabel_price_tip; |     private javax.swing.JLabel jLabel_price_tip; | ||||||
|     private javax.swing.JLabel jLabel_price_total; |     private javax.swing.JLabel jLabel_price_total; | ||||||
|     private javax.swing.JList<String> jList1_Inventory; |     private javax.swing.JList<String> jList1_Inventory; | ||||||
|     private javax.swing.JPanel jPanel2; |  | ||||||
|     private javax.swing.JPanel jPanel_Information; |     private javax.swing.JPanel jPanel_Information; | ||||||
|  |     private javax.swing.JPanel jPanel_Inventory; | ||||||
|     private javax.swing.JPanel jPanel_Inventory_Actions; |     private javax.swing.JPanel jPanel_Inventory_Actions; | ||||||
|  |     private javax.swing.JPanel jPanel_ItemDetails; | ||||||
|     private javax.swing.JPanel jPanel_Items; |     private javax.swing.JPanel jPanel_Items; | ||||||
|     private javax.swing.JPanel jPanel_Main; |     private javax.swing.JPanel jPanel_Main; | ||||||
|     private javax.swing.JPanel jPanel_statusinfo; |     private javax.swing.JPanel jPanel_statusinfo; | ||||||
|  | @ -316,9 +576,14 @@ public class OnTransact extends javax.swing.JFrame { | ||||||
|     private javax.swing.JSpinner jSpinner_item_quantity; |     private javax.swing.JSpinner jSpinner_item_quantity; | ||||||
|     private javax.swing.JSpinner jSpinner_price_tip_value; |     private javax.swing.JSpinner jSpinner_price_tip_value; | ||||||
|     private javax.swing.JTextArea jTextArea1; |     private javax.swing.JTextArea jTextArea1; | ||||||
|  |     private javax.swing.JTextField jTextField_ItemDetails_Discount; | ||||||
|  |     private javax.swing.JTextField jTextField_ItemDetails_SKU; | ||||||
|  |     private javax.swing.JTextField jTextField_ItemDetails_UnitPrice; | ||||||
|     private javax.swing.JTextField jTextField_price_VAT_value; |     private javax.swing.JTextField jTextField_price_VAT_value; | ||||||
|  |     private javax.swing.JTextField jTextField_price_discounted; | ||||||
|     private javax.swing.JTextField jTextField_price_subtotal_value; |     private javax.swing.JTextField jTextField_price_subtotal_value; | ||||||
|     private javax.swing.JTextField jTextField_price_total_value; |     private javax.swing.JTextField jTextField_price_total_value; | ||||||
|  |     private javax.swing.JToggleButton jToggleButton_Discard; | ||||||
|     private javax.swing.JToolBar jToolBar_Information; |     private javax.swing.JToolBar jToolBar_Information; | ||||||
|     private javax.swing.JToolBar jToolBar_Inventory; |     private javax.swing.JToolBar jToolBar_Inventory; | ||||||
|     // End of variables declaration//GEN-END:variables |     // End of variables declaration//GEN-END:variables | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue