本文整理汇总了Java中com.openbravo.pos.ticket.TicketLineInfo类的典型用法代码示例。如果您正苦于以下问题:Java TicketLineInfo类的具体用法?Java TicketLineInfo怎么用?Java TicketLineInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TicketLineInfo类属于com.openbravo.pos.ticket包,在下文中一共展示了TicketLineInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: m_jRefundActionPerformed
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void m_jRefundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jRefundActionPerformed
java.util.List aRefundLines = new ArrayList();
for(int i = 0; i < m_ticket.getLinesCount(); i++) {
TicketLineInfo newline = new TicketLineInfo(m_ticket.getLine(i));
aRefundLines.add(newline);
}
m_ticketCopy = null;
m_TicketsBagTicketBag.showRefund();
m_panelticketedit.showRefundLines(aRefundLines);
TicketInfo refundticket = new TicketInfo();
refundticket.setTicketType(TicketInfo.RECEIPT_REFUND);
refundticket.setCustomer(m_ticket.getCustomer());
refundticket.setPayments(m_ticket.getPayments());
m_panelticketedit.setActiveTicket(refundticket, null);
}
示例2: paintTicketLine
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void paintTicketLine(int index, TicketLineInfo oLine){
if (executeEventAndRefresh("ticket.setline", new ScriptArg("index", index), new ScriptArg("line", oLine)) == null) {
m_oTicket.setLine(index, oLine);
m_ticketlines.setTicketLine(index, oLine);
m_ticketlines.setSelectedIndex(index);
visorTicketLine(oLine); // Y al visor tambien...
printPartialTotals();
stateToZero();
// event receipt
executeEventAndRefresh("ticket.change");
}
}
示例3: m_jEditLineActionPerformed
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void m_jEditLineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEditLineActionPerformed
int i = m_ticketlines.getSelectedIndex();
if (i < 0){
Toolkit.getDefaultToolkit().beep(); // no line selected
} else {
try {
TicketLineInfo newline = JProductLineEdit.showMessage(this, m_App, m_oTicket.getLine(i));
if (newline != null) {
// line has been modified
paintTicketLine(i, newline);
}
} catch (BasicException e) {
new MessageInf(e).show(this);
}
}
}
示例4: jEditAttributesActionPerformed
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void jEditAttributesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEditAttributesActionPerformed
int i = m_ticketlines.getSelectedIndex();
if (i < 0) {
Toolkit.getDefaultToolkit().beep(); // no line selected
} else {
try {
TicketLineInfo line = m_oTicket.getLine(i);
JProductAttEdit attedit = JProductAttEdit.getAttributesEditor(this, m_App.getSession());
attedit.editAttributes(line.getProductAttSetId(), line.getProductAttSetInstId());
attedit.setVisible(true);
if (attedit.isOK()) {
// The user pressed OK
line.setProductAttSetInstId(attedit.getAttributeSetInst());
line.setProductAttSetInstDesc(attedit.getAttributeSetInstDescription());
paintTicketLine(i, line);
}
} catch (BasicException ex) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindattributes"), ex);
msg.show(this);
}
}
}
示例5: insertRow
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
public void insertRow(int index, TicketLineInfo oLine) {
String[] row = new String[m_acolumns.length];
for (int i = 0; i < m_acolumns.length; i++) {
try {
ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
script.put("ticketline", oLine);
row[i] = script.eval(m_acolumns[i].value).toString();
} catch (ScriptException e) {
row[i] = null;
}
}
m_rows.add(index, row);
fireTableRowsInserted(index, index);
}
示例6: m_jRefundActionPerformed
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void m_jRefundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jRefundActionPerformed
java.util.List aRefundLines = new ArrayList();
for(int i = 0; i < m_ticket.getLinesCount(); i++) {
TicketLineInfo newline = new TicketLineInfo(m_ticket.getLine(i));
aRefundLines.add(newline);
}
m_ticketCopy = null;
m_TicketsBagTicketBag.showRefund();
m_panelticketedit.showRefundLines(aRefundLines);
TicketInfo refundticket = new TicketInfo();
refundticket.setTicketType(TicketInfo.RECEIPT_REFUND);
refundticket.setCustomer(m_ticket.getCustomer());
refundticket.setPayments(m_ticket.getPayments());
// Indicate that this a ticket in edit mode
refundticket.setOldTicket(true);
m_panelticketedit.setActiveTicket(refundticket, null);
}
示例7: m_jEditLineActionPerformed
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void m_jEditLineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEditLineActionPerformed
int i = m_ticketlines.getSelectedIndex();
if (i < 0){
Toolkit.getDefaultToolkit().beep(); // no line selected
} else {
try {
TicketLineInfo newline = JProductLineEdit.showMessage(this, m_App, m_oTicket.getLine(i));
if (newline != null) {
// line has been modified
paintTicketLine(i, newline);
}
} catch (BasicException e) {
new MessageInf(e).show(this);
}
}
}
示例8: m_jRefundActionPerformed
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void m_jRefundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jRefundActionPerformed
java.util.List aRefundLines = new ArrayList();
for (int i = 0; i < m_ticket.getLinesCount(); i++) {
TicketLineInfo newline = new TicketLineInfo(m_ticket.getLine(i));
aRefundLines.add(newline);
}
m_ticketCopy = null;
m_TicketsBagTicketBag.showRefund();
m_panelticketedit.showRefundLines(aRefundLines);
TicketInfo refundticket = new TicketInfo();
refundticket.setTicketType(TicketInfo.RECEIPT_REFUND);
refundticket.setCustomer(m_ticket.getCustomer());
refundticket.setPayments(m_ticket.getPayments());
m_panelticketedit.setActiveTicket(refundticket, null);
}
示例9: setLines
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
public void setLines(List aRefundLines) {
m_aLines = aRefundLines;
m_aLinesAll.clear();
for (int i = 0; i < m_aLines.size(); i++ ){
byte[] aSerLine;
aSerLine = ImageUtils.writeSerializable(m_aLines.get(i));
m_aLinesAll.add(ImageUtils.readSerializable(aSerLine));
}
ticketlines.clearTicketLines();
if (m_aLines != null) {
for (int i = 0; i < m_aLines.size(); i++) {
ticketlines.addTicketLine((TicketLineInfo) m_aLines.get(i));
}
}
}
示例10: 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);
}
}
示例11: paintTicketLine
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void paintTicketLine(int index, TicketLineInfo oLine) {
if (executeEventAndRefresh("ticket.setline", new ScriptArg("index", index), new ScriptArg("line", oLine)) == null) {
m_oTicket.setLine(index, oLine);
m_ticketlines.setTicketLine(index, oLine);
m_ticketlines.setSelectedIndex(index);
visorTicketLine(oLine); // Y al visor tambien...
printPartialTotals();
stateToZero();
// event receipt
executeEventAndRefresh("ticket.change");
}
}
示例12: visorTicketLine
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void visorTicketLine(TicketLineInfo oLine) {
if (oLine == null) {
m_App.getDeviceTicket().getDeviceDisplay().clearVisor();
} else {
m_TTP = new TicketParser(getClass().getResourceAsStream(PRINTER_SHEMA), m_App.getDeviceTicket());
try {
ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
script.put("ticketline", oLine);
script.put("local", new AppLocal());
m_TTP.printTicket(getClass().getResourceAsStream(PRINT_TICKET_LINE), script);
} catch (ScriptException | TicketPrinterException e) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotprintline"), e);
msg.show(JPanelTicket.this);
}
}
}
示例13: performDiscountRate
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void performDiscountRate(Double discountrate) {
int index = m_ticketlines.getSelectedIndex();
double total = m_oTicket.getTotal();
TicketLineInfo oLine;
if (bTypeDiscountRate == true) {
if (index >= 0) {
oLine = new DiscountPercent().LineDiscountPercent(m_oTicket.getLine(index), 0.0);
paintTicketLine(index, new DiscountPercent().LineDiscountPercent(oLine, discountrate));
} else {
Toolkit.getDefaultToolkit().beep();
}
} else if (bTypeDiscountRate == false) {
if (total > 0.0) {
for (int i = 0; i < m_oTicket.getLinesCount(); i++) {
oLine = new DiscountPercent().LineDiscountPercent(m_oTicket.getLine(i), 0.0);
paintTicketLine(i, new DiscountPercent().LineDiscountPercent(oLine, discountrate));
}
} else {
Toolkit.getDefaultToolkit().beep();
}
} else {
Toolkit.getDefaultToolkit().beep();
}
refreshTicket();
}
示例14: performDiscountMoney
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void performDiscountMoney(Double discountmoney) {
int index = m_ticketlines.getSelectedIndex();
double total = m_oTicket.getTotal();
TicketLineInfo oLine;
if (bTypeDiscountRate == true) {
if (index >= 0) {
oLine = new DiscountMoney().LineDiscountMoney(m_oTicket.getLine(index), 0.0);
paintTicketLine(index, new DiscountMoney().LineDiscountMoney(oLine, discountmoney));
} else {
Toolkit.getDefaultToolkit().beep();
}
} else if (bTypeDiscountRate == false) {
if (total > 0.0) {
for (int i = 0; i < m_oTicket.getLinesCount(); i++) {
oLine = new DiscountMoney().LineDiscountMoney(m_oTicket.getLine(i), 0.0);
paintTicketLine(i, new DiscountMoney().LineDiscountMoney(oLine, discountmoney / m_oTicket.getLinesCount()));
}
} else {
Toolkit.getDefaultToolkit().beep();
}
} else {
Toolkit.getDefaultToolkit().beep();
}
refreshTicket();
}
示例15: m_jEditLineActionPerformed
import com.openbravo.pos.ticket.TicketLineInfo; //导入依赖的package包/类
private void m_jEditLineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_jEditLineActionPerformed
int i = m_ticketlines.getSelectedIndex();
if (i < 0) {
Toolkit.getDefaultToolkit().beep(); // no line selected
} else {
try {
TicketLineInfo newline = JProductLineEdit.showMessage(this, m_App, m_oTicket.getLine(i));
if (newline != null) {
// line has been modified
paintTicketLine(i, newline);
}
} catch (BasicException e) {
new MessageInf(e).show(this);
}
}
}