本文整理汇总了Java中com.openbravo.pos.util.RoundUtils.compare方法的典型用法代码示例。如果您正苦于以下问题:Java RoundUtils.compare方法的具体用法?Java RoundUtils.compare怎么用?Java RoundUtils.compare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.openbravo.pos.util.RoundUtils
的用法示例。
在下文中一共展示了RoundUtils.compare方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
Double value = m_jTendered.getDoubleValue();
if (value == null) {
m_dTicket = 0.0;
} else {
m_dTicket = value;
}
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dTicket)));
int iCompare = RoundUtils.compare(m_dTicket, m_dTotal);
// it is allowed to pay more
m_notifier.setStatus(m_dTicket > 0.0, iCompare >= 0);
}
示例2: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
Double value = m_jTendered.getDoubleValue();
if (value == null) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dPaid)));
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
// if iCompare > 0 then the payment is not valid
m_notifier.setStatus(m_dPaid > 0.0 && iCompare <= 0, iCompare == 0);
}
示例3: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
Double value = m_jTendered.getDoubleValue();
if (value == null || value == 0.0) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dPaid)));
m_jChangeEuros.setText(iCompare > 0
? Formats.CURRENCY.formatValue(new Double(m_dPaid - m_dTotal))
: null);
m_notifier.setStatus(m_dPaid > 0.0, iCompare >= 0);
}
示例4: updateCurDebt
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
public void updateCurDebt(Double amount, Date d) {
curdebt = curdebt == null ? amount : curdebt + amount;
if (RoundUtils.compare(curdebt, 0.0) > 0) {
if (curdate == null) {
// new date
curdate = d;
}
} else if (RoundUtils.compare(curdebt, 0.0) == 0) {
curdebt = null;
curdate = null;
} else { // < 0
curdate = null;
}
}
示例5: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
Double value = m_jTendered.getDoubleValue();
if (value == null || value == 0.0) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(m_dPaid));
m_jChangeEuros.setText(iCompare > 0
? Formats.CURRENCY.formatValue(m_dPaid - m_dTotal)
: null);
m_notifier.setStatus(m_dPaid > 0.0, iCompare >= 0);
}
示例6: updateCurDebt
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
/**
*
* @param amount
* @param d
*/
public void updateCurDebt(Double amount, Date d) {
curdebt = curdebt == null ? amount : curdebt + amount;
// JG Aug 2014
curdate = (new Date());
if (RoundUtils.compare(curdebt, 0.0) > 0) {
if (curdate == null) {
// new date
curdate = d;
}
} else if (RoundUtils.compare(curdebt, 0.0) == 0) {
curdebt = null;
curdate = null;
} else { // < 0
curdate = null;
}
}
示例7: executePayment
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
@Override
public PaymentInfo executePayment() {
try {
customerext = dlSales.loadCustomerExt(customerext.getId());
} catch (BasicException ex) {
return null;
}
if (RoundUtils.compare(RoundUtils.getValue(customerext.getCurdebt()) + m_dPaid, RoundUtils.getValue(customerext.getMaxdebt())) >= 0) {
printState();
return null;
} else {
return new PaymentInfoTicket(m_dPaid, "debt");
}
}
示例8: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
Double value = m_jTendered.getDoubleValue();
if (value == null || value == 0.0) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(m_dPaid));
m_jChangeEuros.setText(iCompare > 0
? Formats.CURRENCY.formatValue(m_dPaid - m_dTotal)
: "");
m_notifier.setStatus(m_dPaid > 0.0, iCompare >= 0);
}
示例9: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
Double value = m_jTendered.getDoubleValue();
if (value == null) {
m_dTicket = 0.0;
} else {
m_dTicket = value;
}
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dTicket)));
int iCompare = RoundUtils.compare(m_dTicket, m_dTotal);
// it is allowed to pay more
m_notifier.setStatus(m_dTicket > 0.0, iCompare >= 0, true);
}
示例10: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
Double value = m_jTendered.getDoubleValue();
if (value == null) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dPaid)));
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
// if iCompare > 0 then the payment is not valid
m_notifier.setStatus(m_dPaid > 0.0 && iCompare <= 0, iCompare == 0, true);
}
示例11: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
Double value = m_jTendered.getDoubleValue();
if (value == null || value == 0.0) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
addToTempString(value);
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dPaid)));
m_jChangeEuros.setText(iCompare > 0
? Formats.CURRENCY.formatValue(new Double(m_dPaid - m_dTotal))
: null);
m_notifier.setStatus(m_dPaid > 0.0, iCompare >= 0, true);
}
示例12: activate
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
public void activate(CustomerInfoExt customerext, double dTotal, String transID) {
this.customerext = customerext;
m_dTotal = dTotal;
m_jTendered.reset();
//
if (customerext == null) {
m_jName.setText(null);
m_jNotes.setText(null);
txtMaxdebt.setText(null);
txtCurdate.setText(null);
txtCurdebt.setText(null);
m_jKeys.setEnabled(false);
m_jTendered.setEnabled(false);
} else {
m_jName.setText(customerext.getName());
m_jNotes.setText(customerext.getNotes());
txtMaxdebt.setText(Formats.CURRENCY.formatValue(RoundUtils.getValue(customerext.getMaxdebt())));
txtCurdate.setText(Formats.DATE.formatValue(customerext.getCurdate()));
txtCurdebt.setText(Formats.CURRENCY.formatValue(RoundUtils.getValue(customerext.getCurdebt())));
if (RoundUtils.compare(RoundUtils.getValue(customerext.getCurdebt()), RoundUtils.getValue(customerext.getMaxdebt())) >= 0) {
m_jKeys.setEnabled(false);
m_jTendered.setEnabled(false);
} else {
m_jKeys.setEnabled(true);
m_jTendered.setEnabled(true);
m_jTendered.activate();
}
}
printState();
}
示例13: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
if (customerext == null) {
m_jMoneyEuros.setText(null);
jlblMessage.setText(AppLocal.getIntString("message.nocustomernodebt"));
notifier.setStatus(false, false);
} else {
Double value = m_jTendered.getDoubleValue();
if (value == null || value == 0.0) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(new Double(m_dPaid)));
if (RoundUtils.compare(RoundUtils.getValue(customerext.getCurdebt()) + m_dPaid, RoundUtils.getValue(customerext.getMaxdebt())) >= 0) {
// maximum debt exceded
jlblMessage.setText(AppLocal.getIntString("message.customerdebtexceded"));
notifier.setStatus(false, false);
} else {
jlblMessage.setText(null);
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
// if iCompare > 0 then the payment is not valid
notifier.setStatus(m_dPaid > 0.0 && iCompare <= 0, iCompare == 0);
}
}
}
示例14: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
if (customerext == null) {
m_jMoneyEuros.setText(null);
jlblMessage.setText(AppLocal.getIntString("message.nocustomernodebt"));
notifier.setStatus(false, false);
} else {
Double value = m_jTendered.getDoubleValue();
if (value == null || value == 0.0) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(m_dPaid));
if (RoundUtils.compare(RoundUtils.getValue(customerext.getCurdebt()) + m_dPaid, RoundUtils.getValue(customerext.getMaxdebt())) >= 0) {
// maximum debt exceded
jlblMessage.setText(AppLocal.getIntString("message.customerdebtexceded"));
notifier.setStatus(false, false);
} else {
jlblMessage.setText(null);
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
// if iCompare > 0 then the payment is not valid
notifier.setStatus(m_dPaid > 0.0 && iCompare <= 0, iCompare == 0);
}
}
}
示例15: printState
import com.openbravo.pos.util.RoundUtils; //导入方法依赖的package包/类
private void printState() {
if (customerext == null) {
m_jNotes.setText(null);
txtMaxdebt.setText(null);
txtCurdate.setText(null);
txtCurdebt.setText(null);
m_jMoneyEuros.setText(null);
jlblMessage.setText(AppLocal.getIntString("message.nocustomernodebt"));
notifier.setStatus(false, false);
} else {
m_jNotes.setText(customerext.getNotes());
txtMaxdebt.setText(Formats.CURRENCY.formatValue(RoundUtils.getValue(customerext.getMaxdebt())));
txtCurdate.setText(Formats.DATE.formatValue(customerext.getCurdate()));
txtCurdebt.setText(Formats.CURRENCY.formatValue(RoundUtils.getValue(customerext.getCurdebt())));
Double value = m_jTendered.getDoubleValue();
if (value == null || value == 0.0) {
m_dPaid = m_dTotal;
} else {
m_dPaid = value;
}
m_jMoneyEuros.setText(Formats.CURRENCY.formatValue(m_dPaid));
if (RoundUtils.compare(RoundUtils.getValue(customerext.getCurdebt()) + m_dPaid, RoundUtils.getValue(customerext.getMaxdebt())) >= 0) {
// maximum debt exceded
jlblMessage.setText(AppLocal.getIntString("message.customerdebtexceded"));
notifier.setStatus(false, false);
} else {
jlblMessage.setText(null);
int iCompare = RoundUtils.compare(m_dPaid, m_dTotal);
// if iCompare > 0 then the payment is not valid
notifier.setStatus(m_dPaid > 0.0 && iCompare <= 0, iCompare == 0);
}
}
}