Package org.jallinone.purchases.documents.java

Examples of org.jallinone.purchases.documents.java.GridPurchaseDocRowVO


           if (res.isError())
             throw new Exception(res.getErrorMessage());

           rows = ( (VOListResponse) res).getRows();
           if (rows.size() == 1) {
              GridPurchaseDocRowVO itemVO = (GridPurchaseDocRowVO)rows.get(0);

              //vo.setInQtyDOC07();
              //vo.setDecimalsREG02();
              vo.setItemCodeItm01DOC09(itemVO.getItemCodeItm01DOC07());
              vo.setDescriptionSYS10(itemVO.getDescriptionSYS10());
              vo.setSerialNumberRequiredITM01(new Boolean("Y".equals(itemVO.getSerialNumberRequiredITM01())));
              vo.setProgressiveHie02DOC09(itemVO.getProgressiveHie02DOC07()); // item's LOB
              //vo.setQtyDOC07();
              //vo.setSupplierItemCodePur02DOC09();
              //vo.setSupplierQtyDecimalsREG02();
              //vo.setUmCodeREG02();
              //vo.setUmCodeReg02PUR02();
              //vo.setValueREG05();
              vo.setVariantCodeItm11DOC09(itemVO.getVariantCodeItm11DOC07());
              vo.setVariantCodeItm12DOC09(itemVO.getVariantCodeItm12DOC07());
              vo.setVariantCodeItm13DOC09(itemVO.getVariantCodeItm13DOC07());
              vo.setVariantCodeItm14DOC09(itemVO.getVariantCodeItm14DOC07());
              vo.setVariantCodeItm15DOC09(itemVO.getVariantCodeItm15DOC07());
              vo.setVariantTypeItm06DOC09(itemVO.getVariantTypeItm06DOC07());
              vo.setVariantTypeItm07DOC09(itemVO.getVariantTypeItm07DOC07());
              vo.setVariantTypeItm08DOC09(itemVO.getVariantTypeItm08DOC07());
              vo.setVariantTypeItm09DOC09(itemVO.getVariantTypeItm09DOC07());
              vo.setVariantTypeItm10DOC09(itemVO.getVariantTypeItm10DOC07());

              itemFound = true;
           }

           if (!itemFound) {
View Full Code Here


             docVO.getDocYearDoc06DOC06(),
             docVO.getDocNumberDoc06DOC06()
         );

         // retrieve ref. document item rows...
         GridPurchaseDocRowVO vo = null;
         DetailPurchaseDocRowVO refDetailVO = null;
         BigDecimal qty = null;
         BigDecimal invoiceQty = null;
         String docType = null;
         BigDecimal docYear = null;
         BigDecimal docNumber = null;
         BigDecimal rowNumber = null;
         for(int i=0;i<rows.size();i++) {
           vo = (GridPurchaseDocRowVO)rows.get(i);
           refDetailVO = rowAction.loadPurchaseDocRow(
               variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,
               new PurchaseDocRowPK(
                   docVO.getCompanyCodeSys01Doc06DOC06(),
                   docVO.getDocTypeDoc06DOC06(),
                   docVO.getDocYearDoc06DOC06(),
                   docVO.getDocNumberDoc06DOC06(),
                   vo.getItemCodeItm01DOC07(),
                   vo.getVariantTypeItm06DOC07(),
                   vo.getVariantCodeItm11DOC07(),
                   vo.getVariantTypeItm07DOC07(),
                   vo.getVariantCodeItm12DOC07(),
                   vo.getVariantTypeItm08DOC07(),
                   vo.getVariantCodeItm13DOC07(),
                   vo.getVariantTypeItm09DOC07(),
                   vo.getVariantCodeItm14DOC07(),
                   vo.getVariantTypeItm10DOC07(),
                   vo.getVariantCodeItm15DOC07()
               ),
               serverLanguageId,username
           );
           refDetailVO.setInvoiceQtyDOC07(
               refDetailVO.getInvoiceQtyDOC07().add(vo.getQtyDOC07()).setScale(docVO.getDecimalsREG03().intValue(),BigDecimal.ROUND_HALF_UP)
           );
           if (refDetailVO.getInvoiceQtyDOC07().doubleValue()>refDetailVO.getQtyDOC07().doubleValue())
             refDetailVO.setInvoiceQtyDOC07( refDetailVO.getQtyDOC07() );

           // update ref. item row...
           pstmt = conn.prepareStatement(
               "update DOC07_PURCHASE_ITEMS set INVOICE_QTY=?,LAST_UPDATE_USER=?,LAST_UPDATE_DATE=?  where "+
                   "COMPANY_CODE_SYS01=? and DOC_TYPE=? and DOC_YEAR=? and DOC_NUMBER=? and ITEM_CODE_ITM01=? and "+
                   "VARIANT_TYPE_ITM06=? and VARIANT_CODE_ITM11=? and "+
                   "VARIANT_TYPE_ITM07=? and VARIANT_CODE_ITM12=? and "+
                   "VARIANT_TYPE_ITM08=? and VARIANT_CODE_ITM13=? and "+
                   "VARIANT_TYPE_ITM09=? and VARIANT_CODE_ITM14=? and "+
                   "VARIANT_TYPE_ITM10=? and VARIANT_CODE_ITM15=? "
           );
           pstmt.setBigDecimal(1,refDetailVO.getInvoiceQtyDOC07());
           pstmt.setString(2,username);
           pstmt.setTimestamp(3,new java.sql.Timestamp(System.currentTimeMillis()));
           pstmt.setString(4,refDetailVO.getCompanyCodeSys01DOC07());
           pstmt.setString(5,refDetailVO.getDocTypeDOC07());
           pstmt.setBigDecimal(6,refDetailVO.getDocYearDOC07());
           pstmt.setBigDecimal(7,refDetailVO.getDocNumberDOC07());
           pstmt.setString(8,refDetailVO.getItemCodeItm01DOC07());

           pstmt.setString(9,refDetailVO.getVariantTypeItm06DOC07());
           pstmt.setString(10,refDetailVO.getVariantCodeItm11DOC07());
           pstmt.setString(11,refDetailVO.getVariantTypeItm07DOC07());
           pstmt.setString(12,refDetailVO.getVariantCodeItm12DOC07());
           pstmt.setString(13,refDetailVO.getVariantTypeItm08DOC07());
           pstmt.setString(14,refDetailVO.getVariantCodeItm13DOC07());
           pstmt.setString(15,refDetailVO.getVariantTypeItm09DOC07());
           pstmt.setString(16,refDetailVO.getVariantCodeItm14DOC07());
           pstmt.setString(17,refDetailVO.getVariantTypeItm10DOC07());
           pstmt.setString(18,refDetailVO.getVariantCodeItm15DOC07());

           pstmt.execute();
           pstmt.close();

           // update ref. item row in the in delivery note...
           pstmt2 = conn.prepareStatement(
               "select QTY,INVOICE_QTY,DOC_TYPE,DOC_YEAR,DOC_NUMBER,ROW_NUMBER from DOC09_IN_DELIVERY_NOTE_ITEMS where "+
               "COMPANY_CODE_SYS01=? and DOC_TYPE_DOC06=? and DOC_YEAR_DOC06=? and DOC_NUMBER_DOC06=? and ITEM_CODE_ITM01=? and INVOICE_QTY<QTY and "+
               "VARIANT_TYPE_ITM06=? and VARIANT_CODE_ITM11=? and "+
               "VARIANT_TYPE_ITM07=? and VARIANT_CODE_ITM12=? and "+
               "VARIANT_TYPE_ITM08=? and VARIANT_CODE_ITM13=? and "+
               "VARIANT_TYPE_ITM09=? and VARIANT_CODE_ITM14=? and "+
               "VARIANT_TYPE_ITM10=? and VARIANT_CODE_ITM15=? "
           );
           qty = null;
           invoiceQty = null;

           pstmt2.setString(1,refDetailVO.getCompanyCodeSys01DOC07());
           pstmt2.setString(2,refDetailVO.getDocTypeDOC07());
           pstmt2.setBigDecimal(3,refDetailVO.getDocYearDOC07());
           pstmt2.setBigDecimal(4,refDetailVO.getDocNumberDOC07());
           pstmt2.setString(5,refDetailVO.getItemCodeItm01DOC07());

           pstmt2.setString(6,refDetailVO.getVariantTypeItm06DOC07());
           pstmt2.setString(7,refDetailVO.getVariantCodeItm11DOC07());
           pstmt2.setString(8,refDetailVO.getVariantTypeItm07DOC07());
           pstmt2.setString(9,refDetailVO.getVariantCodeItm12DOC07());
           pstmt2.setString(10,refDetailVO.getVariantTypeItm08DOC07());
           pstmt2.setString(11,refDetailVO.getVariantCodeItm13DOC07());
           pstmt2.setString(12,refDetailVO.getVariantTypeItm09DOC07());
           pstmt2.setString(13,refDetailVO.getVariantCodeItm14DOC07());
           pstmt2.setString(14,refDetailVO.getVariantTypeItm10DOC07());
           pstmt2.setString(15,refDetailVO.getVariantCodeItm15DOC07());

           rset = pstmt2.executeQuery();

           // it only updates one row, that matches the where clause...
           if(rset.next()) {
             qty = rset.getBigDecimal(1);
             invoiceQty = rset.getBigDecimal(2);
             docType = rset.getString(3);
             docYear = rset.getBigDecimal(4);
             docNumber = rset.getBigDecimal(5);
             rowNumber = rset.getBigDecimal(6);
           }
           rset.close();
           pstmt2.close();

           if (qty!=null && invoiceQty!=null) {
             if (invoiceQty.doubleValue()+vo.getQtyDOC07().doubleValue()<=qty.doubleValue())
               qty = invoiceQty.add(vo.getQtyDOC07());

             pstmt = conn.prepareStatement(
                 "update DOC09_IN_DELIVERY_NOTE_ITEMS set INVOICE_QTY=?,LAST_UPDATE_USER=?,LAST_UPDATE_DATE=?  where "+
                 "COMPANY_CODE_SYS01=? and DOC_TYPE_DOC06=? and DOC_YEAR_DOC06=? and DOC_NUMBER_DOC06=? and ITEM_CODE_ITM01=? and "+
                 "DOC_TYPE=? and DOC_YEAR=? and DOC_NUMBER=? and ROW_NUMBER=? and "+
View Full Code Here

   * Callback method invoked when the user has double clicked on the selected row of the grid.
   * @param rowNumber selected row index
   * @param persistentObject v.o. related to the selected row
   */
  public void doubleClick(int rowNumber,ValueObject persistentObject) {
    GridPurchaseDocRowVO vo = (GridPurchaseDocRowVO)persistentObject;
    PurchaseDocRowPK pk = new PurchaseDocRowPK(
        vo.getCompanyCodeSys01DOC07(),
        vo.getDocTypeDOC07(),
        vo.getDocYearDOC07(),
        vo.getDocNumberDOC07(),
        vo.getItemCodeItm01DOC07(),
        vo.getVariantTypeItm06DOC07(),
        vo.getVariantCodeItm11DOC07(),
        vo.getVariantTypeItm07DOC07(),
        vo.getVariantCodeItm12DOC07(),
        vo.getVariantTypeItm08DOC07(),
        vo.getVariantCodeItm13DOC07(),
        vo.getVariantTypeItm09DOC07(),
        vo.getVariantCodeItm14DOC07(),
        vo.getVariantTypeItm10DOC07(),
        vo.getVariantCodeItm15DOC07()
    );
    ((PurchaseDocRowController)panel.getDetailPanel().getFormController()).setPk(pk);
    panel.getDetailPanel().setMode(Consts.READONLY);
    panel.getDetailPanel().executeReload();
  }
View Full Code Here

   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response deleteRecords(ArrayList persistentObjects) throws Exception {
    ArrayList pks = new ArrayList();
    PurchaseDocRowPK pk = null;
    GridPurchaseDocRowVO vo = null;
    for(int i=0;i<persistentObjects.size();i++) {
      vo = (GridPurchaseDocRowVO)persistentObjects.get(i);
      pk = new PurchaseDocRowPK(
          vo.getCompanyCodeSys01DOC07(),
          vo.getDocTypeDOC07(),
          vo.getDocYearDOC07(),
          vo.getDocNumberDOC07(),
          vo.getItemCodeItm01DOC07(),
          vo.getVariantTypeItm06DOC07(),
          vo.getVariantCodeItm11DOC07(),
          vo.getVariantTypeItm07DOC07(),
          vo.getVariantCodeItm12DOC07(),
          vo.getVariantTypeItm08DOC07(),
          vo.getVariantCodeItm13DOC07(),
          vo.getVariantTypeItm09DOC07(),
          vo.getVariantCodeItm14DOC07(),
          vo.getVariantTypeItm10DOC07(),
          vo.getVariantCodeItm15DOC07()
      );
      pks.add(pk);
    }
    Response res = ClientUtils.getData("deletePurchaseDocRows",pks);
    if (!res.isError()) {
View Full Code Here

   * Callback method invoked when the user has double clicked on the selected row of the grid.
   * @param rowNumber selected row index
   * @param persistentObject v.o. related to the selected row
   */
  public void doubleClick(int rowNumber,ValueObject persistentObject) {
    GridPurchaseDocRowVO vo = (GridPurchaseDocRowVO)persistentObject;
    PurchaseDocRowPK pk = new PurchaseDocRowPK(
        vo.getCompanyCodeSys01DOC07(),
        vo.getDocTypeDOC07(),
        vo.getDocYearDOC07(),
        vo.getDocNumberDOC07(),
        vo.getItemCodeItm01DOC07(),
        vo.getVariantTypeItm06DOC07(),
        vo.getVariantCodeItm11DOC07(),
        vo.getVariantTypeItm07DOC07(),
        vo.getVariantCodeItm12DOC07(),
        vo.getVariantTypeItm08DOC07(),
        vo.getVariantCodeItm13DOC07(),
        vo.getVariantTypeItm09DOC07(),
        vo.getVariantCodeItm14DOC07(),
        vo.getVariantTypeItm10DOC07(),
        vo.getVariantCodeItm15DOC07()
    );
    ((PurchaseInvoiceDocRowController)panel.getDetailPanel().getFormController()).setPk(pk);
    panel.getDetailPanel().setMode(Consts.READONLY);
    panel.getDetailPanel().executeReload();
  }
View Full Code Here

   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response deleteRecords(ArrayList persistentObjects) throws Exception {
    ArrayList pks = new ArrayList();
    PurchaseDocRowPK pk = null;
    GridPurchaseDocRowVO vo = null;
    for(int i=0;i<persistentObjects.size();i++) {
      vo = (GridPurchaseDocRowVO)persistentObjects.get(i);
      pk = new PurchaseDocRowPK(
          vo.getCompanyCodeSys01DOC07(),
          vo.getDocTypeDOC07(),
          vo.getDocYearDOC07(),
          vo.getDocNumberDOC07(),
          vo.getItemCodeItm01DOC07(),
          vo.getVariantTypeItm06DOC07(),
          vo.getVariantCodeItm11DOC07(),
          vo.getVariantTypeItm07DOC07(),
          vo.getVariantCodeItm12DOC07(),
          vo.getVariantTypeItm08DOC07(),
          vo.getVariantCodeItm13DOC07(),
          vo.getVariantTypeItm09DOC07(),
          vo.getVariantCodeItm14DOC07(),
          vo.getVariantTypeItm10DOC07(),
          vo.getVariantCodeItm15DOC07()
      );
      pks.add(pk);
    }
    Response res = ClientUtils.getData("deletePurchaseDocRows",pks);
    if (!res.isError()) {
View Full Code Here

TOP

Related Classes of org.jallinone.purchases.documents.java.GridPurchaseDocRowVO

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.