<?php
+
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
Released under the terms of the GNU General Public License, GPL,
function add_wo_costing($workorder_id, $cost_type, $trans_type, $trans_no, $factor=1)
{
+ begin_transaction(__FUNCTION__, func_get_args());
$sql = "INSERT INTO ".TB_PREF."wo_costing (workorder_id, cost_type, trans_type, trans_no, factor)
VALUES (".db_escape($workorder_id).","
.db_escape($cost_type).",".db_escape($trans_type).","
.db_escape($trans_no).",".db_escape($factor).")";
db_query($sql, "could not add work order costing");
-
+ commit_transaction();
}
function get_wo_costing($workorder_id)
function delete_wo_costing($trans_type, $trans_no)
{
+ begin_transaction(__FUNCTION__, func_get_args());
$sql="DELETE FROM ".TB_PREF."wo_costing WHERE trans_type=".db_escape($trans_type)
." AND trans_no=".db_escape($trans_no);
db_query($sql, "could not delete work order costing");
+ commit_transaction();
}
/*
//
global $Refs, $wo_cost_types;
- begin_transaction();
+ begin_transaction(__FUNCTION__, func_get_args());
$journal_id = get_next_trans_no(ST_JOURNAL);
{
global $Refs;
+ begin_transaction(__FUNCTION__, func_get_args());
$res = get_wo_costing($wo_id);
while($row = db_fetch($res))
$sql = "DELETE FROM ".TB_PREF."wo_costing WHERE workorder_id=".db_escape($wo_id);
db_query($sql, "could not delete work order costing");
+ commit_transaction();
}