Work in progress - integrate bug fixing from Compiere 260b

This commit is contained in:
Carlos Ruiz 2007-02-25 02:42:59 +00:00
parent 6147f64ec4
commit dbd6a623b3
29 changed files with 170 additions and 125 deletions

View File

@ -537,8 +537,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
{
m_parentNeedSave = false;
String lc = getLinkColumnName();
if (lc.equals(""))
log.severe ("No link column");
if (lc.equals("")) {
log.warning ("No link column");
where.append (" 2=3");
}
else
{
String value = Env.getContext(m_vo.ctx, m_vo.WindowNo, lc);

View File

@ -68,8 +68,6 @@ public class GridWindow implements Serializable
private GridWindowVO m_vo;
/** Tabs */
private ArrayList<GridTab> m_tabs = new ArrayList<GridTab>();
/** Position */
private Rectangle m_position = null;
/** Model last updated */
private Timestamp m_modelUpdated = null;

View File

@ -167,11 +167,11 @@ public class MBPBankAccount extends X_C_BP_BankAccount
*/
public MBank getBank()
{
int C_BP_BankAccount_ID = getC_BP_BankAccount_ID();
if (C_BP_BankAccount_ID == 0)
int C_Bank_ID = getC_Bank_ID();
if (C_Bank_ID == 0)
return null;
if (m_bank == null)
m_bank = new MBank (getCtx(), C_BP_BankAccount_ID, get_TrxName());
m_bank = new MBank (getCtx(), C_Bank_ID, get_TrxName());
return m_bank;
} // getBank

View File

@ -84,7 +84,7 @@ public class MBPartner extends X_C_BPartner
{
MBPartner retValue = null;
String sql = "SELECT * FROM C_BPartner "
+ "WHERE C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo WHERE AD_Client_ID=?)";
+ "WHERE C_BPartner_ID IN (SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo WHERE AD_Client_ID=?)";
PreparedStatement pstmt = null;
try
{
@ -376,7 +376,7 @@ public class MBPartner extends X_C_BPartner
boolean success = true;
String sql = "SELECT * FROM C_BPartner "
+ "WHERE C_BPartner_ID=(SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo WHERE AD_Client_ID=?)";
+ "WHERE C_BPartner_ID IN (SELECT C_BPartnerCashTrx_ID FROM AD_ClientInfo WHERE AD_Client_ID=?)";
PreparedStatement pstmt = null;
try
{
@ -568,7 +568,7 @@ public class MBPartner extends X_C_BPartner
return m_accounts;
//
ArrayList<MBPBankAccount> list = new ArrayList<MBPBankAccount>();
String sql = "SELECT * FROM C_BP_BankAccount WHERE C_BPartner_ID=?";
String sql = "SELECT * FROM C_BP_BankAccount WHERE C_BPartner_ID=? AND IsActive='Y'";
PreparedStatement pstmt = null;
try
{

View File

@ -403,12 +403,12 @@ public class MCostDetail extends X_M_CostDetail
* @param ctx context
* @param whereClause where clause
* @param ID 1st parameter
* @param ID2 2nd parameter
* @param M_AttributeSetInstance_ID ASI
* @param trxName trx
* @return cost detail
*/
private static MCostDetail get (Properties ctx, String whereClause,
int ID, int ID2, String trxName)
int ID, int M_AttributeSetInstance_ID, String trxName)
{
String sql = "SELECT * FROM M_CostDetail WHERE " + whereClause;
MCostDetail retValue = null;
@ -417,7 +417,7 @@ public class MCostDetail extends X_M_CostDetail
{
pstmt = DB.prepareStatement (sql, null);
pstmt.setInt (1, ID);
pstmt.setInt (2, ID2);
pstmt.setInt (2, M_AttributeSetInstance_ID);
ResultSet rs = pstmt.executeQuery ();
if (rs.next ())
retValue = new MCostDetail (ctx, rs, trxName);
@ -693,7 +693,7 @@ public class MCostDetail extends X_M_CostDetail
{
if (isProcessed())
{
log.info("already processed");
log.info("Already processed");
return true;
}
boolean ok = false;

View File

@ -32,7 +32,7 @@ import org.compiere.util.DB;
public class MDunningLevel extends X_C_DunningLevel
{
/** Logger */
private static CLogger s_log = CLogger.getCLogger (MPayment.class);
private static CLogger s_log = CLogger.getCLogger (MDunningLevel.class);
/**
* Standard Constructor

View File

@ -282,7 +282,7 @@ public class MDunningRunLine extends X_C_DunningRunLine
// Total
setTotalAmt(getConvertedAmt().add(getFeeAmt()).add(getInterestAmt()));
// Reset Collection Status only if null
if (getInvoice().getInvoiceCollectionType ()==null)
if (getInvoice()!=null && getInvoice().getInvoiceCollectionType ()==null)
{
if (m_invoice!=null)
{

View File

@ -184,6 +184,20 @@ public class MEntityType extends X_AD_EntityType
/** 10=D, 20=C, 100=U, 110=CUST, 200=A, 210=EXT, 220=XX */
private static final int s_maxAD_EntityType_ID = 221;
/**
* Set AD_EntityType_ID
*/
private void setAD_EntityType_ID()
{
int AD_EntityType_ID = getAD_EntityType_ID();
if (AD_EntityType_ID == 0)
{
String sql = "SELECT NVL(MAX(AD_EntityType_ID), 999999) FROM AD_EntityType WHERE AD_EntityType_ID > 1000";
AD_EntityType_ID= DB.getSQLValue (get_TrxName(), sql);
setAD_EntityType_ID(AD_EntityType_ID+1);
}
} // setAD_EntityType_ID
/**
* Is System Maintained
* @return true if D/C/U/CUST/A/EXT/XX
@ -246,6 +260,7 @@ public class MEntityType extends X_AD_EntityType
+ " - Must be ASCII Letter or Digit");
return false;
}
setAD_EntityType_ID();
} // new
s_entityTypes = null; // reset
return true;

View File

@ -475,6 +475,17 @@ public class MGoal extends X_PA_Goal
return m_color;
} // getColor
/**
* Get the color schema for this goal.
*
* @return the color schema, or null if the measure targer is 0
*/
public MColorSchema getColorSchema()
{
return (getMeasureTarget().signum() == 0) ?
null : MColorSchema.get(getCtx(), getPA_ColorSchema_ID());
}
/**
* Get Measure Display
* @return Measure Display

View File

@ -87,8 +87,6 @@ public class MImage extends X_AD_Image
private Image m_image = null;
/** The Icon */
private Icon m_icon = null;
/** The Image File */
private File m_file = null;
/**
* Get Image

View File

@ -1015,7 +1015,7 @@ public class MInOut extends X_M_InOut implements DocAction
// Credit Check
if (isSOTrx() && !isReversal())
{
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null);
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName());
if (MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus()))
{
m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@="
@ -1546,11 +1546,11 @@ public class MInOut extends X_M_InOut implements DocAction
// Org Must be linked to BPartner
MOrg org = MOrg.get(getCtx(), getAD_Org_ID());
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID();
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName());
if (counterC_BPartner_ID == 0)
return null;
// Business Partner needs to be linked to Org
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null);
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName());
int counterAD_Org_ID = bp.getAD_OrgBP_ID_Int();
if (counterAD_Org_ID == 0)
return null;
@ -1771,6 +1771,7 @@ public class MInOut extends X_M_InOut implements DocAction
return false;
}
reversal.closeIt();
reversal.setProcessing (false);
reversal.setDocStatus(DOCSTATUS_Reversed);
reversal.setDocAction(DOCACTION_None);
reversal.save(get_TrxName());

View File

@ -1046,7 +1046,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
{
BigDecimal retValue = null;
String sql = "SELECT SUM(currencyConvert(al.Amount+al.DiscountAmt+al.WriteOffAmt,"
+ "ah.C_Currency_ID, i.C_Currency_ID,ah.DateTrx,i.C_ConversionType_ID, al.AD_Client_ID,al.AD_Org_ID)) "
+ "ah.C_Currency_ID, i.C_Currency_ID,ah.DateTrx,COALESCE(i.C_ConversionType_ID,0), al.AD_Client_ID,al.AD_Org_ID)) "
+ "FROM C_AllocationLine al"
+ " INNER JOIN C_AllocationHdr ah ON (al.C_AllocationHdr_ID=ah.C_AllocationHdr_ID)"
+ " INNER JOIN C_Invoice i ON (al.C_Invoice_ID=i.C_Invoice_ID) "
@ -1820,7 +1820,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
// Org Must be linked to BPartner
MOrg org = MOrg.get(getCtx(), getAD_Org_ID());
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID();
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName());
if (counterC_BPartner_ID == 0)
return null;
// Business Partner needs to be linked to Org
@ -2046,6 +2046,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
reversal.setC_Payment_ID(0);
reversal.setIsPaid(true);
reversal.closeIt();
reversal.setProcessing (false);
reversal.setDocStatus(DOCSTATUS_Reversed);
reversal.setDocAction(DOCACTION_None);
reversal.save(get_TrxName());

View File

@ -250,7 +250,7 @@ public class MJournal extends X_GL_Journal implements DocAction
count++;
}
if (fromLines.length != count)
log.log(Level.SEVERE, "copyLinesFrom - Line difference - JournalLines=" + fromLines.length + " <> Saved=" + count);
log.log(Level.SEVERE, "Line difference - JournalLines=" + fromLines.length + " <> Saved=" + count);
return count;
} // copyLinesFrom

View File

@ -50,11 +50,13 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
MJournalBatch to = new MJournalBatch (ctx, 0, trxName);
PO.copyValues(from, to, from.getAD_Client_ID(), from.getAD_Org_ID());
to.set_ValueNoCheck ("DocumentNo", null);
to.set_ValueNoCheck ("C_Period_ID", null);
to.setDateAcct(dateDoc);
to.setDateDoc(dateDoc);
to.setDocStatus(DOCSTATUS_Drafted);
to.setDocAction(DOCACTION_Complete);
to.setIsApproved(false);
to.setProcessed (false);
//
if (!to.save())
throw new IllegalStateException("Could not create Journal Batch");
@ -220,7 +222,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
PO.copyValues(fromJournals[i], toJournal, getAD_Client_ID(), getAD_Org_ID());
toJournal.setGL_JournalBatch_ID(getGL_JournalBatch_ID());
toJournal.set_ValueNoCheck ("DocumentNo", null); // create new
toJournal.setC_Period_ID(0);
toJournal.set_ValueNoCheck ("C_Period_ID", null);
toJournal.setDateDoc(getDateDoc()); // dates from this Batch
toJournal.setDateAcct(getDateAcct());
toJournal.setDocStatus(MJournal.DOCSTATUS_Drafted);
@ -238,7 +240,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
}
}
if (fromJournals.length != count)
log.log(Level.SEVERE, "copyDetailsFrom - Line difference - Journals=" + fromJournals.length + " <> Saved=" + count);
log.log(Level.SEVERE, "Line difference - Journals=" + fromJournals.length + " <> Saved=" + count);
return count + lineCount;
} // copyLinesFrom

View File

@ -176,6 +176,28 @@ public class MMovementLine extends X_M_MovementLine
if (newRecord || is_ValueChanged("QtyEntered"))
setMovementQty(getMovementQty());
// Mandatory Instance
if (getM_AttributeSetInstanceTo_ID() == 0)
{
if (getM_AttributeSetInstance_ID() != 0) // set to from
setM_AttributeSetInstanceTo_ID(getM_AttributeSetInstance_ID());
else
{
MProduct product = getProduct();
if (product != null
&& product.getM_AttributeSet_ID() != 0)
{
MAttributeSet mas = MAttributeSet.get(getCtx(), product.getM_AttributeSet_ID());
if (mas.isInstanceAttribute()
&& (mas.isMandatory() || mas.isMandatoryAlways()))
{
log.saveError("FillMandatory", Msg.getElement(getCtx(), "M_AttributeSetInstanceTo_ID"));
return false;
}
}
}
} // ASI
return true;
} // beforeSave

View File

@ -1314,7 +1314,7 @@ public class MOrder extends X_C_Order implements DocAction
// Credit Check
if (isSOTrx())
{
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null);
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName());
if (MBPartner.SOCREDITSTATUS_CreditStop.equals(bp.getSOCreditStatus()))
{
m_processMsg = "@BPartnerCreditStop@ - @TotalOpenBalance@="
@ -1888,11 +1888,11 @@ public class MOrder extends X_C_Order implements DocAction
// Org Must be linked to BPartner
MOrg org = MOrg.get(getCtx(), getAD_Org_ID());
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID();
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName());
if (counterC_BPartner_ID == 0)
return null;
// Business Partner needs to be linked to Org
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null);
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName());
int counterAD_Org_ID = bp.getAD_OrgBP_ID_Int();
if (counterAD_Org_ID == 0)
return null;
@ -2143,6 +2143,26 @@ public class MOrder extends X_C_Order implements DocAction
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
String DocSubTypeSO = dt.getDocSubTypeSO();
// Replace Prepay with POS to revert all doc
if (MDocType.DOCSUBTYPESO_PrepayOrder.equals (DocSubTypeSO))
{
MDocType newDT = null;
MDocType[] dts = MDocType.getOfClient (getCtx());
for (int i = 0; i < dts.length; i++)
{
MDocType type = dts[i];
if (MDocType.DOCSUBTYPESO_PrepayOrder.equals(type.getDocSubTypeSO()))
{
if (type.isDefault() || newDT == null)
newDT = type;
}
}
if (newDT == null)
return false;
else
setC_DocType_ID (newDT.getC_DocType_ID());
}
// PO - just re-open
if (!isSOTrx())
log.info("Existing documents not modified - " + dt);

View File

@ -1655,16 +1655,16 @@ public final class MPayment extends X_C_Payment
// Org Must be linked to BPartner
MOrg org = MOrg.get(getCtx(), getAD_Org_ID());
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID();
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName());
if (counterC_BPartner_ID == 0)
return null;
// Business Partner needs to be linked to Org
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), null);
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName());
int counterAD_Org_ID = bp.getAD_OrgBP_ID_Int();
if (counterAD_Org_ID == 0)
return null;
MBPartner counterBP = new MBPartner (getCtx(), counterC_BPartner_ID, null);
MBPartner counterBP = new MBPartner (getCtx(), counterC_BPartner_ID, get_TrxName());
// MOrgInfo counterOrgInfo = MOrgInfo.get(getCtx(), counterAD_Org_ID);
log.info("Counter BP=" + counterBP.getName());

View File

@ -122,4 +122,20 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct
return success;
} // afterSave
/**
* String Representation
* @return info
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("MProductCategoryAcct[");
sb.append (get_ID())
.append (",M_Product_Category_ID=").append (getM_Product_Category_ID())
.append (",C_AcctSchema_ID=").append(getC_AcctSchema_ID())
.append (",CostingLevel=").append(getCostingLevel())
.append (",CostingMethod=").append(getCostingMethod())
.append ("]");
return sb.toString ();
} // toString
} // MProductCategoryAcct

View File

@ -56,7 +56,7 @@ public class MRecurring extends X_C_Recurring
public String toString()
{
StringBuffer sb = new StringBuffer ("MRecurring[")
.append(get_ID()).append(",").append(getName());
.append(get_ID()).append("-").append(getName());
if (getRecurringType().equals(MRecurring.RECURRINGTYPE_Order))
sb.append(",C_Order_ID=").append(getC_Order_ID());
else if (getRecurringType().equals(MRecurring.RECURRINGTYPE_Invoice))
@ -65,7 +65,7 @@ public class MRecurring extends X_C_Recurring
sb.append(",C_Project_ID=").append(getC_Project_ID());
else if (getRecurringType().equals(MRecurring.RECURRINGTYPE_GLJournal))
sb.append(",GL_JournalBatch_ID=").append(getGL_JournalBatch_ID());
sb.append(",Fequency=").append(getFrequencyType()).append("*").append(getFrequency());
sb.append(",Frequency=").append(getFrequencyType()).append("*").append(getFrequency());
sb.append("]");
return sb.toString();
} // toString

View File

@ -59,10 +59,6 @@ public final class NaturalAccountMap<K,V> extends CCache<K,V>
m_trxName = trxName;
} // NaturalAccountMap
/** Delimiter */
private String m_delim = ",";
/** KeyNo */
private static int s_keyNo = 0;
/** Context */
private Properties m_ctx = null;
/** Transaction */

View File

@ -501,4 +501,18 @@ public class ProductCost
return cost;
} // getPOCost
/**
* String Representation
* @return info
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("ProductCost[");
sb.append ("M_Product_ID=").append(m_M_Product_ID)
.append(",M_AttributeSetInstance_ID").append(m_M_AttributeSetInstance_ID)
.append (",Qty=").append(m_qty)
.append ("]");
return sb.toString ();
} // toString
} // ProductCost

View File

@ -100,7 +100,7 @@ public class BPartnerOrgLink extends SvrProcess
}
else // check if linked to already
{
int C_BPartner_ID = org.getLinkedC_BPartner_ID();
int C_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName());
if (C_BPartner_ID > 0)
throw new IllegalArgumentException ("Organization '" + org.getName()
+ "' already linked (to C_BPartner_ID=" + C_BPartner_ID + ")");

View File

@ -239,16 +239,28 @@ public class ChangeLogProcess extends SvrProcess
{
m_sqlUpdate.append(getSQLValue(cLog.getOldValue()));
if (p_CheckNewValue.booleanValue())
m_sqlUpdateWhere.append(" AND ").append(m_column.getColumnName())
.append("=").append(getSQLValue(cLog.getNewValue()));
{
m_sqlUpdateWhere.append(" AND ").append(m_column.getColumnName());
String newValue = getSQLValue(cLog.getNewValue());
if (newValue == null || "NULL".equals(newValue))
m_sqlUpdateWhere.append(" IS NULL");
else
m_sqlUpdateWhere.append("=").append(newValue);
}
}
// ReDo (a) -> b
else if (p_CheckOldValue != null)
{
m_sqlUpdate.append(getSQLValue(cLog.getNewValue()));
if (p_CheckOldValue.booleanValue())
m_sqlUpdateWhere.append(" AND ").append(m_column.getColumnName())
.append("=").append(getSQLValue(cLog.getOldValue()));
{
String newValue = getSQLValue(cLog.getOldValue());
m_sqlUpdateWhere.append(" AND ").append(m_column.getColumnName());
if (newValue == null || "NULL".equals(newValue))
m_sqlUpdateWhere.append(" IS NULL");
else
m_sqlUpdateWhere.append("=").append(newValue);
}
}
} // createStatement

View File

@ -357,7 +357,7 @@ public class DistributionRun extends SvrProcess
if (runAD_Org_ID == 0)
runAD_Org_ID = Env.getAD_Org_ID(getCtx());
MOrg runOrg = MOrg.get(getCtx(), runAD_Org_ID);
int runC_BPartner_ID = runOrg.getLinkedC_BPartner_ID();
int runC_BPartner_ID = runOrg.getLinkedC_BPartner_ID(get_TrxName());
boolean counter = !m_run.isCreateSingleOrder() // no single Order
&& runC_BPartner_ID > 0 // Org linked to BP
&& !m_docType.isSOTrx(); // PO

View File

@ -39,7 +39,6 @@ public class DocumentTypeVerify extends SvrProcess
/**
* No Parameters (Nop)
* @see org.compiere.process.SvrProcess#prepare()
*/
protected void prepare()
{
@ -47,7 +46,6 @@ public class DocumentTypeVerify extends SvrProcess
/**
* Execute process
* @see org.compiere.process.SvrProcess#doIt()
* @return info
* @throws Exception
*/

View File

@ -42,9 +42,6 @@ public class ImportAccount extends SvrProcess
/** Delete old Imported */
private boolean m_deleteOldImported = false;
/** Organization to be imported to */
private int m_AD_Org_ID = 0;
/** Effective */
private Timestamp m_DateValue = null;

View File

@ -36,8 +36,6 @@ public class ImportBPartner extends SvrProcess
/** Delete old Imported */
private boolean m_deleteOldImported = false;
/** Organization to be imported to */
private int m_AD_Org_ID = 0;
/** Effective */
private Timestamp m_DateValue = null;
@ -101,10 +99,10 @@ public class ImportBPartner extends SvrProcess
// Set BP_Group
sql = new StringBuffer ("UPDATE I_BPartner i "
+ "SET GroupValue=(SELECT Value FROM C_BP_Group g WHERE g.IsDefault='Y'"
+ " AND g.AD_Client_ID=i.AD_Client_ID AND ROWNUM=1) "
+ "WHERE GroupValue IS NULL AND C_BP_Group_ID IS NULL"
+ " AND I_IsImported<>'Y'").append(clientCheck);
+ "SET GroupValue=(SELECT MAX(Value) FROM C_BP_Group g WHERE g.IsDefault='Y'"
+ " AND g.AD_Client_ID=i.AD_Client_ID");
sql.append("WHERE GroupValue IS NULL AND C_BP_Group_ID IS NULL"
+ " AND I_IsImported<>'Y'").append(clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("Set Group Default=" + no);
//
@ -151,10 +149,10 @@ public class ImportBPartner extends SvrProcess
// Set Region
sql = new StringBuffer ("UPDATE I_BPartner i "
+ "Set RegionName=(SELECT Name FROM C_Region r"
+ "Set RegionName=(SELECT MAX(Name FROM C_Region r"
+ " WHERE r.IsDefault='Y' AND r.C_Country_ID=i.C_Country_ID"
+ " AND r.AD_Client_ID IN (0, i.AD_Client_ID) AND ROWNUM=1) "
+ "WHERE RegionName IS NULL AND C_Region_ID IS NULL"
+ " AND r.AD_Client_ID IN (0, i.AD_Client_ID)) " );
sql.append("WHERE RegionName IS NULL AND C_Region_ID IS NULL"
+ " AND I_IsImported<>'Y'").append(clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("Set Region Default=" + no);
@ -433,7 +431,7 @@ public class ImportBPartner extends SvrProcess
if (impBP.getPhone() != null)
user.setPhone(impBP.getPhone());
if (impBP.getPhone2() != null)
user.setPhone(impBP.getPhone2());
user.setPhone2(impBP.getPhone2());
if (impBP.getFax() != null)
user.setFax(impBP.getFax());
if (impBP.getEMail() != null)

View File

@ -1,56 +0,0 @@
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'C_ProcessCreate')
BEGIN
PRINT '<<< DROPPING PROCEDURE C_ProcessCreate >>>'
DROP Procedure C_ProcessCreate
END
go
------------------------------------------------------------------------------
CREATE Procedure C_ProcessCreate
(
@AD_Table_ID Identifier,
@Record_ID Identifier,
@AD_IProcess_ID Identifier OUTPUT
)
--WITH ENCRYPTION
AS
/******************************************************************************
* Author: Jorg Janke (c) ClassApps 1999
* Version: $Header: /cvs/adempiere/db/database/Procedures/C_ProcessCreate.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
*
* Description:
* Create process for background execution
*
* Return values:
* Int_Process_ID
*
* Called by:
*
******************************************************************************/
BEGIN
Set NoCount ON
BEGIN TRANSACTION
SELECT @AD_IProcess_ID = ISNULL(MAX(AD_IProcess_ID), 0)+1
FROM AD_IProcess
---------------------------------
INSERT INTO AD_IProcess
(AD_IProcess_ID, AD_Table_ID, Record_ID, IsProcessing, Updated)
VALUES
(@AD_IProcess_ID, @AD_Table_ID, @Record_ID, 'N', null)
IF (@@ERROR <> 0)
BEGIN
RAISERROR 60001 'Int_Process insert error'
ROLLBACK TRAN
RETURN(1)
END
COMMIT TRANSACTION
END -- C_ProcessCreate
go
------------------------------------------------------------------------------
IF OBJECT_ID('C_ProcessCreate') IS NOT NULL
PRINT '<<< CREATED PROCEDURE C_ProcessCreate >>>'
ELSE
PRINT '<<< FAILED CREATING PROCEDURE C_ProcessCreate >>>'
go

View File

@ -202,11 +202,11 @@ public class MOrg extends X_AD_Org
* Get Linked BPartner
* @return C_BPartner_ID
*/
public int getLinkedC_BPartner_ID()
public int getLinkedC_BPartner_ID(String trxName)
{
if (m_linkedBPartner == null)
{
int C_BPartner_ID = DB.getSQLValue(null,
int C_BPartner_ID = DB.getSQLValue(trxName,
"SELECT C_BPartner_ID FROM C_BPartner WHERE AD_OrgBP_ID=?",
getAD_Org_ID());
if (C_BPartner_ID < 0) // not found = -1