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


Java PaymentInfo类代码示例

本文整理汇总了Java中com.openbravo.pos.payment.PaymentInfo的典型用法代码示例。如果您正苦于以下问题:Java PaymentInfo类的具体用法?Java PaymentInfo怎么用?Java PaymentInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: TicketInfo

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
/** Creates new TicketModel */
public TicketInfo() {
    m_sId = UUID.randomUUID().toString();
    tickettype = RECEIPT_NORMAL;
    m_iTicketId = 0; // incrementamos
    m_dDate = new Date();
    attributes = new Properties();
    m_User = null;
    m_Customer = null;
    m_sActiveCash = null;
    m_aLines = new ArrayList<TicketLineInfo>(); // vacio de lineas

    payments = new ArrayList<PaymentInfo>();
    taxes = null;
    m_sResponse = null;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:17,代码来源:TicketInfo.java

示例2: readValues

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public void readValues(DataRead dr) throws BasicException {
    m_sId = dr.getString(1);
    tickettype = dr.getInt(2).intValue();
    m_iTicketId = dr.getInt(3).intValue();
    m_dDate = dr.getTimestamp(4);
    m_sActiveCash = dr.getString(5);
    try {
        byte[] img = dr.getBytes(6);
        if (img != null) {
            attributes.loadFromXML(new ByteArrayInputStream(img));
        }
    } catch (IOException e) {
    }
    m_User = new UserInfo(dr.getString(7), dr.getString(8));
    m_Customer = new CustomerInfoExt(dr.getString(9));
    m_aLines = new ArrayList<TicketLineInfo>();

    payments = new ArrayList<PaymentInfo>();
    taxes = null;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:21,代码来源:TicketInfo.java

示例3: copyTicket

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public TicketInfo copyTicket() {
    TicketInfo t = new TicketInfo();

    t.tickettype = tickettype;
    t.m_iTicketId = m_iTicketId;
    t.m_dDate = m_dDate;
    t.m_sActiveCash = m_sActiveCash;
    t.attributes = (Properties) attributes.clone();
    t.m_User = m_User;
    t.m_Customer = m_Customer;

    t.m_aLines = new ArrayList<TicketLineInfo>();
    for (TicketLineInfo l : m_aLines) {
        t.m_aLines.add(l.copyTicketLine());
    }
    t.refreshLines();

    t.payments = new LinkedList<PaymentInfo>();
    for (PaymentInfo p : payments) {
        t.payments.add(p.copyPayment());
    }

    // taxes are not copied, must be calculated again.

    return t;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:27,代码来源:TicketInfo.java

示例4: TicketInfo

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
/**
 * Creates new TicketModel
 */
public TicketInfo() {
    m_sId = UUID.randomUUID().toString();
    tickettype = RECEIPT_NORMAL;
    m_iTicketId = 0; // incrementamos
    m_dDate = new Date();
    attributes = new Properties();
    m_User = null;
    m_Customer = null;
    m_sActiveCash = null;
    m_aLines = new ArrayList<TicketLineInfo>(); // vacio de lineas

    payments = new ArrayList<PaymentInfo>();
    taxes = null;
    m_sResponse = null;
}
 
开发者ID:ZarGate,项目名称:OpenbravoPOS,代码行数:19,代码来源:TicketInfo.java

示例5: readExternal

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    // esto es solo para serializar tickets que no estan en la bolsa de tickets pendientes
    m_sId = (String) in.readObject();
    tickettype = in.readInt();
    m_iTicketId = in.readInt();
    m_Customer = (CustomerInfoExt) in.readObject();
    m_dDate = (Date) in.readObject();
    attributes = (Properties) in.readObject();
    m_aLines = (List<TicketLineInfo>) in.readObject();
    m_User = null;
    m_sActiveCash = null;

    payments = new ArrayList<PaymentInfo>();
    taxes = null;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:16,代码来源:TicketInfo.java

示例6: getTotalPaid

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public double getTotalPaid() {

        double sum = 0.0;
        for (PaymentInfo p : payments) {
            if (!"debtpaid".equals(p.getName())) {
                sum += p.getTotal();
            }
        }
        return sum;
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:11,代码来源:TicketInfo.java

示例7: copyTicket

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
/**
 *
 * @return
 */
public TicketInfo copyTicket() {
    TicketInfo t = new TicketInfo();

    t.tickettype = tickettype;
    t.m_iTicketId = m_iTicketId;
    t.m_dDate = m_dDate;
    t.m_sActiveCash = m_sActiveCash;
    t.attributes = (Properties) attributes.clone();
    t.m_User = m_User;
    t.m_Customer = m_Customer;

    t.m_aLines = new ArrayList<>(); // JG June 2102 diamond inference
    for (TicketLineInfo l : m_aLines) {
        t.m_aLines.add(l.copyTicketLine());
    }
    t.refreshLines();

    t.payments = new LinkedList<>(); // JG June 2102 diamond inference
    for (PaymentInfo p : payments) {
        t.payments.add(p.copyPayment());
    }
    t.oldTicket=oldTicket;
    // taxes are not copied, must be calculated again.

    return t;
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:31,代码来源:TicketInfo.java

示例8: getTotalPaid

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
/**
 *
 * @return
 */
public double getTotalPaid() {
    double sum = 0.0;
    for (PaymentInfo p : payments) {
        if (!"debtpaid".equals(p.getName())) {
            sum += p.getTotal();
        }
    }
    return sum;
      }
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:14,代码来源:TicketInfo.java

示例9: getPayments

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public List<PaymentInfo> getPayments() {
    return payments;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:4,代码来源:TicketInfo.java

示例10: setPayments

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public void setPayments(List<PaymentInfo> l) {
    payments = l;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:4,代码来源:TicketInfo.java

示例11: resetPayments

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public void resetPayments() {
    payments = new ArrayList<PaymentInfo>();
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:4,代码来源:TicketInfo.java

示例12: deleteTicket

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public final void deleteTicket(final TicketInfo ticket, final String location) throws BasicException {

        Transaction t = new Transaction(s) {
            public Object transact() throws BasicException {

                // update the inventory
                Date d = new Date();
                for (int i = 0; i < ticket.getLinesCount(); i++) {
                    if (ticket.getLine(i).getProductID() != null)  {
                        // Hay que actualizar el stock si el hay producto
                        getStockDiaryInsert().exec( new Object[] {
                            UUID.randomUUID().toString(),
                            d,
                            ticket.getLine(i).getMultiply() >= 0.0
                                ? MovementReason.IN_REFUND.getKey()
                                : MovementReason.OUT_SALE.getKey(),
                            location,
                            ticket.getLine(i).getProductID(),
                            ticket.getLine(i).getProductAttSetInstId(),
                            new Double(ticket.getLine(i).getMultiply()),
                            new Double(ticket.getLine(i).getPrice())
                        });
                    }
                }

                // update customer debts
                for (PaymentInfo p : ticket.getPayments()) {
                    if ("debt".equals(p.getName()) || "debtpaid".equals(p.getName())) {

                        // udate customer fields...
                        ticket.getCustomer().updateCurDebt(-p.getTotal(), ticket.getDate());

                         // save customer fields...
                        getDebtUpdate().exec(new DataParams() { public void writeValues() throws BasicException {
                            setDouble(1, ticket.getCustomer().getCurdebt());
                            setTimestamp(2, ticket.getCustomer().getCurdate());
                            setString(3, ticket.getCustomer().getId());
                        }});
                    }
                }

                // and delete the receipt
                new StaticSentence(s
                    , "DELETE FROM TAXLINES WHERE RECEIPT = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                new StaticSentence(s
                    , "DELETE FROM PAYMENTS WHERE RECEIPT = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                new StaticSentence(s
                    , "DELETE FROM TICKETLINES WHERE TICKET = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                new StaticSentence(s
                    , "DELETE FROM TICKETS WHERE ID = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                new StaticSentence(s
                    , "DELETE FROM RECEIPTS WHERE ID = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                return null;
            }
        };
        t.execute();
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:63,代码来源:DataLogicSales.java

示例13: transformTickets

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的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

示例14: deleteTicket

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
/**
 *
 * @param ticket
 * @param location
 * @throws BasicException
 */
public final void deleteTicket(final TicketInfo ticket, final String location) throws BasicException {

    Transaction t = new Transaction(s) {
        @Override
        public Object transact() throws BasicException {

            // update the inventory
            Date d = new Date();
            for (int i = 0; i < ticket.getLinesCount(); i++) {
                if (ticket.getLine(i).getProductID() != null)  {
                    // Hay que actualizar el stock si el hay producto
                    getStockDiaryInsert().exec( new Object[] {
                        UUID.randomUUID().toString(),
                        d,
                        ticket.getLine(i).getMultiply() >= 0.0
                            ? MovementReason.IN_REFUND.getKey()
                            : MovementReason.OUT_SALE.getKey(),
                        location,
                        ticket.getLine(i).getProductID(),
                        ticket.getLine(i).getProductAttSetInstId(), ticket.getLine(i).getMultiply(), ticket.getLine(i).getPrice(),
                        ticket.getUser().getName() 
                    });
                }
            }

            // update customer debts
            for (PaymentInfo p : ticket.getPayments()) {
                if ("debt".equals(p.getName()) || "debtpaid".equals(p.getName())) {

                    // udate customer fields...
                    ticket.getCustomer().updateCurDebt(-p.getTotal(), ticket.getDate());

                     // save customer fields...
                    getDebtUpdate().exec(new DataParams() {
                    @Override
                    public void writeValues() throws BasicException {
                        setDouble(1, ticket.getCustomer().getCurdebt());
                        setTimestamp(2, ticket.getCustomer().getCurdate());
                        setString(3, ticket.getCustomer().getId());
                    }});
                }
            }

            // and delete the receipt
            new StaticSentence(s
                , "DELETE FROM TAXLINES WHERE RECEIPT = ?"
                , SerializerWriteString.INSTANCE).exec(ticket.getId());
            new StaticSentence(s
                , "DELETE FROM PAYMENTS WHERE RECEIPT = ?"
                , SerializerWriteString.INSTANCE).exec(ticket.getId());
            new StaticSentence(s
                , "DELETE FROM TICKETLINES WHERE TICKET = ?"
                , SerializerWriteString.INSTANCE).exec(ticket.getId());
            new StaticSentence(s
                , "DELETE FROM TICKETS WHERE ID = ?"
                , SerializerWriteString.INSTANCE).exec(ticket.getId());
            new StaticSentence(s
                , "DELETE FROM RECEIPTS WHERE ID = ?"
                , SerializerWriteString.INSTANCE).exec(ticket.getId());
            return null;
        }
    };
    t.execute();
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:71,代码来源:DataLogicSales.java

示例15: deleteTicket

import com.openbravo.pos.payment.PaymentInfo; //导入依赖的package包/类
public final void deleteTicket(final TicketInfo ticket, final String location) throws BasicException {

        Transaction t = new Transaction(s) {
            public Object transact() throws BasicException {

                // update the inventory
                Date d = new Date();
                for (int i = 0; i < ticket.getLinesCount(); i++) {
                    if (ticket.getLine(i).getProductID() != null)  {
                        // Hay que actualizar el stock si el hay producto
                        getStockDiaryInsert().exec( new Object[] {
                            UUID.randomUUID().toString(),
                            d,
                            ticket.getLine(i).getMultiply() >= 0.0
                                ? MovementReason.IN_REFUND.getKey()
                                : MovementReason.OUT_SALE.getKey(),
                            location,
                            ticket.getLine(i).getProductID(),
                            ticket.getLine(i).getProductAttSetInstId(),
                            new Double(ticket.getLine(i).getMultiply()),
                            new Double(ticket.getLine(i).getPrice())
                        });
                    }
                }

                // update customer debts
                for (PaymentInfo p : ticket.getPayments()) {
                    if ("debt".equals(p.getName()) || "debtpaid".equals(p.getName())) {
                        
                        ticket.setCustomer(loadCustomerExt(ticket.getCustomer().getId()));
                        // udate customer fields...
                        ticket.getCustomer().updateCurDebt(-p.getTotal(), ticket.getDate());

                         // save customer fields...
                        getDebtUpdate().exec(new DataParams() { public void writeValues() throws BasicException {
                            setDouble(1, ticket.getCustomer().getCurdebt());
                            setTimestamp(2, ticket.getCustomer().getCurdate());
                            setString(3, ticket.getCustomer().getId());
                        }});
                    }
                }

                // and delete the receipt
                new StaticSentence(s
                    , "DELETE FROM TAXLINES WHERE RECEIPT = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                new StaticSentence(s
                    , "DELETE FROM PAYMENTS WHERE RECEIPT = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                new StaticSentence(s
                    , "DELETE FROM TICKETLINES WHERE TICKET = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                new StaticSentence(s
                    , "DELETE FROM TICKETS WHERE ID = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                new StaticSentence(s
                    , "DELETE FROM RECEIPTS WHERE ID = ?"
                    , SerializerWriteString.INSTANCE).exec(ticket.getId());
                return null;
            }
        };
        t.execute();
    }
 
开发者ID:nordpos,项目名称:nordpos,代码行数:64,代码来源:DataLogicSales.java


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