diff --git a/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java b/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java index aaa0b32..ff14922 100644 --- a/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java +++ b/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java @@ -1111,114 +1111,4 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain { return new UFDouble(value.toString().trim()); } - public void calculatorPrice1(SaleOrderVO ordervo) throws BusinessException { - - IKeyValue keyValue = new VOKeyValue(ordervo); - - String ctrantypeid = keyValue.getHeadStringValue(SaleOrderHVO.CTRANTYPEID); - if (StringUtil.isEmptyTrimSpace(ctrantypeid)) { - ExceptionUtils.wrappBusinessException( - NCLangRes4VoTransl.getNCLangRes().getStrByID("4006013_0", "04006013-0024")/* @res "请先选择交易类型!" */); - } - // 1.缓存交易类型VO - - SaleOrderBVO[] vbos = ordervo.getChildrenVO(); - UFDouble sumnum = UFDouble.ZERO_DBL; - UFDouble sumnny = UFDouble.ZERO_DBL; - String ybpk = ordervo.getParentVO().getCorigcurrencyid(); - - for (int i = 0; i < vbos.length; i++) { - SaleOrderBVO childrenVO = vbos[i]; - String zbbz = childrenVO.getCcurrencyid(); - - childrenVO.setFtaxtypeflag(1); - // 得到税率 - UFDouble ntaxrate = BFPubTools.getUFDouble_NullAsZero(childrenVO.getNtaxrate()); - - // 折本汇率 - UFDouble nexchangerate = childrenVO.getNexchangerate(); - nexchangerate = getUFDouble_NullAsOne(nexchangerate); - // 含税单价 - UFDouble nqtorigtaxprice = childrenVO.getNqtorigtaxprice(); - // 无税单价 - UFDouble nqtorigprice = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100))); - // 价税合计 - // UFDouble norigtaxmny=nqtorigtaxprice.multiply(childrenVO.getNqtunitnum()); - UFDouble norigtaxmny = nqtorigtaxprice.multiply(childrenVO.getNqtunitnum()).setScale(2, 4); - childrenVO.setNorigtaxmny(norigtaxmny); - // 无税金额 - UFDouble norigmny = nqtorigprice.multiply(childrenVO.getNqtunitnum()); - - childrenVO.setNorigmny(Currency.getFormaUfValue(ybpk, norigmny)); - // 税额 - childrenVO.setNqtorigprice(nqtorigprice.setScale(4, 4)); - - // 无税本币金额单价 - UFDouble taxspric = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100))); - - sumnum = sumnum.add(childrenVO.getNastnum()); - sumnny = sumnny.add(childrenVO.getNorigtaxmny()); - - nqtorigprice = nqtorigprice.setScale(4, 4); - // nqtorigtaxnetprc--含税净价 - childrenVO.setNqtorigtaxnetprc(nqtorigtaxprice); - // nqtorignetprice --无税净价 - childrenVO.setNqtorignetprice(nqtorigprice); - String Vqtunitrate = childrenVO.getVqtunitrate(); - UFDouble dVqtunitrate = UFDouble.ONE_DBL; - if (Vqtunitrate != null) { - dVqtunitrate = BFPubTools.getUFDouble_NullAsZero(Vqtunitrate.split("/")[0]); - } - // norigtaxprice --主含税单价 - - UFDouble wsje = taxspric.multiply(nexchangerate).multiply(childrenVO.getNqtunitnum()); - if (ybpk.equals(zbbz) && BFPubTools.getString_TrimAsNull(childrenVO.getCqtunitid()) - .equals(BFPubTools.getString_TrimAsNull(childrenVO.getCastunitid()))) { - wsje = taxspric.multiply(nexchangerate).multiply(childrenVO.getNqtunitnum()); - } - - wsje = Currency.getFormaUfValue(zbbz, wsje); - // 本币无税金额 - childrenVO.setNorigtaxprice(nqtorigtaxprice.div(dVqtunitrate).setScale(4, 4)); - // norigprice --主无税单价 - childrenVO.setNorigprice(nqtorigprice.div(dVqtunitrate).setScale(4, 4)); - // norigtaxnetprice --主含税净价 - childrenVO.setNorigtaxnetprice(childrenVO.getNorigtaxprice()); - // norignetprice --主无税净价 - childrenVO.setNorignetprice(childrenVO.getNorigprice()); - // ncaltaxmny --计税金额 - - // nqttaxprice --本币含税单价 - childrenVO.setNqttaxprice(nqtorigtaxprice.multiply(nexchangerate)); - // nqtprice --本币无税单价 - UFDouble bbwsd = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100))).multiply(nexchangerate); - childrenVO.setNqtprice(bbwsd.setScale(4, 4)); - // nqttaxnetprice --本币含税净价 - childrenVO.setNqttaxnetprice(nqtorigtaxprice.multiply(nexchangerate)); - // nqtnetprice --本币无税净价 - UFDouble Nqtnetprice = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100))).multiply(nexchangerate); - childrenVO.setNqtnetprice(Nqtnetprice.setScale(4, 4)); - // ntaxprice --主本币含税单价 , nprice --主本币无税单价 - childrenVO.setNtaxprice(nqtorigtaxprice.div(dVqtunitrate).multiply(nexchangerate).setScale(4, 4)); - UFDouble Nprice = nqtorigtaxprice.div(dVqtunitrate).div(UFDouble.ONE_DBL.add(ntaxrate.div(100))) - .multiply(nexchangerate); - childrenVO.setNprice(Nprice.setScale(4, 4)); - // ntaxnetprice --主本币含税净价 - // nnetprice --主本币无税净价 - childrenVO.setNtaxnetprice(nqtorigtaxprice.div(dVqtunitrate).multiply(nexchangerate).setScale(4, 4)); - UFDouble Nnetprice = nqtorigtaxprice.div(UFDouble.ONE_DBL.add(ntaxrate.div(100))).div(dVqtunitrate); - childrenVO.setNnetprice(Nnetprice.multiply(nexchangerate).setScale(4, 4)); - // nmny --本币无税金额 - childrenVO.setNmny(Currency.getFormaUfValue(zbbz, norigmny.multiply(nexchangerate))); - // ntaxmny--本币价税合计 - childrenVO.setNtaxmny( - nqtorigtaxprice.multiply(nexchangerate).multiply(childrenVO.getNqtunitnum()).setScale(2, 4)); - childrenVO.setNcaltaxmny(wsje); - UFDouble ntax = norigtaxmny.multiply(nexchangerate).sub(wsje); - childrenVO.setNtax(ntax.setScale(2, 4)); - } - ordervo.getParentVO().setNtotalnum(sumnum); - ordervo.getParentVO().setNtotalorigmny(sumnny.setScale(2, 4)); - } - }