sage-portugal / 50c-API

Sage 50c API e eXtensibilidade
11 stars 4 forks source link

Preços Errados #20

Closed BrunoSande closed 3 years ago

BrunoSande commented 3 years ago

Boa Tarde, ao tentar criar um artigo onde tenha várias linhas de preço, neste caso 5 com possibilidade a 10, ao fazer o código do sample, a primeira linha é criada como deve ser, todas as outras a criação do preço é errada. Deixo aqui o código que estou a usar:

// inicia as linhas de preços do artigo newItem.InitPriceList(dsoPriceLine.GetPriceLineRS());

// Preço dos artigo (linha de preço=1)
Price myPrice1 = newItem.SalePrice(1, 0, string.Empty, 0, APIEngine.SystemSettings.SystemInfo.ItemDefaultUnit);
// preços de venda1 
myPrice1.TaxIncludedPrice = b.precovenda.ToString.Replace(",", ".");
myPrice1.UnitPrice = APIEngine.DSOCache.TaxesProvider.GetItemNetPrice(myPrice1.TaxIncludedPrice, newItem.TaxableGroupID, systemSettings.SystemInfo.DefaultCountryID, systemSettings.SystemInfo.TaxRegionID);

Price myPrice2 = newItem.SalePrice(2, 0, string.Empty, 0, APIEngine.SystemSettings.SystemInfo.ItemDefaultUnit);
// preços de venda2 
myPrice2.TaxIncludedPrice = b.pvp2.ToString.Replace(",", ".");
myPrice2.UnitPrice = APIEngine.DSOCache.TaxesProvider.GetItemNetPrice(myPrice2.TaxIncludedPrice, newItem.TaxableGroupID, systemSettings.SystemInfo.DefaultCountryID, systemSettings.SystemInfo.TaxRegionID);

Price myPrice3 = newItem.SalePrice(3, 0, string.Empty, 0, APIEngine.SystemSettings.SystemInfo.ItemDefaultUnit);
// preços de venda3 
myPrice3.TaxIncludedPrice = b.pvp3.ToString.Replace(",", ".");
myPrice3.UnitPrice = APIEngine.DSOCache.TaxesProvider.GetItemNetPrice(myPrice3.TaxIncludedPrice, newItem.TaxableGroupID, systemSettings.SystemInfo.DefaultCountryID, systemSettings.SystemInfo.TaxRegionID);

Price myPrice4 = newItem.SalePrice(4, 0, string.Empty, 0, APIEngine.SystemSettings.SystemInfo.ItemDefaultUnit);
// preços de venda4 
myPrice4.TaxIncludedPrice = b.pvp4.ToString.Replace(",", ".");
myPrice4.UnitPrice = APIEngine.DSOCache.TaxesProvider.GetItemNetPrice(myPrice4.TaxIncludedPrice, newItem.TaxableGroupID, systemSettings.SystemInfo.DefaultCountryID, systemSettings.SystemInfo.TaxRegionID);

Price myPrice5 = newItem.SalePrice(5, 0, string.Empty, 0, APIEngine.SystemSettings.SystemInfo.ItemDefaultUnit);
// preços de venda 
myPrice5.TaxIncludedPrice = b.pvp5.ToString.Replace(",", ".");
myPrice5.UnitPrice = APIEngine.DSOCache.TaxesProvider.GetItemNetPrice(myPrice5.TaxIncludedPrice, newItem.TaxableGroupID, systemSettings.SystemInfo.DefaultCountryID, systemSettings.SystemInfo.TaxRegionID);

Aparentemente ele multiplica o resultado por 100 sem ser na linha 1. 1

vinha por este meio pedir a vossa ajuda.

sem outro assunto de momento cumprimentos Bruno Sande