How to create invoice in netsuite using suitetalk?

左心房为你撑大大i 提交于 2019-11-26 23:40:57

问题


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);
        }

来源:https://stackoverflow.com/questions/52686093/how-to-create-invoice-in-netsuite-using-suitetalk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!