hg merge release-3.1 (merge release3.1 into development)

This commit is contained in:
Carlos Ruiz 2016-03-19 17:45:39 +01:00
commit 062582bb21
11 changed files with 191 additions and 35 deletions

View File

@ -0,0 +1,26 @@
-- IDEMPIERE-2064 Show all DocAction button in trx windows in toolbar and window
update ad_column set istoolbarbutton='B' where ad_column_id in (
1789,
2171,
3495,
4324,
5497,
10797,
11480,
12076,
12120,
12282,
12319,
12330,
12412,
12449,
12461,
59447,
59452,
59480,
210983)
;
SELECT register_migration_script('201602191721_IDEMPIERE-2064.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
-- IDEMPIERE-3052 Advanced Search on doctype on invoices or orders shows all the doctypes
update ad_column set AD_Val_Rule_ID=124 where AD_Column_ID=3493 and AD_Val_Rule_ID IS NULL
;
update ad_column set AD_Val_Rule_ID=133 where AD_Column_ID=2172 and AD_Val_Rule_ID IS NULL
;
SELECT register_migration_script('201603110209_IDEMPIERE-3052.sql') FROM dual
;

View File

@ -0,0 +1,26 @@
-- IDEMPIERE-2064 Show all DocAction button in trx windows in toolbar and window
update ad_column set istoolbarbutton='B' where ad_column_id in (
1789,
2171,
3495,
4324,
5497,
10797,
11480,
12076,
12120,
12282,
12319,
12330,
12412,
12449,
12461,
59447,
59452,
59480,
210983)
;
SELECT register_migration_script('201602191721_IDEMPIERE-2064.sql') FROM dual
;

View File

@ -0,0 +1,11 @@
-- IDEMPIERE-3052 Advanced Search on doctype on invoices or orders shows all the doctypes
update ad_column set AD_Val_Rule_ID=124 where AD_Column_ID=3493 and AD_Val_Rule_ID IS NULL
;
update ad_column set AD_Val_Rule_ID=133 where AD_Column_ID=2172 and AD_Val_Rule_ID IS NULL
;
SELECT register_migration_script('201603110209_IDEMPIERE-3052.sql') FROM dual
;

View File

@ -417,10 +417,13 @@ public class CalloutInOut extends CalloutEngine
{
if (ol.getC_Charge_ID() > 0 && ol.getM_Product_ID() <= 0) {
mTab.setValue("C_Charge_ID", new Integer(ol.getC_Charge_ID()));
mTab.setValue("M_Product_ID", null);
mTab.setValue("M_AttributeSetInstance_ID", null);
}
else {
mTab.setValue("M_Product_ID", new Integer(ol.getM_Product_ID()));
mTab.setValue("M_AttributeSetInstance_ID", new Integer(ol.getM_AttributeSetInstance_ID()));
mTab.setValue("C_Charge_ID", null);
}
//
mTab.setValue("C_UOM_ID", new Integer(ol.getC_UOM_ID()));
@ -472,10 +475,13 @@ public class CalloutInOut extends CalloutEngine
{
if (rl.getC_Charge_ID() > 0 && rl.getM_Product_ID() <= 0) {
mTab.setValue("C_Charge_ID", new Integer(rl.getC_Charge_ID()));
mTab.setValue("M_Product_ID", null);
mTab.setValue("M_AttributeSetInstance_ID", null);
}
else {
mTab.setValue("M_Product_ID", new Integer(rl.getM_Product_ID()));
mTab.setValue("M_AttributeSetInstance_ID", new Integer(rl.getM_AttributeSetInstance_ID()));
mTab.setValue("C_Charge_ID", null);
}
//
mTab.setValue("C_UOM_ID", new Integer(rl.getC_UOM_ID()));

View File

@ -183,14 +183,42 @@ public class Doc_Invoice extends Doc
BigDecimal LineNetAmtTax = tax.calculateTax(LineNetAmt, true, getStdPrecision());
if (log.isLoggable(Level.FINE)) log.fine("LineNetAmt=" + LineNetAmt + " - Tax=" + LineNetAmtTax);
LineNetAmt = LineNetAmt.subtract(LineNetAmtTax);
for (int t = 0; t < m_taxes.length; t++)
{
if (m_taxes[t].getC_Tax_ID() == C_Tax_ID)
if (tax.isSummary()) {
BigDecimal sumChildLineNetAmtTax = Env.ZERO;
DocTax taxToApplyDiff = null;
for (MTax childTax : tax.getChildTaxes(false)) {
if (!childTax.isZeroTax())
{
BigDecimal childLineNetAmtTax = childTax.calculateTax(LineNetAmt, false, getStdPrecision());
if (log.isLoggable(Level.FINE)) log.fine("LineNetAmt=" + LineNetAmt + " - Child Tax=" + childLineNetAmtTax);
for (int t = 0; t < m_taxes.length; t++)
{
if (m_taxes[t].getC_Tax_ID() == childTax.getC_Tax_ID())
{
m_taxes[t].addIncludedTax(childLineNetAmtTax);
taxToApplyDiff = m_taxes[t];
sumChildLineNetAmtTax = sumChildLineNetAmtTax.add(childLineNetAmtTax);
break;
}
}
}
}
BigDecimal diffChildVsSummary = LineNetAmtTax.subtract(sumChildLineNetAmtTax);
if (diffChildVsSummary.signum() != 0 && taxToApplyDiff != null) {
taxToApplyDiff.addIncludedTax(diffChildVsSummary);
}
} else {
for (int t = 0; t < m_taxes.length; t++)
{
m_taxes[t].addIncludedTax(LineNetAmtTax);
break;
if (m_taxes[t].getC_Tax_ID() == C_Tax_ID)
{
m_taxes[t].addIncludedTax(LineNetAmtTax);
break;
}
}
}
BigDecimal PriceListTax = tax.calculateTax(PriceList, true, getStdPrecision());
PriceList = PriceList.subtract(PriceListTax);
}
@ -220,9 +248,24 @@ public class Doc_Invoice extends Doc
BigDecimal diff = m_taxes[i].getIncludedTaxDifference();
for (int j = 0; j < dls.length; j++)
{
if (dls[j].getC_Tax_ID() == m_taxes[i].getC_Tax_ID())
{
dls[j].setLineNetAmtDifference(diff);
MTax lineTax = MTax.get(getCtx(), dls[j].getC_Tax_ID());
MTax[] composingTaxes = null;
if (lineTax.isSummary()) {
composingTaxes = lineTax.getChildTaxes(false);
} else {
composingTaxes = new MTax[1];
composingTaxes[0] = lineTax;
}
for (MTax mTax : composingTaxes) {
if (mTax.getC_Tax_ID() == m_taxes[i].getC_Tax_ID())
{
dls[j].setLineNetAmtDifference(diff);
m_taxes[i].addIncludedTax(diff.negate());
diff = Env.ZERO;
break;
}
}
if (diff.signum() == 0) {
break;
}
} // for all lines

View File

@ -1053,12 +1053,12 @@ public class MInOut extends X_M_InOut implements DocAction
if (is_ValueChanged("AD_Org_ID"))
{
StringBuilder sql = new StringBuilder("UPDATE M_InOutLine ol")
.append(" SET AD_Org_ID =")
.append("(SELECT AD_Org_ID")
.append(" FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) ")
.append("WHERE M_InOut_ID=").append(getC_Order_ID());
int no = DB.executeUpdate(sql.toString(), get_TrxName());
final String sql = "UPDATE M_InOutLine ol"
+ " SET AD_Org_ID ="
+ "(SELECT AD_Org_ID"
+ " FROM M_InOut o WHERE ol.M_InOut_ID=o.M_InOut_ID) "
+ "WHERE M_InOut_ID=?";
int no = DB.executeUpdateEx(sql, new Object[] {getM_InOut_ID()}, get_TrxName());
if (log.isLoggable(Level.FINE)) log.fine("Lines -> #" + no);
}
return true;
@ -1426,11 +1426,36 @@ public class MInOut extends X_M_InOut implements DocAction
// sLine.getM_AttributeSetInstance_ID() != 0
if (mtrx == null)
{
Timestamp dateMPolicy = getMovementDate();
if(sLine.getM_AttributeSetInstance_ID()>0){
Timestamp dateMPolicy= null;
MStorageOnHand[] storages = null;
if (sLine.getMovementQty().compareTo(Env.ZERO) > 0) {
// Find Date Material Policy bases on ASI
storages = MStorageOnHand.getWarehouse(getCtx(), 0,
sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), null,
MClient.MMPOLICY_FiFo.equals(product.getMMPolicy()), false,
sLine.getM_Locator_ID(), get_TrxName());
} else {
//Case of reversal
storages = MStorageOnHand.getWarehouse(getCtx(), 0,
sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), null,
MClient.MMPOLICY_FiFo.equals(product.getMMPolicy()), false,
sLine.getM_Locator_ID(), get_TrxName());
}
for (MStorageOnHand storage : storages) {
if (storage.getQtyOnHand().compareTo(sLine.getMovementQty()) >= 0) {
dateMPolicy = storage.getDateMaterialPolicy();
break;
}
}
if (dateMPolicy == null && storages.length > 0)
dateMPolicy = storages[0].getDateMaterialPolicy();
if (dateMPolicy==null && sLine.getM_AttributeSetInstance_ID()!=0) {
I_M_AttributeSetInstance asi = sLine.getM_AttributeSetInstance();
dateMPolicy = asi.getCreated();
}
} else if(dateMPolicy==null)
dateMPolicy = getMovementDate();
// Fallback: Update Storage - see also VMatch.createMatchRecord
if (!MStorageOnHand.add(getCtx(), getM_Warehouse_ID(),

View File

@ -1019,12 +1019,19 @@ public class MOrderLine extends X_C_OrderLine
{
if (!success)
return success;
MTax tax = new MTax(getCtx(), getC_Tax_ID(), get_TrxName());
MTaxProvider provider = new MTaxProvider(tax.getCtx(), tax.getC_TaxProvider_ID(), tax.get_TrxName());
ITaxProvider calculator = Core.getTaxProvider(provider);
if (calculator == null)
throw new AdempiereException(Msg.getMsg(getCtx(), "TaxNoProvider"));
return calculator.recalculateTax(provider, this, newRecord);
if (getParent().isProcessed())
return success;
if ( newRecord
|| is_ValueChanged(MOrderLine.COLUMNNAME_C_Tax_ID)
|| is_ValueChanged(MOrderLine.COLUMNNAME_LineNetAmt)) {
MTax tax = new MTax(getCtx(), getC_Tax_ID(), get_TrxName());
MTaxProvider provider = new MTaxProvider(tax.getCtx(), tax.getC_TaxProvider_ID(), tax.get_TrxName());
ITaxProvider calculator = Core.getTaxProvider(provider);
if (calculator == null)
throw new AdempiereException(Msg.getMsg(getCtx(), "TaxNoProvider"));
return calculator.recalculateTax(provider, this, newRecord);
}
return success;
} // afterSave
/**

View File

@ -79,7 +79,7 @@ public class StandardTaxProvider implements ITaxProvider {
for (int j = 0; j < cTaxes.length; j++)
{
MTax cTax = cTaxes[j];
BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), order.isTaxIncluded(), order.getPrecision());
BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), false, order.getPrecision());
//
MOrderTax newOTax = new MOrderTax(order.getCtx(), 0, order.get_TrxName());
newOTax.setClientOrg(order);
@ -210,7 +210,7 @@ public class StandardTaxProvider implements ITaxProvider {
for (int j = 0; j < cTaxes.length; j++)
{
MTax cTax = cTaxes[j];
BigDecimal taxAmt = cTax.calculateTax(iTax.getTaxBaseAmt(), invoice.isTaxIncluded(), invoice.getPrecision());
BigDecimal taxAmt = cTax.calculateTax(iTax.getTaxBaseAmt(), false, invoice.getPrecision());
//
MInvoiceTax newITax = new MInvoiceTax(invoice.getCtx(), 0, invoice.get_TrxName());
newITax.setClientOrg(invoice);
@ -336,7 +336,7 @@ public class StandardTaxProvider implements ITaxProvider {
for (int j = 0; j < cTaxes.length; j++)
{
MTax cTax = cTaxes[j];
BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), rma.isTaxIncluded(), rma.getPrecision());
BigDecimal taxAmt = cTax.calculateTax(oTax.getTaxBaseAmt(), false, rma.getPrecision());
//
MRMATax newOTax = new MRMATax(rma.getCtx(), 0, rma.get_TrxName());
newOTax.setClientOrg(rma);

View File

@ -1344,7 +1344,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
String adInfo = e.getAD_Message();
if ( ! prevdbInfo.equals(dbInfo)
&& ( GridTab.DEFAULT_STATUS_MESSAGE.equals(adInfo)
&& ( adInfo == null
|| GridTab.DEFAULT_STATUS_MESSAGE.equals(adInfo)
|| GridTable.DATA_REFRESH_MESSAGE.equals(adInfo)
|| GridTable.DATA_INSERTED_MESSAGE.equals(adInfo)
|| GridTable.DATA_UPDATE_COPIED_MESSAGE.equals(adInfo)

View File

@ -1,13 +1,13 @@
<project name="zklibrary" basedir="." default="copy">
<target name="copy">
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zk/7.0.7.FL.20151022/zk-7.0.7.FL.20151022.jar" dest="lib/zk.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zul/7.0.7.FL.20151022/zul-7.0.7.FL.20151022.jar" dest="lib/zul.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zhtml/7.0.7.FL.20151022/zhtml-7.0.7.FL.20151022.jar" dest="lib/zhtml.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zkplus/7.0.7.FL.20151022/zkplus-7.0.7.FL.20151022.jar" dest="lib/zkplus.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zk/zkbind/7.0.7.FL.20151022/zkbind-7.0.7.FL.20151022.jar" dest="lib/zkbind.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/common/zcommon/7.0.7.FL.20151022/zcommon-7.0.7.FL.20151022.jar" dest="lib/zcommon.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/common/zel/7.0.7.FL.20151022/zel-7.0.7.FL.20151022.jar" dest="lib/zel.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/common/zweb/7.0.7.FL.20151022/zweb-7.0.7.FL.20151022.jar" dest="lib/zweb.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zk.jar" dest="lib/zk.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zul.jar" dest="lib/zul.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zhtml.jar" dest="lib/zhtml.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zkplus.jar" dest="lib/zkplus.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zkbind.jar" dest="lib/zkbind.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zcommon.jar" dest="lib/zcommon.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zel.jar" dest="lib/zel.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://downloads.sourceforge.net/project/idempiere/binary.file/jarfile/3.1/zweb.jar" dest="lib/zweb.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zkforge/ckez/4.4.6.2/ckez-4.4.6.2.jar" dest="lib/ckez.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zkforge/gmapsz/3.0.3/gmapsz-3.0.3.jar" dest="lib/gmapsz.jar" usetimestamp="true" verbose="true" retries="5" />
<get src="http://mavensync.zkoss.org/maven2/org/zkoss/zkforge/timelinez/2.3.1_50/timelinez-2.3.1_50.jar" dest="lib/timelinez.jar" usetimestamp="true" verbose="true" retries="5" />