当前位置: 首页>>代码示例>>PHP>>正文


PHP AccountLine::delete方法代码示例

本文整理汇总了PHP中AccountLine::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP AccountLine::delete方法的具体用法?PHP AccountLine::delete怎么用?PHP AccountLine::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AccountLine的用法示例。


在下文中一共展示了AccountLine::delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  *	Delete a subscription
  *
  *	@param	User	$user		User that delete
  *	@return	int					<0 if KO, 0 if not found, >0 if OK
  */
 function delete($user)
 {
     // It subscription is linked to a bank transaction, we get it
     if ($this->fk_bank) {
         require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
         $accountline = new AccountLine($this->db);
         $result = $accountline->fetch($this->fk_bank);
     }
     $this->db->begin();
     $sql = "DELETE FROM " . MAIN_DB_PREFIX . "cotisation WHERE rowid = " . $this->id;
     dol_syslog(get_class($this) . "::delete sql=" . $sql);
     $resql = $this->db->query($sql);
     if ($resql) {
         $num = $this->db->affected_rows($resql);
         if ($num) {
             require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
             $member = new Adherent($this->db);
             $result = $member->fetch($this->fk_adherent);
             $result = $member->update_end_date($user);
             if ($accountline->rowid > 0) {
                 $result = $accountline->delete($user);
                 // Return false if refused because line is conciliated
                 if ($result > 0) {
                     $this->db->commit();
                     return 1;
                 } else {
                     $this->error = $accountline->error;
                     $this->db->rollback();
                     return -1;
                 }
             } else {
                 $this->db->commit();
                 return 1;
             }
         } else {
             $this->db->commit();
             return 0;
         }
     } else {
         $this->error = $this->db->lasterror();
         $this->db->rollback();
         return -1;
     }
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:50,代码来源:cotisation.class.php

示例2: setEventMessages

        $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
        if ($insertid > 0) {
            setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
            header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id . "&action=addline");
            exit;
        } else {
            setEventMessages($object->error, $object->errors, 'errors');
        }
    } else {
        $action = 'addline';
    }
}
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->modifier) {
    $accline = new AccountLine($db);
    $result = $accline->fetch(GETPOST("rowid"));
    $result = $accline->delete();
}
/*
 * View
 */
llxHeader('', $langs->trans("FinancialAccount") . '-' . $langs->trans("Transactions"));
$societestatic = new Societe($db);
$userstatic = new User($db);
$chargestatic = new ChargeSociales($db);
$loanstatic = new Loan($db);
$memberstatic = new Adherent($db);
$paymentstatic = new Paiement($db);
$paymentsupplierstatic = new PaiementFourn($db);
$paymentvatstatic = new TVA($db);
$paymentsalstatic = new PaymentSalary($db);
$donstatic = new Don($db);
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:account.php

示例3: delete

 /**
  *      Supprime un paiement ainsi que les lignes qu'il a genere dans comptes
  *      Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse
  *      Si le paiement porte sur au moins une facture a "payee", on refuse
  *
  *      @param	int		$notrigger		No trigger
  *      @return int     				<0 si ko, >0 si ok
  */
 function delete($notrigger = 0)
 {
     global $conf, $user, $langs;
     $error = 0;
     $bank_line_id = $this->bank_line;
     $this->db->begin();
     // Verifier si paiement porte pas sur une facture classee
     // Si c'est le cas, on refuse la suppression
     $billsarray = $this->getBillsArray('fk_statut > 1');
     if (is_array($billsarray)) {
         if (count($billsarray)) {
             $this->error = "ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible";
             $this->db->rollback();
             return -1;
         }
     } else {
         $this->db->rollback();
         return -2;
     }
     $accline = new AccountLine($this->db);
     // Delete bank urls. If payment is on a conciliated line, return error.
     if ($bank_line_id) {
         $result = $accline->fetch($bank_line_id);
         if ($result == 0) {
             $accline->rowid = $bank_line_id;
         }
         // If not found, we set artificially rowid to allow delete of llx_bank_url
         $result = $accline->delete_urls($user);
         if ($result < 0) {
             $this->error = $accline->error;
             $this->db->rollback();
             return -3;
         }
     }
     // Delete payment (into paiement_facture and paiement)
     $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'paiement_facture';
     $sql .= ' WHERE fk_paiement = ' . $this->id;
     dol_syslog($sql);
     $result = $this->db->query($sql);
     if ($result) {
         $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'paiement';
         $sql .= ' WHERE rowid = ' . $this->id;
         dol_syslog($sql);
         $result = $this->db->query($sql);
         if (!$result) {
             $this->error = $this->db->lasterror();
             $this->db->rollback();
             return -3;
         }
         // Supprimer l'ecriture bancaire si paiement lie a ecriture
         if ($bank_line_id) {
             $result = $accline->delete($user);
             if ($result < 0) {
                 $this->error = $accline->error;
                 $this->db->rollback();
                 return -4;
             }
         }
         if (!$notrigger) {
             // Appel des triggers
             $result = $this->call_trigger('PAYMENT_DELETE', $user);
             if ($result < 0) {
                 $this->db->rollback();
                 return -1;
             }
             // Fin appel triggers
         }
         $this->db->commit();
         return 1;
     } else {
         $this->error = $this->db->error;
         $this->db->rollback();
         return -5;
     }
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:83,代码来源:paiement.class.php

示例4: AccountLine

            $action = "create";
        }
    }
    $action = 'create';
}
if ($action == 'delete') {
    $result = $object->fetch($id);
    if ($object->rappro == 0) {
        $db->begin();
        $ret = $object->delete($user);
        if ($ret > 0) {
            if ($object->fk_bank) {
                $accountline = new AccountLine($db);
                $result = $accountline->fetch($object->fk_bank);
                if ($result > 0) {
                    $result = $accountline->delete($user);
                }
                // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
            }
            if ($result >= 0) {
                $db->commit();
                header("Location: " . DOL_URL_ROOT . '/compta/salaries/index.php');
                exit;
            } else {
                $object->error = $accountline->error;
                $db->rollback();
                setEventMessage($object->error, 'errors');
            }
        } else {
            $db->rollback();
            setEventMessage($object->error, 'errors');
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:card.php

示例5: header

        $langs->load("errors");
        $mesg = '<div class="error">' . $langs->trans("ErrorPleaseTypeBankTransactionReportName") . '</div>';
    }
    if (!$error) {
        header('Location: ' . DOL_URL_ROOT . '/compta/bank/rappro.php?account=' . $id);
        // To avoid to submit twice and allow back
        exit;
    }
}
/*
 * Action suppression ecriture
 */
if ($action == 'del') {
    $bankline = new AccountLine($db);
    $bankline->fetch($_GET["rowid"]);
    $result = $bankline->delete($user);
    if ($result < 0) {
        dol_print_error($db, $bankline->error);
    }
}
// Load bank groups
$sql = "SELECT rowid, label FROM " . MAIN_DB_PREFIX . "bank_categ ORDER BY label";
$resql = $db->query($sql);
$options = "";
if ($resql) {
    $var = True;
    $num = $db->num_rows($resql);
    if ($num > 0) {
        $options .= '<option value="0"' . (GETPOST('cat') ? '' : ' selected="true"') . '>&nbsp;</option>';
    }
    $i = 0;
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:rappro.php

示例6: delete

 /**
  *	Supprime un paiement ainsi que les lignes qu'il a genere dans comptes
  *	Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse
  *	Si le paiement porte sur au moins une facture a "payee", on refuse
  *
  *	@param		int		$notrigger		No trigger
  *	@return     int     <0 si ko, >0 si ok
  */
 function delete($notrigger = 0)
 {
     global $conf, $user, $langs;
     $bank_line_id = $this->bank_line;
     $this->db->begin();
     // Verifier si paiement porte pas sur une facture a l'etat payee
     // Si c'est le cas, on refuse la suppression
     $billsarray = $this->getBillsArray('paye=1');
     if (is_array($billsarray)) {
         if (count($billsarray)) {
             $this->error = "ErrorCantDeletePaymentSharedWithPayedInvoice";
             $this->db->rollback();
             return -1;
         }
     } else {
         $this->db->rollback();
         return -2;
     }
     // Verifier si paiement ne porte pas sur ecriture bancaire rapprochee
     // Si c'est le cas, on refuse le delete
     if ($bank_line_id) {
         $accline = new AccountLine($this->db, $bank_line_id);
         $accline->fetch($bank_line_id);
         if ($accline->rappro) {
             $this->error = "ErrorCantDeletePaymentReconciliated";
             $this->db->rollback();
             return -3;
         }
     }
     // Efface la ligne de paiement (dans paiement_facture et paiement)
     $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'paiementfourn_facturefourn';
     $sql .= ' WHERE fk_paiementfourn = ' . $this->id;
     $resql = $this->db->query($sql);
     if ($resql) {
         $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'paiementfourn';
         $sql .= ' WHERE rowid = ' . $this->id;
         $result = $this->db->query($sql);
         if (!$result) {
             $this->error = $this->db->error();
             $this->db->rollback();
             return -3;
         }
         // Supprimer l'ecriture bancaire si paiement lie a ecriture
         if ($bank_line_id) {
             $accline = new AccountLine($this->db);
             $result = $accline->fetch($bank_line_id);
             if ($result > 0) {
                 $result = $accline->delete();
             }
             if ($result < 0) {
                 $this->error = $accline->error;
                 $this->db->rollback();
                 return -4;
             }
         }
         if (!$notrigger) {
             // Appel des triggers
             $result = $this->call_trigger('PAYMENT_SUPPLIER_DELETE', $user);
             if ($result < 0) {
                 $this->db->rollback();
                 return -1;
             }
             // Fin appel triggers
         }
         $this->db->commit();
         return 1;
     } else {
         $this->error = $this->db->error;
         $this->db->rollback();
         return -5;
     }
 }
开发者ID:Albertopf,项目名称:prueba,代码行数:80,代码来源:paiementfourn.class.php

示例7: delete

 /**
  *	Supprime un paiement ainsi que les lignes qu'il a genere dans comptes
  *	Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse
  *	Si le paiement porte sur au moins une facture a "payee", on refuse
  *
  *	@param		int		$notrigger		No trigger
  *	@return     int     <0 si ko, >0 si ok
  */
 function delete($notrigger = 0)
 {
     $bank_line_id = $this->bank_line;
     $this->db->begin();
     // Verifier si paiement porte pas sur une facture a l'etat payee
     // Si c'est le cas, on refuse la suppression
     $billsarray = $this->getBillsArray('paye=1');
     if (is_array($billsarray)) {
         if (count($billsarray)) {
             $this->error = 'Can\'t delete a payment shared by at least one invoice with status payed';
             $this->db->rollback();
             return -1;
         }
     } else {
         $this->db->rollback();
         return -2;
     }
     // Verifier si paiement ne porte pas sur ecriture bancaire rapprochee
     // Si c'est le cas, on refuse le delete
     if ($bank_line_id) {
         $accline = new AccountLine($this->db, $bank_line_id);
         $accline->fetch($bank_line_id);
         if ($accline->rappro) {
             $this->error = 'Impossible de supprimer un paiement qui a genere une ecriture qui a ete rapprochee';
             $this->db->rollback();
             return -3;
         }
     }
     // Efface la ligne de paiement (dans paiement_facture et paiement)
     $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'paiementfourn_facturefourn';
     $sql .= ' WHERE fk_paiementfourn = ' . $this->id;
     dol_syslog("sql=" . $sql);
     $resql = $this->db->query($sql);
     if ($resql) {
         $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'paiementfourn';
         $sql .= ' WHERE rowid = ' . $this->id;
         dol_syslog("sql=" . $sql);
         $result = $this->db->query($sql);
         if (!$result) {
             $this->error = $this->db->error();
             $this->db->rollback();
             return -3;
         }
         // Supprimer l'ecriture bancaire si paiement lie a ecriture
         if ($bank_line_id) {
             $accline = new AccountLine($this->db);
             $accline->fetch($bank_line_id);
             $result = $accline->delete();
             if ($result < 0) {
                 $this->error = $accline->error;
                 $this->db->rollback();
                 return -4;
             }
         }
         $this->db->commit();
         return 1;
     } else {
         $this->error = $this->db->error;
         $this->db->rollback();
         return -5;
     }
 }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:70,代码来源:paiementfourn.class.php

示例8: delete

 /**
  *  Delete object in database
  *
  *  @param	User	$user        	User that delete
  *  @param  int		$notrigger		0=launch triggers after, 1=disable triggers
  *  @return int						<0 if KO, >0 if OK
  */
 function delete($user, $notrigger = 0)
 {
     global $conf, $langs;
     $error = 0;
     dol_syslog(get_class($this) . "::delete");
     $this->db->begin();
     if ($this->bank_line > 0) {
         $accline = new AccountLine($this->db);
         $accline->fetch($this->bank_line);
         $result = $accline->delete();
         if ($result < 0) {
             $this->errors[] = $accline->error;
             $error++;
         }
     }
     if (!$error) {
         $sql = "DELETE FROM " . MAIN_DB_PREFIX . "paiementcharge";
         $sql .= " WHERE rowid=" . $this->id;
         dol_syslog(get_class($this) . "::delete", LOG_DEBUG);
         $resql = $this->db->query($sql);
         if (!$resql) {
             $error++;
             $this->errors[] = "Error " . $this->db->lasterror();
         }
     }
     if (!$error) {
         if (!$notrigger) {
             // Uncomment this and change MYOBJECT to your own tag if you
             // want this action call a trigger.
             //// Call triggers
             //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
             //$interface=new Interfaces($this->db);
             //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
             //if ($result < 0) { $error++; $this->errors=$interface->errors; }
             //// End call triggers
         }
     }
     // Commit or rollback
     if ($error) {
         foreach ($this->errors as $errmsg) {
             dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
             $this->error .= $this->error ? ', ' . $errmsg : $errmsg;
         }
         $this->db->rollback();
         return -1 * $error;
     } else {
         $this->db->commit();
         return 1;
     }
 }
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:57,代码来源:paymentsocialcontribution.class.php

示例9: delete

	/**
	 *      Supprime un paiement ainsi que les lignes qu'il a genere dans comptes
	 *      Si le paiement porte sur un ecriture compte qui est rapprochee, on refuse
	 *      Si le paiement porte sur au moins une facture a "payee", on refuse
	 *      @return     int     <0 si ko, >0 si ok
	 */
	function delete($notrigger=0)
	{
		global $conf, $user, $langs;

		$error=0;

		$bank_line_id = $this->bank_line;

		$this->db->begin();

		// Verifier si paiement porte pas sur une facture classee
		// Si c'est le cas, on refuse la suppression
		$billsarray=$this->getBillsArray('fk_statut > 1');
		if (is_array($billsarray))
		{
			if (sizeof($billsarray))
			{
				$this->error="ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible";
				$this->db->rollback();
				return -1;
			}
		}
		else
		{
			$this->db->rollback();
			return -2;
		}

		// Delete bank urls. If payment if on a conciliated line, return error.
		if ($bank_line_id)
		{
			$accline = new AccountLine($this->db);
			$accline->fetch($bank_line_id);
            $result=$accline->delete_urls($user);
            if ($result < 0)
            {
                $this->error=$accline->error;
				$this->db->rollback();
				return -3;
            }
		}

		// Delete payment (into paiement_facture and paiement)
		$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiement_facture';
		$sql.= ' WHERE fk_paiement = '.$this->id;
		$result = $this->db->query($sql);
		if ($result)
		{
			$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiement';
			$sql.= ' WHERE rowid = '.$this->id;
			$result = $this->db->query($sql);
			if (! $result)
			{
				$this->error=$this->db->lasterror();
				$this->db->rollback();
				return -3;
			}

			// Supprimer l'ecriture bancaire si paiement lie a ecriture
			if ($bank_line_id)
			{
				$accline = new AccountLine($this->db);
				$accline->fetch($bank_line_id);
				$result=$accline->delete();
				if ($result < 0)
				{
					$this->error=$accline->error;
					$this->db->rollback();
					return -4;
				}
			}

			if (! $notrigger)
			{
				// Appel des triggers
				include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
				$interface=new Interfaces($this->db);
				$result=$interface->run_triggers('PAYMENT_DELETE',$this,$user,$langs,$conf);
				if ($result < 0) { $error++; $this->errors=$interface->errors; }
				// Fin appel triggers
			}

			$this->db->commit();
			return 1;
		}
		else
		{
			$this->error=$this->db->error;
			$this->db->rollback();
			return -5;
		}
	}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:98,代码来源:paiement.class.php


注:本文中的AccountLine::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。