JavaPOS Questions and Upgrades

Help is preferred to those who publish their work as Open Source and not as private branches rejecting collaboration. Such projects are not maintainable and shall be deleted.
Forum rules
This forum is personally pruned to avoid redundant posts. Related topics are grouped together. IF YOU HAVE REGISTERED, you need to send email to red1(a)red1.org with your username in the subject title to get me to activate you.

JavaPOS Questions and Upgrades

Postby edwinallenz » Thu Nov 24, 2011 9:49 pm

Im looking into the changes made on the new JavaPOS on adempiere, its good improvement.
I compiled it and it's running.

I have some, if you can help me.

1. Where is a good point to start learning how to develop some changes for the POS, I would like to make a window for adding a new Business partner from the Java POS and a little alert when the product is out of stok. And also where to learn the coding standars for adempiere.

2. The document "Adempiere JavaPOS" said there is a standalone version of the POS. Where I can find documentation or some help on how to achieve this.

3. I noticed that the prices displayed on Java POS are not working with the disccount schema. I this true? If is it, could you give me a little guide about how to implement this functionality.
edwinallenz
 
Posts: 7
Joined: Mon Nov 21, 2011 7:40 am

Re: JavaPOS Questions and Upgrades

Postby red1 » Sat Nov 26, 2011 4:56 pm

Hi edwinallenz,
Maybe this is what you want for the standalone POS viewtopic.php?f=29&t=1356.

Do you know Java? If you do you can checkout the code from the SVN i gave for JavaPOS and check what is the code doing. Making stock alert check and Discount Schema reference is easy, if you are familiar with the ADempiere table model in java code, and the pop up box needs some reference to other JavaPOS code that does pop-up so that you need not reinvent the wheel.

I would be happy if you contribute this back so that any future enhancements from everyone will not override your local instance and you or your client has a hard time upgrading.
red1
Site Admin
 
Posts: 2326
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: JavaPOS Questions and Upgrades

Postby edwinallenz » Sun Jan 08, 2012 11:33 am

Thanks red1 I don't know too much about Adempiere table model, but I'm trying to undertand it with your videos and source code.
I made a little modification to the java pos for showing the stock alert that I want to share.

In SubCurrentLine.java
Code: Select all
if (results.length == 0)
      {
         String message = Msg.translate(p_ctx,  "search.product.notfound");
         ADialog.warn(0, p_posPanel, message + query);
         setM_Product_ID(0);
         p_posPanel.f_curLine.setPrice(Env.ZERO);
      }
      else if (results.length == 1)
      {   //check qty avaliable      
         if (results[0].getQtyAvailable().intValue() <= 0){
                                //less than 0 alert
            ADialog.warn(0, p_posPanel, "Product stock is " + results[0].getQtyAvailable() + ", less than 0.");
         }

...
}


I want to use this POS for a production enviroment, so I want to make some enchacements, right know I'm going to start working on creating a new Business partner window.

wish me luck.
edwinallenz
 
Posts: 7
Joined: Mon Nov 21, 2011 7:40 am

Re: JavaPOS Questions and Upgrades

Postby red1 » Mon Jan 09, 2012 11:29 am

Glancing at it looks OK. Does it show up alright? Then please attach a screenshot here. Thanks for sharing. Keep going, man. I am now in Bogota and heading to Medelin, Quito and Sao Paulo. There are lots of eager supporters, collaborators here also. So you can now welcome to a really huge club. Check out my Facebook trail of my travels here http://www.facebook.com/red1org :) cheers!
red1
Site Admin
 
Posts: 2326
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: JavaPOS Questions and Upgrades

Postby edwinallenz » Wed Jan 18, 2012 11:50 am

Some screen shot's of my solution.
Stock Qty
POSQty.PNG
StockQty
POSQty.PNG (64.03 KiB) Viewed 559 times

Stock Alert
StockAlert.PNG
Stock Alert
StockAlert.PNG (63.37 KiB) Viewed 559 times
edwinallenz
 
Posts: 7
Joined: Mon Nov 21, 2011 7:40 am

Re: JavaPOS Questions and Upgrades

Postby red1 » Thu Jan 19, 2012 6:27 am

As long as this pop-up does not stop the sale just in case the data is not used. From your code you are only issuing a warning so it should be OK. Or you can make a check at the 'Availability' rule that warns only if it is so and not if it is 'Forced'. In this way the user can have smoother operations without inventory control (for those POS that are lazy or just really standalone without purchasing and inventory).
red1
Site Admin
 
Posts: 2326
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: JavaPOS Questions and Upgrades

Postby edwinallenz » Wed Jan 25, 2012 9:46 am

I was able to create the "New Client" window successfully, I will share the screenshots and source code later.
I have some issues with the JavaPos that I like to solve, if some one can give me a hand or guidance I'll appreciate it.

1. When an "Pos Order" is created from POS or from the "Sales order window", the payment is not allocated. And it increments the client credit.
Any advance on how to create the payment allocation from the POS source code? THIS IS THE MOST IMPORTANT.
2. In the customer field if you press ENTER instead of TAB after you type your text, the custumer is not searched, and the field is reseted.
3. How to navigate with TAB in the Query Product window.
4. Final, Its possible to integrate the Business Partner Info, Product Info, ... views in the POS.

Best regards.
edwinallenz
 
Posts: 7
Joined: Mon Nov 21, 2011 7:40 am

Re: JavaPOS Questions and Upgrades

Postby red1 » Wed Jan 25, 2012 1:05 pm

I am not aware of the above issues. AFAIK a processed POS transaction via Java POS is as what i exposed in the tests as reported before i.e. Payment record is created. So i wonder if you get something similar. Perhaps you are right that allocation is deferred and need further follow up action from the user or accounting dept later. I am not that sure of back room accounting needs but i think allowing things to be more loose is better than more tight (further config or customization for particular usage).
red1
Site Admin
 
Posts: 2326
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: JavaPOS Questions and Upgrades

Postby edwinallenz » Tue Apr 03, 2012 10:18 pm

I completed the allocation in the POS.
This is what I did:

1. In the payOrder() function in sub current line, add a call to a new function to create the payment allocation, in my case PosAllocation(), this function have to be called after the payment is completed
Sample code

Code: Select all
   private void payOrder() {

      //Check if order is completed, if so, print and open drawer, create an empty order and set cashGiven to zero

      if( p_posPanel.m_order != null ) //red1 wrong action flow below
      {
         PosPayment pay = PosPayment.pay(p_posPanel);
         if (!pay.isPaid() )
            return; //red1 not paid (cancelled) cannot continue process the order.
         
         if (!p_posPanel.m_order.isProcessed() && !p_posPanel.m_order.processOrder() )
         {
            ADialog.warn(0, p_posPanel, "PosOrderProcessFailed");
            return;
         }
         else
         {
            
            printTicket();
            PosAllocation();
            p_posPanel.setOrder(0);
         }
      }   
   }



2. Create the posAllocation function in SubCurrentLine class as follows
Code: Select all
public boolean PosAllocation()
   {
      //Master allocation
      m_allocation = new MAllocationHdr (Env.getCtx(), false, p_posPanel.m_order.getDateAcct(),   //   automatic
            p_posPanel.m_order.getC_Currency_ID(), "Pos order " + p_posPanel.m_order.getC_Order_ID(),trxName);
         m_allocation.setAD_Org_ID(p_posPanel.m_order.getAD_Org_ID());
         if (!m_allocation.save())
            return false;
         
      //Allocation detail
      MAllocationLine aLine = new MAllocationLine (m_allocation, p_posPanel.m_order.payment.getPayAmt(),
            Env.ZERO, Env.ZERO, Env.ZERO);
      aLine.setC_BPartner_ID(p_posPanel.m_order.getC_BPartner_ID());
      aLine.setC_Payment_ID(p_posPanel.m_order.payment.get_ID());
      aLine.setC_Invoice_ID(p_posPanel.m_order.getC_Invoice_ID());
      if(! aLine.save())
         return false;         
      m_allocation.processIt(MAllocationHdr.DOCACTION_Complete);
      if (!m_allocation.save())
         return false;
      return true;
   }
edwinallenz
 
Posts: 7
Joined: Mon Nov 21, 2011 7:40 am

JavaPOS Questions and Upgrades (Pos, Credit and Quotation do

Postby edwinallenz » Tue Apr 03, 2012 10:25 pm

I need to make a new improvement, I want to be able to select with a ComboBox some Order Document Types, in this case I need Pos Order, On credit order and Quotation. I think I have to change the document type when the POS create de document but I'm wondering how to fill the ComboBox with the document types I need. I explored the X_C_DocType class but I didn't find a function to get the Types asociated with a GL_Category.

Thanks in advance.
edwinallenz
 
Posts: 7
Joined: Mon Nov 21, 2011 7:40 am


Return to HELP ME!!!

Who is online

Users browsing this forum: No registered users and 0 guests

cron