Beispiel #1
0
 /**
  * Customizing the Delete procedure.
  */
 function trash($module, $recordId)
 {
     $status = getInvoiceStatus($recordId);
     if ($status != 'Cancel') {
         addProductsToStock($recordId);
     }
     parent::trash($module, $recordId);
 }
Beispiel #2
0
 function trash($module, $record)
 {
     global $adb;
     parent::trash($module, $record);
     if (vtlib_isModuleActive('TCTotals')) {
         include_once 'modules/TCTotals/TCTotalsHandler.php';
         $tcdata = $adb->query("select smownerid,date_start from vtiger_timecontrol inner join vtiger_crmentity on crmid=timecontrolid where timecontrolid={$record}");
         $workdate = $adb->query_result($tcdata, 0, 'date_start');
         $tcuser = $adb->query_result($tcdata, 0, 'smownerid');
         TCTotalsHandler::updateTotalTimeForUserOnDate($tcuser, $workdate);
     }
 }
Beispiel #3
0
 /**
  * Customizing the Delete procedure.
  */
 function trash($module, $recordId)
 {
     global $adb;
     $result = $adb->pquery("SELECT postatus FROM vtiger_purchaseorder where purchaseorderid=?", array($recordId));
     $poStatus = $adb->query_result($result, 0, 'postatus');
     if ($poStatus == 'Received Shipment') {
         deductProductsFromStock($recordId);
     }
     parent::trash($module, $recordId);
 }
Beispiel #4
0
 /**
  * Customizing the Delete procedure.
  */
 function trash($module, $recordId)
 {
     global $adb;
     $result = $adb->pquery("SELECT sostatus FROM vtiger_salesorder where salesorderid=?", array($recordId));
     $soStatus = $adb->query_result($result, 0, 'sostatus');
     if ($soStatus != 'Cancelled') {
         addProductsToStock($recordId);
     }
     parent::trash($module, $recordId);
 }
Beispiel #5
0
 function trash($module, $record)
 {
     global $adb;
     parent::trash($module, $record);
     $rs = $adb->pquery("select related_id,parent_id from vtiger_cobropago where cobropagoid=?", array($record));
     if ($rs and $adb->num_rows($rs) == 1) {
         $relatedId = $adb->query_result($rs, 0, 'related_id');
         $pid = $adb->query_result($rs, 0, 'parent_id');
         if (!empty($relatedId) and self::invoice_control_installed()) {
             Invoice::updateAmountDue($relatedId);
         }
         // Calculate related module balance
         CobroPago::calculateRelatedTotals($pid);
     }
 }
Beispiel #6
0
 /**
  * Customizing the Delete procedure.
  */
 function trash($module, $recordId)
 {
     global $adb;
     $result = $adb->pquery("SELECT invoicestatus FROM vtiger_invoice where invoiceid=?", array($recordId));
     $invoiceStatus = $adb->query_result($result, 0, 'invoicestatus');
     if ($invoiceStatus != 'Cancel') {
         addProductsToStock($recordId);
     }
     parent::trash($module, $recordId);
 }