Skip to content

Commit

Permalink
HUsToReturn_CreateShippedHU (#10834)
Browse files Browse the repository at this point in the history
* HUsToReturn_CreateShippedHU

* generate models

* ServiceRepair_Old_Shipped_HU

* M_InOutLine.IsWarrantyCase; handle it

* 5582850_sys_ServiceRepair_Old_Shipped_HU_index.sql

* QA

* QA
  • Loading branch information
teosarca committed Mar 18, 2021
1 parent d66c387 commit 09b3436
Show file tree
Hide file tree
Showing 39 changed files with 3,273 additions and 875 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import lombok.Value;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.mm.attributes.AttributeSetInstanceId;
import org.adempiere.mm.attributes.api.ImmutableAttributeSet;
import org.adempiere.model.InterfaceWrapperHelper;
import org.adempiere.util.lang.IContextAware;
import org.adempiere.warehouse.LocatorId;
Expand Down Expand Up @@ -246,6 +247,8 @@ public interface IHandlingUnitsBL extends ISingletonService

AttributeSetInstanceId createASIFromHUAttributes(@NonNull ProductId productId, @NonNull I_M_HU hu);

ImmutableAttributeSet getImmutableAttributeSet(@NonNull I_M_HU hu);

@Builder
@Value
class TopLevelHusQuery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -958,11 +958,15 @@ public AttributeSetInstanceId createASIFromHUAttributes(@NonNull final ProductId
@Override
public AttributeSetInstanceId createASIFromHUAttributes(@NonNull final ProductId productId, @NonNull final I_M_HU hu)
{
final ImmutableAttributeSet attributes = attributeStorageFactoryService.createHUAttributeStorageFactory()
.getImmutableAttributeSet(hu);
final ImmutableAttributeSet attributes = getImmutableAttributeSet(hu);

final I_M_AttributeSetInstance asi = attributeSetInstanceBL.createASIWithASFromProductAndInsertAttributeSet(productId, attributes);
return AttributeSetInstanceId.ofRepoId(asi.getM_AttributeSetInstance_ID());
}

@Override
public ImmutableAttributeSet getImmutableAttributeSet(@NonNull final I_M_HU hu)
{
return attributeStorageFactoryService.createHUAttributeStorageFactory().getImmutableAttributeSet(hu);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class CreateCustomerReturnLineReq
@Nullable
AttributeSetInstanceId attributeSetInstanceId;

boolean warrantyCase;

@NonNull
Quantity qtyReturned;

Expand All @@ -65,6 +67,7 @@ public CreateCustomerReturnLineReq(
@NonNull final ProductId productId,
@NonNull final Quantity qtyReturned,
@Nullable final AttributeSetInstanceId attributeSetInstanceId,
final boolean warrantyCase,
@Nullable final InOutLineId originShipmentLineId,
@Nullable final HUPIItemProductId hupiItemProductId,
@Nullable final QtyTU qtyTU)
Expand All @@ -73,6 +76,7 @@ public CreateCustomerReturnLineReq(
this.productId = productId;
this.qtyReturned = qtyReturned;
this.attributeSetInstanceId = attributeSetInstanceId;
this.warrantyCase = warrantyCase;
this.originShipmentLineId = originShipmentLineId;
this.hupiItemProductId = hupiItemProductId;
this.qtyTU = qtyTU;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public I_M_InOutLine createReturnLine(@NonNull final CreateCustomerReturnLineReq
returnLine.setM_AttributeSetInstance_ID(request.getAttributeSetInstanceId().getRepoId());
}

returnLine.setIsWarrantyCase(request.isWarrantyCase());

if (request.getHupiItemProductId() != null && request.getQtyTU() != null)
{
returnLine.setQtyEnteredTU(request.getQtyTU().toBigDecimal());
Expand Down
9 changes: 9 additions & 0 deletions backend/de.metas.servicerepair.base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>de.metas.adempiere.adempiere</groupId>
<artifactId>de.metas.adempiere.adempiere.base</artifactId>
<version>${metasfresh.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public interface I_C_Project_Repair_Consumption_Summary
String COLUMNNAME_C_Project_ID = "C_Project_ID";

/**
* Set Repair Project Consumption Summary.
* Set Expenses Overview.
*
* <br>Type: ID
* <br>Mandatory: true
Expand All @@ -82,7 +82,7 @@ public interface I_C_Project_Repair_Consumption_Summary
void setC_Project_Repair_Consumption_Summary_ID (int C_Project_Repair_Consumption_Summary_ID);

/**
* Get Repair Project Consumption Summary.
* Get Expenses Overview.
*
* <br>Type: ID
* <br>Mandatory: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public interface I_C_Project_Repair_CostCollector
String COLUMNNAME_C_Project_ID = "C_Project_ID";

/**
* Set Repair Project Cost Collector.
* Set Service/Repair Project Expenses.
*
* <br>Type: ID
* <br>Mandatory: true
Expand All @@ -83,7 +83,7 @@ public interface I_C_Project_Repair_CostCollector
void setC_Project_Repair_CostCollector_ID (int C_Project_Repair_CostCollector_ID);

/**
* Get Repair Project Cost Collector.
* Get Service/Repair Project Expenses.
*
* <br>Type: ID
* <br>Mandatory: true
Expand Down Expand Up @@ -239,6 +239,27 @@ public interface I_C_Project_Repair_CostCollector
ModelColumn<I_C_Project_Repair_CostCollector, Object> COLUMN_IsActive = new ModelColumn<>(I_C_Project_Repair_CostCollector.class, "IsActive", null);
String COLUMNNAME_IsActive = "IsActive";

/**
* Set Warranty Case.
*
* <br>Type: YesNo
* <br>Mandatory: true
* <br>Virtual Column: false
*/
void setIsWarrantyCase (boolean IsWarrantyCase);

/**
* Get Warranty Case.
*
* <br>Type: YesNo
* <br>Mandatory: true
* <br>Virtual Column: false
*/
boolean isWarrantyCase();

ModelColumn<I_C_Project_Repair_CostCollector, Object> COLUMN_IsWarrantyCase = new ModelColumn<>(I_C_Project_Repair_CostCollector.class, "IsWarrantyCase", null);
String COLUMNNAME_IsWarrantyCase = "IsWarrantyCase";

/**
* Set Attributes.
* Attribute Instances for Products
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,27 @@ public interface I_C_Project_Repair_Task
ModelColumn<I_C_Project_Repair_Task, Object> COLUMN_IsRepairOrderDone = new ModelColumn<>(I_C_Project_Repair_Task.class, "IsRepairOrderDone", null);
String COLUMNNAME_IsRepairOrderDone = "IsRepairOrderDone";

/**
* Set Warranty Case.
*
* <br>Type: YesNo
* <br>Mandatory: true
* <br>Virtual Column: false
*/
void setIsWarrantyCase (boolean IsWarrantyCase);

/**
* Get Warranty Case.
*
* <br>Type: YesNo
* <br>Mandatory: true
* <br>Virtual Column: false
*/
boolean isWarrantyCase();

ModelColumn<I_C_Project_Repair_Task, Object> COLUMN_IsWarrantyCase = new ModelColumn<>(I_C_Project_Repair_Task.class, "IsWarrantyCase", null);
String COLUMNNAME_IsWarrantyCase = "IsWarrantyCase";

/**
* Set Attributes.
* Attribute Instances for Products
Expand Down

0 comments on commit 09b3436

Please sign in to comment.