dot-nugget

Code and Knowledgebase Site

Code and Knowledgebase Site for Rumery Enterprises, LLC. Tampa Bay area custom software developer

get magento invoice entity using order id c#

clock November 1, 2011 10:41 by author

Couldn't find a c# example so I created one.  A customer wanted to pull notes from an Invoice to place in SAGE when the processing orders were being pulled down via the v2 API.

//pass in the order_id value from your salesOrderEntity object.

 public salesOrderInvoiceEntity[] GetSalesOrders(string orderID)
        {
            if (string.IsNullOrEmpty(this.SessionId))
                this.Login();

            filters listFilters = null;

            complexFilter cFilter = new complexFilter();

            cFilter.key = "order_id";
            cFilter.value = new associativeEntity
            {
                key = "equal",
                value = orderID
            };

            listFilters = new filters();
            listFilters.complex_filter = new complexFilter[] { cFilter };

            salesOrderInvoiceListRequest req = new salesOrderInvoiceListRequest(this.SessionId, listFilters);
            return magentoService.salesOrderInvoiceList(req).result;
        }


//I Only need the last comment but you can return the salesOrderInvoiceCommentEntity object and parse all that the invoice has.
  public string  GetInvoiceComments(string id)
        {
            if (string.IsNullOrEmpty(this.SessionId))
                this.Login();
            salesOrderInvoiceInfoResponse req = magentoService.salesOrderInvoiceInfo(new salesOrderInvoiceInfoRequest(this.SessionId, id));
            if (req.result.comments != null)
                return req.result.comments[0].comment;
            else
                return string.Empty;

        }

 

 

 



Obout Grid v6.0.4 Programmatic only filter

clock March 14, 2010 12:25 by author
add java script function filterGrid(ddl) { if (ddl.value == '*') { Grid1.removeFilter(); } else { Grid1.addFilterCriteria('AccountRep', OboutGridFilterCriteria.EqualTo, ddl.value); Grid1.executeFilter(); } } set grid to AllowFiltering="True" and FilterType="ProgrammaticOnly" if (!Page.IsPostBack) { ddlReps.Attributes["onchange"] = "filterGrid(this)"; }


Sign in