0

顧客と請求書を QuickBooks に追加しようとしていますが、どちらも表示されません。QuickBooks は次の XML で応答します。

http://pastebin.com/PLsFbA6N

顧客と請求書を追加するための私のコードは機能しているようで、エラーは表示されません。

public Customer BuildCustomerAddRq(JMAOrder _Order)
    {
        // Construct subordinate required records
        //BuildStandardTermsAddRq("Web Order");

        // build the main customer record
        Customer QBCustomerAdd = new Customer();
        var Customer = _Order.BillingAddress;
        var Billing = _Order.BillingAddress;

        PhysicalAddress phy = new PhysicalAddress();

        // if the setting is that all orders go under the same customer ID, then push 
        // the address lines down one and store the customer name on address line 1.
        if (_qboSettings.CustomerID == "SingleName")
        {
            QBCustomerAdd.DBAName = "Web Store";
            QBCustomerAdd.Email = new EmailAddress[] { new EmailAddress() { Address = "info@webstore.com", Tag = new string[] { "Business" } } };
            QBCustomerAdd.GivenName = "Web";
            QBCustomerAdd.Active = true;
            QBCustomerAdd.FamilyName = "Store";
            phy.Line1 = "Web Store";
            phy.Line2 = "";
            phy.Tag = new string[] { "Billing" };
        }

        else
        {
            //QBCustomerAdd.DBAName = GetCustId(_Order);
            QBCustomerAdd.Email = new EmailAddress[] { new EmailAddress() { Address = Customer.Email, Tag = new string[] { "Business" } } };
            QBCustomerAdd.GivenName = Customer.FirstName;
            QBCustomerAdd.Active = true;
            QBCustomerAdd.FamilyName = Customer.LastName;
            if (!String.IsNullOrEmpty(Customer.PhoneNumber))
            {
                QBCustomerAdd.Phone = new TelephoneNumber[] { new TelephoneNumber() { FreeFormNumber = Customer.PhoneNumber, Tag = new string[] { "Business" } } };
            }


            phy.Line1 = Billing.Address1;
            if (!String.IsNullOrEmpty(Billing.Address2))
            {
                phy.Line2 = Billing.Address2;
            }

            phy.City = Billing.City;
            if (Billing.RegionName != null)
            {
                phy.CountrySubDivisionCode = Billing.RegionName;
            }
            phy.PostalCode = Billing.PostalCode;
            phy.Country = Billing.CountryName;
            phy.Tag = new string[] { "Billing" };

        }

        // build add request and exit
        QBCustomerAdd.Address = new PhysicalAddress[] { phy };
        try
        {
            Customer cu = dataServices.Add(QBCustomerAdd);
            return cu;
        }
        catch (Exception ex)
        {
            ErrorMessageDataSource.Insert(new ErrorMessage(MessageSeverity.Error, "QBO", String.Format("Error adding customer : {0}", ex.ToString())));
            Customer ct = new Customer();
            return ct;

        }

Intuit Sync Manager を実行すると、新しい顧客や請求書が表示されません。QuickBooks に新しい顧客を追加することはできますか?

4

1 に答える 1

2

お客様が QuickBooks をエラー状態で入力したようです。QBCustomerAdd.Name フィールドを追加する必要がありました。

                CustomerQuery cq = new CustomerQuery();
            cq.ErroredObjectsOnly = true;
            var bList = cq.ExecuteQuery<Customer>(dataServices.ServiceContext);
于 2013-05-19T19:57:46.437 に答える