亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? invoiceworker.java

?? Sequoia ERP是一個真正的企業(yè)級開源ERP解決方案。它提供的模塊包括:電子商務應用(e-commerce), POS系統(tǒng)(point of sales),知識管理,存貨與倉庫管理
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * $Id: InvoiceWorker.java 7051 2006-03-22 22:34:02Z sichen $ * * Copyright 2003-2006 The Apache Software Foundation *  * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at *  * http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */package org.ofbiz.accounting.invoice;import java.math.BigDecimal;import java.sql.Timestamp;import java.util.Iterator;import java.util.List;import org.ofbiz.base.util.Debug;import org.ofbiz.base.util.UtilDateTime;import org.ofbiz.base.util.UtilMisc;import org.ofbiz.base.util.UtilNumber;import org.ofbiz.entity.condition.EntityConditionList;import org.ofbiz.entity.condition.EntityExpr;import org.ofbiz.entity.condition.EntityOperator;import org.ofbiz.entity.GenericDelegator;import org.ofbiz.entity.GenericEntityException;import org.ofbiz.entity.GenericValue;import org.ofbiz.entity.util.EntityUtil;/** * InvoiceWorker - Worker methods of invoices * * @author     <a href="mailto:jaz@ofbiz.org">Andy Zeneski</a>  * @version    $Rev: 7051 $ * @since      2.1 */public class InvoiceWorker {        public static String module = InvoiceWorker.class.getName();    private static int decimals = UtilNumber.getBigDecimalScale("invoice.decimals");    private static int rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");    /**     * Method to return the total amount of an invoice     * @param invoice GenericValue object of the Invoice     * @return the invoice total as double     */    public static double getInvoiceTotal(GenericDelegator delegator, String invoiceId) {        return getInvoiceTotalBd(delegator, invoiceId).doubleValue();    }    public static BigDecimal getInvoiceTotalBd(GenericDelegator delegator, String invoiceId) {        if (delegator == null) {            throw new IllegalArgumentException("Null delegator is not allowed in this method");        }                GenericValue invoice = null;        try {            invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId));            } catch (GenericEntityException e) {            Debug.logError(e, "Problem getting Invoice", module);        }                if (invoice == null) {            throw new IllegalArgumentException("The invoiceId passed does not match an existing invoice");        }                return getInvoiceTotalBd(invoice);    }        /**     * Method to return the total amount of an invoice     * @param invoice GenericValue object of the Invoice     * @return the invoice total as double     */        public static double getInvoiceTotal(GenericValue invoice) {            return getInvoiceTotalBd(invoice).doubleValue();        }                public static BigDecimal getInvoiceTotalBd(GenericValue invoice) {        BigDecimal invoiceTotal = new BigDecimal("0");        List invoiceItems = null;        try {            invoiceItems = invoice.getRelated("InvoiceItem");        } catch (GenericEntityException e) {            Debug.logError(e, "Trouble getting InvoiceItem list", module);                    }        if (invoiceItems != null && invoiceItems.size() > 0) {            Iterator invoiceItemsIter = invoiceItems.iterator();            while (invoiceItemsIter.hasNext()) {                GenericValue invoiceItem = (GenericValue) invoiceItemsIter.next();                BigDecimal amount = invoiceItem.getBigDecimal("amount");                BigDecimal quantity = invoiceItem.getBigDecimal("quantity");                if (amount == null)                    amount = new BigDecimal("0");                if (quantity == null)                    quantity = new BigDecimal("1");                invoiceTotal = invoiceTotal.add( amount.multiply(quantity)).setScale(decimals,rounding);            }        }        return invoiceTotal;            }    /**     * Method to obtain the bill to party for an invoice. Note that invoice.partyId is the bill to party.     * @param invoice GenericValue object of the Invoice     * @return GenericValue object of the Party     */    public static GenericValue getBillToParty(GenericValue invoice) {        try {            GenericValue billToParty = invoice.getRelatedOne("Party");            if (billToParty != null) {                return billToParty;            }        } catch (GenericEntityException e) {            Debug.logError(e, "Trouble getting Party from Invoice", module);        }        // remaining code is the old method, which we leave here for compatibility purposes        List billToRoles = null;        try {            billToRoles = invoice.getRelated("InvoiceRole", UtilMisc.toMap("roleTypeId", "BILL_TO_CUSTOMER"),                 UtilMisc.toList("-datetimePerformed"));        } catch (GenericEntityException e) {            Debug.logError(e, "Trouble getting InvoiceRole list", module);                    }                if (billToRoles != null) {                    GenericValue role = EntityUtil.getFirst(billToRoles);            GenericValue party = null;            try {                party = role.getRelatedOne("Party");            } catch (GenericEntityException e) {                Debug.logError(e, "Trouble getting Party from InvoiceRole", module);            }            if (party != null)                return party;        }                    return null;            }    /** Convenience method to obtain the bill from party for an invoice. Note that invoice.partyIdFrom is the bill from party. */    public static GenericValue getBillFromParty(GenericValue invoice) {        try {            return invoice.getRelatedOne("FromParty");        } catch (GenericEntityException e) {            Debug.logError(e, "Trouble getting FromParty from Invoice", module);        }        return null;    }        /**      * Method to obtain the send from party for an invoice      * @param invoice GenericValue object of the Invoice      * @return GenericValue object of the Party      */        public static GenericValue getSendFromParty(GenericValue invoice) {        GenericValue billFromParty = getBillFromParty(invoice);        if (billFromParty != null) {            return billFromParty;        }        // remaining code is the old method, which we leave here for compatibility purposes        List sendFromRoles = null;        try {            sendFromRoles = invoice.getRelated("InvoiceRole", UtilMisc.toMap("roleTypeId", "BILL_FROM_VENDOR"),                 UtilMisc.toList("-datetimePerformed"));        } catch (GenericEntityException e) {            Debug.logError(e, "Trouble getting InvoiceRole list", module);                    }                if (sendFromRoles != null) {                    GenericValue role = EntityUtil.getFirst(sendFromRoles);            GenericValue party = null;            try {                party = role.getRelatedOne("Party");            } catch (GenericEntityException e) {                Debug.logError(e, "Trouble getting Party from InvoiceRole", module);            }            if (party != null)                return party;        }                    return null;            }        /**      * Method to obtain the billing address for an invoice      * @param invoice GenericValue object of the Invoice      * @return GenericValue object of the PostalAddress      */            public static GenericValue getBillToAddress(GenericValue invoice) {        return getInvoiceAddressByType(invoice, "BILLING_LOCATION");            }        /**      * Method to obtain the sending address for an invoice      * @param invoice GenericValue object of the Invoice      * @return GenericValue object of the PostalAddress      */            public static GenericValue getSendFromAddress(GenericValue invoice) {        return getInvoiceAddressByType(invoice, "PAYMENT_LOCATION");                    }        public static GenericValue getInvoiceAddressByType(GenericValue invoice, String contactMechPurposeTypeId) {        GenericDelegator delegator = invoice.getDelegator();        List locations = null;        // first try InvoiceContactMech to see if we can find the address needed        try {            locations = invoice.getRelated("InvoiceContactMech", UtilMisc.toMap("contactMechPurposeTypeId", contactMechPurposeTypeId), null);        } catch (GenericEntityException e) {            Debug.logError("Touble getting InvoiceContactMech entity list", module);                   }        if (locations == null || locations.size() == 0)    {            // if no locations found get it from the PartyAndContactMech using the from and to party on the invoice            String destinationPartyId = null;            if (invoice.getString("invoiceTypeId").equals("SALES_INVOICE"))                destinationPartyId = invoice.getString("partyId");            if (invoice.getString("invoiceTypeId").equals("PURCHASE_INVOICE"))                destinationPartyId = new String("partyFrom");            try {                locations = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",                         UtilMisc.toMap("partyId", destinationPartyId, "contactMechPurposeTypeId", contactMechPurposeTypeId)));            } catch (GenericEntityException e) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜电影一区二区三区| 久久品道一品道久久精品| 亚洲激情av在线| 色综合久久综合网欧美综合网| 亚洲天堂2014| 欧美日韩精品久久久| 日精品一区二区| 精品区一区二区| 国产精品1024| 成人免费在线视频观看| 欧美午夜一区二区三区| 午夜精品国产更新| wwwwww.欧美系列| 成人黄色av电影| 亚洲国产一区二区在线播放| 欧美一区二区三区成人| 国产麻豆精品久久一二三| 亚洲欧美中日韩| 777a∨成人精品桃花网| 狠狠色2019综合网| 国产精品国产三级国产aⅴ原创| 欧洲激情一区二区| 久久成人免费电影| 国产精品乱人伦中文| 欧美色综合天天久久综合精品| 久热成人在线视频| 国产精品久久网站| 欧美精品v国产精品v日韩精品| 九九精品一区二区| 国产精品成人免费精品自在线观看| 欧洲一区二区三区免费视频| 国产在线播精品第三| 国产精品第四页| 欧美一区二区三区啪啪| 成人网页在线观看| 丝瓜av网站精品一区二区| 国产片一区二区三区| 欧美日韩亚洲综合| 国产成人在线视频免费播放| 亚洲国产精品麻豆| 欧美国产激情二区三区| 91精品国产色综合久久ai换脸 | 久久久久久久久久看片| 色呦呦网站一区| 国产一本一道久久香蕉| 亚洲一区二区精品久久av| 国产亚洲一二三区| 欧美一区二区三区的| 一本色道久久加勒比精品| 国产乱色国产精品免费视频| 石原莉奈一区二区三区在线观看| 亚洲欧洲日韩一区二区三区| 精品福利一二区| 欧美一区二区在线不卡| 91免费国产视频网站| 风间由美中文字幕在线看视频国产欧美| 亚洲成人激情综合网| 亚洲猫色日本管| 欧美国产禁国产网站cc| 精品国产精品一区二区夜夜嗨| 欧美性色综合网| 一本久久a久久免费精品不卡| 福利一区二区在线| 国产在线不卡一卡二卡三卡四卡| 久久电影网电视剧免费观看| 一区二区视频免费在线观看| 亚洲国产精品ⅴa在线观看| 欧美电影免费观看完整版| 欧美日韩在线精品一区二区三区激情| av在线播放一区二区三区| 国产另类ts人妖一区二区| 美女一区二区三区| 水野朝阳av一区二区三区| 亚洲成av人**亚洲成av**| 亚洲黄色免费电影| 亚洲精品欧美专区| 亚洲乱码一区二区三区在线观看| 中文天堂在线一区| 国产日韩欧美不卡在线| 久久久国产精品午夜一区ai换脸| 久久久精品免费网站| 久久综合av免费| 日本一区二区免费在线| 国产欧美一区二区精品仙草咪 | 九九热在线视频观看这里只有精品| 丝袜美腿亚洲综合| 婷婷久久综合九色国产成人| 丝袜美腿亚洲一区二区图片| 日本欧美韩国一区三区| 奇米四色…亚洲| 久久超级碰视频| 国产美女主播视频一区| 国产91富婆露脸刺激对白| 国产91精品一区二区麻豆亚洲| 国产盗摄精品一区二区三区在线| 成人福利视频在线| 色综合天天综合| 欧美日韩一区二区三区在线看| 欧美精品久久99| 欧美成人一区二区三区片免费 | 久久免费视频一区| 中文字幕不卡在线播放| 1024成人网| 日韩高清在线不卡| 欧美在线你懂的| 欧美人妖巨大在线| 精品乱人伦小说| 中文字幕一区二区三区在线播放| 亚洲国产一区二区视频| 秋霞午夜鲁丝一区二区老狼| 国产精品亚洲视频| 99久久er热在这里只有精品66| 欧美午夜一区二区| 精品国产一区二区三区不卡| 中文字幕亚洲精品在线观看| 日本中文一区二区三区| 懂色av中文字幕一区二区三区 | 夜夜嗨av一区二区三区| 久久精品国内一区二区三区| 成人网页在线观看| 欧美精品一卡二卡| 国产欧美一区二区三区鸳鸯浴| 一区二区三区四区激情| 免费欧美日韩国产三级电影| 成人的网站免费观看| 91精品国产福利在线观看| 国产欧美一区二区精品性色| 午夜精品一区在线观看| 成人一区二区三区| 91精品国产色综合久久不卡蜜臀 | 欧美视频一二三区| 久久久不卡影院| 午夜视频在线观看一区| 成人av在线网| 精品国产三级a在线观看| 一区二区三区中文在线| 国产乱码精品一区二区三| 欧美日韩在线直播| 国产精品剧情在线亚洲| 蜜臀av一区二区三区| 色综合久久中文字幕| 久久嫩草精品久久久精品一| 日韩精品高清不卡| 色噜噜久久综合| 欧美激情一二三区| 久久99精品久久久久久国产越南| 91九色02白丝porn| 国产精品久久久久影视| 黑人巨大精品欧美一区| 日韩一本二本av| 亚洲国产综合色| 色综合久久综合网欧美综合网| 国产片一区二区三区| 精东粉嫩av免费一区二区三区| 欧美视频在线一区| 亚洲另类在线视频| 成人av网站在线观看| 国产日韩综合av| 国模套图日韩精品一区二区| 日韩精品一区二区三区中文不卡| 亚洲不卡一区二区三区| 欧美综合视频在线观看| 自拍av一区二区三区| 99精品桃花视频在线观看| 中文字幕va一区二区三区| 国产精品亚洲成人| 欧美精品一区二区三区蜜臀| 久久精品国产秦先生| 日韩欧美色电影| 蜜桃传媒麻豆第一区在线观看| 在线播放/欧美激情| 天天av天天翘天天综合网| 欧美午夜精品一区二区蜜桃| 亚洲免费在线电影| 日本精品一区二区三区四区的功能| 亚洲欧美日韩在线不卡| 91论坛在线播放| 亚洲一区二区欧美激情| 欧美四级电影网| 日韩和欧美一区二区| 欧美一级电影网站| 看片的网站亚洲| 久久久噜噜噜久久中文字幕色伊伊 | 一区二区三区久久| 欧美在线不卡一区| 天天射综合影视| 欧美xxxx老人做受| 国产成人a级片| 亚洲男同1069视频| 欧美三级视频在线| 久久精品国产99国产精品| 久久久国产精品午夜一区ai换脸| 成人av资源网站| 亚洲国产综合色| 精品国产一区二区三区久久久蜜月 | 欧美在线三级电影| 美女精品一区二区| 国产视频一区在线观看| 91女神在线视频| 日韩成人午夜精品|