Package org.openbravo.model.financialmgmt.payment

Examples of org.openbravo.model.financialmgmt.payment.PaymentTerm


    // original db is not updated
    final List<BaseOBObject> pts = DalUtil.copyAll(new ArrayList<BaseOBObject>(getPaymentTerms()),
        false);

    // change some data and export
    final PaymentTerm pt = (PaymentTerm) pts.get(0);
    pt.setName("testtest");
    pt.getFinancialMgmtPaymentTermLineList().get(0).setOverduePaymentDayRule("2");

    String xml = getXML(pts);
    xml = xml.replaceAll("</name>", "t</name>");

    setUserContext("1000019");
View Full Code Here


    // original db is not updated
    final List<BaseOBObject> pts = DalUtil.copyAll(new ArrayList<BaseOBObject>(getPaymentTerms()),
        false);

    for (final BaseOBObject bob : pts) {
      final PaymentTerm pt = (PaymentTerm) bob;
      final PaymentTermLine ptl = pt.getFinancialMgmtPaymentTermLineList().get(1);
      pt.getFinancialMgmtPaymentTermLineList().remove(ptl);
    }

    String xml = getXML(pts);
    // there is a unique constraint on name
    xml = xml.replaceAll("</name>", "t</name>");
View Full Code Here

    final List<BaseOBObject> pts = DalUtil.copyAll(new ArrayList<BaseOBObject>(getPaymentTerms()),
        true);

    // add one at the back
    for (final BaseOBObject bob : pts) {
      final PaymentTerm pt = (PaymentTerm) bob;
      pt.setId("abc");
      final PaymentTermLine ptl0 = pt.getFinancialMgmtPaymentTermLineList().get(0);
      ptl0.setPaymentTerms(pt);
      final PaymentTermLine ptl = (PaymentTermLine) DalUtil.copy(ptl0);
      ptl.setId(null);
      ptl.setClient(null);
      ptl.setOrganization(null);
      ptl.setLineNo((long) NO_OF_PT_LINE);
      pt.getFinancialMgmtPaymentTermLineList().add(ptl);
      ptl.setPaymentTerms(pt);
    }

    String xml = getXML(pts);
    // log.debug(xml);
View Full Code Here

  private void createSavePaymentTerm() {
    setAccess();
    final List<PaymentTerm> result = new ArrayList<PaymentTerm>();
    for (int i = 0; i < NO_OF_PT; i++) {
      final PaymentTerm source = OBDal.getInstance().get(PaymentTerm.class, "1000000");
      final PaymentTerm pt = (PaymentTerm) DalUtil.copy(source, false);
      pt.setName("test " + i);
      pt.setOrganization(OBContext.getOBContext().getCurrentOrganization());

      // force new
      // now add a payment termline
      for (int j = 0; j < NO_OF_PT_LINE; j++) {
        final PaymentTermLine ptl = OBProvider.getInstance().get(PaymentTermLine.class);
        ptl.setExcludeTax(true);
        ptl.setLastDayCutoff(new Long(10));
        ptl.setMaturityDate1(new Long(5));
        ptl.setMaturityDate2(new Long(1));
        ptl.setMaturityDate3(new Long(1));
        ptl.setOffsetMonthDue(new Long(j));
        ptl.setLineNo((long) j);
        ptl.setOverduePaymentDayRule("1");
        ptl.setOverduePaymentDaysRule((long) 10);
        ptl.setNextBusinessDay(true);
        ptl.setRest(true);
        ptl.setPaymentTerms(pt);
        ptl.setPercentageDue(1.0f);
        pt.getFinancialMgmtPaymentTermLineList().add(ptl);
      }
      result.add(pt);
    }
    for (final PaymentTerm pt : result) {
      OBDal.getInstance().save(pt);
View Full Code Here

    for (PaymentTerm pt : pts) {
      ptls.addAll(pt.getFinancialMgmtPaymentTermLineList());
    }
    final List<BaseOBObject> copiedPts = DalUtil.copyAll(new ArrayList<BaseOBObject>(pts));
    for (BaseOBObject bob : copiedPts) {
      final PaymentTerm pt = (PaymentTerm) bob;
      assertFalse(pts.contains(pt));
      for (PaymentTermLine ptl : pt.getFinancialMgmtPaymentTermLineList()) {
        assertSame(pt, ptl.getPaymentTerms());
        assertFalse(ptls.contains(ptl));
      }
      for (PaymentTermTrl ptt : pt.getFinancialMgmtPaymentTermTrlList()) {
        assertSame(pt, ptt.getPaymentTerms());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.openbravo.model.financialmgmt.payment.PaymentTerm

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.