当前位置: 首页>>代码示例>>Java>>正文


Java TicketLineInfo.getProductID方法代码示例

本文整理汇总了Java中com.openbravo.pos.ticket.TicketLineInfo.getProductID方法的典型用法代码示例。如果您正苦于以下问题:Java TicketLineInfo.getProductID方法的具体用法?Java TicketLineInfo.getProductID怎么用?Java TicketLineInfo.getProductID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.openbravo.pos.ticket.TicketLineInfo的用法示例。


在下文中一共展示了TicketLineInfo.getProductID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addSelectedLines

import com.openbravo.pos.ticket.TicketLineInfo; //导入方法依赖的package包/类
public void addSelectedLines(TicketLineInfo[] lines) {
    
    int i = findFirstNonAuxiliarLine();         
          
    TicketLineInfo firstline = lines[0];
    
    if (i >= 0 
            && ticket.getLine(i).getProductID() != null && firstline.getProductID() != null && ticket.getLine(i).getProductID().equals(firstline.getProductID())
            && ticket.getLine(i).getTaxInfo().getId().equals(firstline.getTaxInfo().getId())
            && ticket.getLine(i).getPrice() == firstline.getPrice()) {  
        
        // add the auxiliars.
        for (int j = 1; j < lines.length; j++) {
            ticket.insertLine(i + 1, lines[j]);
            ticketlines.insertTicketLine(i + 1, lines[j]);
        }
        
        // inc the line
        ticket.getLine(i).setMultiply(ticket.getLine(i).getMultiply() + firstline.getMultiply());
        ticketlines.setTicketLine(i, ticket.getLine(i));  
        ticketlines.setSelectedIndex(i);
        
    } else {
        // add all at the end in inverse order.
        int insertpoint = ticket.getLinesCount();
        for (int j = lines.length - 1; j >= 0; j--) {
            ticket.insertLine(insertpoint, lines[j]);
            ticketlines.insertTicketLine(insertpoint, lines[j]);
        }
    }       
    
    printTotals();
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:34,代码来源:SimpleReceipt.java

示例2: addSelectedLines

import com.openbravo.pos.ticket.TicketLineInfo; //导入方法依赖的package包/类
/**
 *
 * @param lines
 */
public void addSelectedLines(TicketLineInfo[] lines) {
    
    int i = findFirstNonAuxiliarLine();         
          
    TicketLineInfo firstline = lines[0];
    
    if (i >= 0 
            && ticket.getLine(i).getProductID() != null && firstline.getProductID() != null && ticket.getLine(i).getProductID().equals(firstline.getProductID())
            && ticket.getLine(i).getTaxInfo().getId().equals(firstline.getTaxInfo().getId())
            && ticket.getLine(i).getPrice() == firstline.getPrice()) {  
        
        // add the auxiliars.
        for (int j = 1; j < lines.length; j++) {
            ticket.insertLine(i + 1, lines[j]);
            ticketlines.insertTicketLine(i + 1, lines[j]);
        }
        
        // inc the line
        ticket.getLine(i).setMultiply(ticket.getLine(i).getMultiply() + firstline.getMultiply());
        ticketlines.setTicketLine(i, ticket.getLine(i));  
        ticketlines.setSelectedIndex(i);
        
    } else {
        // add all at the end in inverse order.
        int insertpoint = ticket.getLinesCount();
        for (int j = lines.length - 1; j >= 0; j--) {
            ticket.insertLine(insertpoint, lines[j]);
            ticketlines.insertTicketLine(insertpoint, lines[j]);
        }
    }       
    
    printTotals();
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:38,代码来源:SimpleReceipt.java

示例3: transformTickets

import com.openbravo.pos.ticket.TicketLineInfo; //导入方法依赖的package包/类
private Order[] transformTickets(List<TicketInfo> ticketlist) {

        // Transformamos de tickets a ordenes
        Order[] orders = new Order[ticketlist.size()];
        for (int i = 0; i < ticketlist.size(); i++) {
            TicketInfo ticket = ticketlist.get(i);

            orders[i] = new Order();

            OrderIdentifier orderid = new OrderIdentifier();
            Calendar datenew = Calendar.getInstance();
            datenew.setTime(ticket.getDate());
            orderid.setDateNew(datenew);
            orderid.setDocumentNo(Integer.toString(ticket.getTicketId()));

            orders[i].setOrderId(orderid);
            orders[i].setState(800175);
            
            // set the business partner
            BPartner bp;
            if (ticket.getCustomerId() == null) {
                bp = null;
            } else {
                bp = new BPartner();
                bp.setId(ticket.getCustomer().getSearchkey());
                bp.setName(ticket.getCustomer().getName());
            }
            orders[i].setBusinessPartner(bp);

            //Saco las lineas del pedido
            OrderLine[] orderLine = new OrderLine[ticket.getLines().size()];
            for (int j = 0; j < ticket.getLines().size(); j++){
                TicketLineInfo line = ticket.getLines().get(j);

                orderLine[j] = new OrderLine();
                orderLine[j].setOrderLineId(String.valueOf(line.getTicketLine()));// o simplemente "j"
                if (line.getProductID() == null) {
                    orderLine[j].setProductId("0");
                } else {
                    orderLine[j].setProductId(line.getProductID()); // capturar error
                }
                orderLine[j].setUnits(line.getMultiply());
                orderLine[j].setPrice(line.getPrice());
                orderLine[j].setTaxId(line.getTaxInfo().getId());     
            }
            orders[i].setLines(orderLine);

            //Saco las lineas de pago
            Payment[] paymentLine = new Payment[ticket.getPayments().size()];
            for (int j = 0; j < ticket.getPayments().size(); j++){       
                PaymentInfo payment = ticket.getPayments().get(j);

                paymentLine[j] = new Payment();
                paymentLine[j].setAmount(payment.getTotal());
                if ("magcard".equals(payment.getName())) {
                    paymentLine[j].setPaymentType("K");
                } else if ("cheque".equals(payment.getName())) {
                    paymentLine[j].setPaymentType("2");
                } else if ("cash".equals(payment.getName())) {
                    paymentLine[j].setPaymentType("B");
                } else {
                    paymentLine[j].setPaymentType(null); // unknown
                }        
            }     
            orders[i].setPayment(paymentLine);                    
        }
        
        return orders;
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:70,代码来源:OrdersSync.java


注:本文中的com.openbravo.pos.ticket.TicketLineInfo.getProductID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。