897: where boe_id = to_number(cv_document_no)
898: and exists
899: (
900: select 1
901: from jai_boe_roundings
902: where boe_id = head.boe_id
903: and nvl(rounding_amount,0)>0
904: );
905:
4514:
4515:
4516: --------------------------------------------------------------------------------------------
4517:
4518: delete from jai_boe_roundings
4519: where boe_id = boe_rec.boe_id;
4520:
4521: for new_tax_line in get_boe_tax_rec(boe_rec.boe_detail_id)
4522: loop
4519: where boe_id = boe_rec.boe_id;
4520:
4521: for new_tax_line in get_boe_tax_rec(boe_rec.boe_detail_id)
4522: loop
4523: update jai_boe_roundings
4524: set tax_amount = tax_amount + new_tax_line.tax_amount,
4525: total_amount = total_amount + new_tax_line.tax_amount,
4526: last_update_date = SYSDATE,
4527: last_updated_by = v_user_id,
4529: where boe_id = boe_rec.boe_id
4530: and tax_id = new_tax_line.tax_id;
4531:
4532: if(sql%notfound)then
4533: insert into jai_boe_roundings
4534: (
4535: boe_id,
4536: tax_amount,
4537: total_amount,
4552: v_user_id,
4553: sysdate,
4554: v_user_id,
4555: v_login_id,
4556: JAI_BOE_ROUNDINGS_S.nextval,
4557: new_tax_line.tax_id
4558:
4559: );
4560: end if;