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