Vous êtes sur la page 1sur 4

Callout waktu selesai

/******************************************************************************
* 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 org.compiere.model;

import java.sql.Timestamp;
import java.util.Properties;

import org.compiere.model.CalloutEngine;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.util.Env;


public class Calloutwaktuselesai extends CalloutEngine
{
public String waktuselesai(Properties ctx, int WindowNo, GridTab mTab,
GridField mField, Object value)
{
Timestamp wml = Env.getContextAsDate(ctx, WindowNo, "waktu_mulai");
Timestamp wsls = Env.getContextAsDate(ctx, WindowNo,
"waktu_selesai");

if(wml != null && wsls != null){

if(wml.compareTo(wsls) > 0 ){
mTab.setValue("waktu_selesai", null);
mTab.setValue("waktu_mulai", null);
return "waktu selesai lebih awal dari waktu mulai";
}
}
return "";
}

}




Callout baseline target
/******************************************************************************
* 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 org.compiere.model;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Properties;

import org.compiere.model.CalloutEngine;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.util.Env;


public class Calloutbaselinetarget extends CalloutEngine
{
public String baselinetarget(Properties ctx, int WindowNo, GridTab mTab,
GridField mField, Object value)
{
BigDecimal bsl = (BigDecimal)mTab.getValue("baseline");
BigDecimal tgt = (BigDecimal)mTab.getValue("target");

if(bsl != null && tgt != null){

if(bsl.compareTo(tgt) > 0 ){
mTab.setValue("baseline", null);
mTab.setValue("target", null);
return "target lebih besar dari baseline";
}
}
return "";
}

}





Callout total biaya

/******************************************************************************
* 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 org.compiere.model;


import java.math.BigDecimal;
import java.util.Properties;

import org.compiere.model.CalloutEngine;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;


public class Callouttotalbiaya extends CalloutEngine
{
public String totalbiaya(Properties ctx, int WindowNo, GridTab mTab,
GridField mField, Object value)
{
BigDecimal vol = (BigDecimal)mTab.getValue("Volume");
BigDecimal har = (BigDecimal)mTab.getValue("harga");
BigDecimal ttl = (BigDecimal)mTab.getValue("total");

if(har != null && vol != null){
ttl = vol.multiply(har);
mTab.setValue("total", ttl);
}
return "";
}

}




Callout tarif
/******************************************************************************
* 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 org.compiere.model;

import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Properties;
import java.util.logging.Level;

import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Ini;
import org.compiere.util.Msg;

public class Callouttarif extends CalloutEngine
{

public String Ctarif(Properties ctx, int WindowNo, GridTab mTab, GridField
mField, Object value) throws SQLException
{
String sqltarif = "SELECT satuan, tarif "
+ "FROM siko_tarif_kegiatan "
+ "WHERE siko_tarif_kegiatan_id=?";

String siko_tarif_kegiatan_id = Env.getContext(ctx, WindowNo,
Env.TAB_INFO, "siko_tarif_kegiatan_id");

PreparedStatement pstmt = null;
pstmt = DB.prepareStatement(sqltarif, null);
ResultSet rs = null;
rs = pstmt.executeQuery();

String satu = rs.getString("satuan");
BigDecimal hrg = rs.getBigDecimal("tarif");

mTab.setValue("satuan", satu);
mTab.setValue("harga", hrg);

return "";
}

}

Vous aimerez peut-être aussi