Atualizando arquivos
This commit is contained in:
parent
584399aa18
commit
d3451a33bf
1 changed files with 22 additions and 2 deletions
|
|
@ -93,8 +93,28 @@ try{
|
|||
/** Verifica se o cadastro do orçamento foi bem sucedido */
|
||||
if($budgetsId > 0){
|
||||
|
||||
/** Atualiza o valor do produto do orçamento */
|
||||
$ProductsCompanies->UpdateValueProduct($CompaniesBudgetsValidate->getcompanyId(), $CompaniesBudgetsValidate->getProductsId(), $CompaniesBudgetsValidate->getReadjustmentBudget());
|
||||
//Lista os itens com array
|
||||
$itens = json_decode($CompaniesBudgetsValidate->getProductsId());
|
||||
|
||||
//Verifica se mais de um item foi informado
|
||||
if(count($itens) > 1){
|
||||
|
||||
//Atualiza os itens do orçamento
|
||||
for($i=0; $i < count($itens); $i++){
|
||||
|
||||
/** Atualiza o valor do produto do orçamento */
|
||||
$ProductsCompanies->UpdateValueProduct($CompaniesBudgetsValidate->getcompanyId(),
|
||||
$itens[$i],
|
||||
$CompaniesBudgetsValidate->getReadjustmentBudget()/(count($itens)));
|
||||
}
|
||||
|
||||
}else {
|
||||
|
||||
/** Atualiza o valor do produto do orçamento */
|
||||
$ProductsCompanies->UpdateValueProduct($CompaniesBudgetsValidate->getcompanyId(),
|
||||
$itens[0],
|
||||
$CompaniesBudgetsValidate->getReadjustmentBudget());
|
||||
}
|
||||
|
||||
/** Prepara o retorno */
|
||||
$procedure = '<script type="text/javascript">';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue