コード例 #1
0
  public ESInvoiceEntry.Builder getInvoiceOtherRegionsEntryBuilder() {
    ESProductEntity product =
        (ESProductEntity)
            this.injector
                .getInstance(DAOESProduct.class)
                .create(this.product.getOtherRegionProductEntity());
    this.context = this.contexts.canaryIslands().staCruzDeTenerife().getParentContext();

    ESInvoiceEntry.Builder invoiceEntryBuilder =
        this.injector.getInstance(ESInvoiceEntry.Builder.class);
    ESShippingPoint.Builder originBuilder = this.shippingPoint.getShippingPointBuilder();

    invoiceEntryBuilder.clear();

    invoiceEntryBuilder
        .setUnitAmount(AmountType.WITHOUT_TAX, ESInvoiceEntryTestUtil.AMOUNT)
        .setTaxPointDate(new Date())
        .setDescription(product.getDescription())
        .setQuantity(ESInvoiceEntryTestUtil.QUANTITY)
        .setUnitOfMeasure(product.getUnitOfMeasure())
        .setProductUID(product.getUID())
        .setContextUID(this.context.getUID())
        .setShippingOrigin(originBuilder)
        .setCurrency(Currency.getInstance("EUR"));

    return invoiceEntryBuilder;
  }
コード例 #2
0
  private ManualBuilder getManualInvoiceEntryBuilder(ESProductEntity product) {
    ESInvoiceEntry.ManualBuilder invoiceEntryBuilder =
        this.injector.getInstance(ESInvoiceEntry.ManualBuilder.class);
    ESShippingPoint.Builder originBuilder = this.shippingPoint.getShippingPointBuilder();
    this.context = this.contexts.spain().allRegions();

    invoiceEntryBuilder.clear();

    invoiceEntryBuilder
        .setUnitAmount(AmountType.WITH_TAX, ESInvoiceEntryTestUtil.AMOUNT)
        .setTaxPointDate(new Date())
        .setDescription(product.getDescription())
        .setQuantity(ESInvoiceEntryTestUtil.QUANTITY)
        .setUnitOfMeasure(product.getUnitOfMeasure())
        .setProductUID(product.getUID())
        .setContextUID(this.context.getUID())
        .setShippingOrigin(originBuilder)
        .setCurrency(CURRENCY);

    return invoiceEntryBuilder;
  }