public String getBFNNumber(LineItemOrder lineItemOrder) {
   List<SupplierReferenceInformation> supplierReferenceInformationList =
       lineItemOrder.getSupplierReferenceInformation();
   if (supplierReferenceInformationList != null && supplierReferenceInformationList.size() > 0) {
     for (int i = 0; i < supplierReferenceInformationList.size(); i++) {
       SupplierReferenceInformation supplierReferenceInformation =
           supplierReferenceInformationList.get(i);
       List<SupplierLineItemReference> supplierLineItemReferenceList =
           supplierReferenceInformation.getSupplierLineItemReference();
       if (supplierLineItemReferenceList != null && supplierLineItemReferenceList.size() > 0) {
         SupplierLineItemReference supplierLineItemReferenceRef =
             supplierLineItemReferenceList.get(0);
         String supplierOrderLine = supplierLineItemReferenceRef.getSuppliersOrderLine();
         String vendorItemReference = supplierLineItemReferenceRef.getVendorReferenceNumber();
         if (supplierOrderLine.equals("BFN")) {
           return vendorItemReference;
         }
       }
     }
   }
   return null;
 }
  private Integer getPurchaseOrderNumber(LineItemOrder lineItemOrder) throws Exception {
    if (lineItemOrder.getSupplierReferenceInformation() != null
        && lineItemOrder.getSupplierReferenceInformation().size() > 0) {
      for (int i = 0; i < lineItemOrder.getSupplierReferenceInformation().size(); i++) {
        if (lineItemOrder.getSupplierReferenceInformation().get(i).getSupplierLineItemReference()
                != null
            && lineItemOrder
                    .getSupplierReferenceInformation()
                    .get(i)
                    .getSupplierLineItemReference()
                    .size()
                > 0) {
          for (int j = 0;
              j
                  < lineItemOrder
                      .getSupplierReferenceInformation()
                      .get(i)
                      .getSupplierLineItemReference()
                      .size();
              j++) {
            if (lineItemOrder
                        .getSupplierReferenceInformation()
                        .get(i)
                        .getSupplierLineItemReference()
                        .get(j)
                        .getSuppliersOrderLine()
                    != null
                && (lineItemOrder
                        .getSupplierReferenceInformation()
                        .get(i)
                        .getSupplierLineItemReference()
                        .get(j)
                        .getSuppliersOrderLine()
                        .equals("ON")
                    || lineItemOrder
                        .getSupplierReferenceInformation()
                        .get(i)
                        .getSupplierLineItemReference()
                        .get(j)
                        .getSuppliersOrderLine()
                        .equals("LI"))) {
              try {
                if (lineItemOrder
                            .getSupplierReferenceInformation()
                            .get(i)
                            .getSupplierLineItemReference()
                            .get(j)
                            .getVendorReferenceNumber()
                        != null
                    && isNumeric(
                        lineItemOrder
                            .getSupplierReferenceInformation()
                            .get(i)
                            .getSupplierLineItemReference()
                            .get(j)
                            .getVendorReferenceNumber())) {
                  return Integer.parseInt(
                      lineItemOrder
                          .getSupplierReferenceInformation()
                          .get(i)
                          .getSupplierLineItemReference()
                          .get(j)
                          .getVendorReferenceNumber());
                } else {
                  return 0;
                }

              } catch (Exception e) {
                LOG.error(
                    "Purchase Order Number should be a number but invoice file has :"
                        + lineItemOrder
                            .getSupplierReferenceInformation()
                            .get(i)
                            .getSupplierLineItemReference()
                            .get(j)
                            .getVendorReferenceNumber());
                throw new Exception(
                    "Purchase Order Number should be a number but invoice file has :"
                        + lineItemOrder
                            .getSupplierReferenceInformation()
                            .get(i)
                            .getSupplierLineItemReference()
                            .get(j)
                            .getVendorReferenceNumber(),
                    e);
              }
            }
          }
        }
      }
    }
    /*if(invOrder.getMessage().getPurchaseOrderQualifier() != null){
        if(invOrder.getMessage().getPurchaseOrderQualifier().getPurchaseOrderReference() != null){
            return Integer.parseInt(invOrder.getMessage().getPurchaseOrderQualifier().getPurchaseOrderReference().getPurchaseOrderNumber());
        }
    }*/
    return null;
  }