1
I have 3 items Accessories, Tires and Vehicles, the values are added to a maintenance screen that is the main one. The problem is that when it is to change only one of the items, the added value is just what I selected. But it is not updated with the other values
var TotalVeiculo;
var TotalAcessorio;
var TotalPneu;
function Somatorio(){
TotalVeiculo = TotalVeiculo != undefined?TotalVeiculo:0;
TotalAcessorio = TotalAcessorio != undefined?TotalAcessorio:0;
TotalPneu = TotalPneu != undefined?TotalPneu:0;
vmObjeto.selecionado.VlrTotalManutencao = (TotalVeiculo + TotalAcessorio + TotalPneu);
$("#total").html("R$ " + vmObjeto.selecionado.VlrTotalManutencao + ",00");
}
function RetornoItemsa(aTela, aItens, pneu, total, quantia) {
var window = $(aTela).data("kendoWindow");
window.close();
ItensVeiculos = aItens;
TotalVeiculo = parseFloat(total);
$("#btnItensVeiculos").html(" Veículos("+quantia+")");
Somatorio();
};
function RetornoItemsb(aTela, aItens, pneu, total, quantia) {
var window = $(aTela).data("kendoWindow");
window.close();
ItensAcessoriosVeiculos = aItens;
TotalAcessorio = parseFloat(total);
$("#btnItensAcessoriosVeiculos").html("Acessórios ("+quantia+")");
Somatorio();
};
function RetornoItemsc(aTela, aItens, pneu, total, quantia) {
var window = $(aTela).data("kendoWindow");
window.close();
ItensPneusVeiculos = aItens;
TotalPneu = parseFloat(total);
$("#btnItensPneusVeiculos").html("Pneus ("+quantia+")");
Somatorio();
};
The question is missing code. Can you do a jsFiddle and [edit] the question to put it together? So it’s easy to help.
– Sergio
Actually my problem is in this part, the retonositem a, b, and c, comes from another window all with total parameters, which will be stored in the var Vlrtotalmanutenção. Then I say that Vlrtotalmanutenion is equal to the total of all items. Let’s say I just want to add the accessory item, the other items "Tires and vehicles" can’t be added tbm. It’s like the values don’t update c.
– Maikon Michael