intuitdeveloper / sampleapp-crud_.net_oauth2 Goto Github PK
View Code? Open in Web Editor NEWSampleApp-CRUD_.Net_Oauth2
SampleApp-CRUD_.Net_Oauth2
Please rename https://github.com/IntuitDeveloper/SampleApp-CRUD_.Net_Oauth2/blob/master/SampleApp_CRUD_.Net/SampleApp_CRUD_.Net/AssemblyInfo1.cs
to https://github.com/IntuitDeveloper/SampleApp-CRUD_.Net_Oauth2/blob/master/SampleApp_CRUD_.Net/SampleApp_CRUD_.Net/AssemblyInfo.cs.
This is preventing your application from running
I am using the code in this solution as an example, but for some reason the Invoice it creates does not contain any Quantity or Price despite me specifying it.
Here is my code:
` var customerCrud = new CustomerCRUD();
// Initialize Service
QBOServiceInitializer serviceInitializer = new QBOServiceInitializer(dictionary["accesstoken"], dictionary["refreshtoken"], dictionary["realmid"]);
var serviceContext = serviceInitializer.InitializeQBOServiceContextUsingoAuth();
serviceContext.IppConfiguration.BaseUrl.Qbo = AppController.qbobaseurl;
var customer = new Customer();
customer = customerCrud.CustomerFindByEmail("[email protected]", serviceContext);
if (customer != null)
{
// Create Invoice for Customer
Customer customer2 = customer; // Helper.FindOrAdd<Customer>(serviceContext, customer);
TaxCode taxCode = Helper.FindOrAdd<TaxCode>(serviceContext, new TaxCode());
Account account = Helper.FindOrAddAccount(serviceContext, AccountTypeEnum.AccountsReceivable, AccountClassificationEnum.Liability);
Invoice invoice = new Invoice();
invoice.Deposit = new Decimal(0.00);
invoice.DepositSpecified = true;
invoice.PaymentType = PaymentTypeEnum.CreditCard;
invoice.CustomerRef = new ReferenceType()
{
name = customer.DisplayName,
Value = customer.Id
};
invoice.DueDate = DateTime.UtcNow.Date;
invoice.DueDateSpecified = true;
invoice.TotalAmt = new Decimal(10.00);
invoice.TotalAmtSpecified = true;
invoice.ApplyTaxAfterDiscount = false;
invoice.ApplyTaxAfterDiscountSpecified = true;
invoice.PrintStatus = PrintStatusEnum.NotSet;
invoice.PrintStatusSpecified = true;
invoice.EmailStatus = EmailStatusEnum.NotSet;
invoice.EmailStatusSpecified = true;
EmailAddress billEmail = new EmailAddress();
billEmail.Address = @"[email protected]";
billEmail.Default = true;
billEmail.DefaultSpecified = true;
billEmail.Tag = "Tag";
invoice.BillEmail = billEmail;
EmailAddress billEmailcc = new EmailAddress();
billEmailcc.Address = @"[email protected]";
billEmailcc.Default = true;
billEmailcc.DefaultSpecified = true;
billEmailcc.Tag = "Tag";
invoice.BillEmailCc = billEmailcc;
EmailAddress billEmailbcc = new EmailAddress();
billEmailbcc.Address = @"[email protected]";
billEmailbcc.Default = true;
billEmailbcc.DefaultSpecified = true;
billEmailbcc.Tag = "Tag";
invoice.BillEmailBcc = billEmailbcc;
invoice.Balance = new Decimal(10.00);
invoice.BalanceSpecified = true;
invoice.TxnDate = DateTime.UtcNow.Date;
invoice.TxnDateSpecified = true;
List<Line> lineList = new List<Line>();
Line line = new Line();
line.Description = "Line Item 1";
line.Amount = new Decimal(100.00);
line.AmountSpecified = true;
line.DetailType = LineDetailTypeEnum.SalesItemLineDetail;
line.DetailTypeSpecified = true;
SalesItemLineDetail salesLineItem = new SalesItemLineDetail()
{
ItemRef = new ReferenceType()
{
name = "Weekly_Meals"//,
//Value = ""
},
Qty = 1,
QtySpecified = true,
ServiceDate = DateTime.Now.Date,
ServiceDateSpecified = true,
TaxInclusiveAmt = Convert.ToDecimal(100.00)
};
// Set Price
//salesLineItem.AnyIntuitObject = orderItem.Price;
//salesLineItem.ItemElementName = ItemChoiceType.UnitPrice;
line.AnyIntuitObject = salesLineItem;
lineList.Add(line);
invoice.Line = lineList.ToArray();
invoice.TxnTaxDetail = new TxnTaxDetail()
{
TotalTax = Convert.ToDecimal(10),
TotalTaxSpecified = true
};
Invoice added = Helper.Add<Invoice>(serviceContext, invoice);`
Any help provided would be much appreciated.
Thanks,
Pete
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.