refactor balinusa
This commit is contained in:
parent
3ee96629d7
commit
a5ac3831fa
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +0,0 @@
|
|||
package andromedia.midsuit.model;
|
||||
|
||||
public class X_C_Location {
|
||||
|
||||
}
|
||||
|
|
@ -1,23 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/bcprov-ext-jdk15on-160.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/hsqldb.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/jackcess-encrypt-2.1.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/poi-ooxml-3.9.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/dom4j-1.6.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/poi-3.9.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="lib" path="META-INF/xmlbeans-2.3.0.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/poi-ooxml-schemas-3.9.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/jackcess-2.1.3.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/ucanaccess-3.0.7.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/commons-lang-2.6.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/commons-logging-1.1.1.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/bcprov-ext-jdk15on-160.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/hsqldb.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/jackcess-encrypt-2.1.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/poi-ooxml-3.9.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/dom4j-1.6.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="META-INF/poi-3.9.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="lib" path="META-INF/xmlbeans-2.3.0.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/poi-ooxml-schemas-3.9.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/jackcess-2.1.3.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/ucanaccess-3.0.7.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/commons-lang-2.6.jar"/>
|
||||
<classpathentry kind="lib" path="META-INF/commons-logging-1.1.1.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>andromedia.midsuit.project</name>
|
||||
<name>balinusa.midsuit.project</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Andromedia Midsuit
|
||||
Bundle-SymbolicName: andromedia.midsuit.project
|
||||
Bundle-Name: Balinusa
|
||||
Bundle-SymbolicName: balinusa.midsuit.project
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.adempiere.base;bundle-version="5.1.0",
|
||||
|
|
@ -20,7 +20,7 @@ Import-Package: org.compiere.apps,
|
|||
org.compiere.minigrid,
|
||||
org.compiere.process,
|
||||
org.osgi.framework;version="1.8.0"
|
||||
Bundle-Activator: andromedia.midsuit.activator.Activator
|
||||
Bundle-Activator: balinusa.midsuit.activator.Activator
|
||||
Bundle-ClassPath: .,
|
||||
META-INF/poi-3.9.jar,
|
||||
META-INF/bcprov-ext-jdk15on-160.jar,
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
/.DS_Store
|
||||
/balinusa/
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.activator;
|
||||
package balinusa.midsuit.activator;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
|
||||
|
|
@ -1,66 +1,66 @@
|
|||
package andromedia.midsuit.callout;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduction;
|
||||
import org.compiere.model.MProductionLine;
|
||||
import org.compiere.model.Query;
|
||||
|
||||
import andromedia.midsuit.model.MID_Analysis;
|
||||
import andromedia.midsuit.model.MID_AnalysisPro;
|
||||
|
||||
public class MID_CalloutAnalysisQC extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
|
||||
if(mField.getColumnName().equals(MProduction.COLUMNNAME_M_Production_ID)) {
|
||||
setProductQuantity(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
return setRawMaterial(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public String setProductQuantity(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue){
|
||||
|
||||
String valueReturn = "";
|
||||
MProduction prod = new MProduction(ctx, (int) value, null);
|
||||
|
||||
if (prod != null) {
|
||||
mTab.setValue(MID_AnalysisPro.COLUMNNAME_M_Product_ID, prod.getM_Product_ID());
|
||||
mTab.setValue(MID_AnalysisPro.COLUMNNAME_Qty, prod.getProductionQty());
|
||||
}
|
||||
mTab.setValue(MID_Analysis.COLUMNNAME_JumlahRM, valueReturn);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setRawMaterial(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue){
|
||||
|
||||
String valueReturn = "";
|
||||
List<MProductionLine> productionLines = new Query(ctx, MProductionLine.Table_Name, "M_Production_ID = ? and isEndProduct='N'", null)
|
||||
.setParameters(new Object[] {(int) value})
|
||||
.list();
|
||||
|
||||
for(MProductionLine productionLine : productionLines) {
|
||||
if(productionLine != null) {
|
||||
valueReturn += productionLine.getQtyUsed().toString() == null ? "0;" : productionLine.getQtyUsed().toString() + ";";
|
||||
}
|
||||
}
|
||||
|
||||
mTab.setValue(MID_Analysis.COLUMNNAME_JumlahRM, valueReturn);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduction;
|
||||
import org.compiere.model.MProductionLine;
|
||||
import org.compiere.model.Query;
|
||||
|
||||
import balinusa.midsuit.model.MID_Analysis;
|
||||
import balinusa.midsuit.model.MID_AnalysisPro;
|
||||
|
||||
public class MID_CalloutAnalysisQC extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
|
||||
if(mField.getColumnName().equals(MProduction.COLUMNNAME_M_Production_ID)) {
|
||||
setProductQuantity(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
return setRawMaterial(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public String setProductQuantity(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue){
|
||||
|
||||
String valueReturn = "";
|
||||
MProduction prod = new MProduction(ctx, (int) value, null);
|
||||
|
||||
if (prod != null) {
|
||||
mTab.setValue(MID_AnalysisPro.COLUMNNAME_M_Product_ID, prod.getM_Product_ID());
|
||||
mTab.setValue(MID_AnalysisPro.COLUMNNAME_Qty, prod.getProductionQty());
|
||||
}
|
||||
mTab.setValue(MID_Analysis.COLUMNNAME_JumlahRM, valueReturn);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setRawMaterial(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue){
|
||||
|
||||
String valueReturn = "";
|
||||
List<MProductionLine> productionLines = new Query(ctx, MProductionLine.Table_Name, "M_Production_ID = ? and isEndProduct='N'", null)
|
||||
.setParameters(new Object[] {(int) value})
|
||||
.list();
|
||||
|
||||
for(MProductionLine productionLine : productionLines) {
|
||||
if(productionLine != null) {
|
||||
valueReturn += productionLine.getQtyUsed().toString() == null ? "0;" : productionLine.getQtyUsed().toString() + ";";
|
||||
}
|
||||
}
|
||||
|
||||
mTab.setValue(MID_Analysis.COLUMNNAME_JumlahRM, valueReturn);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ import org.compiere.model.CalloutEngine;
|
|||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
|
||||
import andromedia.midsuit.model.X_mid_ceisa_upload;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_upload;
|
||||
|
||||
public class MID_CalloutCeisaUpload extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
|
|
@ -1,42 +1,42 @@
|
|||
package andromedia.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MInOut;
|
||||
import org.compiere.model.MOrder;
|
||||
|
||||
public class MID_CalloutInOut extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
|
||||
if(mField.getColumnName().equals(MInOut.COLUMNNAME_MovementDate)) {
|
||||
mTab.setValue(MInOut.COLUMNNAME_DateAcct, value);
|
||||
}
|
||||
|
||||
// if(mField.getColumnName().equals(MInOut.COLUMNNAME_C_Order_ID)) {
|
||||
// setAJU(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setAJU(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
MOrder order = new MOrder(ctx, (int)value, null);
|
||||
|
||||
if(order != null) {
|
||||
mTab.setValue("noaju1", order.get_ValueAsString("noaju1") == null ? null : order.get_ValueAsString("noaju1"));
|
||||
mTab.setValue("noaju2", order.get_ValueAsString("noaju2") == null ? null : order.get_ValueAsString("noaju2"));
|
||||
mTab.setValue("noaju3", order.get_ValueAsString("noaju3") == null ? null : order.get_ValueAsString("noaju3"));
|
||||
mTab.setValue("noaju4", order.get_ValueAsString("noaju4") == null ? null : order.get_ValueAsString("noaju4"));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MInOut;
|
||||
import org.compiere.model.MOrder;
|
||||
|
||||
public class MID_CalloutInOut extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
|
||||
if(mField.getColumnName().equals(MInOut.COLUMNNAME_MovementDate)) {
|
||||
mTab.setValue(MInOut.COLUMNNAME_DateAcct, value);
|
||||
}
|
||||
|
||||
// if(mField.getColumnName().equals(MInOut.COLUMNNAME_C_Order_ID)) {
|
||||
// setAJU(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setAJU(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
MOrder order = new MOrder(ctx, (int)value, null);
|
||||
|
||||
if(order != null) {
|
||||
mTab.setValue("noaju1", order.get_ValueAsString("noaju1") == null ? null : order.get_ValueAsString("noaju1"));
|
||||
mTab.setValue("noaju2", order.get_ValueAsString("noaju2") == null ? null : order.get_ValueAsString("noaju2"));
|
||||
mTab.setValue("noaju3", order.get_ValueAsString("noaju3") == null ? null : order.get_ValueAsString("noaju3"));
|
||||
mTab.setValue("noaju4", order.get_ValueAsString("noaju4") == null ? null : order.get_ValueAsString("noaju4"));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +1,34 @@
|
|||
package andromedia.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MInOutLine;
|
||||
import org.compiere.model.MOrderLine;
|
||||
|
||||
public class MID_CalloutInOutLine extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
|
||||
if(mField.getColumnName().equals(MInOutLine.COLUMNNAME_C_OrderLine_ID)) {
|
||||
this.setDescription(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setDescription(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
MOrderLine ol = new MOrderLine(ctx, (int)value, null);
|
||||
|
||||
mTab.setValue(MInOutLine.COLUMNNAME_Description, ol.getDescription() != null ? ol.getDescription() : null);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MInOutLine;
|
||||
import org.compiere.model.MOrderLine;
|
||||
|
||||
public class MID_CalloutInOutLine extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
|
||||
if(mField.getColumnName().equals(MInOutLine.COLUMNNAME_C_OrderLine_ID)) {
|
||||
this.setDescription(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setDescription(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
MOrderLine ol = new MOrderLine(ctx, (int)value, null);
|
||||
|
||||
mTab.setValue(MInOutLine.COLUMNNAME_Description, ol.getDescription() != null ? ol.getDescription() : null);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Properties;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ import org.compiere.model.CalloutEngine;
|
|||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
|
||||
import andromedia.midsuit.model.X_mid_ceisa_order;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_order;
|
||||
|
||||
public class MID_CalloutIsReturnCeisa extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Properties;
|
||||
|
|
@ -1,55 +1,55 @@
|
|||
package andromedia.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MOrder;
|
||||
import org.compiere.model.MPriceList;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
public class MID_CalloutOrder extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
|
||||
if(mField.getColumnName().equals(MOrder.COLUMNNAME_AD_Org_ID)) {
|
||||
return setPricelistByOrg(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
if(mField.getColumnName().equals(MOrder.COLUMNNAME_DateOrdered)) {
|
||||
mTab.setValue(MOrder.COLUMNNAME_DatePromised, value);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setPricelistByOrg(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
|
||||
int org = (int) value;
|
||||
int AD_Client_ID = (int) mTab.getValue(MOrder.COLUMNNAME_AD_Client_ID);
|
||||
boolean isSOTrx = (boolean) mTab.getValue(MOrder.COLUMNNAME_IsSOTrx);
|
||||
|
||||
int priceList = new Query(ctx, MPriceList.Table_Name, "AD_Org_ID =? AND IsSOPriceList =?", null)
|
||||
.setParameters(new Object[] { org, isSOTrx })
|
||||
.setOnlyActiveRecords(true)
|
||||
.firstId();
|
||||
|
||||
if(priceList>0)
|
||||
mTab.setValue(MOrder.COLUMNNAME_M_PriceList_ID, priceList);
|
||||
|
||||
else
|
||||
{
|
||||
priceList = new Query(ctx, MPriceList.Table_Name, "AD_Client_ID =? AND AD_Org_ID =? AND IsSOPriceList =?", null)
|
||||
.setParameters(new Object[] {AD_Client_ID, 0, isSOTrx })
|
||||
.setOnlyActiveRecords(true)
|
||||
.firstId();
|
||||
mTab.setValue(MOrder.COLUMNNAME_M_PriceList_ID, priceList);
|
||||
}
|
||||
Env.setContext(ctx, "#M_PriceList_ID", priceList);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MOrder;
|
||||
import org.compiere.model.MPriceList;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
public class MID_CalloutOrder extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
|
||||
if(mField.getColumnName().equals(MOrder.COLUMNNAME_AD_Org_ID)) {
|
||||
return setPricelistByOrg(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
if(mField.getColumnName().equals(MOrder.COLUMNNAME_DateOrdered)) {
|
||||
mTab.setValue(MOrder.COLUMNNAME_DatePromised, value);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setPricelistByOrg(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
|
||||
int org = (int) value;
|
||||
int AD_Client_ID = (int) mTab.getValue(MOrder.COLUMNNAME_AD_Client_ID);
|
||||
boolean isSOTrx = (boolean) mTab.getValue(MOrder.COLUMNNAME_IsSOTrx);
|
||||
|
||||
int priceList = new Query(ctx, MPriceList.Table_Name, "AD_Org_ID =? AND IsSOPriceList =?", null)
|
||||
.setParameters(new Object[] { org, isSOTrx })
|
||||
.setOnlyActiveRecords(true)
|
||||
.firstId();
|
||||
|
||||
if(priceList>0)
|
||||
mTab.setValue(MOrder.COLUMNNAME_M_PriceList_ID, priceList);
|
||||
|
||||
else
|
||||
{
|
||||
priceList = new Query(ctx, MPriceList.Table_Name, "AD_Client_ID =? AND AD_Org_ID =? AND IsSOPriceList =?", null)
|
||||
.setParameters(new Object[] {AD_Client_ID, 0, isSOTrx })
|
||||
.setOnlyActiveRecords(true)
|
||||
.firstId();
|
||||
mTab.setValue(MOrder.COLUMNNAME_M_PriceList_ID, priceList);
|
||||
}
|
||||
Env.setContext(ctx, "#M_PriceList_ID", priceList);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ import org.compiere.model.MOrder;
|
|||
import org.compiere.model.MRMA;
|
||||
import org.compiere.model.MRequisition;
|
||||
|
||||
import andromedia.midsuit.model.X_mid_ceisa_order;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_order;
|
||||
|
||||
public class MID_CalloutOrderCeisa extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Properties;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Properties;
|
||||
|
|
@ -8,7 +8,8 @@ import org.compiere.model.CalloutEngine;
|
|||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.util.DB;
|
||||
import andromedia.midsuit.model.X_C_OrderLineMA;
|
||||
|
||||
import balinusa.midsuit.model.X_C_OrderLineMA;
|
||||
|
||||
public class MID_CalloutOrderLineMA extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
|
|
@ -1,31 +1,31 @@
|
|||
package andromedia.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduct;
|
||||
|
||||
import andromedia.midsuit.model.X_ps_ppo;
|
||||
|
||||
public class MID_CalloutPPO extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
if(mField.getColumnName().equals(X_ps_ppo.COLUMNNAME_M_Product_ID)){
|
||||
return product(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String product(Properties ctx, int windowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
if (value==null) return "";
|
||||
|
||||
MProduct product = new MProduct(ctx, (int)value, null);
|
||||
mTab.setValue("C_UOM_ID", product.getC_UOM_ID());
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduct;
|
||||
|
||||
import balinusa.midsuit.model.X_ps_ppo;
|
||||
|
||||
public class MID_CalloutPPO extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
if(mField.getColumnName().equals(X_ps_ppo.COLUMNNAME_M_Product_ID)){
|
||||
return product(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String product(Properties ctx, int windowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
if (value==null) return "";
|
||||
|
||||
MProduct product = new MProduct(ctx, (int)value, null);
|
||||
mTab.setValue("C_UOM_ID", product.getC_UOM_ID());
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +1,35 @@
|
|||
package andromedia.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduction;
|
||||
import andromedia.midsuit.model.MID_PPO;
|
||||
import andromedia.midsuit.model.X_M_Production;
|
||||
|
||||
public class MID_CalloutProduction extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(mField.getColumnName().equals(X_M_Production.COLUMNNAME_ps_ppo_ID)) {
|
||||
if(value == null) return null;
|
||||
setProductByPPO(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setProductByPPO(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
MID_PPO ppo = new MID_PPO(ctx,(int)value, null);
|
||||
|
||||
if(ppo != null && ppo.getM_Product_ID() > 0) {
|
||||
mTab.setValue(MProduction.COLUMNNAME_M_Product_ID, ppo.getM_Product_ID());
|
||||
mTab.setValue(MProduction.COLUMNNAME_ProductionQty, ppo.getQtyOrdered());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduction;
|
||||
|
||||
import balinusa.midsuit.model.MID_PPO;
|
||||
import balinusa.midsuit.model.X_M_Production;
|
||||
|
||||
public class MID_CalloutProduction extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(mField.getColumnName().equals(X_M_Production.COLUMNNAME_ps_ppo_ID)) {
|
||||
if(value == null) return null;
|
||||
setProductByPPO(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setProductByPPO(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
MID_PPO ppo = new MID_PPO(ctx,(int)value, null);
|
||||
|
||||
if(ppo != null && ppo.getM_Product_ID() > 0) {
|
||||
mTab.setValue(MProduction.COLUMNNAME_M_Product_ID, ppo.getM_Product_ID());
|
||||
mTab.setValue(MProduction.COLUMNNAME_ProductionQty, ppo.getQtyOrdered());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +1,57 @@
|
|||
package andromedia.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduct;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
public class MID_CalloutProductionLine extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
|
||||
if (mField.getColumnName().equals("isConvertUOM"))
|
||||
return setUOM(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
if (mField.getColumnName().equals("QtyEntered"))
|
||||
return setConversion(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
if (mField.getColumnName().equals("M_Product_ID"))
|
||||
{
|
||||
if(value==null) return "";
|
||||
MProduct pro = new MProduct(ctx, (int)value, null);
|
||||
mTab.setValue("C_UOM_ID", pro.getC_UOM_ID());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setConversion(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value,
|
||||
Object oldValue) {
|
||||
if (value == null || mTab.getValue("M_Product_ID") == null) {
|
||||
return "";
|
||||
}
|
||||
// BigDecimal QtyOrdered = MUOMConversion.convertProductFrom(Env.getCtx(), (int) mTab.getValue("M_Product_ID"),
|
||||
// (int) mTab.getValue("C_UOM_To_ID"), (BigDecimal) mTab.getValue("QtyEntered"));
|
||||
// if (QtyOrdered == null)
|
||||
// QtyOrdered = (BigDecimal) mTab.getValue("QtyEntered");
|
||||
//
|
||||
// mTab.setValue("QtyUsed", QtyOrdered);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public String setUOM(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
if (value == null)
|
||||
return "";
|
||||
if (mTab.getValue("M_Product_ID") == null)
|
||||
return "";
|
||||
|
||||
MProduct product = new MProduct(Env.getCtx(), (int) mTab.getValue("M_Product_ID"), null);
|
||||
mTab.setValue("QtyEntered", mTab.getValue("QtyUsed"));
|
||||
mTab.setValue("C_UOM_ID", product.getC_UOM_ID());
|
||||
mTab.setValue("C_UOM_To_ID", product.getC_UOM_ID());
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MProduct;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
public class MID_CalloutProductionLine extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
|
||||
if (mField.getColumnName().equals("isConvertUOM"))
|
||||
return setUOM(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
if (mField.getColumnName().equals("QtyEntered"))
|
||||
return setConversion(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
if (mField.getColumnName().equals("M_Product_ID"))
|
||||
{
|
||||
if(value==null) return "";
|
||||
MProduct pro = new MProduct(ctx, (int)value, null);
|
||||
mTab.setValue("C_UOM_ID", pro.getC_UOM_ID());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String setConversion(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value,
|
||||
Object oldValue) {
|
||||
if (value == null || mTab.getValue("M_Product_ID") == null) {
|
||||
return "";
|
||||
}
|
||||
// BigDecimal QtyOrdered = MUOMConversion.convertProductFrom(Env.getCtx(), (int) mTab.getValue("M_Product_ID"),
|
||||
// (int) mTab.getValue("C_UOM_To_ID"), (BigDecimal) mTab.getValue("QtyEntered"));
|
||||
// if (QtyOrdered == null)
|
||||
// QtyOrdered = (BigDecimal) mTab.getValue("QtyEntered");
|
||||
//
|
||||
// mTab.setValue("QtyUsed", QtyOrdered);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public String setUOM(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
if (value == null)
|
||||
return "";
|
||||
if (mTab.getValue("M_Product_ID") == null)
|
||||
return "";
|
||||
|
||||
MProduct product = new MProduct(Env.getCtx(), (int) mTab.getValue("M_Product_ID"), null);
|
||||
mTab.setValue("QtyEntered", mTab.getValue("QtyUsed"));
|
||||
mTab.setValue("C_UOM_ID", product.getC_UOM_ID());
|
||||
mTab.setValue("C_UOM_To_ID", product.getC_UOM_ID());
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,34 +1,35 @@
|
|||
package andromedia.midsuit.callout;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.util.DB;
|
||||
import andromedia.midsuit.model.X_C_OrderLineMA;
|
||||
|
||||
public class MID_CalloutRMALineMA extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
if(mField.getColumnName().equals(X_C_OrderLineMA.COLUMNNAME_M_AttributeSetInstance_ID)) {
|
||||
return setDateMaterialPolicy(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String setDateMaterialPolicy(Properties ctx, int windowNo, GridTab mTab, GridField mField, Object value,
|
||||
Object oldValue) {
|
||||
if(value==null) return "";
|
||||
Timestamp retValue = DB.getSQLValueTSEx(null, "SELECT DateMaterialPolicy FROM M_Storage WHERE M_AttributeSetInstance_ID =? ", new Object[] { (int)value });
|
||||
if(retValue!=null)
|
||||
mTab.setValue(X_C_OrderLineMA.COLUMNNAME_DateMaterialPolicy, retValue);
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.adempiere.base.IColumnCallout;
|
||||
import org.compiere.model.CalloutEngine;
|
||||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
import balinusa.midsuit.model.X_C_OrderLineMA;
|
||||
|
||||
public class MID_CalloutRMALineMA extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
|
||||
// TODO Auto-generated method stub
|
||||
if(value == null) return null;
|
||||
if(mField.getColumnName().equals(X_C_OrderLineMA.COLUMNNAME_M_AttributeSetInstance_ID)) {
|
||||
return setDateMaterialPolicy(ctx, WindowNo, mTab, mField, value, oldValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String setDateMaterialPolicy(Properties ctx, int windowNo, GridTab mTab, GridField mField, Object value,
|
||||
Object oldValue) {
|
||||
if(value==null) return "";
|
||||
Timestamp retValue = DB.getSQLValueTSEx(null, "SELECT DateMaterialPolicy FROM M_Storage WHERE M_AttributeSetInstance_ID =? ", new Object[] { (int)value });
|
||||
if(retValue!=null)
|
||||
mTab.setValue(X_C_OrderLineMA.COLUMNNAME_DateMaterialPolicy, retValue);
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Properties;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.callout;
|
||||
package balinusa.midsuit.callout;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Properties;
|
||||
|
|
@ -8,7 +8,7 @@ import org.compiere.model.CalloutEngine;
|
|||
import org.compiere.model.GridField;
|
||||
import org.compiere.model.GridTab;
|
||||
|
||||
import andromedia.midsuit.model.X_MID_RequisitionLine;
|
||||
import balinusa.midsuit.model.X_MID_RequisitionLine;
|
||||
|
||||
public class MID_CalloutRequisitionTrxLine extends CalloutEngine implements IColumnCallout{
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.doc;
|
||||
package balinusa.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
|
|
@ -1,35 +1,35 @@
|
|||
package andromedia.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.compiere.acct.Doc;
|
||||
import org.compiere.acct.Fact;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
|
||||
import andromedia.midsuit.model.MID_Analysis;
|
||||
|
||||
public class MID_DocAnalysis extends Doc {
|
||||
|
||||
public MID_DocAnalysis (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super (as, MID_Analysis.class, rs, null, trxName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String loadDocumentDetails() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getBalance() {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Fact> createFacts(MAcctSchema as) {
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
return facts;
|
||||
}
|
||||
}
|
||||
package balinusa.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.compiere.acct.Doc;
|
||||
import org.compiere.acct.Fact;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
|
||||
import balinusa.midsuit.model.MID_Analysis;
|
||||
|
||||
public class MID_DocAnalysis extends Doc {
|
||||
|
||||
public MID_DocAnalysis (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super (as, MID_Analysis.class, rs, null, trxName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String loadDocumentDetails() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getBalance() {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Fact> createFacts(MAcctSchema as) {
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
return facts;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.doc;
|
||||
package balinusa.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.doc;
|
||||
package balinusa.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
|
|
@ -1,34 +1,35 @@
|
|||
package andromedia.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.compiere.acct.Doc;
|
||||
import org.compiere.acct.Fact;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import andromedia.midsuit.model.MID_PPO;;
|
||||
|
||||
public class MID_DocMRPPPO extends Doc{
|
||||
|
||||
public MID_DocMRPPPO (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super (as, MID_PPO.class, rs, null, trxName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String loadDocumentDetails() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getBalance() {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Fact> createFacts(MAcctSchema as) {
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
return facts;
|
||||
}
|
||||
package balinusa.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.compiere.acct.Doc;
|
||||
import org.compiere.acct.Fact;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
|
||||
import balinusa.midsuit.model.MID_PPO;;
|
||||
|
||||
public class MID_DocMRPPPO extends Doc{
|
||||
|
||||
public MID_DocMRPPPO (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super (as, MID_PPO.class, rs, null, trxName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String loadDocumentDetails() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getBalance() {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Fact> createFacts(MAcctSchema as) {
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
return facts;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.doc;
|
||||
package balinusa.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
|
|
@ -9,7 +9,7 @@ import org.compiere.acct.Fact;
|
|||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
import andromedia.midsuit.model.MID_MRequisitionTrx;
|
||||
import balinusa.midsuit.model.MID_MRequisitionTrx;
|
||||
|
||||
public class MID_DocMidRequsiition extends Doc {
|
||||
|
||||
|
|
@ -1,272 +1,272 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.compiere.acct.Doc;
|
||||
import org.compiere.acct.DocLine;
|
||||
import org.compiere.acct.Fact;
|
||||
import org.compiere.acct.FactLine;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MCostDetail;
|
||||
import org.compiere.model.MMovement;
|
||||
import org.compiere.model.MMovementLine;
|
||||
import org.compiere.model.MMovementLineMA;
|
||||
import org.compiere.model.MProduct;
|
||||
import org.compiere.model.ProductCost;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
/**
|
||||
* Post Invoice Documents.
|
||||
* <pre>
|
||||
* Table: M_Movement (323)
|
||||
* Document Types: MMM
|
||||
* </pre>
|
||||
* @author Jorg Janke
|
||||
* @author Armen Rizal, Goodwill Consulting
|
||||
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
|
||||
* @version $Id: Doc_Movement.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
|
||||
*/
|
||||
public class MID_DocMovement extends Doc
|
||||
{
|
||||
private int m_Reversal_ID = 0;
|
||||
@SuppressWarnings("unused")
|
||||
private String m_DocStatus = "";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param as accounting schema
|
||||
* @param rs record
|
||||
* @param trxName trx
|
||||
*/
|
||||
public MID_DocMovement (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super (as, MMovement.class, rs, DOCTYPE_MatMovement, trxName);
|
||||
} // Doc_Movement
|
||||
|
||||
/**
|
||||
* Load Document Details
|
||||
* @return error message or null
|
||||
*/
|
||||
protected String loadDocumentDetails()
|
||||
{
|
||||
setC_Currency_ID(NO_CURRENCY);
|
||||
MMovement move = (MMovement)getPO();
|
||||
setDateDoc (move.getMovementDate());
|
||||
setDateAcct(move.getMovementDate());
|
||||
m_Reversal_ID = move.getReversal_ID();//store original (voided/reversed) document
|
||||
m_DocStatus = move.getDocStatus();
|
||||
// Contained Objects
|
||||
p_lines = loadLines(move);
|
||||
if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length);
|
||||
return null;
|
||||
} // loadDocumentDetails
|
||||
|
||||
/**
|
||||
* Load Invoice Line
|
||||
* @param move move
|
||||
* @return document lines (DocLine_Material)
|
||||
*/
|
||||
private DocLine[] loadLines(MMovement move)
|
||||
{
|
||||
ArrayList<DocLine> list = new ArrayList<DocLine>();
|
||||
MMovementLine[] lines = move.getLines(false);
|
||||
if(move.get_ValueAsBoolean("IsAsset"))
|
||||
return new DocLine[0];
|
||||
for (int i = 0; i < lines.length; i++)
|
||||
{
|
||||
MMovementLine line = lines[i];
|
||||
DocLine docLine = new DocLine (line, this);
|
||||
docLine.setQty(line.getMovementQty(), false);
|
||||
docLine.setReversalLine_ID(line.getReversalLine_ID());
|
||||
if (log.isLoggable(Level.FINE)) log.fine(docLine.toString());
|
||||
list.add (docLine);
|
||||
}
|
||||
|
||||
// Return Array
|
||||
DocLine[] dls = new DocLine[list.size()];
|
||||
list.toArray(dls);
|
||||
return dls;
|
||||
} // loadLines
|
||||
|
||||
/**
|
||||
* Get Balance
|
||||
* @return balance (ZERO) - always balanced
|
||||
*/
|
||||
public BigDecimal getBalance()
|
||||
{
|
||||
BigDecimal retValue = Env.ZERO;
|
||||
return retValue;
|
||||
} // getBalance
|
||||
|
||||
/**
|
||||
* Create Facts (the accounting logic) for
|
||||
* MMM.
|
||||
* <pre>
|
||||
* Movement
|
||||
* Inventory DR CR
|
||||
* InventoryTo DR CR
|
||||
* </pre>
|
||||
* @param as account schema
|
||||
* @return Fact
|
||||
*/
|
||||
public ArrayList<Fact> createFacts (MAcctSchema as)
|
||||
{
|
||||
// create Fact Header
|
||||
Fact fact = new Fact(this, as, Fact.POST_Actual);
|
||||
setC_Currency_ID(as.getC_Currency_ID());
|
||||
|
||||
// Line pointers
|
||||
FactLine dr = null;
|
||||
FactLine cr = null;
|
||||
|
||||
for (int i = 0; i < p_lines.length; i++)
|
||||
{
|
||||
DocLine line = p_lines[i];
|
||||
BigDecimal costs = null;
|
||||
|
||||
if (!isReversal(line))
|
||||
{
|
||||
MProduct product = (MProduct) line.getProduct();
|
||||
String costingLevel = product.getCostingLevel(as);
|
||||
if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(costingLevel) )
|
||||
{
|
||||
if (line.getM_AttributeSetInstance_ID() == 0 )
|
||||
{
|
||||
MMovementLine mLine = (MMovementLine) line.getPO();
|
||||
MMovementLineMA mas[] = MMovementLineMA.get(getCtx(), mLine.get_ID(), getTrxName());
|
||||
if (mas != null && mas.length > 0 )
|
||||
{
|
||||
costs = BigDecimal.ZERO;
|
||||
for (int j = 0; j < mas.length; j++)
|
||||
{
|
||||
MMovementLineMA ma = mas[j];
|
||||
BigDecimal QtyMA = ma.getMovementQty();
|
||||
ProductCost pc = line.getProductCost();
|
||||
pc.setQty(QtyMA);
|
||||
pc.setM_M_AttributeSetInstance_ID(ma.getM_AttributeSetInstance_ID());
|
||||
BigDecimal maCosts = line.getProductCosts(as, line.getAD_Org_ID(), true, "M_MovementLine_ID=? AND IsSOTrx='N'");
|
||||
|
||||
costs = costs.add(maCosts);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
costs = line.getProductCosts(as, line.getAD_Org_ID(), true, "M_MovementLine_ID=? AND IsSOTrx='N'");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// MZ Goodwill
|
||||
// if Inventory Move CostDetail exist then get Cost from Cost Detail
|
||||
costs = line.getProductCosts(as, line.getAD_Org_ID(), true, "M_MovementLine_ID=? AND IsSOTrx='N'");
|
||||
// end MZ
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
costs = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
// ** Inventory DR CR
|
||||
dr = fact.createLine(line,
|
||||
line.getAccount(ProductCost.ACCTTYPE_P_Asset, as),
|
||||
as.getC_Currency_ID(), costs.negate()); // from (-) CR
|
||||
if (dr == null)
|
||||
continue;
|
||||
dr.setM_Locator_ID(line.getM_Locator_ID());
|
||||
dr.setQty(line.getQty().negate()); // outgoing
|
||||
if (isReversal(line))
|
||||
{
|
||||
// Set AmtAcctDr from Original Movement
|
||||
if (!dr.updateReverseLine (MMovement.Table_ID,
|
||||
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
|
||||
{
|
||||
p_Error = "Original Inventory Move not posted yet";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// ** InventoryTo DR CR
|
||||
cr = fact.createLine(line,
|
||||
line.getAccount(ProductCost.ACCTTYPE_P_Asset, as),
|
||||
as.getC_Currency_ID(), costs); // to (+) DR
|
||||
if (cr == null)
|
||||
continue;
|
||||
cr.setM_Locator_ID(line.getM_LocatorTo_ID());
|
||||
cr.setQty(line.getQty());
|
||||
if (isReversal(line))
|
||||
{
|
||||
// Set AmtAcctCr from Original Movement
|
||||
if (!cr.updateReverseLine (MMovement.Table_ID,
|
||||
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
|
||||
{
|
||||
p_Error = "Original Inventory Move not posted yet";
|
||||
return null;
|
||||
}
|
||||
costs = cr.getAcctBalance(); //get original cost
|
||||
}
|
||||
|
||||
// Only for between-org movements
|
||||
if (dr.getAD_Org_ID() != cr.getAD_Org_ID())
|
||||
{
|
||||
String costingLevel = line.getProduct().getCostingLevel(as);
|
||||
if (!MAcctSchema.COSTINGLEVEL_Organization.equals(costingLevel))
|
||||
continue;
|
||||
//
|
||||
String description = line.getDescription();
|
||||
if (description == null)
|
||||
description = "";
|
||||
// Cost Detail From
|
||||
if (!MCostDetail.createMovement(as, dr.getAD_Org_ID(), // locator org
|
||||
line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(),
|
||||
line.get_ID(), 0,
|
||||
costs.negate(), line.getQty().negate(), true,
|
||||
description + "(|->)", getTrxName()))
|
||||
{
|
||||
p_Error = "Failed to create cost detail record";
|
||||
return null;
|
||||
}
|
||||
// Cost Detail To
|
||||
if (!MCostDetail.createMovement(as, cr.getAD_Org_ID(), // locator org
|
||||
line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(),
|
||||
line.get_ID(), 0,
|
||||
costs, line.getQty(), false,
|
||||
description + "(|<-)", getTrxName()))
|
||||
{
|
||||
p_Error = "Failed to create cost detail record";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
facts.add(fact);
|
||||
return facts;
|
||||
} // createFact
|
||||
|
||||
private boolean isReversal(DocLine line) {
|
||||
return m_Reversal_ID !=0 && line.getReversalLine_ID() != 0;
|
||||
}
|
||||
|
||||
} // Doc_Movement
|
||||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package balinusa.midsuit.doc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.compiere.acct.Doc;
|
||||
import org.compiere.acct.DocLine;
|
||||
import org.compiere.acct.Fact;
|
||||
import org.compiere.acct.FactLine;
|
||||
import org.compiere.model.MAcctSchema;
|
||||
import org.compiere.model.MCostDetail;
|
||||
import org.compiere.model.MMovement;
|
||||
import org.compiere.model.MMovementLine;
|
||||
import org.compiere.model.MMovementLineMA;
|
||||
import org.compiere.model.MProduct;
|
||||
import org.compiere.model.ProductCost;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
/**
|
||||
* Post Invoice Documents.
|
||||
* <pre>
|
||||
* Table: M_Movement (323)
|
||||
* Document Types: MMM
|
||||
* </pre>
|
||||
* @author Jorg Janke
|
||||
* @author Armen Rizal, Goodwill Consulting
|
||||
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
|
||||
* @version $Id: Doc_Movement.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
|
||||
*/
|
||||
public class MID_DocMovement extends Doc
|
||||
{
|
||||
private int m_Reversal_ID = 0;
|
||||
@SuppressWarnings("unused")
|
||||
private String m_DocStatus = "";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param as accounting schema
|
||||
* @param rs record
|
||||
* @param trxName trx
|
||||
*/
|
||||
public MID_DocMovement (MAcctSchema as, ResultSet rs, String trxName)
|
||||
{
|
||||
super (as, MMovement.class, rs, DOCTYPE_MatMovement, trxName);
|
||||
} // Doc_Movement
|
||||
|
||||
/**
|
||||
* Load Document Details
|
||||
* @return error message or null
|
||||
*/
|
||||
protected String loadDocumentDetails()
|
||||
{
|
||||
setC_Currency_ID(NO_CURRENCY);
|
||||
MMovement move = (MMovement)getPO();
|
||||
setDateDoc (move.getMovementDate());
|
||||
setDateAcct(move.getMovementDate());
|
||||
m_Reversal_ID = move.getReversal_ID();//store original (voided/reversed) document
|
||||
m_DocStatus = move.getDocStatus();
|
||||
// Contained Objects
|
||||
p_lines = loadLines(move);
|
||||
if (log.isLoggable(Level.FINE)) log.fine("Lines=" + p_lines.length);
|
||||
return null;
|
||||
} // loadDocumentDetails
|
||||
|
||||
/**
|
||||
* Load Invoice Line
|
||||
* @param move move
|
||||
* @return document lines (DocLine_Material)
|
||||
*/
|
||||
private DocLine[] loadLines(MMovement move)
|
||||
{
|
||||
ArrayList<DocLine> list = new ArrayList<DocLine>();
|
||||
MMovementLine[] lines = move.getLines(false);
|
||||
if(move.get_ValueAsBoolean("IsAsset"))
|
||||
return new DocLine[0];
|
||||
for (int i = 0; i < lines.length; i++)
|
||||
{
|
||||
MMovementLine line = lines[i];
|
||||
DocLine docLine = new DocLine (line, this);
|
||||
docLine.setQty(line.getMovementQty(), false);
|
||||
docLine.setReversalLine_ID(line.getReversalLine_ID());
|
||||
if (log.isLoggable(Level.FINE)) log.fine(docLine.toString());
|
||||
list.add (docLine);
|
||||
}
|
||||
|
||||
// Return Array
|
||||
DocLine[] dls = new DocLine[list.size()];
|
||||
list.toArray(dls);
|
||||
return dls;
|
||||
} // loadLines
|
||||
|
||||
/**
|
||||
* Get Balance
|
||||
* @return balance (ZERO) - always balanced
|
||||
*/
|
||||
public BigDecimal getBalance()
|
||||
{
|
||||
BigDecimal retValue = Env.ZERO;
|
||||
return retValue;
|
||||
} // getBalance
|
||||
|
||||
/**
|
||||
* Create Facts (the accounting logic) for
|
||||
* MMM.
|
||||
* <pre>
|
||||
* Movement
|
||||
* Inventory DR CR
|
||||
* InventoryTo DR CR
|
||||
* </pre>
|
||||
* @param as account schema
|
||||
* @return Fact
|
||||
*/
|
||||
public ArrayList<Fact> createFacts (MAcctSchema as)
|
||||
{
|
||||
// create Fact Header
|
||||
Fact fact = new Fact(this, as, Fact.POST_Actual);
|
||||
setC_Currency_ID(as.getC_Currency_ID());
|
||||
|
||||
// Line pointers
|
||||
FactLine dr = null;
|
||||
FactLine cr = null;
|
||||
|
||||
for (int i = 0; i < p_lines.length; i++)
|
||||
{
|
||||
DocLine line = p_lines[i];
|
||||
BigDecimal costs = null;
|
||||
|
||||
if (!isReversal(line))
|
||||
{
|
||||
MProduct product = (MProduct) line.getProduct();
|
||||
String costingLevel = product.getCostingLevel(as);
|
||||
if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(costingLevel) )
|
||||
{
|
||||
if (line.getM_AttributeSetInstance_ID() == 0 )
|
||||
{
|
||||
MMovementLine mLine = (MMovementLine) line.getPO();
|
||||
MMovementLineMA mas[] = MMovementLineMA.get(getCtx(), mLine.get_ID(), getTrxName());
|
||||
if (mas != null && mas.length > 0 )
|
||||
{
|
||||
costs = BigDecimal.ZERO;
|
||||
for (int j = 0; j < mas.length; j++)
|
||||
{
|
||||
MMovementLineMA ma = mas[j];
|
||||
BigDecimal QtyMA = ma.getMovementQty();
|
||||
ProductCost pc = line.getProductCost();
|
||||
pc.setQty(QtyMA);
|
||||
pc.setM_M_AttributeSetInstance_ID(ma.getM_AttributeSetInstance_ID());
|
||||
BigDecimal maCosts = line.getProductCosts(as, line.getAD_Org_ID(), true, "M_MovementLine_ID=? AND IsSOTrx='N'");
|
||||
|
||||
costs = costs.add(maCosts);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
costs = line.getProductCosts(as, line.getAD_Org_ID(), true, "M_MovementLine_ID=? AND IsSOTrx='N'");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// MZ Goodwill
|
||||
// if Inventory Move CostDetail exist then get Cost from Cost Detail
|
||||
costs = line.getProductCosts(as, line.getAD_Org_ID(), true, "M_MovementLine_ID=? AND IsSOTrx='N'");
|
||||
// end MZ
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
costs = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
// ** Inventory DR CR
|
||||
dr = fact.createLine(line,
|
||||
line.getAccount(ProductCost.ACCTTYPE_P_Asset, as),
|
||||
as.getC_Currency_ID(), costs.negate()); // from (-) CR
|
||||
if (dr == null)
|
||||
continue;
|
||||
dr.setM_Locator_ID(line.getM_Locator_ID());
|
||||
dr.setQty(line.getQty().negate()); // outgoing
|
||||
if (isReversal(line))
|
||||
{
|
||||
// Set AmtAcctDr from Original Movement
|
||||
if (!dr.updateReverseLine (MMovement.Table_ID,
|
||||
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
|
||||
{
|
||||
p_Error = "Original Inventory Move not posted yet";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// ** InventoryTo DR CR
|
||||
cr = fact.createLine(line,
|
||||
line.getAccount(ProductCost.ACCTTYPE_P_Asset, as),
|
||||
as.getC_Currency_ID(), costs); // to (+) DR
|
||||
if (cr == null)
|
||||
continue;
|
||||
cr.setM_Locator_ID(line.getM_LocatorTo_ID());
|
||||
cr.setQty(line.getQty());
|
||||
if (isReversal(line))
|
||||
{
|
||||
// Set AmtAcctCr from Original Movement
|
||||
if (!cr.updateReverseLine (MMovement.Table_ID,
|
||||
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
|
||||
{
|
||||
p_Error = "Original Inventory Move not posted yet";
|
||||
return null;
|
||||
}
|
||||
costs = cr.getAcctBalance(); //get original cost
|
||||
}
|
||||
|
||||
// Only for between-org movements
|
||||
if (dr.getAD_Org_ID() != cr.getAD_Org_ID())
|
||||
{
|
||||
String costingLevel = line.getProduct().getCostingLevel(as);
|
||||
if (!MAcctSchema.COSTINGLEVEL_Organization.equals(costingLevel))
|
||||
continue;
|
||||
//
|
||||
String description = line.getDescription();
|
||||
if (description == null)
|
||||
description = "";
|
||||
// Cost Detail From
|
||||
if (!MCostDetail.createMovement(as, dr.getAD_Org_ID(), // locator org
|
||||
line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(),
|
||||
line.get_ID(), 0,
|
||||
costs.negate(), line.getQty().negate(), true,
|
||||
description + "(|->)", getTrxName()))
|
||||
{
|
||||
p_Error = "Failed to create cost detail record";
|
||||
return null;
|
||||
}
|
||||
// Cost Detail To
|
||||
if (!MCostDetail.createMovement(as, cr.getAD_Org_ID(), // locator org
|
||||
line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(),
|
||||
line.get_ID(), 0,
|
||||
costs, line.getQty(), false,
|
||||
description + "(|<-)", getTrxName()))
|
||||
{
|
||||
p_Error = "Failed to create cost detail record";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
facts.add(fact);
|
||||
return facts;
|
||||
} // createFact
|
||||
|
||||
private boolean isReversal(DocLine line) {
|
||||
return m_Reversal_ID !=0 && line.getReversalLine_ID() != 0;
|
||||
}
|
||||
|
||||
} // Doc_Movement
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.factory;
|
||||
package balinusa.midsuit.factory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -16,35 +16,35 @@ import org.compiere.model.MProductionLine;
|
|||
import org.compiere.model.X_C_OrderLine;
|
||||
import org.compiere.model.X_M_RequisitionLine;
|
||||
|
||||
import andromedia.midsuit.callout.MID_CalloutAnalysisQC;
|
||||
import andromedia.midsuit.callout.MID_CalloutCeisaUpload;
|
||||
import andromedia.midsuit.callout.MID_CalloutInOut;
|
||||
import andromedia.midsuit.callout.MID_CalloutInOutLine;
|
||||
import andromedia.midsuit.callout.MID_CalloutInventoryLine;
|
||||
import andromedia.midsuit.callout.MID_CalloutInventoryLineMA;
|
||||
import andromedia.midsuit.callout.MID_CalloutIsReturnCeisa;
|
||||
import andromedia.midsuit.callout.MID_CalloutMovement;
|
||||
import andromedia.midsuit.callout.MID_CalloutMovementLineMA;
|
||||
import andromedia.midsuit.callout.MID_CalloutOrder;
|
||||
import andromedia.midsuit.callout.MID_CalloutOrderCeisa;
|
||||
import andromedia.midsuit.callout.MID_CalloutOrderLine;
|
||||
import andromedia.midsuit.callout.MID_CalloutOrderLineMA;
|
||||
import andromedia.midsuit.callout.MID_CalloutPPO;
|
||||
import andromedia.midsuit.callout.MID_CalloutProduction;
|
||||
import andromedia.midsuit.callout.MID_CalloutProductionLine;
|
||||
import andromedia.midsuit.callout.MID_CalloutRMALineMA;
|
||||
import andromedia.midsuit.callout.MID_CalloutRequisition;
|
||||
import andromedia.midsuit.callout.MID_CalloutRequisitionLine;
|
||||
import andromedia.midsuit.callout.MID_CalloutRequisitionTrxLine;
|
||||
import andromedia.midsuit.model.MID_Analysis;
|
||||
import andromedia.midsuit.model.MID_MMovement;
|
||||
import andromedia.midsuit.model.X_C_OrderLineMA;
|
||||
import andromedia.midsuit.model.X_MID_Requisition;
|
||||
import andromedia.midsuit.model.X_MID_RequisitionLine;
|
||||
import andromedia.midsuit.model.X_M_RMAMA;
|
||||
import andromedia.midsuit.model.X_mid_ceisa_order;
|
||||
import andromedia.midsuit.model.X_mid_ceisa_upload;
|
||||
import andromedia.midsuit.model.X_ps_ppo;
|
||||
import balinusa.midsuit.callout.MID_CalloutAnalysisQC;
|
||||
import balinusa.midsuit.callout.MID_CalloutCeisaUpload;
|
||||
import balinusa.midsuit.callout.MID_CalloutInOut;
|
||||
import balinusa.midsuit.callout.MID_CalloutInOutLine;
|
||||
import balinusa.midsuit.callout.MID_CalloutInventoryLine;
|
||||
import balinusa.midsuit.callout.MID_CalloutInventoryLineMA;
|
||||
import balinusa.midsuit.callout.MID_CalloutIsReturnCeisa;
|
||||
import balinusa.midsuit.callout.MID_CalloutMovement;
|
||||
import balinusa.midsuit.callout.MID_CalloutMovementLineMA;
|
||||
import balinusa.midsuit.callout.MID_CalloutOrder;
|
||||
import balinusa.midsuit.callout.MID_CalloutOrderCeisa;
|
||||
import balinusa.midsuit.callout.MID_CalloutOrderLine;
|
||||
import balinusa.midsuit.callout.MID_CalloutOrderLineMA;
|
||||
import balinusa.midsuit.callout.MID_CalloutPPO;
|
||||
import balinusa.midsuit.callout.MID_CalloutProduction;
|
||||
import balinusa.midsuit.callout.MID_CalloutProductionLine;
|
||||
import balinusa.midsuit.callout.MID_CalloutRMALineMA;
|
||||
import balinusa.midsuit.callout.MID_CalloutRequisition;
|
||||
import balinusa.midsuit.callout.MID_CalloutRequisitionLine;
|
||||
import balinusa.midsuit.callout.MID_CalloutRequisitionTrxLine;
|
||||
import balinusa.midsuit.model.MID_Analysis;
|
||||
import balinusa.midsuit.model.MID_MMovement;
|
||||
import balinusa.midsuit.model.X_C_OrderLineMA;
|
||||
import balinusa.midsuit.model.X_MID_Requisition;
|
||||
import balinusa.midsuit.model.X_MID_RequisitionLine;
|
||||
import balinusa.midsuit.model.X_M_RMAMA;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_order;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_upload;
|
||||
import balinusa.midsuit.model.X_ps_ppo;
|
||||
|
||||
public class MID_CalloutFactory implements IColumnCalloutFactory{
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.factory;
|
||||
package balinusa.midsuit.factory;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
|
@ -11,10 +11,10 @@ import org.compiere.model.X_M_InOut;
|
|||
import org.compiere.model.X_M_RMA;
|
||||
import org.compiere.util.CLogger;
|
||||
|
||||
import andromedia.midsuit.form.MID_WCreateFromInvoice;
|
||||
import andromedia.midsuit.form.MID_WCreateFromOrder;
|
||||
import andromedia.midsuit.form.MID_WCreateFromRMA;
|
||||
import andromedia.midsuit.form.MID_WCreateFromShipment;
|
||||
import balinusa.midsuit.form.MID_WCreateFromInvoice;
|
||||
import balinusa.midsuit.form.MID_WCreateFromOrder;
|
||||
import balinusa.midsuit.form.MID_WCreateFromRMA;
|
||||
import balinusa.midsuit.form.MID_WCreateFromShipment;
|
||||
|
||||
public class MID_CreateFromFactory implements ICreateFromFactory{
|
||||
private CLogger log = CLogger.getCLogger(getClass());
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.factory;
|
||||
package balinusa.midsuit.factory;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
|
@ -16,18 +16,18 @@ import org.compiere.util.DB;
|
|||
import org.compiere.util.Env;
|
||||
import org.eevolution.model.MDDOrder;
|
||||
|
||||
import andromedia.midsuit.doc.MID_DocAllocationHdr;
|
||||
import andromedia.midsuit.doc.MID_DocAnalysis;
|
||||
import andromedia.midsuit.doc.MID_DocDDOrder;
|
||||
import andromedia.midsuit.doc.MID_DocInvoice;
|
||||
import andromedia.midsuit.doc.MID_DocMRPPPO;
|
||||
import andromedia.midsuit.doc.MID_DocMatchInv;
|
||||
import andromedia.midsuit.doc.MID_DocMidRequsiition;
|
||||
import andromedia.midsuit.doc.MID_DocMovement;
|
||||
import andromedia.midsuit.model.MID_Analysis;
|
||||
import andromedia.midsuit.model.MID_MMovement;
|
||||
import andromedia.midsuit.model.MID_MRequisitionTrx;
|
||||
import andromedia.midsuit.model.MID_PPO;
|
||||
import balinusa.midsuit.doc.MID_DocAllocationHdr;
|
||||
import balinusa.midsuit.doc.MID_DocAnalysis;
|
||||
import balinusa.midsuit.doc.MID_DocDDOrder;
|
||||
import balinusa.midsuit.doc.MID_DocInvoice;
|
||||
import balinusa.midsuit.doc.MID_DocMRPPPO;
|
||||
import balinusa.midsuit.doc.MID_DocMatchInv;
|
||||
import balinusa.midsuit.doc.MID_DocMidRequsiition;
|
||||
import balinusa.midsuit.doc.MID_DocMovement;
|
||||
import balinusa.midsuit.model.MID_Analysis;
|
||||
import balinusa.midsuit.model.MID_MMovement;
|
||||
import balinusa.midsuit.model.MID_MRequisitionTrx;
|
||||
import balinusa.midsuit.model.MID_PPO;
|
||||
|
||||
public class MID_DocFactory implements IDocFactory{
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.factory;
|
||||
package balinusa.midsuit.factory;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.factory;
|
||||
package balinusa.midsuit.factory;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.sql.ResultSet;
|
||||
|
|
@ -11,47 +11,47 @@ import org.compiere.model.MMovementLine;
|
|||
import org.compiere.model.PO;
|
||||
import org.compiere.util.Env;
|
||||
|
||||
import andromedia.midsuit.model.MID_Aging;
|
||||
import andromedia.midsuit.model.MID_Analysis;
|
||||
import andromedia.midsuit.model.MID_AnalysisLine;
|
||||
import andromedia.midsuit.model.MID_AnalysisPro;
|
||||
import andromedia.midsuit.model.MID_Ceisa_Order;
|
||||
import andromedia.midsuit.model.MID_MAssetAddition;
|
||||
import andromedia.midsuit.model.MID_MAssetDisposed;
|
||||
import andromedia.midsuit.model.MID_MBillingList;
|
||||
import andromedia.midsuit.model.MID_MBillingListLine;
|
||||
import andromedia.midsuit.model.MID_MDDOrder;
|
||||
import andromedia.midsuit.model.MID_MDDOrderLine;
|
||||
import andromedia.midsuit.model.MID_MDepreciationEntry;
|
||||
import andromedia.midsuit.model.MID_MInventory;
|
||||
import andromedia.midsuit.model.MID_MInvoice;
|
||||
import andromedia.midsuit.model.MID_MOrder;
|
||||
import andromedia.midsuit.model.MID_MOrderLine;
|
||||
import andromedia.midsuit.model.MID_MPayment;
|
||||
import andromedia.midsuit.model.MID_MProductionConfirm;
|
||||
import andromedia.midsuit.model.MID_MRequisition;
|
||||
import andromedia.midsuit.model.MID_MRequisitionLine;
|
||||
import andromedia.midsuit.model.MID_MRequisitionTrx;
|
||||
import andromedia.midsuit.model.MID_MRequisitionTrxLine;
|
||||
import andromedia.midsuit.model.MID_MRequsitionTax;
|
||||
import andromedia.midsuit.model.MID_PPO;
|
||||
import andromedia.midsuit.model.MID_PPOLine;
|
||||
import andromedia.midsuit.model.MID_UnrealizedRate;
|
||||
import andromedia.midsuit.model.MID_UnrealizedRateLine;
|
||||
import andromedia.midsuit.model.MWarehouse;
|
||||
import andromedia.midsuit.model.X_C_OrderLineMA;
|
||||
import andromedia.midsuit.model.X_MID_UploadPEB;
|
||||
import andromedia.midsuit.model.X_MID_UploadPEBLine;
|
||||
import andromedia.midsuit.model.X_MID_UploadTPB;
|
||||
import andromedia.midsuit.model.X_MID_UploadTPBLine;
|
||||
import andromedia.midsuit.model.X_MID_UploadTPBLineDet;
|
||||
import andromedia.midsuit.model.X_M_RMAMA;
|
||||
import andromedia.midsuit.model.X_M_RequisitionTax;
|
||||
import andromedia.midsuit.model.X_mid_ceisa_entitas;
|
||||
import andromedia.midsuit.model.X_mid_ceisa_order;
|
||||
import andromedia.midsuit.model.X_mid_ceisa_orderline;
|
||||
import andromedia.midsuit.model.X_mid_ceisa_upload;
|
||||
import andromedia.midsuit.model.X_zpos_Cashier;
|
||||
import balinusa.midsuit.model.MID_Aging;
|
||||
import balinusa.midsuit.model.MID_Analysis;
|
||||
import balinusa.midsuit.model.MID_AnalysisLine;
|
||||
import balinusa.midsuit.model.MID_AnalysisPro;
|
||||
import balinusa.midsuit.model.MID_Ceisa_Order;
|
||||
import balinusa.midsuit.model.MID_MAssetAddition;
|
||||
import balinusa.midsuit.model.MID_MAssetDisposed;
|
||||
import balinusa.midsuit.model.MID_MBillingList;
|
||||
import balinusa.midsuit.model.MID_MBillingListLine;
|
||||
import balinusa.midsuit.model.MID_MDDOrder;
|
||||
import balinusa.midsuit.model.MID_MDDOrderLine;
|
||||
import balinusa.midsuit.model.MID_MDepreciationEntry;
|
||||
import balinusa.midsuit.model.MID_MInventory;
|
||||
import balinusa.midsuit.model.MID_MInvoice;
|
||||
import balinusa.midsuit.model.MID_MOrder;
|
||||
import balinusa.midsuit.model.MID_MOrderLine;
|
||||
import balinusa.midsuit.model.MID_MPayment;
|
||||
import balinusa.midsuit.model.MID_MProductionConfirm;
|
||||
import balinusa.midsuit.model.MID_MRequisition;
|
||||
import balinusa.midsuit.model.MID_MRequisitionLine;
|
||||
import balinusa.midsuit.model.MID_MRequisitionTrx;
|
||||
import balinusa.midsuit.model.MID_MRequisitionTrxLine;
|
||||
import balinusa.midsuit.model.MID_MRequsitionTax;
|
||||
import balinusa.midsuit.model.MID_PPO;
|
||||
import balinusa.midsuit.model.MID_PPOLine;
|
||||
import balinusa.midsuit.model.MID_UnrealizedRate;
|
||||
import balinusa.midsuit.model.MID_UnrealizedRateLine;
|
||||
import balinusa.midsuit.model.MWarehouse;
|
||||
import balinusa.midsuit.model.X_C_OrderLineMA;
|
||||
import balinusa.midsuit.model.X_MID_UploadPEB;
|
||||
import balinusa.midsuit.model.X_MID_UploadPEBLine;
|
||||
import balinusa.midsuit.model.X_MID_UploadTPB;
|
||||
import balinusa.midsuit.model.X_MID_UploadTPBLine;
|
||||
import balinusa.midsuit.model.X_MID_UploadTPBLineDet;
|
||||
import balinusa.midsuit.model.X_M_RMAMA;
|
||||
import balinusa.midsuit.model.X_M_RequisitionTax;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_entitas;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_order;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_orderline;
|
||||
import balinusa.midsuit.model.X_mid_ceisa_upload;
|
||||
import balinusa.midsuit.model.X_zpos_Cashier;
|
||||
|
||||
public class MID_ModelFactory implements IModelFactory{
|
||||
private static HashMap<String, String> mapTableModels = new HashMap<String, String>();
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.factory;
|
||||
package balinusa.midsuit.factory;
|
||||
|
||||
import org.adempiere.base.IProcessFactory;
|
||||
import org.compiere.process.ProcessCall;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.factory;
|
||||
package balinusa.midsuit.factory;
|
||||
|
||||
import org.adempiere.base.event.AbstractEventHandler;
|
||||
import org.adempiere.base.event.IEventTopics;
|
||||
|
|
@ -26,23 +26,23 @@ import org.compiere.model.PO;
|
|||
import org.compiere.util.CLogger;
|
||||
import org.osgi.service.event.Event;
|
||||
|
||||
import andromedia.midsuit.model.X_M_RequisitionTax;
|
||||
import andromedia.midsuit.validator.MID_CurrencyRateValidator;
|
||||
import andromedia.midsuit.validator.MID_DeprWorkfileValidator;
|
||||
import andromedia.midsuit.validator.MID_InOutValidator;
|
||||
import andromedia.midsuit.validator.MID_InventoryLineMAValidator;
|
||||
import andromedia.midsuit.validator.MID_InventoryLineValidator;
|
||||
import andromedia.midsuit.validator.MID_InventoryValidator;
|
||||
import andromedia.midsuit.validator.MID_InvoiceTaxValidator;
|
||||
import andromedia.midsuit.validator.MID_JournalValidator;
|
||||
import andromedia.midsuit.validator.MID_OrderLineValidator;
|
||||
import andromedia.midsuit.validator.MID_OrderTaxValidator;
|
||||
import andromedia.midsuit.validator.MID_OrderValidator;
|
||||
import andromedia.midsuit.validator.MID_PaymentValidator;
|
||||
import andromedia.midsuit.validator.MID_ProductValidator;
|
||||
import andromedia.midsuit.validator.MID_ProductionLineValidator;
|
||||
import andromedia.midsuit.validator.MID_ProductionValidator;
|
||||
import andromedia.midsuit.validator.MID_RequisitionTaxValidator;
|
||||
import balinusa.midsuit.model.X_M_RequisitionTax;
|
||||
import balinusa.midsuit.validator.MID_CurrencyRateValidator;
|
||||
import balinusa.midsuit.validator.MID_DeprWorkfileValidator;
|
||||
import balinusa.midsuit.validator.MID_InOutValidator;
|
||||
import balinusa.midsuit.validator.MID_InventoryLineMAValidator;
|
||||
import balinusa.midsuit.validator.MID_InventoryLineValidator;
|
||||
import balinusa.midsuit.validator.MID_InventoryValidator;
|
||||
import balinusa.midsuit.validator.MID_InvoiceTaxValidator;
|
||||
import balinusa.midsuit.validator.MID_JournalValidator;
|
||||
import balinusa.midsuit.validator.MID_OrderLineValidator;
|
||||
import balinusa.midsuit.validator.MID_OrderTaxValidator;
|
||||
import balinusa.midsuit.validator.MID_OrderValidator;
|
||||
import balinusa.midsuit.validator.MID_PaymentValidator;
|
||||
import balinusa.midsuit.validator.MID_ProductValidator;
|
||||
import balinusa.midsuit.validator.MID_ProductionLineValidator;
|
||||
import balinusa.midsuit.validator.MID_ProductionValidator;
|
||||
import balinusa.midsuit.validator.MID_RequisitionTaxValidator;
|
||||
|
||||
public class MID_ValidatorFactory extends AbstractEventHandler {
|
||||
public CLogger log = CLogger.getCLogger(MID_ValidatorFactory.class);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.security.Timestamp;
|
||||
|
|
@ -23,8 +23,8 @@ import org.compiere.util.KeyNamePair;
|
|||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.Trx;
|
||||
|
||||
import andromedia.midsuit.model.MID_MBillingList;
|
||||
import andromedia.midsuit.model.MID_MBillingListLine;
|
||||
import balinusa.midsuit.model.MID_MBillingList;
|
||||
import balinusa.midsuit.model.MID_MBillingListLine;
|
||||
|
||||
public class BillingListGenerate extends GenForm {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
|
|
@ -31,7 +31,7 @@ import org.compiere.util.Env;
|
|||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
import andromedia.midsuit.model.MID_MRequisitionTrxLine;
|
||||
import balinusa.midsuit.model.MID_MRequisitionTrxLine;
|
||||
|
||||
public class MID_CreateFromOrder extends CreateFrom {
|
||||
/*
|
||||
|
|
@ -1,230 +1,230 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2009 Low Heng Sin *
|
||||
* Copyright (C) 2009 Idalica Corporation *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.form;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.compiere.apps.IStatusBar;
|
||||
import org.compiere.grid.CreateFrom;
|
||||
import org.compiere.minigrid.IMiniTable;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MInOutLine;
|
||||
import org.compiere.model.MInOutLineMA;
|
||||
import org.compiere.model.MRMA;
|
||||
import org.compiere.model.MRMALine;
|
||||
import org.compiere.model.MStorageOnHand;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.model.X_M_InOutLineMA;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
import andromedia.midsuit.model.X_C_OrderLineMA;
|
||||
import andromedia.midsuit.model.X_M_RMAMA;
|
||||
|
||||
/**
|
||||
* Create Transactions for RMA
|
||||
* @author ashley
|
||||
* @author Teo Sarca, www.arhipac.ro
|
||||
* <li>BF [ 2007837 ] VCreateFrom.save() should run in trx
|
||||
*/
|
||||
public abstract class MID_CreateFromRMA extends CreateFrom {
|
||||
|
||||
public MID_CreateFromRMA(GridTab mTab)
|
||||
{
|
||||
super(mTab);
|
||||
if (log.isLoggable(Level.INFO)) log.info(mTab.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dynInit() throws Exception
|
||||
{
|
||||
log.config("");
|
||||
setTitle(Msg.getElement(Env.getCtx(), "M_RMA_ID") + " .. " + Msg.translate(Env.getCtx(), "CreateFrom"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected Vector<Vector<Object>> getRMAData()
|
||||
{
|
||||
int M_InOut_ID = Env.getContextAsInt(Env.getCtx(), getGridTab().getWindowNo(), "InOut_ID");
|
||||
int M_RMA_ID = Env.getContextAsInt(Env.getCtx(), getGridTab().getWindowNo(), "M_RMA_ID");
|
||||
|
||||
Vector<Vector<Object>> data = new Vector<Vector<Object>>();
|
||||
|
||||
/**
|
||||
* 1 M_InOutLine_ID
|
||||
* 2 Line
|
||||
* 3 Product Name
|
||||
* 4 Qty Entered
|
||||
* 5 Movement Qty
|
||||
* 6 ASI
|
||||
*/
|
||||
StringBuilder sqlStmt = new StringBuilder();
|
||||
|
||||
sqlStmt.append("SELECT iol.M_InOutLine_ID, iol.Line, ");
|
||||
sqlStmt.append("COALESCE(p.Name, c.Name) AS ProductName, ");
|
||||
sqlStmt.append("iol.QtyEntered, ");
|
||||
sqlStmt.append("iol.movementQty-(SELECT COALESCE((SELECT SUM(rmal.qty) FROM M_RMALine rmal JOIN M_RMA rma ON rma.M_RMA_ID=rmal.M_RMA_ID WHERE rmal.M_InOutLine_ID=iol.M_InOutLine_ID AND rma.DocStatus IN ('CO','CL')),0)) AS MovementQty, ");
|
||||
sqlStmt.append("CASE WHEN iol.M_AttributeSetInstance_ID IS NOT NULL THEN (SELECT SerNo FROM M_AttributeSetInstance asi WHERE asi.M_AttributeSetInstance_ID=iol.M_AttributeSetInstance_ID) END as ASI, ");
|
||||
sqlStmt.append("iol.Description " );
|
||||
sqlStmt.append("FROM M_InOutLine iol ");
|
||||
sqlStmt.append("LEFT JOIN M_Product p ON p.M_Product_ID = iol.M_Product_ID ");
|
||||
sqlStmt.append("LEFT JOIN C_Charge c ON c.C_Charge_ID = iol.C_Charge_ID ");
|
||||
sqlStmt.append("WHERE M_InOut_ID=? ");
|
||||
sqlStmt.append("AND iol.M_InOutLine_ID NOT IN (SELECT rmal.M_InOutLine_ID FROM M_RMALine rmal WHERE rmal.M_RMA_ID=?)");
|
||||
sqlStmt.append(" ORDER BY iol.Line " );
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement(sqlStmt.toString(), null);
|
||||
pstmt.setInt(1, M_InOut_ID);
|
||||
pstmt.setInt(2, M_RMA_ID);
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next())
|
||||
{
|
||||
Vector<Object> line = new Vector<Object>(8);
|
||||
line.add(new Boolean(false)); // 0-Selection
|
||||
|
||||
KeyNamePair lineKNPair = new KeyNamePair(rs.getInt(1), rs.getString(2)); // 1-Line
|
||||
line.add(lineKNPair);
|
||||
line.add(rs.getString(3)); //2-Product
|
||||
line.add(rs.getString(6)); //3-ASI
|
||||
|
||||
BigDecimal qtyEntered = rs.getBigDecimal(4);
|
||||
BigDecimal movementQty = rs.getBigDecimal(5);
|
||||
|
||||
line.add(qtyEntered); //4-Qty
|
||||
line.add(movementQty); //5-Movement Qty
|
||||
|
||||
line.add(rs.getString(7)); // 6 - Description
|
||||
data.add(line);
|
||||
}
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
log.log(Level.SEVERE, sqlStmt.toString(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null;
|
||||
pstmt = null;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void info(IMiniTable miniTable, IStatusBar statusBar)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void configureMiniTable (IMiniTable miniTable)
|
||||
{
|
||||
miniTable.setColumnClass(0, Boolean.class, false); // 0-Selection
|
||||
miniTable.setColumnClass(1, String.class, true); // 1-Line
|
||||
miniTable.setColumnClass(2, String.class, true); // 2-Product
|
||||
miniTable.setColumnClass(3, String.class, true); // 3-ASI
|
||||
miniTable.setColumnClass(4, BigDecimal.class, true); // 4-Qty
|
||||
miniTable.setColumnClass(5, BigDecimal.class, false); // 5-Delivered Qty
|
||||
miniTable.setColumnClass(6, String.class, true); // 6-Description
|
||||
|
||||
// Table UI
|
||||
miniTable.autoSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean save(IMiniTable miniTable, String trxName)
|
||||
{
|
||||
log.config("");
|
||||
int M_RMA_ID = Env.getContextAsInt(Env.getCtx(), getGridTab().getWindowNo(), "M_RMA_ID");
|
||||
|
||||
// Integer bpId = (Integer)bPartnerField.getValue();
|
||||
MRMA rma = new MRMA(Env.getCtx(), M_RMA_ID, trxName);
|
||||
//update BP
|
||||
// rma.setC_BPartner_ID(bpId);
|
||||
|
||||
for (int i = 0; i < miniTable.getRowCount(); i++)
|
||||
{
|
||||
if (((Boolean)miniTable.getValueAt(i, 0)).booleanValue())
|
||||
{
|
||||
BigDecimal d = (BigDecimal)miniTable.getValueAt(i, 5); // 5-Movement Qty
|
||||
KeyNamePair pp = (KeyNamePair)miniTable.getValueAt(i, 1); // 1-Line
|
||||
|
||||
int inOutLineId = pp.getKey();
|
||||
MInOutLine iol = new MInOutLine(rma.getCtx(), inOutLineId, rma.get_TrxName());
|
||||
MRMALine rmaLine = new MRMALine(rma.getCtx(), 0, rma.get_TrxName());
|
||||
rmaLine.setM_RMA_ID(M_RMA_ID);
|
||||
rmaLine.setM_InOutLine_ID(inOutLineId);
|
||||
rmaLine.setQty(d);
|
||||
rmaLine.setAD_Org_ID(rma.getAD_Org_ID());
|
||||
rmaLine.setDescription((String)miniTable.getValueAt(i, 6));
|
||||
if (!rmaLine.save())
|
||||
{
|
||||
throw new IllegalStateException("Could not create RMA Line");
|
||||
}
|
||||
List<MInOutLineMA> attLines = new Query(Env.getCtx(), X_M_InOutLineMA.Table_Name, "M_InOutLine_ID =?", trxName)
|
||||
.setParameters(new Object[] { inOutLineId })
|
||||
.setOnlyActiveRecords(true)
|
||||
.list();
|
||||
log.severe(iol.getM_AttributeSetInstance_ID()+" ");
|
||||
if(attLines.size()<=0)
|
||||
rmaLine.set_ValueNoCheck("M_AttributeSetInstance_ID", iol.getM_AttributeSetInstance_ID());
|
||||
else {
|
||||
for(MInOutLineMA attLine : attLines) {
|
||||
X_M_RMAMA inoutAtt = new X_M_RMAMA(rma.getCtx(), 0, rma.get_TrxName());
|
||||
inoutAtt.setAD_Org_ID(attLine.getAD_Org_ID());
|
||||
inoutAtt.setM_InOutLine_ID(iol.getM_InOutLine_ID());
|
||||
inoutAtt.setM_RMALine_ID(rmaLine.get_ID());
|
||||
inoutAtt.setIsAutoGenerated(false);
|
||||
inoutAtt.setM_AttributeSetInstance_ID(attLine.getM_AttributeSetInstance_ID());
|
||||
inoutAtt.setMovementQty(attLine.getMovementQty());
|
||||
inoutAtt.setDateMaterialPolicy(attLine.getDateMaterialPolicy());
|
||||
inoutAtt.saveEx();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
rma.saveEx();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected Vector<String> getOISColumnNames()
|
||||
{
|
||||
// Header Info
|
||||
Vector<String> columnNames = new Vector<String>(7);
|
||||
columnNames.add(Msg.getMsg(Env.getCtx(), "Select"));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "Line"));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "M_Product_ID"));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "SerNo"));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "Quantity"));
|
||||
columnNames.add(Msg.getElement(Env.getCtx(), "QtyDelivered", false));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "Description"));
|
||||
|
||||
return columnNames;
|
||||
}
|
||||
}
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 Low Heng Sin *
|
||||
* Copyright (C) 2009 Idalica Corporation *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*****************************************************************************/
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.compiere.apps.IStatusBar;
|
||||
import org.compiere.grid.CreateFrom;
|
||||
import org.compiere.minigrid.IMiniTable;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MInOutLine;
|
||||
import org.compiere.model.MInOutLineMA;
|
||||
import org.compiere.model.MRMA;
|
||||
import org.compiere.model.MRMALine;
|
||||
import org.compiere.model.MStorageOnHand;
|
||||
import org.compiere.model.Query;
|
||||
import org.compiere.model.X_M_InOutLineMA;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
import balinusa.midsuit.model.X_C_OrderLineMA;
|
||||
import balinusa.midsuit.model.X_M_RMAMA;
|
||||
|
||||
/**
|
||||
* Create Transactions for RMA
|
||||
* @author ashley
|
||||
* @author Teo Sarca, www.arhipac.ro
|
||||
* <li>BF [ 2007837 ] VCreateFrom.save() should run in trx
|
||||
*/
|
||||
public abstract class MID_CreateFromRMA extends CreateFrom {
|
||||
|
||||
public MID_CreateFromRMA(GridTab mTab)
|
||||
{
|
||||
super(mTab);
|
||||
if (log.isLoggable(Level.INFO)) log.info(mTab.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dynInit() throws Exception
|
||||
{
|
||||
log.config("");
|
||||
setTitle(Msg.getElement(Env.getCtx(), "M_RMA_ID") + " .. " + Msg.translate(Env.getCtx(), "CreateFrom"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected Vector<Vector<Object>> getRMAData()
|
||||
{
|
||||
int M_InOut_ID = Env.getContextAsInt(Env.getCtx(), getGridTab().getWindowNo(), "InOut_ID");
|
||||
int M_RMA_ID = Env.getContextAsInt(Env.getCtx(), getGridTab().getWindowNo(), "M_RMA_ID");
|
||||
|
||||
Vector<Vector<Object>> data = new Vector<Vector<Object>>();
|
||||
|
||||
/**
|
||||
* 1 M_InOutLine_ID
|
||||
* 2 Line
|
||||
* 3 Product Name
|
||||
* 4 Qty Entered
|
||||
* 5 Movement Qty
|
||||
* 6 ASI
|
||||
*/
|
||||
StringBuilder sqlStmt = new StringBuilder();
|
||||
|
||||
sqlStmt.append("SELECT iol.M_InOutLine_ID, iol.Line, ");
|
||||
sqlStmt.append("COALESCE(p.Name, c.Name) AS ProductName, ");
|
||||
sqlStmt.append("iol.QtyEntered, ");
|
||||
sqlStmt.append("iol.movementQty-(SELECT COALESCE((SELECT SUM(rmal.qty) FROM M_RMALine rmal JOIN M_RMA rma ON rma.M_RMA_ID=rmal.M_RMA_ID WHERE rmal.M_InOutLine_ID=iol.M_InOutLine_ID AND rma.DocStatus IN ('CO','CL')),0)) AS MovementQty, ");
|
||||
sqlStmt.append("CASE WHEN iol.M_AttributeSetInstance_ID IS NOT NULL THEN (SELECT SerNo FROM M_AttributeSetInstance asi WHERE asi.M_AttributeSetInstance_ID=iol.M_AttributeSetInstance_ID) END as ASI, ");
|
||||
sqlStmt.append("iol.Description " );
|
||||
sqlStmt.append("FROM M_InOutLine iol ");
|
||||
sqlStmt.append("LEFT JOIN M_Product p ON p.M_Product_ID = iol.M_Product_ID ");
|
||||
sqlStmt.append("LEFT JOIN C_Charge c ON c.C_Charge_ID = iol.C_Charge_ID ");
|
||||
sqlStmt.append("WHERE M_InOut_ID=? ");
|
||||
sqlStmt.append("AND iol.M_InOutLine_ID NOT IN (SELECT rmal.M_InOutLine_ID FROM M_RMALine rmal WHERE rmal.M_RMA_ID=?)");
|
||||
sqlStmt.append(" ORDER BY iol.Line " );
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement(sqlStmt.toString(), null);
|
||||
pstmt.setInt(1, M_InOut_ID);
|
||||
pstmt.setInt(2, M_RMA_ID);
|
||||
rs = pstmt.executeQuery();
|
||||
while (rs.next())
|
||||
{
|
||||
Vector<Object> line = new Vector<Object>(8);
|
||||
line.add(new Boolean(false)); // 0-Selection
|
||||
|
||||
KeyNamePair lineKNPair = new KeyNamePair(rs.getInt(1), rs.getString(2)); // 1-Line
|
||||
line.add(lineKNPair);
|
||||
line.add(rs.getString(3)); //2-Product
|
||||
line.add(rs.getString(6)); //3-ASI
|
||||
|
||||
BigDecimal qtyEntered = rs.getBigDecimal(4);
|
||||
BigDecimal movementQty = rs.getBigDecimal(5);
|
||||
|
||||
line.add(qtyEntered); //4-Qty
|
||||
line.add(movementQty); //5-Movement Qty
|
||||
|
||||
line.add(rs.getString(7)); // 6 - Description
|
||||
data.add(line);
|
||||
}
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
log.log(Level.SEVERE, sqlStmt.toString(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null;
|
||||
pstmt = null;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void info(IMiniTable miniTable, IStatusBar statusBar)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void configureMiniTable (IMiniTable miniTable)
|
||||
{
|
||||
miniTable.setColumnClass(0, Boolean.class, false); // 0-Selection
|
||||
miniTable.setColumnClass(1, String.class, true); // 1-Line
|
||||
miniTable.setColumnClass(2, String.class, true); // 2-Product
|
||||
miniTable.setColumnClass(3, String.class, true); // 3-ASI
|
||||
miniTable.setColumnClass(4, BigDecimal.class, true); // 4-Qty
|
||||
miniTable.setColumnClass(5, BigDecimal.class, false); // 5-Delivered Qty
|
||||
miniTable.setColumnClass(6, String.class, true); // 6-Description
|
||||
|
||||
// Table UI
|
||||
miniTable.autoSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean save(IMiniTable miniTable, String trxName)
|
||||
{
|
||||
log.config("");
|
||||
int M_RMA_ID = Env.getContextAsInt(Env.getCtx(), getGridTab().getWindowNo(), "M_RMA_ID");
|
||||
|
||||
// Integer bpId = (Integer)bPartnerField.getValue();
|
||||
MRMA rma = new MRMA(Env.getCtx(), M_RMA_ID, trxName);
|
||||
//update BP
|
||||
// rma.setC_BPartner_ID(bpId);
|
||||
|
||||
for (int i = 0; i < miniTable.getRowCount(); i++)
|
||||
{
|
||||
if (((Boolean)miniTable.getValueAt(i, 0)).booleanValue())
|
||||
{
|
||||
BigDecimal d = (BigDecimal)miniTable.getValueAt(i, 5); // 5-Movement Qty
|
||||
KeyNamePair pp = (KeyNamePair)miniTable.getValueAt(i, 1); // 1-Line
|
||||
|
||||
int inOutLineId = pp.getKey();
|
||||
MInOutLine iol = new MInOutLine(rma.getCtx(), inOutLineId, rma.get_TrxName());
|
||||
MRMALine rmaLine = new MRMALine(rma.getCtx(), 0, rma.get_TrxName());
|
||||
rmaLine.setM_RMA_ID(M_RMA_ID);
|
||||
rmaLine.setM_InOutLine_ID(inOutLineId);
|
||||
rmaLine.setQty(d);
|
||||
rmaLine.setAD_Org_ID(rma.getAD_Org_ID());
|
||||
rmaLine.setDescription((String)miniTable.getValueAt(i, 6));
|
||||
if (!rmaLine.save())
|
||||
{
|
||||
throw new IllegalStateException("Could not create RMA Line");
|
||||
}
|
||||
List<MInOutLineMA> attLines = new Query(Env.getCtx(), X_M_InOutLineMA.Table_Name, "M_InOutLine_ID =?", trxName)
|
||||
.setParameters(new Object[] { inOutLineId })
|
||||
.setOnlyActiveRecords(true)
|
||||
.list();
|
||||
log.severe(iol.getM_AttributeSetInstance_ID()+" ");
|
||||
if(attLines.size()<=0)
|
||||
rmaLine.set_ValueNoCheck("M_AttributeSetInstance_ID", iol.getM_AttributeSetInstance_ID());
|
||||
else {
|
||||
for(MInOutLineMA attLine : attLines) {
|
||||
X_M_RMAMA inoutAtt = new X_M_RMAMA(rma.getCtx(), 0, rma.get_TrxName());
|
||||
inoutAtt.setAD_Org_ID(attLine.getAD_Org_ID());
|
||||
inoutAtt.setM_InOutLine_ID(iol.getM_InOutLine_ID());
|
||||
inoutAtt.setM_RMALine_ID(rmaLine.get_ID());
|
||||
inoutAtt.setIsAutoGenerated(false);
|
||||
inoutAtt.setM_AttributeSetInstance_ID(attLine.getM_AttributeSetInstance_ID());
|
||||
inoutAtt.setMovementQty(attLine.getMovementQty());
|
||||
inoutAtt.setDateMaterialPolicy(attLine.getDateMaterialPolicy());
|
||||
inoutAtt.saveEx();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
rma.saveEx();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected Vector<String> getOISColumnNames()
|
||||
{
|
||||
// Header Info
|
||||
Vector<String> columnNames = new Vector<String>(7);
|
||||
columnNames.add(Msg.getMsg(Env.getCtx(), "Select"));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "Line"));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "M_Product_ID"));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "SerNo"));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "Quantity"));
|
||||
columnNames.add(Msg.getElement(Env.getCtx(), "QtyDelivered", false));
|
||||
columnNames.add(Msg.translate(Env.getCtx(), "Description"));
|
||||
|
||||
return columnNames;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*****************************************************************************/
|
||||
|
||||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
|
|
@ -50,8 +50,8 @@ import org.compiere.util.Env;
|
|||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
import andromedia.midsuit.model.X_C_OrderLineMA;
|
||||
import andromedia.midsuit.model.X_M_RMAMA;
|
||||
import balinusa.midsuit.model.X_C_OrderLineMA;
|
||||
import balinusa.midsuit.model.X_M_RMAMA;
|
||||
|
||||
/**
|
||||
* Create Invoice Transactions from PO Orders or Receipt
|
||||
|
|
@ -1,475 +1,475 @@
|
|||
package andromedia.midsuit.form;
|
||||
|
||||
import static org.compiere.model.SystemIDs.COLUMN_C_INVOICE_C_BPARTNER_ID;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.ClientInfo;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.apps.form.WCreateFromInvoiceUI;
|
||||
import org.adempiere.webui.apps.form.WCreateFromWindow;
|
||||
import org.adempiere.webui.component.Column;
|
||||
import org.adempiere.webui.component.Columns;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
import org.adempiere.webui.component.GridFactory;
|
||||
import org.adempiere.webui.component.Label;
|
||||
import org.adempiere.webui.component.ListItem;
|
||||
import org.adempiere.webui.component.ListModelTable;
|
||||
import org.adempiere.webui.component.Listbox;
|
||||
import org.adempiere.webui.component.ListboxFactory;
|
||||
import org.adempiere.webui.component.Panel;
|
||||
import org.adempiere.webui.component.Row;
|
||||
import org.adempiere.webui.component.Rows;
|
||||
import org.adempiere.webui.editor.WEditor;
|
||||
import org.adempiere.webui.editor.WSearchEditor;
|
||||
import org.adempiere.webui.event.ValueChangeEvent;
|
||||
import org.adempiere.webui.event.ValueChangeListener;
|
||||
import org.adempiere.webui.util.ZKUpdateUtil;
|
||||
import org.compiere.grid.CreateFromInvoice;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.model.MLookup;
|
||||
import org.compiere.model.MLookupFactory;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Space;
|
||||
|
||||
public class MID_WCreateFromInvoice extends MID_CreateFromInvoice implements EventListener<Event>, ValueChangeListener
|
||||
{
|
||||
private WCreateFromWindow window;
|
||||
|
||||
public MID_WCreateFromInvoice(GridTab tab)
|
||||
{
|
||||
super(tab);
|
||||
log.info(getGridTab().toString());
|
||||
|
||||
window = new WCreateFromWindow(this, getGridTab().getWindowNo());
|
||||
|
||||
p_WindowNo = getGridTab().getWindowNo();
|
||||
|
||||
try
|
||||
{
|
||||
if (!dynInit())
|
||||
return;
|
||||
zkInit();
|
||||
setInitOK(true);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, "", e);
|
||||
setInitOK(false);
|
||||
}
|
||||
AEnv.showWindow(window);
|
||||
}
|
||||
|
||||
/** Window No */
|
||||
private int p_WindowNo;
|
||||
|
||||
/** Logger */
|
||||
private CLogger log = CLogger.getCLogger(getClass());
|
||||
|
||||
protected Label bPartnerLabel = new Label();
|
||||
protected WEditor bPartnerField;
|
||||
|
||||
protected Label orderLabel = new Label();
|
||||
protected Listbox orderField = ListboxFactory.newDropdownListbox();
|
||||
|
||||
protected Label shipmentLabel = new Label();
|
||||
protected Listbox shipmentField = ListboxFactory.newDropdownListbox();
|
||||
|
||||
/** Label for the rma selection */
|
||||
protected Label rmaLabel = new Label();
|
||||
/** Combo box for selecting RMA document */
|
||||
protected Listbox rmaField = ListboxFactory.newDropdownListbox();
|
||||
|
||||
private Grid parameterStdLayout;
|
||||
|
||||
/**
|
||||
* Dynamic Init
|
||||
* @throws Exception if Lookups cannot be initialized
|
||||
* @return true if initialized
|
||||
*/
|
||||
public boolean dynInit() throws Exception
|
||||
{
|
||||
log.config("");
|
||||
|
||||
super.dynInit();
|
||||
|
||||
window.setTitle(getTitle());
|
||||
|
||||
// RMA Selection option should only be available for AP Credit Memo
|
||||
Integer docTypeId = (Integer)getGridTab().getValue("C_DocTypeTarget_ID");
|
||||
MDocType docType = MDocType.get(Env.getCtx(), docTypeId);
|
||||
if (!MDocType.DOCBASETYPE_APCreditMemo.equals(docType.getDocBaseType()) && !MDocType.DOCBASETYPE_ARCreditMemo.equals(docType.getDocBaseType()))
|
||||
{
|
||||
rmaLabel.setVisible(false);
|
||||
rmaField.setVisible(false);
|
||||
}
|
||||
|
||||
initBPartner(true);
|
||||
bPartnerField.addValueChangeListener(this);
|
||||
|
||||
return true;
|
||||
} // dynInit
|
||||
|
||||
protected void zkInit() throws Exception
|
||||
{
|
||||
bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
|
||||
orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", isSOTrx));
|
||||
shipmentLabel.setText(Msg.getElement(Env.getCtx(), "M_InOut_ID", isSOTrx));
|
||||
rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID"));
|
||||
|
||||
Panel parameterPanel = window.getParameterPanel();
|
||||
|
||||
parameterStdLayout = GridFactory.newGridLayout();
|
||||
Panel parameterStdPanel = new Panel();
|
||||
parameterStdPanel.appendChild(parameterStdLayout);
|
||||
|
||||
setupColumns(parameterStdLayout);
|
||||
|
||||
parameterPanel.appendChild(parameterStdPanel);
|
||||
ZKUpdateUtil.setVflex(parameterStdLayout, "min");
|
||||
|
||||
Rows rows = (Rows) parameterStdLayout.newRows();
|
||||
Row row = rows.newRow();
|
||||
row.appendChild(bPartnerLabel.rightAlign());
|
||||
if (bPartnerField != null)
|
||||
row.appendChild(bPartnerField.getComponent());
|
||||
row.appendChild(orderLabel.rightAlign());
|
||||
ZKUpdateUtil.setHflex(orderField, "1");
|
||||
row.appendChild(orderField);
|
||||
|
||||
row = rows.newRow();
|
||||
row.appendChild(new Space());
|
||||
row.appendChild(new Space());
|
||||
row.appendChild(shipmentLabel.rightAlign());
|
||||
ZKUpdateUtil.setHflex(shipmentField, "1");
|
||||
row.appendChild(shipmentField);
|
||||
|
||||
// Add RMA document selection to panel
|
||||
row = rows.newRow();
|
||||
row.appendChild(new Space());
|
||||
row.appendChild(new Space());
|
||||
row.appendChild(rmaLabel.rightAlign());
|
||||
ZKUpdateUtil.setHflex(rmaField, "1");
|
||||
row.appendChild(rmaField);
|
||||
|
||||
if (ClientInfo.isMobile()) {
|
||||
if (noOfParameterColumn == 2)
|
||||
LayoutUtils.compactTo(parameterStdLayout, 2);
|
||||
ClientInfo.onClientInfo(window, this::onClientInfo);
|
||||
}
|
||||
|
||||
hideEmptyRow(rows);
|
||||
}
|
||||
|
||||
private void hideEmptyRow(org.zkoss.zul.Rows rows) {
|
||||
for(Component a : rows.getChildren()) {
|
||||
Row row = (Row) a;
|
||||
boolean visible = false;
|
||||
for(Component b : row.getChildren()) {
|
||||
if (b instanceof Space)
|
||||
continue;
|
||||
else if (!b.isVisible()) {
|
||||
continue;
|
||||
} else {
|
||||
if (!b.getChildren().isEmpty()) {
|
||||
for (Component c : b.getChildren()) {
|
||||
if (c.isVisible()) {
|
||||
visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
row.setVisible(visible);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean m_actionActive = false;
|
||||
|
||||
private int noOfParameterColumn;
|
||||
|
||||
/**
|
||||
* Action Listener
|
||||
* @param e event
|
||||
* @throws Exception
|
||||
*/
|
||||
public void onEvent(Event e) throws Exception
|
||||
{
|
||||
if (m_actionActive)
|
||||
return;
|
||||
m_actionActive = true;
|
||||
|
||||
// Order
|
||||
if (e.getTarget().equals(orderField))
|
||||
{
|
||||
ListItem li = orderField.getSelectedItem();
|
||||
int C_Order_ID = 0;
|
||||
if (li != null && li.getValue() != null)
|
||||
C_Order_ID = ((Integer) li.getValue()).intValue();
|
||||
// set Invoice, RMA and Shipment to Null
|
||||
rmaField.setSelectedIndex(-1);
|
||||
shipmentField.setSelectedIndex(-1);
|
||||
loadOrder(C_Order_ID, true);
|
||||
}
|
||||
// Shipment
|
||||
else if (e.getTarget().equals(shipmentField))
|
||||
{
|
||||
ListItem li = shipmentField.getSelectedItem();
|
||||
int M_InOut_ID = 0;
|
||||
if (li != null && li.getValue() != null)
|
||||
M_InOut_ID = ((Integer) li.getValue()).intValue();
|
||||
// set Order, RMA and Invoice to Null
|
||||
orderField.setSelectedIndex(-1);
|
||||
rmaField.setSelectedIndex(-1);
|
||||
loadShipment(M_InOut_ID);
|
||||
}
|
||||
// RMA
|
||||
else if (e.getTarget().equals(rmaField))
|
||||
{
|
||||
ListItem li = rmaField.getSelectedItem();
|
||||
int M_RMA_ID = 0;
|
||||
if (li != null && li.getValue() != null)
|
||||
M_RMA_ID = ((Integer) li.getValue()).intValue();
|
||||
// set Order and Invoice to Null
|
||||
orderField.setSelectedIndex(-1);
|
||||
shipmentField.setSelectedIndex(-1);
|
||||
loadRMA(M_RMA_ID);
|
||||
}
|
||||
m_actionActive = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Listener
|
||||
* @param e event
|
||||
*/
|
||||
public void valueChange (ValueChangeEvent e)
|
||||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config(e.getPropertyName() + "=" + e.getNewValue());
|
||||
|
||||
// BPartner - load Order/Invoice/Shipment
|
||||
if (e.getPropertyName().equals("C_BPartner_ID"))
|
||||
{
|
||||
int C_BPartner_ID = ((Integer)e.getNewValue()).intValue();
|
||||
initBPOrderDetails (C_BPartner_ID, true);
|
||||
}
|
||||
window.tableChanged(null);
|
||||
} // vetoableChange
|
||||
|
||||
/**************************************************************************
|
||||
* Load BPartner Field
|
||||
* @param forInvoice true if Invoices are to be created, false receipts
|
||||
* @throws Exception if Lookups cannot be initialized
|
||||
*/
|
||||
protected void initBPartner (boolean forInvoice) throws Exception
|
||||
{
|
||||
// load BPartner
|
||||
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
|
||||
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
|
||||
bPartnerField = new WSearchEditor ("C_BPartner_ID", true, false, true, lookup);
|
||||
//
|
||||
int C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BPartner_ID");
|
||||
bPartnerField.setValue(new Integer(C_BPartner_ID));
|
||||
|
||||
// initial loading
|
||||
initBPOrderDetails(C_BPartner_ID, forInvoice);
|
||||
} // initBPartner
|
||||
|
||||
/**
|
||||
* Load PBartner dependent Order/Invoice/Shipment Field.
|
||||
* @param C_BPartner_ID BPartner
|
||||
* @param forInvoice for invoice
|
||||
*/
|
||||
protected void initBPOrderDetails (int C_BPartner_ID, boolean forInvoice)
|
||||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID=" + C_BPartner_ID);
|
||||
KeyNamePair pp = new KeyNamePair(0,"");
|
||||
// load PO Orders - Closed, Completed
|
||||
orderField.removeActionListener(this);
|
||||
orderField.removeAllItems();
|
||||
orderField.addItem(pp);
|
||||
|
||||
ArrayList<KeyNamePair> list = loadOrderData(C_BPartner_ID, forInvoice, false);
|
||||
for(KeyNamePair knp : list)
|
||||
orderField.addItem(knp);
|
||||
|
||||
orderField.setSelectedIndex(0);
|
||||
orderField.addActionListener(this);
|
||||
|
||||
initBPDetails(C_BPartner_ID);
|
||||
} // initBPartnerOIS
|
||||
|
||||
public void initBPDetails(int C_BPartner_ID)
|
||||
{
|
||||
initBPShipmentDetails(C_BPartner_ID);
|
||||
initBPRMADetails(C_BPartner_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load PBartner dependent Order/Invoice/Shipment Field.
|
||||
* @param C_BPartner_ID
|
||||
*/
|
||||
private void initBPShipmentDetails(int C_BPartner_ID)
|
||||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID" + C_BPartner_ID);
|
||||
|
||||
// load Shipments (Receipts) - Completed, Closed
|
||||
shipmentField.removeActionListener(this);
|
||||
shipmentField.removeAllItems();
|
||||
// None
|
||||
KeyNamePair pp = new KeyNamePair(0,"");
|
||||
shipmentField.addItem(pp);
|
||||
|
||||
ArrayList<KeyNamePair> list = loadShipmentData(C_BPartner_ID);
|
||||
for(KeyNamePair knp : list)
|
||||
shipmentField.addItem(knp);
|
||||
|
||||
shipmentField.setSelectedIndex(0);
|
||||
shipmentField.addActionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load RMA that are candidates for shipment
|
||||
* @param C_BPartner_ID BPartner
|
||||
*/
|
||||
private void initBPRMADetails(int C_BPartner_ID)
|
||||
{
|
||||
rmaField.removeActionListener(this);
|
||||
rmaField.removeAllItems();
|
||||
// None
|
||||
KeyNamePair pp = new KeyNamePair(0,"");
|
||||
rmaField.addItem(pp);
|
||||
|
||||
ArrayList<KeyNamePair> list = loadRMAData(C_BPartner_ID);
|
||||
for(KeyNamePair knp : list)
|
||||
rmaField.addItem(knp);
|
||||
|
||||
rmaField.setSelectedIndex(0);
|
||||
rmaField.addActionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Data - Order
|
||||
* @param C_Order_ID Order
|
||||
* @param forInvoice true if for invoice vs. delivery qty
|
||||
*/
|
||||
protected void loadOrder (int C_Order_ID, boolean forInvoice)
|
||||
{
|
||||
loadTableOIS(getOrderData(C_Order_ID, forInvoice));
|
||||
} // LoadOrder
|
||||
|
||||
protected void loadRMA (int M_RMA_ID)
|
||||
{
|
||||
loadTableOIS(getRMAData(M_RMA_ID));
|
||||
}
|
||||
|
||||
protected void loadShipment (int M_InOut_ID)
|
||||
{
|
||||
loadTableOIS(getShipmentData(M_InOut_ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Order/Invoice/Shipment data into Table
|
||||
* @param data data
|
||||
*/
|
||||
protected void loadTableOIS (Vector<?> data)
|
||||
{
|
||||
window.getWListbox().clear();
|
||||
|
||||
// Remove previous listeners
|
||||
window.getWListbox().getModel().removeTableModelListener(window);
|
||||
// Set Model
|
||||
ListModelTable model = new ListModelTable(data);
|
||||
model.addTableModelListener(window);
|
||||
window.getWListbox().setData(model, getOISColumnNames());
|
||||
//
|
||||
|
||||
configureMiniTable(window.getWListbox());
|
||||
} // loadOrder
|
||||
|
||||
public void showWindow()
|
||||
{
|
||||
window.setVisible(true);
|
||||
}
|
||||
|
||||
public void closeWindow()
|
||||
{
|
||||
window.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getWindow() {
|
||||
return window;
|
||||
}
|
||||
|
||||
protected void setupColumns(Grid parameterGrid) {
|
||||
noOfParameterColumn = ClientInfo.maxWidth((ClientInfo.EXTRA_SMALL_WIDTH+ClientInfo.SMALL_WIDTH)/2) ? 2 : 4;
|
||||
Columns columns = new Columns();
|
||||
parameterGrid.appendChild(columns);
|
||||
if (ClientInfo.maxWidth((ClientInfo.EXTRA_SMALL_WIDTH+ClientInfo.SMALL_WIDTH)/2))
|
||||
{
|
||||
Column column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "35%");
|
||||
columns.appendChild(column);
|
||||
column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "65%");
|
||||
columns.appendChild(column);
|
||||
}
|
||||
else
|
||||
{
|
||||
Column column = new Column();
|
||||
columns.appendChild(column);
|
||||
column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "15%");
|
||||
columns.appendChild(column);
|
||||
ZKUpdateUtil.setWidth(column, "35%");
|
||||
column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "15%");
|
||||
columns.appendChild(column);
|
||||
column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "35%");
|
||||
columns.appendChild(column);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onClientInfo()
|
||||
{
|
||||
if (ClientInfo.isMobile() && parameterStdLayout != null && parameterStdLayout.getRows() != null)
|
||||
{
|
||||
int nc = ClientInfo.maxWidth((ClientInfo.EXTRA_SMALL_WIDTH+ClientInfo.SMALL_WIDTH)/2) ? 2 : 4;
|
||||
int cc = noOfParameterColumn;
|
||||
if (nc == cc)
|
||||
return;
|
||||
|
||||
parameterStdLayout.getColumns().detach();
|
||||
setupColumns(parameterStdLayout);
|
||||
if (cc > nc)
|
||||
{
|
||||
LayoutUtils.compactTo(parameterStdLayout, nc);
|
||||
}
|
||||
else
|
||||
{
|
||||
LayoutUtils.expandTo(parameterStdLayout, nc, false);
|
||||
}
|
||||
hideEmptyRow(parameterStdLayout.getRows());
|
||||
|
||||
ZKUpdateUtil.setCSSHeight(window);
|
||||
ZKUpdateUtil.setCSSWidth(window);
|
||||
window.invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import static org.compiere.model.SystemIDs.COLUMN_C_INVOICE_C_BPARTNER_ID;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.ClientInfo;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.apps.form.WCreateFromInvoiceUI;
|
||||
import org.adempiere.webui.apps.form.WCreateFromWindow;
|
||||
import org.adempiere.webui.component.Column;
|
||||
import org.adempiere.webui.component.Columns;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
import org.adempiere.webui.component.GridFactory;
|
||||
import org.adempiere.webui.component.Label;
|
||||
import org.adempiere.webui.component.ListItem;
|
||||
import org.adempiere.webui.component.ListModelTable;
|
||||
import org.adempiere.webui.component.Listbox;
|
||||
import org.adempiere.webui.component.ListboxFactory;
|
||||
import org.adempiere.webui.component.Panel;
|
||||
import org.adempiere.webui.component.Row;
|
||||
import org.adempiere.webui.component.Rows;
|
||||
import org.adempiere.webui.editor.WEditor;
|
||||
import org.adempiere.webui.editor.WSearchEditor;
|
||||
import org.adempiere.webui.event.ValueChangeEvent;
|
||||
import org.adempiere.webui.event.ValueChangeListener;
|
||||
import org.adempiere.webui.util.ZKUpdateUtil;
|
||||
import org.compiere.grid.CreateFromInvoice;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.model.MLookup;
|
||||
import org.compiere.model.MLookupFactory;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.KeyNamePair;
|
||||
import org.compiere.util.Msg;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Space;
|
||||
|
||||
public class MID_WCreateFromInvoice extends MID_CreateFromInvoice implements EventListener<Event>, ValueChangeListener
|
||||
{
|
||||
private WCreateFromWindow window;
|
||||
|
||||
public MID_WCreateFromInvoice(GridTab tab)
|
||||
{
|
||||
super(tab);
|
||||
log.info(getGridTab().toString());
|
||||
|
||||
window = new WCreateFromWindow(this, getGridTab().getWindowNo());
|
||||
|
||||
p_WindowNo = getGridTab().getWindowNo();
|
||||
|
||||
try
|
||||
{
|
||||
if (!dynInit())
|
||||
return;
|
||||
zkInit();
|
||||
setInitOK(true);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, "", e);
|
||||
setInitOK(false);
|
||||
}
|
||||
AEnv.showWindow(window);
|
||||
}
|
||||
|
||||
/** Window No */
|
||||
private int p_WindowNo;
|
||||
|
||||
/** Logger */
|
||||
private CLogger log = CLogger.getCLogger(getClass());
|
||||
|
||||
protected Label bPartnerLabel = new Label();
|
||||
protected WEditor bPartnerField;
|
||||
|
||||
protected Label orderLabel = new Label();
|
||||
protected Listbox orderField = ListboxFactory.newDropdownListbox();
|
||||
|
||||
protected Label shipmentLabel = new Label();
|
||||
protected Listbox shipmentField = ListboxFactory.newDropdownListbox();
|
||||
|
||||
/** Label for the rma selection */
|
||||
protected Label rmaLabel = new Label();
|
||||
/** Combo box for selecting RMA document */
|
||||
protected Listbox rmaField = ListboxFactory.newDropdownListbox();
|
||||
|
||||
private Grid parameterStdLayout;
|
||||
|
||||
/**
|
||||
* Dynamic Init
|
||||
* @throws Exception if Lookups cannot be initialized
|
||||
* @return true if initialized
|
||||
*/
|
||||
public boolean dynInit() throws Exception
|
||||
{
|
||||
log.config("");
|
||||
|
||||
super.dynInit();
|
||||
|
||||
window.setTitle(getTitle());
|
||||
|
||||
// RMA Selection option should only be available for AP Credit Memo
|
||||
Integer docTypeId = (Integer)getGridTab().getValue("C_DocTypeTarget_ID");
|
||||
MDocType docType = MDocType.get(Env.getCtx(), docTypeId);
|
||||
if (!MDocType.DOCBASETYPE_APCreditMemo.equals(docType.getDocBaseType()) && !MDocType.DOCBASETYPE_ARCreditMemo.equals(docType.getDocBaseType()))
|
||||
{
|
||||
rmaLabel.setVisible(false);
|
||||
rmaField.setVisible(false);
|
||||
}
|
||||
|
||||
initBPartner(true);
|
||||
bPartnerField.addValueChangeListener(this);
|
||||
|
||||
return true;
|
||||
} // dynInit
|
||||
|
||||
protected void zkInit() throws Exception
|
||||
{
|
||||
bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
|
||||
orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", isSOTrx));
|
||||
shipmentLabel.setText(Msg.getElement(Env.getCtx(), "M_InOut_ID", isSOTrx));
|
||||
rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID"));
|
||||
|
||||
Panel parameterPanel = window.getParameterPanel();
|
||||
|
||||
parameterStdLayout = GridFactory.newGridLayout();
|
||||
Panel parameterStdPanel = new Panel();
|
||||
parameterStdPanel.appendChild(parameterStdLayout);
|
||||
|
||||
setupColumns(parameterStdLayout);
|
||||
|
||||
parameterPanel.appendChild(parameterStdPanel);
|
||||
ZKUpdateUtil.setVflex(parameterStdLayout, "min");
|
||||
|
||||
Rows rows = (Rows) parameterStdLayout.newRows();
|
||||
Row row = rows.newRow();
|
||||
row.appendChild(bPartnerLabel.rightAlign());
|
||||
if (bPartnerField != null)
|
||||
row.appendChild(bPartnerField.getComponent());
|
||||
row.appendChild(orderLabel.rightAlign());
|
||||
ZKUpdateUtil.setHflex(orderField, "1");
|
||||
row.appendChild(orderField);
|
||||
|
||||
row = rows.newRow();
|
||||
row.appendChild(new Space());
|
||||
row.appendChild(new Space());
|
||||
row.appendChild(shipmentLabel.rightAlign());
|
||||
ZKUpdateUtil.setHflex(shipmentField, "1");
|
||||
row.appendChild(shipmentField);
|
||||
|
||||
// Add RMA document selection to panel
|
||||
row = rows.newRow();
|
||||
row.appendChild(new Space());
|
||||
row.appendChild(new Space());
|
||||
row.appendChild(rmaLabel.rightAlign());
|
||||
ZKUpdateUtil.setHflex(rmaField, "1");
|
||||
row.appendChild(rmaField);
|
||||
|
||||
if (ClientInfo.isMobile()) {
|
||||
if (noOfParameterColumn == 2)
|
||||
LayoutUtils.compactTo(parameterStdLayout, 2);
|
||||
ClientInfo.onClientInfo(window, this::onClientInfo);
|
||||
}
|
||||
|
||||
hideEmptyRow(rows);
|
||||
}
|
||||
|
||||
private void hideEmptyRow(org.zkoss.zul.Rows rows) {
|
||||
for(Component a : rows.getChildren()) {
|
||||
Row row = (Row) a;
|
||||
boolean visible = false;
|
||||
for(Component b : row.getChildren()) {
|
||||
if (b instanceof Space)
|
||||
continue;
|
||||
else if (!b.isVisible()) {
|
||||
continue;
|
||||
} else {
|
||||
if (!b.getChildren().isEmpty()) {
|
||||
for (Component c : b.getChildren()) {
|
||||
if (c.isVisible()) {
|
||||
visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
row.setVisible(visible);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean m_actionActive = false;
|
||||
|
||||
private int noOfParameterColumn;
|
||||
|
||||
/**
|
||||
* Action Listener
|
||||
* @param e event
|
||||
* @throws Exception
|
||||
*/
|
||||
public void onEvent(Event e) throws Exception
|
||||
{
|
||||
if (m_actionActive)
|
||||
return;
|
||||
m_actionActive = true;
|
||||
|
||||
// Order
|
||||
if (e.getTarget().equals(orderField))
|
||||
{
|
||||
ListItem li = orderField.getSelectedItem();
|
||||
int C_Order_ID = 0;
|
||||
if (li != null && li.getValue() != null)
|
||||
C_Order_ID = ((Integer) li.getValue()).intValue();
|
||||
// set Invoice, RMA and Shipment to Null
|
||||
rmaField.setSelectedIndex(-1);
|
||||
shipmentField.setSelectedIndex(-1);
|
||||
loadOrder(C_Order_ID, true);
|
||||
}
|
||||
// Shipment
|
||||
else if (e.getTarget().equals(shipmentField))
|
||||
{
|
||||
ListItem li = shipmentField.getSelectedItem();
|
||||
int M_InOut_ID = 0;
|
||||
if (li != null && li.getValue() != null)
|
||||
M_InOut_ID = ((Integer) li.getValue()).intValue();
|
||||
// set Order, RMA and Invoice to Null
|
||||
orderField.setSelectedIndex(-1);
|
||||
rmaField.setSelectedIndex(-1);
|
||||
loadShipment(M_InOut_ID);
|
||||
}
|
||||
// RMA
|
||||
else if (e.getTarget().equals(rmaField))
|
||||
{
|
||||
ListItem li = rmaField.getSelectedItem();
|
||||
int M_RMA_ID = 0;
|
||||
if (li != null && li.getValue() != null)
|
||||
M_RMA_ID = ((Integer) li.getValue()).intValue();
|
||||
// set Order and Invoice to Null
|
||||
orderField.setSelectedIndex(-1);
|
||||
shipmentField.setSelectedIndex(-1);
|
||||
loadRMA(M_RMA_ID);
|
||||
}
|
||||
m_actionActive = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Listener
|
||||
* @param e event
|
||||
*/
|
||||
public void valueChange (ValueChangeEvent e)
|
||||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config(e.getPropertyName() + "=" + e.getNewValue());
|
||||
|
||||
// BPartner - load Order/Invoice/Shipment
|
||||
if (e.getPropertyName().equals("C_BPartner_ID"))
|
||||
{
|
||||
int C_BPartner_ID = ((Integer)e.getNewValue()).intValue();
|
||||
initBPOrderDetails (C_BPartner_ID, true);
|
||||
}
|
||||
window.tableChanged(null);
|
||||
} // vetoableChange
|
||||
|
||||
/**************************************************************************
|
||||
* Load BPartner Field
|
||||
* @param forInvoice true if Invoices are to be created, false receipts
|
||||
* @throws Exception if Lookups cannot be initialized
|
||||
*/
|
||||
protected void initBPartner (boolean forInvoice) throws Exception
|
||||
{
|
||||
// load BPartner
|
||||
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
|
||||
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
|
||||
bPartnerField = new WSearchEditor ("C_BPartner_ID", true, false, true, lookup);
|
||||
//
|
||||
int C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BPartner_ID");
|
||||
bPartnerField.setValue(new Integer(C_BPartner_ID));
|
||||
|
||||
// initial loading
|
||||
initBPOrderDetails(C_BPartner_ID, forInvoice);
|
||||
} // initBPartner
|
||||
|
||||
/**
|
||||
* Load PBartner dependent Order/Invoice/Shipment Field.
|
||||
* @param C_BPartner_ID BPartner
|
||||
* @param forInvoice for invoice
|
||||
*/
|
||||
protected void initBPOrderDetails (int C_BPartner_ID, boolean forInvoice)
|
||||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID=" + C_BPartner_ID);
|
||||
KeyNamePair pp = new KeyNamePair(0,"");
|
||||
// load PO Orders - Closed, Completed
|
||||
orderField.removeActionListener(this);
|
||||
orderField.removeAllItems();
|
||||
orderField.addItem(pp);
|
||||
|
||||
ArrayList<KeyNamePair> list = loadOrderData(C_BPartner_ID, forInvoice, false);
|
||||
for(KeyNamePair knp : list)
|
||||
orderField.addItem(knp);
|
||||
|
||||
orderField.setSelectedIndex(0);
|
||||
orderField.addActionListener(this);
|
||||
|
||||
initBPDetails(C_BPartner_ID);
|
||||
} // initBPartnerOIS
|
||||
|
||||
public void initBPDetails(int C_BPartner_ID)
|
||||
{
|
||||
initBPShipmentDetails(C_BPartner_ID);
|
||||
initBPRMADetails(C_BPartner_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load PBartner dependent Order/Invoice/Shipment Field.
|
||||
* @param C_BPartner_ID
|
||||
*/
|
||||
private void initBPShipmentDetails(int C_BPartner_ID)
|
||||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config("C_BPartner_ID" + C_BPartner_ID);
|
||||
|
||||
// load Shipments (Receipts) - Completed, Closed
|
||||
shipmentField.removeActionListener(this);
|
||||
shipmentField.removeAllItems();
|
||||
// None
|
||||
KeyNamePair pp = new KeyNamePair(0,"");
|
||||
shipmentField.addItem(pp);
|
||||
|
||||
ArrayList<KeyNamePair> list = loadShipmentData(C_BPartner_ID);
|
||||
for(KeyNamePair knp : list)
|
||||
shipmentField.addItem(knp);
|
||||
|
||||
shipmentField.setSelectedIndex(0);
|
||||
shipmentField.addActionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load RMA that are candidates for shipment
|
||||
* @param C_BPartner_ID BPartner
|
||||
*/
|
||||
private void initBPRMADetails(int C_BPartner_ID)
|
||||
{
|
||||
rmaField.removeActionListener(this);
|
||||
rmaField.removeAllItems();
|
||||
// None
|
||||
KeyNamePair pp = new KeyNamePair(0,"");
|
||||
rmaField.addItem(pp);
|
||||
|
||||
ArrayList<KeyNamePair> list = loadRMAData(C_BPartner_ID);
|
||||
for(KeyNamePair knp : list)
|
||||
rmaField.addItem(knp);
|
||||
|
||||
rmaField.setSelectedIndex(0);
|
||||
rmaField.addActionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Data - Order
|
||||
* @param C_Order_ID Order
|
||||
* @param forInvoice true if for invoice vs. delivery qty
|
||||
*/
|
||||
protected void loadOrder (int C_Order_ID, boolean forInvoice)
|
||||
{
|
||||
loadTableOIS(getOrderData(C_Order_ID, forInvoice));
|
||||
} // LoadOrder
|
||||
|
||||
protected void loadRMA (int M_RMA_ID)
|
||||
{
|
||||
loadTableOIS(getRMAData(M_RMA_ID));
|
||||
}
|
||||
|
||||
protected void loadShipment (int M_InOut_ID)
|
||||
{
|
||||
loadTableOIS(getShipmentData(M_InOut_ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Order/Invoice/Shipment data into Table
|
||||
* @param data data
|
||||
*/
|
||||
protected void loadTableOIS (Vector<?> data)
|
||||
{
|
||||
window.getWListbox().clear();
|
||||
|
||||
// Remove previous listeners
|
||||
window.getWListbox().getModel().removeTableModelListener(window);
|
||||
// Set Model
|
||||
ListModelTable model = new ListModelTable(data);
|
||||
model.addTableModelListener(window);
|
||||
window.getWListbox().setData(model, getOISColumnNames());
|
||||
//
|
||||
|
||||
configureMiniTable(window.getWListbox());
|
||||
} // loadOrder
|
||||
|
||||
public void showWindow()
|
||||
{
|
||||
window.setVisible(true);
|
||||
}
|
||||
|
||||
public void closeWindow()
|
||||
{
|
||||
window.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getWindow() {
|
||||
return window;
|
||||
}
|
||||
|
||||
protected void setupColumns(Grid parameterGrid) {
|
||||
noOfParameterColumn = ClientInfo.maxWidth((ClientInfo.EXTRA_SMALL_WIDTH+ClientInfo.SMALL_WIDTH)/2) ? 2 : 4;
|
||||
Columns columns = new Columns();
|
||||
parameterGrid.appendChild(columns);
|
||||
if (ClientInfo.maxWidth((ClientInfo.EXTRA_SMALL_WIDTH+ClientInfo.SMALL_WIDTH)/2))
|
||||
{
|
||||
Column column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "35%");
|
||||
columns.appendChild(column);
|
||||
column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "65%");
|
||||
columns.appendChild(column);
|
||||
}
|
||||
else
|
||||
{
|
||||
Column column = new Column();
|
||||
columns.appendChild(column);
|
||||
column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "15%");
|
||||
columns.appendChild(column);
|
||||
ZKUpdateUtil.setWidth(column, "35%");
|
||||
column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "15%");
|
||||
columns.appendChild(column);
|
||||
column = new Column();
|
||||
ZKUpdateUtil.setWidth(column, "35%");
|
||||
columns.appendChild(column);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onClientInfo()
|
||||
{
|
||||
if (ClientInfo.isMobile() && parameterStdLayout != null && parameterStdLayout.getRows() != null)
|
||||
{
|
||||
int nc = ClientInfo.maxWidth((ClientInfo.EXTRA_SMALL_WIDTH+ClientInfo.SMALL_WIDTH)/2) ? 2 : 4;
|
||||
int cc = noOfParameterColumn;
|
||||
if (nc == cc)
|
||||
return;
|
||||
|
||||
parameterStdLayout.getColumns().detach();
|
||||
setupColumns(parameterStdLayout);
|
||||
if (cc > nc)
|
||||
{
|
||||
LayoutUtils.compactTo(parameterStdLayout, nc);
|
||||
}
|
||||
else
|
||||
{
|
||||
LayoutUtils.expandTo(parameterStdLayout, nc, false);
|
||||
}
|
||||
hideEmptyRow(parameterStdLayout.getRows());
|
||||
|
||||
ZKUpdateUtil.setCSSHeight(window);
|
||||
ZKUpdateUtil.setCSSWidth(window);
|
||||
window.invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import static org.compiere.model.SystemIDs.COLUMN_C_INVOICELINE_M_PRODUCT_ID;
|
||||
|
||||
|
|
@ -1,204 +1,204 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2009 Low Heng Sin *
|
||||
* Copyright (C) 2009 Idalica Corporation *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.form;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.ClientInfo;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.apps.form.WCreateFromWindow;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
import org.adempiere.webui.component.GridFactory;
|
||||
import org.adempiere.webui.component.Label;
|
||||
import org.adempiere.webui.component.ListModelTable;
|
||||
import org.adempiere.webui.component.Panel;
|
||||
import org.adempiere.webui.component.Row;
|
||||
import org.adempiere.webui.component.Rows;
|
||||
import org.adempiere.webui.editor.WEditor;
|
||||
import org.adempiere.webui.editor.WSearchEditor;
|
||||
import org.adempiere.webui.event.ValueChangeEvent;
|
||||
import org.adempiere.webui.event.ValueChangeListener;
|
||||
import org.adempiere.webui.util.ZKUpdateUtil;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MLookup;
|
||||
import org.compiere.model.MLookupFactory;
|
||||
|
||||
import static org.compiere.model.SystemIDs.*;
|
||||
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
public class MID_WCreateFromRMA extends MID_CreateFromRMA implements ValueChangeListener
|
||||
{
|
||||
private WCreateFromWindow window;
|
||||
|
||||
public MID_WCreateFromRMA(GridTab tab)
|
||||
{
|
||||
super(tab);
|
||||
log.info(getGridTab().toString());
|
||||
|
||||
window = new WCreateFromWindow(this, getGridTab().getWindowNo());
|
||||
|
||||
p_WindowNo = getGridTab().getWindowNo();
|
||||
|
||||
try
|
||||
{
|
||||
if (!dynInit())
|
||||
return;
|
||||
zkInit();
|
||||
setInitOK(true);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, "", e);
|
||||
setInitOK(false);
|
||||
}
|
||||
AEnv.showWindow(window);
|
||||
}
|
||||
|
||||
/** Window No */
|
||||
private int p_WindowNo;
|
||||
|
||||
/** Logger */
|
||||
private CLogger log = CLogger.getCLogger(getClass());
|
||||
|
||||
protected Label bPartnerLabel = new Label();
|
||||
protected WEditor bPartnerField;
|
||||
|
||||
/**
|
||||
* Dynamic Init
|
||||
* @throws Exception if Lookups cannot be initialized
|
||||
* @return true if initialized
|
||||
*/
|
||||
public boolean dynInit() throws Exception
|
||||
{
|
||||
log.config("");
|
||||
|
||||
super.dynInit();
|
||||
|
||||
window.setTitle(getTitle());
|
||||
|
||||
initBPartner(true);
|
||||
bPartnerField.addValueChangeListener(this);
|
||||
|
||||
loadRMA();
|
||||
|
||||
return true;
|
||||
} // dynInit
|
||||
|
||||
protected void zkInit() throws Exception
|
||||
{
|
||||
bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
|
||||
|
||||
Panel parameterPanel = window.getParameterPanel();
|
||||
|
||||
Grid parameterStdLayout = GridFactory.newGridLayout();
|
||||
Panel parameterStdPanel = new Panel();
|
||||
parameterStdPanel.appendChild(parameterStdLayout);
|
||||
|
||||
parameterPanel.appendChild(parameterStdPanel);
|
||||
ZKUpdateUtil.setVflex(parameterStdLayout, "min");
|
||||
|
||||
Rows rows = (Rows) parameterStdLayout.newRows();
|
||||
Row row = rows.newRow();
|
||||
row.appendChild(bPartnerLabel.rightAlign());
|
||||
if (bPartnerField != null)
|
||||
row.appendChild(bPartnerField.getComponent());
|
||||
|
||||
if (ClientInfo.isMobile()) {
|
||||
ClientInfo.onClientInfo(window, this::onClientInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Listener
|
||||
* @param e event
|
||||
*/
|
||||
public void valueChange (ValueChangeEvent e)
|
||||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config(e.getPropertyName() + "=" + e.getNewValue());
|
||||
|
||||
// BPartner - load Order/Invoice/Shipment
|
||||
if (e.getPropertyName().equals("C_BPartner_ID"))
|
||||
{
|
||||
loadRMA();
|
||||
}
|
||||
window.tableChanged(null);
|
||||
} // vetoableChange
|
||||
|
||||
/**************************************************************************
|
||||
* Load BPartner Field
|
||||
* @param forInvoice true if Invoices are to be created, false receipts
|
||||
* @throws Exception if Lookups cannot be initialized
|
||||
*/
|
||||
protected void initBPartner (boolean forInvoice) throws Exception
|
||||
{
|
||||
// load BPartner
|
||||
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
|
||||
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
|
||||
bPartnerField = new WSearchEditor ("C_BPartner_ID", true, false, true, lookup);
|
||||
//
|
||||
int C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BPartner_ID");
|
||||
bPartnerField.setValue(new Integer(C_BPartner_ID));
|
||||
} // initBPartner
|
||||
|
||||
protected void loadRMA()
|
||||
{
|
||||
loadTableOIS(getRMAData());
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Order/Invoice/Shipment data into Table
|
||||
* @param data data
|
||||
*/
|
||||
protected void loadTableOIS (Vector<?> data)
|
||||
{
|
||||
window.getWListbox().clear();
|
||||
|
||||
// Remove previous listeners
|
||||
window.getWListbox().getModel().removeTableModelListener(window);
|
||||
// Set Model
|
||||
ListModelTable model = new ListModelTable(data);
|
||||
model.addTableModelListener(window);
|
||||
window.getWListbox().setData(model, getOISColumnNames());
|
||||
//
|
||||
|
||||
configureMiniTable(window.getWListbox());
|
||||
} // loadOrder
|
||||
|
||||
public void showWindow()
|
||||
{
|
||||
window.setVisible(true);
|
||||
}
|
||||
|
||||
public void closeWindow()
|
||||
{
|
||||
window.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getWindow() {
|
||||
return window;
|
||||
}
|
||||
|
||||
protected void onClientInfo() {
|
||||
ZKUpdateUtil.setCSSHeight(window);
|
||||
ZKUpdateUtil.setCSSWidth(window);
|
||||
window.invalidate();
|
||||
}
|
||||
}
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2009 Low Heng Sin *
|
||||
* Copyright (C) 2009 Idalica Corporation *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*****************************************************************************/
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.webui.ClientInfo;
|
||||
import org.adempiere.webui.apps.AEnv;
|
||||
import org.adempiere.webui.apps.form.WCreateFromWindow;
|
||||
import org.adempiere.webui.component.Grid;
|
||||
import org.adempiere.webui.component.GridFactory;
|
||||
import org.adempiere.webui.component.Label;
|
||||
import org.adempiere.webui.component.ListModelTable;
|
||||
import org.adempiere.webui.component.Panel;
|
||||
import org.adempiere.webui.component.Row;
|
||||
import org.adempiere.webui.component.Rows;
|
||||
import org.adempiere.webui.editor.WEditor;
|
||||
import org.adempiere.webui.editor.WSearchEditor;
|
||||
import org.adempiere.webui.event.ValueChangeEvent;
|
||||
import org.adempiere.webui.event.ValueChangeListener;
|
||||
import org.adempiere.webui.util.ZKUpdateUtil;
|
||||
import org.compiere.model.GridTab;
|
||||
import org.compiere.model.MLookup;
|
||||
import org.compiere.model.MLookupFactory;
|
||||
|
||||
import static org.compiere.model.SystemIDs.*;
|
||||
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
|
||||
public class MID_WCreateFromRMA extends MID_CreateFromRMA implements ValueChangeListener
|
||||
{
|
||||
private WCreateFromWindow window;
|
||||
|
||||
public MID_WCreateFromRMA(GridTab tab)
|
||||
{
|
||||
super(tab);
|
||||
log.info(getGridTab().toString());
|
||||
|
||||
window = new WCreateFromWindow(this, getGridTab().getWindowNo());
|
||||
|
||||
p_WindowNo = getGridTab().getWindowNo();
|
||||
|
||||
try
|
||||
{
|
||||
if (!dynInit())
|
||||
return;
|
||||
zkInit();
|
||||
setInitOK(true);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, "", e);
|
||||
setInitOK(false);
|
||||
}
|
||||
AEnv.showWindow(window);
|
||||
}
|
||||
|
||||
/** Window No */
|
||||
private int p_WindowNo;
|
||||
|
||||
/** Logger */
|
||||
private CLogger log = CLogger.getCLogger(getClass());
|
||||
|
||||
protected Label bPartnerLabel = new Label();
|
||||
protected WEditor bPartnerField;
|
||||
|
||||
/**
|
||||
* Dynamic Init
|
||||
* @throws Exception if Lookups cannot be initialized
|
||||
* @return true if initialized
|
||||
*/
|
||||
public boolean dynInit() throws Exception
|
||||
{
|
||||
log.config("");
|
||||
|
||||
super.dynInit();
|
||||
|
||||
window.setTitle(getTitle());
|
||||
|
||||
initBPartner(true);
|
||||
bPartnerField.addValueChangeListener(this);
|
||||
|
||||
loadRMA();
|
||||
|
||||
return true;
|
||||
} // dynInit
|
||||
|
||||
protected void zkInit() throws Exception
|
||||
{
|
||||
bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));
|
||||
|
||||
Panel parameterPanel = window.getParameterPanel();
|
||||
|
||||
Grid parameterStdLayout = GridFactory.newGridLayout();
|
||||
Panel parameterStdPanel = new Panel();
|
||||
parameterStdPanel.appendChild(parameterStdLayout);
|
||||
|
||||
parameterPanel.appendChild(parameterStdPanel);
|
||||
ZKUpdateUtil.setVflex(parameterStdLayout, "min");
|
||||
|
||||
Rows rows = (Rows) parameterStdLayout.newRows();
|
||||
Row row = rows.newRow();
|
||||
row.appendChild(bPartnerLabel.rightAlign());
|
||||
if (bPartnerField != null)
|
||||
row.appendChild(bPartnerField.getComponent());
|
||||
|
||||
if (ClientInfo.isMobile()) {
|
||||
ClientInfo.onClientInfo(window, this::onClientInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Listener
|
||||
* @param e event
|
||||
*/
|
||||
public void valueChange (ValueChangeEvent e)
|
||||
{
|
||||
if (log.isLoggable(Level.CONFIG)) log.config(e.getPropertyName() + "=" + e.getNewValue());
|
||||
|
||||
// BPartner - load Order/Invoice/Shipment
|
||||
if (e.getPropertyName().equals("C_BPartner_ID"))
|
||||
{
|
||||
loadRMA();
|
||||
}
|
||||
window.tableChanged(null);
|
||||
} // vetoableChange
|
||||
|
||||
/**************************************************************************
|
||||
* Load BPartner Field
|
||||
* @param forInvoice true if Invoices are to be created, false receipts
|
||||
* @throws Exception if Lookups cannot be initialized
|
||||
*/
|
||||
protected void initBPartner (boolean forInvoice) throws Exception
|
||||
{
|
||||
// load BPartner
|
||||
int AD_Column_ID = COLUMN_C_INVOICE_C_BPARTNER_ID; // C_Invoice.C_BPartner_ID
|
||||
MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
|
||||
bPartnerField = new WSearchEditor ("C_BPartner_ID", true, false, true, lookup);
|
||||
//
|
||||
int C_BPartner_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BPartner_ID");
|
||||
bPartnerField.setValue(new Integer(C_BPartner_ID));
|
||||
} // initBPartner
|
||||
|
||||
protected void loadRMA()
|
||||
{
|
||||
loadTableOIS(getRMAData());
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Order/Invoice/Shipment data into Table
|
||||
* @param data data
|
||||
*/
|
||||
protected void loadTableOIS (Vector<?> data)
|
||||
{
|
||||
window.getWListbox().clear();
|
||||
|
||||
// Remove previous listeners
|
||||
window.getWListbox().getModel().removeTableModelListener(window);
|
||||
// Set Model
|
||||
ListModelTable model = new ListModelTable(data);
|
||||
model.addTableModelListener(window);
|
||||
window.getWListbox().setData(model, getOISColumnNames());
|
||||
//
|
||||
|
||||
configureMiniTable(window.getWListbox());
|
||||
} // loadOrder
|
||||
|
||||
public void showWindow()
|
||||
{
|
||||
window.setVisible(true);
|
||||
}
|
||||
|
||||
public void closeWindow()
|
||||
{
|
||||
window.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getWindow() {
|
||||
return window;
|
||||
}
|
||||
|
||||
protected void onClientInfo() {
|
||||
ZKUpdateUtil.setCSSHeight(window);
|
||||
ZKUpdateUtil.setCSSWidth(window);
|
||||
window.invalidate();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*****************************************************************************/
|
||||
|
||||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,4 @@
|
|||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.form;
|
||||
package balinusa.midsuit.form;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
|
@ -49,7 +49,7 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.North;
|
||||
|
||||
import andromedia.midsuit.grid.InvoiceLandedCost;
|
||||
import balinusa.midsuit.grid.InvoiceLandedCost;
|
||||
|
||||
/**
|
||||
* Generate Shipment (manual) view class
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.grid;
|
||||
package balinusa.midsuit.grid;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.PreparedStatement;
|
||||
|
|
@ -1,167 +1,167 @@
|
|||
package andromedia.midsuit.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.process.DocAction;
|
||||
import org.compiere.process.DocOptions;
|
||||
import org.compiere.process.DocumentEngine;
|
||||
|
||||
public class AND_PPO extends X_ps_ppo implements DocAction, DocOptions{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4798412851170213351L;
|
||||
|
||||
public AND_PPO(Properties ctx, int ps_ppo_ID, String trxName) {
|
||||
super(ctx, ps_ppo_ID, trxName);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public AND_PPO(Properties ctx, ResultSet rs, String trxName) {
|
||||
super(ctx, rs, trxName);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public int customizeValidActions(String docStatus, Object processing, String orderType, String isSOTrx,
|
||||
int AD_Table_ID, String[] docAction, String[] options, int index) {
|
||||
for (int i = 0; i < options.length; i++) {
|
||||
options[i] = null;
|
||||
}
|
||||
index = 0;
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Drafted) || docStatus.equals(DocumentEngine.STATUS_Invalid)) {
|
||||
options[index++] = DocumentEngine.ACTION_Complete;
|
||||
options[index++] = DocumentEngine.ACTION_Prepare;
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
} else if (docStatus.equals(DocumentEngine.STATUS_Completed)) {
|
||||
options[index++] = DocumentEngine.ACTION_Close;
|
||||
options[index++] = DocumentEngine.ACTION_ReActivate;
|
||||
} else if (docStatus.equals(DocumentEngine.STATUS_InProgress))
|
||||
options[index++] = DocumentEngine.ACTION_Complete;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIt(String action) throws Exception {
|
||||
log.warning("Processing Action=" + action + " - DocStatus=" + getDocStatus() + " - DocAction=" + getDocAction());
|
||||
DocumentEngine engine = new DocumentEngine(this, getDocStatus());
|
||||
return engine.processIt(getDocAction(), getDocAction());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unlockIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean invalidateIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String prepareIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean approveIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rejectIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String completeIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean voidIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean closeIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reverseCorrectIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reverseAccrualIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reActivateIt() {
|
||||
// TODO Auto-generated method stub
|
||||
setDocStatus(DocAction.STATUS_InProgress);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSummary() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDocumentInfo() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File createPDF() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcessMsg() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDoc_User_ID() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getC_Currency_ID() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getApprovalAmt() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.compiere.process.DocAction;
|
||||
import org.compiere.process.DocOptions;
|
||||
import org.compiere.process.DocumentEngine;
|
||||
|
||||
public class AND_PPO extends X_ps_ppo implements DocAction, DocOptions{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4798412851170213351L;
|
||||
|
||||
public AND_PPO(Properties ctx, int ps_ppo_ID, String trxName) {
|
||||
super(ctx, ps_ppo_ID, trxName);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public AND_PPO(Properties ctx, ResultSet rs, String trxName) {
|
||||
super(ctx, rs, trxName);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public int customizeValidActions(String docStatus, Object processing, String orderType, String isSOTrx,
|
||||
int AD_Table_ID, String[] docAction, String[] options, int index) {
|
||||
for (int i = 0; i < options.length; i++) {
|
||||
options[i] = null;
|
||||
}
|
||||
index = 0;
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Drafted) || docStatus.equals(DocumentEngine.STATUS_Invalid)) {
|
||||
options[index++] = DocumentEngine.ACTION_Complete;
|
||||
options[index++] = DocumentEngine.ACTION_Prepare;
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
} else if (docStatus.equals(DocumentEngine.STATUS_Completed)) {
|
||||
options[index++] = DocumentEngine.ACTION_Close;
|
||||
options[index++] = DocumentEngine.ACTION_ReActivate;
|
||||
} else if (docStatus.equals(DocumentEngine.STATUS_InProgress))
|
||||
options[index++] = DocumentEngine.ACTION_Complete;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIt(String action) throws Exception {
|
||||
log.warning("Processing Action=" + action + " - DocStatus=" + getDocStatus() + " - DocAction=" + getDocAction());
|
||||
DocumentEngine engine = new DocumentEngine(this, getDocStatus());
|
||||
return engine.processIt(getDocAction(), getDocAction());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unlockIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean invalidateIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String prepareIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean approveIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rejectIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String completeIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean voidIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean closeIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reverseCorrectIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reverseAccrualIt() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reActivateIt() {
|
||||
// TODO Auto-generated method stub
|
||||
setDocStatus(DocAction.STATUS_InProgress);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSummary() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDocumentInfo() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File createPDF() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcessMsg() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDoc_User_ID() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getC_Currency_ID() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getApprovalAmt() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package andromedia.midsuit.model;
|
||||
package balinusa.midsuit.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue