Привет, у меня проблема со статусом.Пример: vendBudget = 1000.00 и totBaseCost = 1000.01, он должен быть НЕ БЮДЖЕТИРОВАН, но я думаю, что он получает только целое число.
totBaseCost = mbo.getDouble("TOTALBASECOST")
totBaseCost1 = "%.2f" % float(totBaseCost)
#totBaseCost1 = "%.2f" % totBaseCost
budgetSet = mbo.getMboSet("BUDGET")
availBudget = 0
if budgetSet is not None:
budgetMbo = budgetSet.getMbo(0)
totBudgetAmount = budgetMbo.getFloat("C1BUDTOTCOST")
estTotCost = budgetMbo.getMboSet("C1ESTTOTCOSE").sum("LINECOST")
comTotCost = budgetMbo.getMboSet("C1COMMITTED").sum("LINECOST")
actTotCost = budgetMbo.getMboSet("C1ACTTOTCOST").sum("LINECOST")
#Available Budget
availBudget = float(totBudgetAmount) - float(estTotCost) - float(comTotCost) - float(actTotCost)
availBudget = "%.3f" % availBudget
if availBudget < 0:
availBudget = abs(availBudget)
if (totBaseCost1) > availBudget and availBudget <> 0:
mbo.setValue("C1BUDGETSTATUS","",11L)
mbo.setValue("C1BUDGETSTATUS","UNBUDGETED",11L)
elif (totBaseCost1) <= availBudget:
mbo.setValue("C1BUDGETSTATUS","",11L)
mbo.setValue("C1BUDGETSTATUS","BUDGETED",11L)
elif str(totBaseCost1) == "0.00" and str(availBudget) <> "0.00":
mbo.setValue("C1BUDGETSTATUS","",11L)
mbo.setValue("C1BUDGETSTATUS","BUDGETED",11L)