From: Jorg J. <jj...@us...> - 2004-01-05 05:37:09
|
Update of /cvsroot/compiere/base/src/org/compiere/model In directory sc8-pr-cvs1:/tmp/cvs-serv3071/src/org/compiere/model Modified Files: CalloutPayment.java CalloutEngine.java MField.java Log Message: . Index: CalloutPayment.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutPayment.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CalloutPayment.java 27 Dec 2003 07:13:32 -0000 1.3 --- CalloutPayment.java 5 Jan 2004 05:37:05 -0000 1.4 *************** *** 224,228 **** log.debug("amounts Pay=" + PayAmt + ", Discount=" + DiscountAmt + ", WriteOff=" + WriteOffAmt + ", OverUnderAmt=" + OverUnderAmt); ! // int C_Currency_ID = ((Integer)mTab.getValue("C_Currency_ID")).intValue(); MCurrency currency = MCurrency.get(ctx, C_Currency_ID); --- 224,228 ---- log.debug("amounts Pay=" + PayAmt + ", Discount=" + DiscountAmt + ", WriteOff=" + WriteOffAmt + ", OverUnderAmt=" + OverUnderAmt); ! // Get Currency Info int C_Currency_ID = ((Integer)mTab.getValue("C_Currency_ID")).intValue(); MCurrency currency = MCurrency.get(ctx, C_Currency_ID); *************** *** 234,238 **** int AD_Client_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Client_ID"); int AD_Org_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Org_ID"); ! // Get Rate BigDecimal CurrencyRate = Env.ONE; if ((C_Currency_ID > 0 && C_Currency_Invoice_ID > 0 && --- 234,238 ---- int AD_Client_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Client_ID"); int AD_Org_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Org_ID"); ! // Get Currency Rate BigDecimal CurrencyRate = Env.ONE; if ((C_Currency_ID > 0 && C_Currency_Invoice_ID > 0 && *************** *** 247,252 **** if (CurrencyRate == null || CurrencyRate.compareTo(Env.ZERO) == 0) { ! // mTab.setValue("C_Currency_ID", new Integer(C_Currency_Invoice_ID)); setCalloutActive(false); return "NoCurrencyConversion"; } --- 247,254 ---- if (CurrencyRate == null || CurrencyRate.compareTo(Env.ZERO) == 0) { ! // mTab.setValue("C_Currency_ID", new Integer(C_Currency_Invoice_ID)); // does not work setCalloutActive(false); + if (C_Currency_Invoice_ID == 0) + return ""; // no error message when no invoice is selected return "NoCurrencyConversion"; } *************** *** 274,277 **** --- 276,289 ---- } + // No Invoice - Set Discount, Witeoff, Under/Over to 0 + else if (C_Invoice_ID == 0) + { + if (Env.ZERO.compareTo(DiscountAmt) != 0) + mTab.setValue("DiscountAmt", Env.ZERO); + if (Env.ZERO.compareTo(WriteOffAmt) != 0) + mTab.setValue("WriteOffAmt", Env.ZERO); + if (Env.ZERO.compareTo(OverUnderAmt) != 0) + mTab.setValue("OverUnderAmt", Env.ZERO); + } // PayAmt - calculate write off else if (colName.equals("PayAmt")) Index: CalloutEngine.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutEngine.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CalloutEngine.java 17 Oct 2003 06:15:20 -0000 1.2 --- CalloutEngine.java 5 Jan 2004 05:37:05 -0000 1.3 *************** *** 66,70 **** .append(" (old=").append(oldValue) .append(") {active=").append(isCalloutActive()).append("}"); ! log.info (msg); // Find Method --- 66,71 ---- .append(" (old=").append(oldValue) .append(") {active=").append(isCalloutActive()).append("}"); ! if (!isCalloutActive()) ! log.info (msg); // Find Method Index: MField.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MField.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** MField.java 27 Dec 2003 07:13:32 -0000 1.53 --- MField.java 5 Jan 2004 05:37:05 -0000 1.54 *************** *** 367,371 **** || m_vo.AD_Column_ID == 3045 // Order.POReference || m_vo.AD_Column_ID == 3782 // Invoice.POReference ! || m_vo.AD_Column_ID == 3785) // Invoice.POReference return true; --- 367,372 ---- || m_vo.AD_Column_ID == 3045 // Order.POReference || m_vo.AD_Column_ID == 3782 // Invoice.POReference ! || m_vo.AD_Column_ID == 3785 // Invoice.POReference ! || m_vo.AD_Column_ID == 4379) // ReverseAllocation.Processing return true; |