[2093355 ] Small bugs in OpenXpertya POS

SOLVED AS EXPLAINED.. some cosmetics next...
1) Java POS can start a new order while not completed present orders! <-- killer stuff. Can jump to any Order by choice.
2) Java POS do not commit illegal action such as reversing Reserved Qty without Model action.
3) Can delete Drafted non reserved OrderLines. Cannot delete when completed.
This commit is contained in:
Redhuan D. Oon 2008-12-02 16:52:18 +00:00
parent 446b5092ba
commit e194ec8172
5 changed files with 26 additions and 12 deletions

View File

@ -274,7 +274,7 @@ public class QueryTicket extends PosSubPanel
sql += " AND o.C_Order_ID = " + id;
if (doc != null && !doc.equalsIgnoreCase(""))
sql += " AND o.DocumentNo = '" + doc + "'";
sql += " AND o.DateOrdered = ?";
sql += " AND o.DateOrdered = ? Order By o.DocumentNo";
PreparedStatement pstm = DB.prepareStatement(sql, null);
pstm.setTimestamp(1, date);
@ -348,7 +348,9 @@ public class QueryTicket extends PosSubPanel
if (m_c_order_id > 0)
{
p_posPanel.f_curLine.setOldOrder(m_c_order_id);
p_posPanel.f_curLine.setOrder(m_c_order_id);
p_posPanel.updateInfo();
}
p_posPanel.closeQuery(this);
} // close

View File

@ -153,7 +153,7 @@ public class SubBPartner extends PosSubPanel
log.info( "PosSubCustomer - actionPerformed: " + action);
// New
if (action.equals("New"))
setC_BPartner_ID(0);
p_posPanel.newOrder(); //red1 New POS Order instead - B_Partner already has direct field
// Edit
else if (action.equals("Edit"))
{

View File

@ -251,7 +251,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
}
else
{
p_posPanel.f_status.setStatusLine("Order not fully pay.");
p_posPanel.f_status.setStatusLine("PAYMENT NOT FULL.");
}
}
// Print
@ -396,7 +396,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
{
MOrder order = p_posPanel.f_curLine.getOrder();
BigDecimal total = new BigDecimal(0);
if (order != null)
if (order != null && !order.getTotalLines().equals(Env.ZERO))
total = order.getGrandTotal();
double cashReturn = given.doubleValue() - total.doubleValue();
f_cashReturn.setValue(new BigDecimal(cashReturn));

View File

@ -283,7 +283,7 @@ public class SubCurrentLine extends PosSubPanel implements ActionListener {
if (numLineas > row)
{
//delete line from order
lineas[row].setQtyReserved(Env.ZERO); //red1 - [2093355 ] Small bugs in OpenXpertya POS
//illegal! lineas[row].setQtyReserved(Env.ZERO); //red1 - [2093355 ] Small bugs in OpenXpertya POS
lineas[row].delete(true);
for (int i = row; i < (numLineas - 1); i++)
lineas[i] = lineas[i + 1];
@ -489,4 +489,11 @@ public class SubCurrentLine extends PosSubPanel implements ActionListener {
p_posPanel.updateInfo();
}
/**
* @param m_c_order_id
*/
public void setOrder(int m_c_order_id)
{
m_order = new MOrder(p_ctx , m_c_order_id, null);
}
} // PosSubCurrentLine

View File

@ -47,6 +47,7 @@ import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.model.Query;
/**
@ -288,7 +289,7 @@ public class SubLines extends PosSubPanel implements ActionListener
{
int noLines = m_table.getRowCount();
p_posPanel.f_status.setStatusDB(noLines);
if (order == null)
if (order == null || noLines == 0) //red1 WORKAROUND (noLines == 0) means total and tax in order head is false.
{
f_net.setValue(Env.ZERO);
f_total.setValue(Env.ZERO);
@ -296,10 +297,14 @@ public class SubLines extends PosSubPanel implements ActionListener
}
else
{
order.prepareIt();
f_net.setValue(order.getTotalLines());
f_total.setValue(order.getGrandTotal());
f_tax.setValue(order.getGrandTotal().subtract(order.getTotalLines()));
// order.prepareIt(); //red1 Avoid Reserving Inventory until final process and update context directly from DB.
p_posPanel.f_curLine.setOrder(order.getC_Order_ID());
MOrder retValue = p_posPanel.f_curLine.getOrder();
//red1 - end -
f_net.setValue(retValue.getTotalLines());
f_total.setValue(retValue.getGrandTotal());
f_tax.setValue(retValue.getGrandTotal().subtract(retValue.getTotalLines()));
}
} // setSums
} // PosSubAllLines