0

特定の顧客の新しい請求書を挿入する必要があります。挿入することはできますが、複数の項目を請求書に挿入する方法がわかりません。プロパティ Items および ItemsElementName を使用して複数の項目を挿入する方法。私の質問が不明な場合は、お知らせください。参照用にスナップショットとコードを添付しました。

コード:

protected void btnsendInvoiceDetails_Click(object sender, EventArgs e)
        {
                string accessToken = "lvprdRM1HLr6o11Bnip2fGizlXWbFfADnS1Btvm2L4VPOTRI";
                string appToken = "297db54bb5526b494adb86fb2a41063192cd";
                string accessTokenSecret = "JfSTrprW83JTXrSVHD3uf7th23gP0SOzBQcn4Nrt";
                string consumerKey = "qyprdKLN5YHpCPSlWQZTiKVc28dywR";
                string consumerSecret = "JPMNB37YnCPGU9m9vuXkF2M71lbDb7blhcLB7HeF";
                string companyID = "813162085";
                OAuthRequestValidator oauthValidator = new OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey, consumerSecret);
                ServiceContext context = new ServiceContext(oauthValidator,appToken,companyID, IntuitServicesType.QBO);
                DataServices service = new DataServices(context);

                InvoiceHeader a = new InvoiceHeader();
                a.CustomerName = "Antivirus Norton Security";
                a.CustomerId = new IdType { idDomain = idDomainEnum.QBO, Value = "6" };
                a.TotalAmt = 157.00m;
                a.SubTotalAmt = 37.00m;
                a.ShipMethodName = "Gmail";
                a.ShipMethodId = new IdType { idDomain = idDomainEnum.QBO, Value = "41" };
                a.DocNumber = "1040";
                a.DueDateSpecified = true;
               // a.Item = 10.00m;
               //a.ItemElementName = ItemChoiceType2.DiscountAmt;
                DateTime dt = Convert.ToDateTime("08/07/2013");
                a.DueDate = dt;

                InvoiceLine mnm = new InvoiceLine();
                mnm.Desc = "Antivirus Norton Security The Best Security ";
                mnm.Id = new IdType { idDomain = idDomainEnum.QBO, Value = "25" };
                mnm.Amount = 65.00m;
                mnm.AmountSpecified = true;
               // mnm.Items = "Europe";
               //mnm.ItemsElementName = "Zebronic";
                InvoiceLine[] invline = new InvoiceLine[] { mnm };
                var invoices = new Intuit.Ipp.Data.Qbo.Invoice();
                invoices.Header = a;
                invoices.Line = invline;
                var addedInvoice = service.Add(invoices);
                var qboInvoices = service.FindAll(invoices, 1,10);
                foreach (var qboinv in qboInvoices)
                {
                    string id = Convert.ToString(qboinv.Id.Value);
                }
                GridView1.DataSource = invoices;
                GridView1.DataBind();
        }

画像:

ここに画像の説明を入力

4

1 に答える 1

0

これを試して:

InvoiceLine i = new InvoiceLine();
i.ItemsElementName = new ItemsChoiceType2[1];
i.ItemsElementName[0] = ItemsChoiceType2.ItemId;
i.Items = new Intuit.Ipp.Data.Qbd.IdType[1];
i.Items[0] = new Intuit.Ipp.Data.Qbd.IdType() { idDomain = Intuit.Ipp.Data.Qbd.idDomainEnum.QBO, Value = "6" };
于 2013-10-10T09:17:51.763 に答える