本文整理汇总了Java中com.openbravo.pos.ticket.TicketLineInfo.getMultiply方法的典型用法代码示例。如果您正苦于以下问题:Java TicketLineInfo.getMultiply方法的具体用法?Java TicketLineInfo.getMultiply怎么用?Java TicketLineInfo.getMultiply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.openbravo.pos.ticket.TicketLineInfo
的用法示例。
在下文中一共展示了TicketLineInfo.getMultiply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: m_jbtnAddOneActionPerformed
import com.openbravo.pos.ticket.TicketLineInfo; //导入方法依赖的package包/类
private void m_jbtnAddOneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jbtnAddOneActionPerformed
int index = ticketlines.getSelectedIndex();
if (index >= 0) {
TicketLineInfo oLine = (TicketLineInfo) m_aLines.get(index);
TicketLineInfo oNewLine = new TicketLineInfo(oLine);
oNewLine.setMultiply(-1.0);
if (isMultiplyControl) {
oLine.setMultiply(oLine.getMultiply()-1.0);
ticketlines.setTicketLine(index, oLine);
ticketlines.setSelectedIndex(index);
if (oLine.getMultiply() == 0) {
ticketlines.removeTicketLine(index);
m_aLines.remove(index);
}
}
m_jTicketEdit.addTicketLine(oNewLine);
}
}
示例2: getTotalOfaTicket
import com.openbravo.pos.ticket.TicketLineInfo; //导入方法依赖的package包/类
public BigDecimal getTotalOfaTicket(String place) {
double total = 0;
for (TicketLineInfo line : findTicket(place).getM_aLines()) {
total += line.getMultiply() * line.getPrice();
}
return BigDecimal.valueOf(total);
}
示例3: getSelectedLinesUnit
import com.openbravo.pos.ticket.TicketLineInfo; //导入方法依赖的package包/类
public TicketLineInfo[] getSelectedLinesUnit() {
// never returns an empty array, or null, or an array with at least one element.
int i = findFirstNonAuxiliarLine();
if (i >= 0) {
TicketLineInfo line = ticket.getLine(i);
if (line.getMultiply() >= 1.0) {
List<TicketLineInfo> l = new ArrayList<TicketLineInfo>();
if (line.getMultiply() > 1.0) {
line.setMultiply(line.getMultiply() -1.0);
ticketlines.setTicketLine(i, line);
line = line.copyTicketLine();
line.setMultiply(1.0);
l.add(line);
i++;
} else { // == 1.0
l.add(line);
ticket.removeLine(i);
ticketlines.removeTicketLine(i);
}
// add also auxiliars
while (i < ticket.getLinesCount() && ticket.getLine(i).isProductCom()) {
l.add(ticket.getLine(i));
ticket.removeLine(i);
ticketlines.removeTicketLine(i);
}
printTotals();
return l.toArray(new TicketLineInfo[l.size()]);
} else { // < 1.0
return null;
}
} else {
return null;
}
}
示例4: getSelectedLinesUnit
import com.openbravo.pos.ticket.TicketLineInfo; //导入方法依赖的package包/类
/**
*
* @return
*/
public TicketLineInfo[] getSelectedLinesUnit() {
// never returns an empty array, or null, or an array with at least one element.
int i = findFirstNonAuxiliarLine();
if (i >= 0) {
TicketLineInfo line = ticket.getLine(i);
if (line.getMultiply() >= 1.0) {
List<TicketLineInfo> l = new ArrayList<>();
if (line.getMultiply() > 1.0) {
line.setMultiply(line.getMultiply() -1.0);
ticketlines.setTicketLine(i, line);
line = line.copyTicketLine();
line.setMultiply(1.0);
l.add(line);
i++;
} else { // == 1.0
l.add(line);
ticket.removeLine(i);
ticketlines.removeTicketLine(i);
}
// add also auxiliars
while (i < ticket.getLinesCount() && ticket.getLine(i).isProductCom()) {
l.add(ticket.getLine(i));
ticket.removeLine(i);
ticketlines.removeTicketLine(i);
}
printTotals();
return l.toArray(new TicketLineInfo[l.size()]);
} else { // < 1.0
return null;
}
} else {
return null;
}
}