1003544 Purchase Order window is showing as default the Sales Price List
This commit is contained in:
parent
5b3e0af93f
commit
c03e01aa2e
|
@ -159,7 +159,18 @@ public class CalloutInvoice extends CalloutEngine
|
|||
{ // get default PriceList
|
||||
int i = Env.getContextAsInt(ctx, "#M_PriceList_ID");
|
||||
if (i != 0)
|
||||
mTab.setValue("M_PriceList_ID", new Integer(i));
|
||||
{
|
||||
MPriceList pl = new MPriceList(ctx, i, null);
|
||||
if (IsSOTrx == pl.isSOPriceList())
|
||||
mTab.setValue("M_PriceList_ID", new Integer(i));
|
||||
else
|
||||
{
|
||||
String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC";
|
||||
ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx);
|
||||
if (ii != 0)
|
||||
mTab.setValue("M_PriceList_ID", new Integer(ii));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PaymentRule
|
||||
|
|
|
@ -289,7 +289,18 @@ public class CalloutOrder extends CalloutEngine
|
|||
{ // get default PriceList
|
||||
int i = Env.getContextAsInt(ctx, "#M_PriceList_ID");
|
||||
if (i != 0)
|
||||
mTab.setValue("M_PriceList_ID", new Integer(i));
|
||||
{
|
||||
MPriceList pl = new MPriceList(ctx, i, null);
|
||||
if (IsSOTrx == pl.isSOPriceList())
|
||||
mTab.setValue("M_PriceList_ID", new Integer(i));
|
||||
else
|
||||
{
|
||||
String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC";
|
||||
ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx);
|
||||
if (ii != 0)
|
||||
mTab.setValue("M_PriceList_ID", new Integer(ii));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Bill-To
|
||||
|
@ -494,7 +505,18 @@ public class CalloutOrder extends CalloutEngine
|
|||
{ // get default PriceList
|
||||
int i = Env.getContextAsInt(ctx, "#M_PriceList_ID");
|
||||
if (i != 0)
|
||||
mTab.setValue("M_PriceList_ID", new Integer(i));
|
||||
{
|
||||
MPriceList pl = new MPriceList(ctx, i, null);
|
||||
if (IsSOTrx == pl.isSOPriceList())
|
||||
mTab.setValue("M_PriceList_ID", new Integer(i));
|
||||
else
|
||||
{
|
||||
String sql2 = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC";
|
||||
ii = DB.getSQLValue (null, sql2, Env.getAD_Client_ID(ctx), IsSOTrx);
|
||||
if (ii != 0)
|
||||
mTab.setValue("M_PriceList_ID", new Integer(ii));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int bill_Location_ID = rs.getInt("Bill_Location_ID");
|
||||
|
|
|
@ -925,11 +925,16 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
{
|
||||
int ii = Env.getContextAsInt(getCtx(), "#M_PriceList_ID");
|
||||
if (ii != 0)
|
||||
setM_PriceList_ID(ii);
|
||||
else
|
||||
{
|
||||
String sql = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsDefault='Y'";
|
||||
ii = DB.getSQLValue (null, sql, getAD_Client_ID());
|
||||
MPriceList pl = new MPriceList(getCtx(), ii, null);
|
||||
if (isSOTrx() == pl.isSOPriceList())
|
||||
setM_PriceList_ID(ii);
|
||||
}
|
||||
|
||||
if (getM_PriceList_ID() == 0)
|
||||
{
|
||||
String sql = "SELECT M_PriceList_ID FROM M_PriceList WHERE AD_Client_ID=? AND IsSOPriceList=? AND IsActive='Y' ORDER BY IsDefault DESC";
|
||||
ii = DB.getSQLValue (null, sql, getAD_Client_ID(), isSOTrx());
|
||||
if (ii != 0)
|
||||
setM_PriceList_ID (ii);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue