Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8122

Create a Instance in the SupplierInvoice business object

$
0
0

Hi All community,

 

I need to register correctly on the SupplierInvoice business object.

I followed the steps in the PSM without success.

 

Thi's my code.

 

var SI_Root:elementsof SupplierInvoice;

// Nodo Root - SupplierInvoice

SI_Root.TypeCode= "004";// Set document type to Invoice
SI_Root.Date= Context.GetCurrentSystemDate();

SI_Root.TransactionDate = Context.GetCurrentSystemDate();

SI_Root.ReceiptDate= Context.GetCurrentSystemDate();
SI_Root.Name.content= "Liquidity for supplier";

SI_Root.DocumentItemsGrossAmountIndicator = false;

// Root node creation

var SI = SupplierInvoice.Create(SI_Root);

if (SI.IsSet()){

 

 

// Set External Document ID

var BTDRef: elementsof SupplierInvoice.BusinessTransactionDocumentReference;

BTDRef.BusinessTransactionDocumentReference.ID.content = "001-002-003004";

SI.CustomerInvoiceReference.Create(BTDRef);

 

 

// Set Supplier ID

var SI_SParty:elementsof SupplierInvoice.Party;

SI_SParty.PartyKey.PartyID.content = "C-002";

SI.SellerParty.Create(SI_SParty);

 

 

// Set Bill-To Party

var SI_BParty:elementsof SupplierInvoice.Party;

SI_BParty.PartyKey.PartyID.content = "33053";

SI.BuyerParty.Create(SI_BParty);

 

 

//Posicion

var SI_Item:elementsof SupplierInvoice.Item;

SI_Item.Description.content = "Liquidacion 41";// description

SI_Item.Quantity.content= 1;
SI_Item.Quantity.unitCode= "EA";

SI_Item.NetUnitPrice.BaseQuantity.content = 1;

SI_Item.NetUnitPrice.Amount.content = "400";

var SI_Item1 = SI.Item.Create(SI_Item);

if (SI_Item1.IsSet()){

SI_Item1.ItemProduct.ProductKey.ProductTypeCode = "1"; // type product

SI_Item1.ItemProduct.ProductKey.ProductID.content = "195";// product id

SI_Item1.TaxCalculationItem.CountryCode = "EC";

SI_Item1.TaxCalculationItem.TaxationCharacteristicsCode.content = "10";

foreach(var inst in SI_Item1.ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment){

inst.GeneralLedgerAccountAliasCode.content = "Z-0068"; //Accounting leader

inst.AccountingCodingBlockTypeCode.content = "CC"; //Accounting type

inst.CostCentreID  = "10100"; // cost center

inst.CostObjectKey.CostObjectID = "10100";

inst.CostObjectKey.CostObjectTypeCode = "1";

}

}

 

 

SI_Root.GrossAmount.content= "412";

SI_Root.TaxAmount.content = "12";

 

 

SI.FinishDataEntryProcessing();

 

 

------

the instance has been registered with errors.

If someone already registry and help me please.

 

 

Thanks in advance,

Best regards,

Joe.


Viewing all articles
Browse latest Browse all 8122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>