Method Community

 

Sales Order vs Sales Receipt vs Invoice

Last post 02-20-2015 12:07 PM by Method_Alexander. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-18-2015 11:28 AM

    Sales Order vs Sales Receipt vs Invoice

    We are currently working on integration with our e-commerce website and a daily dump of client sales.

    We started working on having the AI insert the sales as invoices but these are full paid items not ones with balances so we started working them as sales orders that are full paid for but what we are running into is we are not able to edit the amount field is the table sales order line. 

    I can not seem to locate where to change this to allow the addition of line items 

    Please help 

  • 02-19-2015 9:53 AM In reply to

    Re: Sales Order vs Sales Receipt vs Invoice

    StickerBrad,

    Since you are inserting already paid items, You'll want to look at using Sales Receipts rather than Sales Orders.  You'll first create the Sales Receipt header (Table = SalesReceipts), and then insert the items purchased as Sales Receipt Lines (Table = SalesReceiptLines)  The total from the Sales Receipt Lines will add up to create the total amount for the Sales Receipt.
    I've attached a code snippet of how to accomplish this.

    var MAPIsvc = new MethodAPIService.Service();
    string account = txtAccountName.Text;
    string email = txtLoginEmail.Text;
    string pwd = txtLoginPassword.Text;
    string recordId = "";
    string tablename = "SalesReceipt";
    string[ fields = "Customer,BillAddressAddr1,DueDate,TxnDate".Split(',');
    string[ values = "Angy Trees,123 Fake St,2015-01-01 12:00:00,2015-01-01 12:00:00".Split(',');
    txtResponse.Text = MAPIsvc.MethodAPIInsert(account, email, pwd, tablename, fields, values, ref recordId);

    tablename = "SalesReceiptLine";
    fields = "SalesReceiptRecordID,Item,Quantity,Rate,SalesTaxCode".Split(',');
    values = (recordId+",Hours,10,10,NON").Split(',');
    txtResponse.Text = MAPIsvc.MethodAPIInsert(account, email, pwd, tablename, fields, values, ref recordId);

  • 02-19-2015 10:08 AM In reply to

    Re: Sales Order vs Sales Receipt vs Invoice

    Thanks for this. 

    We are also having the API look for leads entered by the sales staff and then converting them to clients once it shown as sold 

    Could we still work int his fashion

  • 02-20-2015 12:07 PM In reply to

    Re: Sales Order vs Sales Receipt vs Invoice

    StickerBrad,

    Yes you should still be able to convert a lead to a customer by updating the lead status to false. You need to use MethodAPIUpdateV2 to set IsLeadStatusOnly to false where the RecordID matches the lead you want to convert into a customer. Here’s some sample c# code that does this:

                var MAPIsvc = new MethodAPIService.Service();
                string account = txtAccountName.Text;
                string email = txtLoginEmail.Text;
                string pwd = txtLoginPassword.Text;
                string RecordID_To_Update = "446";
                string tablename = "Customer";
                string[ updatefields = "IsLeadStatusOnly".Split(',');
                string[ updatevalues = "false".Split(',');
                txtResponse.Text = MAPIsvc.MethodAPIUpdateV2(account, email, pwd, "", tablename, updatefields, updatevalues,RecordID_To_Update);
Page 1 of 1 (4 items)