Skip to content

Commit

Permalink
Merge branch 'develop' into feature/3477
Browse files Browse the repository at this point in the history
* develop: (29 commits)
  Add overwrite values from Smart Browser field
  Allows define system events for validation of Standard Request Type
  Validate client
  Add better approach for validation engine
  Add optional value for source price list
  Add support to data type as mapping from entities (adempiere#3476)
  Adding the Weight and Volume field into Sales Order and Purchase Order  Feature/3473 (adempiere#3474)
  Add the database function to get the daily salary (adempiere#3458)
  Error in calculating quantity ordered or reserved for manufacturing order and distribution order  (adempiere#3472)
  Fixed error with missing parameter for Requisition PO Create (adempiere#3475)
  Fixed error with Dependent Entities for Record Access (adempiere#3480)
  Remove deprecated methods for Order (adempiere#3484)
  Fixed error when a Purchase order is voided (adempiere#3449)
  Update MPPForecastDefinitionLine.java
  adempiere#3469 [Bug Report] In the process Generate an Invoice from the Receipt is not validate if an Invoice was generated adempiere#3469 (adempiere#3470)
  adempiere#3467 [Bug Report] Generate Receipt from Invoice process is not validate if was generate a Material Receipt from a previous execution adempiere#3467 (adempiere#3468)
  adempiere#3462 [Bug Report] Total matched invoice qty adempiere#3462 (adempiere#3464)
  Fixed error with translation value for reference
  fix: BP Group getSQlWhere in Forecast Run Create.
  Fixed error with Crosstab for Smart Browser
  ...
  • Loading branch information
e-Evolution committed Jul 1, 2021
2 parents 4c62216 + 3e50388 commit b425ad9
Show file tree
Hide file tree
Showing 41 changed files with 2,759 additions and 742 deletions.
67 changes: 40 additions & 27 deletions base/src/org/compiere/model/I_R_StandardRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

/** Generated Interface for R_StandardRequest
* @author Adempiere (generated)
* @version Release 3.9.2
* @version Release 3.9.3
*/
public interface I_R_StandardRequest
{
Expand Down Expand Up @@ -231,19 +231,6 @@ public interface I_R_StandardRequest

public org.compiere.model.I_R_RequestType getR_RequestType() throws RuntimeException;

/** Column name R_StandardRequestType_ID */
public static final String COLUMNNAME_R_StandardRequestType_ID = "R_StandardRequestType_ID";

/** Set Standard Request Type.
* Standard Request Type
*/
public void setR_StandardRequestType_ID (int R_StandardRequestType_ID);

/** Get Standard Request Type.
* Standard Request Type
*/
public int getR_StandardRequestType_ID();

/** Column name R_StandardRequest_ID */
public static final String COLUMNNAME_R_StandardRequest_ID = "R_StandardRequest_ID";

Expand All @@ -257,6 +244,19 @@ public interface I_R_StandardRequest
*/
public int getR_StandardRequest_ID();

/** Column name R_StandardRequestType_ID */
public static final String COLUMNNAME_R_StandardRequestType_ID = "R_StandardRequestType_ID";

/** Set Standard Request Type.
* Standard Request Type
*/
public void setR_StandardRequestType_ID (int R_StandardRequestType_ID);

/** Get Standard Request Type.
* Standard Request Type
*/
public int getR_StandardRequestType_ID();

/** Column name R_Status_ID */
public static final String COLUMNNAME_R_Status_ID = "R_Status_ID";

Expand Down Expand Up @@ -302,6 +302,19 @@ public interface I_R_StandardRequest
*/
public int getSeqNo();

/** Column name Subject */
public static final String COLUMNNAME_Subject = "Subject";

/** Set Subject.
* Email Message Subject
*/
public void setSubject (String Subject);

/** Get Subject.
* Email Message Subject
*/
public String getSubject();

/** Column name Summary */
public static final String COLUMNNAME_Summary = "Summary";

Expand All @@ -328,19 +341,6 @@ public interface I_R_StandardRequest
*/
public String getTaskStatus();

/** Column name UUID */
public static final String COLUMNNAME_UUID = "UUID";

/** Set Immutable Universally Unique Identifier.
* Immutable Universally Unique Identifier
*/
public void setUUID (String UUID);

/** Get Immutable Universally Unique Identifier.
* Immutable Universally Unique Identifier
*/
public String getUUID();

/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";

Expand All @@ -356,4 +356,17 @@ public interface I_R_StandardRequest
* User who updated this records
*/
public int getUpdatedBy();

/** Column name UUID */
public static final String COLUMNNAME_UUID = "UUID";

/** Set Immutable Universally Unique Identifier.
* Immutable Universally Unique Identifier
*/
public void setUUID (String UUID);

/** Get Immutable Universally Unique Identifier.
* Immutable Universally Unique Identifier
*/
public String getUUID();
}
4 changes: 2 additions & 2 deletions base/src/org/compiere/model/MInOut.java
Original file line number Diff line number Diff line change
Expand Up @@ -1478,9 +1478,9 @@ quantity, reservedDiff, orderedDiff, get_TrxName()))
} // stock movement

// Correct Order Line
if (product != null && orderLine != null && isSOTrx() && !orderLine.getParent().isReturnOrder()) // other in VMatch.createMatchRecord
if (product != null && product.isStocked() && orderLine != null && isSOTrx() && !orderLine.getParent().isReturnOrder()) // other in VMatch.createMatchRecord
orderLine.setQtyReserved(orderLine.getQtyReserved().add(QtySO));
else if (product != null && orderLine != null && !isSOTrx() && !orderLine.getParent().isReturnOrder())
else if (product != null && product.isStocked() && orderLine != null && !isSOTrx() && !orderLine.getParent().isReturnOrder())
orderLine.setQtyReserved(orderLine.getQtyReserved().add(QtyPO));

// Update Sales Order Line
Expand Down
13 changes: 0 additions & 13 deletions base/src/org/compiere/model/MInvoiceLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -1317,17 +1317,4 @@ public void setRMALine(MRMALine rmaLine)
setC_Activity_ID(rmaLine.getC_Activity_ID());
setC_Campaign_ID(rmaLine.getC_Campaign_ID());
}

/**
* @return matched qty
*/
public BigDecimal getMatchedQty()
{
String sql = "SELECT COALESCE(SUM("+MMatchInv.COLUMNNAME_Qty+"),0)"
+" FROM "+MMatchInv.Table_Name
+" WHERE "+MMatchInv.COLUMNNAME_C_InvoiceLine_ID+"=?"
+" AND "+MMatchInv.COLUMNNAME_Processed+"=?";
return DB.getSQLValueBDEx(get_TrxName(), sql, getC_InvoiceLine_ID(), true);
}

} // MInvoiceLine
118 changes: 11 additions & 107 deletions base/src/org/compiere/model/MMatchPO.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.Properties;
import java.util.logging.Level;

Expand Down Expand Up @@ -283,114 +284,17 @@ public static MMatchPO[] getOrderLine (Properties ctx, int C_OrderLine_ID, Strin
// end MZ

/**
* Find/Create PO(Inv) Match
* @param iLine invoice line
* @param sLine receipt line
* @param dateTrx date
* @param qty qty
* @return Match Record
* @return PO matched qty
*/
@Deprecated
public static MMatchPO create (MInvoiceLine iLine, MInOutLine sLine,
Timestamp dateTrx, BigDecimal qty)
{
String trxName = null;
Properties ctx = null;
int C_OrderLine_ID = 0;
if (iLine != null)
{
trxName = iLine.get_TrxName();
ctx = iLine.getCtx();
C_OrderLine_ID = iLine.getC_OrderLine_ID();
}
if (sLine != null)
{
trxName = sLine.get_TrxName();
ctx = sLine.getCtx();
C_OrderLine_ID = sLine.getC_OrderLine_ID();
}

MMatchPO retValue = null;
String sql = "SELECT * FROM M_MatchPO WHERE C_OrderLine_ID=?";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = DB.prepareStatement (sql, trxName);
pstmt.setInt (1, C_OrderLine_ID);
rs = pstmt.executeQuery ();
while (rs.next ())
{
MMatchPO mpo = new MMatchPO (ctx, rs, trxName);
if (qty.compareTo(mpo.getQty()) == 0)
{
if (iLine != null)
{
if (mpo.getC_InvoiceLine_ID() == 0
|| mpo.getC_InvoiceLine_ID() == iLine.getC_InvoiceLine_ID())
{
mpo.setC_InvoiceLine_ID(iLine);
if (iLine.getM_AttributeSetInstance_ID() != 0)
{
if (mpo.getM_AttributeSetInstance_ID() == 0)
mpo.setM_AttributeSetInstance_ID(iLine.getM_AttributeSetInstance_ID());
else if (mpo.getM_AttributeSetInstance_ID() != iLine.getM_AttributeSetInstance_ID())
continue;
}
}
else
continue;
}
if (sLine != null)
{
if (mpo.getM_InOutLine_ID() == 0
|| mpo.getM_InOutLine_ID() == sLine.getM_InOutLine_ID())
{
mpo.setM_InOutLine_ID(sLine.getM_InOutLine_ID());
if (sLine.getM_AttributeSetInstance_ID() != 0)
{
if (mpo.getM_AttributeSetInstance_ID() == 0)
mpo.setM_AttributeSetInstance_ID(sLine.getM_AttributeSetInstance_ID());
else if (mpo.getM_AttributeSetInstance_ID() != sLine.getM_AttributeSetInstance_ID())
continue;
}
}
else
continue;
}
retValue = mpo;
break;
}
}
}
catch (Exception e)
{
s_log.log(Level.SEVERE, sql, e);
}
finally
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}

// Create New
if (retValue == null)
{
if (sLine != null)
{
retValue = new MMatchPO (sLine, dateTrx, qty);
if (iLine != null)
retValue.setC_InvoiceLine_ID(iLine);
}
else if (iLine != null)
{
retValue = new MMatchPO (iLine, dateTrx, qty);
}
}

return retValue;
} // create

public static BigDecimal getPOMatchedQuantity(MOrderLine orderLine) {
Optional<BigDecimal> maybeMatchedQty = Optional.ofNullable(
new Query(orderLine.getCtx() , MMatchPO.Table_Name , MMatchPO.COLUMNNAME_C_OrderLine_ID + "=? AND " + MMatchPO.COLUMNNAME_Processed + "=? ", orderLine.get_TrxName())
.setClient_ID()
.setParameters(orderLine.getC_OrderLine_ID(), true)
.sum(MMatchPO.COLUMNNAME_Qty)
);
return maybeMatchedQty.orElse(BigDecimal.ZERO);
}

/** Static Logger */
private static CLogger s_log = CLogger.getCLogger (MMatchPO.class);
Expand Down
Loading

0 comments on commit b425ad9

Please sign in to comment.