Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
840 views
in Technique[技术] by (71.8m points)

api - How to create invoice in netsuite using suitetalk?

Thanks for reading this topic, i would appreciate if someone from netsuite can share with me solution of below issue.

I am creating invoice?in netsuite web portal with the customer that doesn't have credit limit, i have added inventory item and then payment item of that items it's working very well and i am very happy. but when i am going to create the same thing using suitetalk webservices it's showing me below error.

[Code=USER_ERROR] Customer balance exceeds credit limit

[Code=WARNING] Customer balance of 23.52 exceeds credit limit of 0.01.

[Code=WARNING] Customer balance of 23.52 exceeds credit limit of 0.01.

please have a look the source code:

        Invoice invoice = new Invoice();
                
        invoice.entity = new RecordRef() { internalId = "5967", type = RecordType.customer, typeSpecified = true };
        invoice.tranDate = DateTime.UtcNow;
        invoice.memo = "TEST0001";
        invoice.department = new RecordRef() { internalId = "2", type = RecordType.department, typeSpecified = true };
        invoice.location = new RecordRef() { internalId = "1", type = RecordType.location, typeSpecified = true };

        InvoiceItemList invoiceItemList = new InvoiceItemList();
        List<InvoiceItem> invoiceItems = new List<InvoiceItem>();

        // payment item
        invoiceItems.Add(new InvoiceItem()
        {
            item = new RecordRef() { internalId = "62374" },
            rate = (25 * -1).ToString(),
            price = new RecordRef() { internalId = "-1", type = RecordType.priceLevel, typeSpecified = true },
            taxCode = new RecordRef() { internalId = "16", type = RecordType.taxGroup, typeSpecified = true }
        });

        // inventory or other items
        InvoiceItem invoiceItem = new InvoiceItem();
        invoiceItem.item = new RecordRef() { internalId = "59852" };
        invoiceItem.rate = "25";
        invoiceItem.quantity = 1;
        invoiceItem.quantitySpecified = true;
        invoiceItem.taxCode = new RecordRef() { internalId = "16", type = RecordType.taxGroup, typeSpecified = true };
        invoiceItem.price = new RecordRef() { internalId = "-1", type = RecordType.priceLevel, typeSpecified = true };            

        invoiceItems.Add(invoiceItem);

        invoiceItemList.item = invoiceItems.ToArray();
        invoice.itemList = invoiceItemList;

        WriteResponse writeRes = Client.Service.add(invoice);
        if (writeRes.status != null && writeRes.status.isSuccess)
        {
            string baseRef = ((RecordRef)writeRes.baseRef).internalId;
        }
        else
        {
            string response = Client.GetStatusDetails(writeRes.status);
            MessageBox.Show(response);
        }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...