Kişi bilgileri gizlidir. Logo çalışanları görebilir.

Take back mode

  j-Platform/LPT

How can i Open my invoice slip in Take Back mode from code ?


LPT


Kişi bilgileri gizlidir. Logo çalışanları görebilir.
.) public void onClicktest(JLbsXUIControlEvent event){
      try {
            createReturnSlip(event.getContainer(), event.getData(), event.getClientContext());
           } catch (ObjectFactoryException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
           } catch (QueryFactoryException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
           } catch (SessionTimeoutException e) {
              // TODO Auto-generated catch block
             e.printStackTrace();
           } catch (SessionReestablishedException e) {
              // TODO Auto-generated catch block
               e.printStackTrace();
           } catch (ContractException e) {
              // TODO Auto-generated catch block
                    e.printStackTrace();
             } catch (LbsLocalizableException e) {
               // TODO Auto-generated catch block
                    e.printStackTrace();
 }
         }     
 public boolean createReturnSlip(ILbsXUIPane container, Object data, IClientContext context) throws ObjectFactoryException, QueryFactoryException, SessionTimeoutException, SessionReestablishedException, ContractException, LbsLocalizableException
       {
             final LOBOInvoice invoice = (LOBOInvoice)UnityHelper.getBOByReference(context, LOBOInvoice.class, 9);
            if(!LOHelper.validateReturnSlip(container, context, invoice, 0))
                    return false;
            boolean isLocked = UnityHelper.lockBO(context, LOBOInvoice.LockIdTemplate,9);
             if (!isLocked)
                    return false;
             int returnInvoiceType = LOHelper.getReturnInvoiceType(invoice.getInvoiceType());
             String contractId = LOHelper.getContract(JLbsXUITypes.XUIMODE_DBENTRY, LOConstants.CONTRACTS_INVOICE, returnInvoiceType);
             InvoiceInput input = new InvoiceInput();
             input.setTypeInfo(returnInvoiceType);
             input.setFromWhere(LOConstants.INV_CREATERETURNINVOICE);
             input.setSourceInvoiceRef(9);
             Hashtable<String, String> props = new Hashtable<String, String>();
             props.put("Modal", "true");
             ContractParameter[] contracts = new ContractParameter[] { new ContractParameter(input, "input") }
             try
             {  AppletContractService.executeContract(context, contractId, new IContractCallback()
                    {  public void onComplete(IClientContext context, ContractParameter... outputs)
                           {   ObjectIdentifier boId = AppletContractListenerBase.findBOIdentifier(outputs);
                          }
               public void onException(IClientContext context, ContractExceptionEvent event)
                           {
                           }
      
                    }, props, contracts);
             }
             finally
             {
                    if(UnityHelper.isBOLocked(context, LOBOInvoice.LockIdTemplate, 9)) // do not use isLocked variable. If invoice is saved, LOLHInvoice will unlock, so check last lock state.
                           UnityHelper.unlockBO(context, LOBOInvoice.LockIdTemplate, 9);
             }
           return true;
       }

 


10/02/16 15:42

Cevap vermek için giriş yapmanız gerekmektedir.