IDEMPIERE-3107 Production (Light) system enable to complete production without end product
This commit is contained in:
parent
367f50673b
commit
d8278975ed
|
@ -103,6 +103,12 @@ public class MProduction extends X_M_Production implements DocAction {
|
||||||
StringBuilder errors = new StringBuilder();
|
StringBuilder errors = new StringBuilder();
|
||||||
int processed = 0;
|
int processed = 0;
|
||||||
|
|
||||||
|
//IDEMPIERE-3107 Check if End Product in Production Lines exist
|
||||||
|
if(!isHaveEndProduct(getLines())) {
|
||||||
|
m_processMsg = "Production does not contain End Product";
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isUseProductionPlan()) {
|
if (!isUseProductionPlan()) {
|
||||||
MProductionLine[] lines = getLines();
|
MProductionLine[] lines = getLines();
|
||||||
errors.append(processLines(lines));
|
errors.append(processLines(lines));
|
||||||
|
@ -142,6 +148,15 @@ public class MProduction extends X_M_Production implements DocAction {
|
||||||
return DocAction.STATUS_Completed;
|
return DocAction.STATUS_Completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isHaveEndProduct(MProductionLine[] lines) {
|
||||||
|
|
||||||
|
for(MProductionLine line : lines) {
|
||||||
|
if(line.isEndProduct())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private Object processLines(MProductionLine[] lines) {
|
private Object processLines(MProductionLine[] lines) {
|
||||||
StringBuilder errors = new StringBuilder();
|
StringBuilder errors = new StringBuilder();
|
||||||
for ( int i = 0; i<lines.length; i++) {
|
for ( int i = 0; i<lines.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue