/** * Mark staging item as void (delete item) * @return CActiveRecord[] */ public static function MarkStagingItemAsVoid($ap_id) { // get staging POs if ($ap_id != 0) { $ap=Aps::model()->findByPk($ap_id); $ap->Vendor_ID = 0; $ap->AP_Approval_Value = 100; $ap->Previous_AP_A_Val = 1; $ap->Approved = 1; //$ap->Invoice_Amount = 0; ???? if ($ap->validate()) { // begin transaction $transaction = Yii::app()->db->beginTransaction(); try { Pos::generatePdfAddVoid($ap->Document_ID); $ap->save(); $transaction->commit(); } catch(Exception $e) { $transaction->rollback(); } } } }
/** * Mark staging item as void (delete item) * @return CActiveRecord[] */ public static function MarkStagingItemAsVoid($po_id) { // get staging POs if ($po_id != 0) { $po=Pos::model()->findByPk($po_id); $po->Vendor_ID = 0; $po->PO_Approval_Value = 100; $po->PO_Previous_PO_Val = 1; $po->PO_Approved = 1; $po->Sign_Requested_By = 0; $po->Sign_Dept_Approval = 0; $po->Sign_Accounting = 0; if ($po->validate()) { // begin transaction $transaction = Yii::app()->db->beginTransaction(); try { Pos::generatePdfAddVoid($po->Document_ID); $po->save(); $transaction->commit(); } catch(Exception $e) { $transaction->rollback(); } } } }