Package org.openbravo.model.pos

Examples of org.openbravo.model.pos.ExternalPOS


        final String payment_total = request.getParameter("payment_total");
        final String erp_org = request.getParameter("erp.org");

        final Order iOrder = new Order();

        final ExternalPOS extPos = (ExternalPOS) obq.list().get(0);

        // Client
        iOrder.setClient(extPos.getClient());

        // Organization
        final Organization syncOrgSel = (Organization) OBDal.getInstance().get(
                "Organization", erp_org);
        iOrder.setOrganization(syncOrgSel);

        // Sales representative
        iOrder.setSalesRepresentative(extPos.getSalesRepresentative());

        // Warehouse
        iOrder.setWarehouse(extPos.getWarehouse());

        // Price list
        iOrder.setPriceList(extPos.getPriceList());

        // Currency
        iOrder.setCurrency(extPos.getPriceList().getCurrency());

        // Shipping company
        iOrder.setShippingCompany(extPos.getShippingCompany());

        // Business Partner
        if (bp_id == null) {
            final BusinessPartner syncBp = extPos.getBusinessPartner();
            iOrder.setBusinessPartner(syncBp);
            final Location syncBpLoc = (syncBp.getBusinessPartnerLocationList()
                    .isEmpty()) ? null : syncBp
                    .getBusinessPartnerLocationList().get(0);

            iOrder.setPartnerAddress(syncBpLoc);
            // Payment Term
            iOrder.setPaymentTerms(syncBp.getPaymentTerms());
        } else {
            final BusinessPartner syncSelBp = (BusinessPartner) OBDal
                    .getInstance().get("BusinessPartner", bp_id);
            iOrder.setBusinessPartner(syncSelBp);
            final Location syncBpLoc = (syncSelBp
                    .getBusinessPartnerLocationList().isEmpty()) ? null
                    : syncSelBp.getBusinessPartnerLocationList().get(0);
            iOrder.setPartnerAddress(syncBpLoc);
        }

        // Document type
        iOrder.setDocumentType(extPos.getDocumentType());

        // Document number
        iOrder.setDocumentNo(ti_id + "." + ti_type);

        // Document name
        iOrder.setDocumentTypeName(extPos.getDocumentType().getName());

        // Product
        final Product pro = (Product) OBDal.getInstance().get("Product",
                line_product);
        iOrder.setProduct(pro);
View Full Code Here


            throw new OBException(sb.toString());
        } else {
            final StringBuilder sPro = new StringBuilder();
            boolean incPro = false;
            for (final BaseOBObject b : obq1.list()) {
                final ExternalPOS ePos = (ExternalPOS) b;
                warehouseId = ePos.getWarehouse().getId();
                if (ePos.getIncludedProduct().equals("N")) {
                    incPro = true;
                    sPro.append("(''");
                    for (final ExternalPOSProduct p : ePos
                            .getExternalPOSProductList()) {
                        sPro.append(", '" + p.getProduct().getId() + "'");
                    }
                    sPro.append(")");
                }
View Full Code Here

TOP

Related Classes of org.openbravo.model.pos.ExternalPOS

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.