當前位置: 首頁>>代碼示例>>PHP>>正文


PHP invoice::insert方法代碼示例

本文整理匯總了PHP中invoice::insert方法的典型用法代碼示例。如果您正苦於以下問題:PHP invoice::insert方法的具體用法?PHP invoice::insert怎麽用?PHP invoice::insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在invoice的用法示例。


在下文中一共展示了invoice::insert方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: recur

	public function recur()
	{
		$invoice = invoice::select($this->id);
		$ni = new invoice();
		$ni->biller_id = $invoice['biller_id'];
		$ni->customer_id = $invoice['customer_id'];
		$ni->type_id = $invoice['type_id'];
		$ni->preference_id = $invoice['preference_id'];
		//$ni->date = $invoice['date_original'];
		$ni->date = date('Y-m-d');
		$ni->custom_field1 = $invoice['custom_field1'];
		$ni->custom_field2 = $invoice['custom_field2'];
		$ni->custom_field3 = $invoice['custom_field3'];
		$ni->custom_field4 = $invoice['custom_field4'];
		$ni->note = $invoice['note'];
		$ni_id = $ni->insert();
		//insert each line item
		foreach ($invoice['invoice_items'] as $key => $value)
		{
			$nii = new invoice();
			$nii->invoice_id=$ni_id;
			$nii->quantity=$invoice['invoice_items'][$key]['quantity'];
			$nii->product_id=$invoice['invoice_items'][$key]['product_id'];
			$nii->unit_price=$invoice['invoice_items'][$key]['unit_price'];
			$nii->tax_amount=$invoice['invoice_items'][$key]['tax_amount'];
			$nii->gross_total=$invoice['invoice_items'][$key]['gross_total'];
			$nii->description=$invoice['invoice_items'][$key]['description'];
			$nii->total=$invoice['invoice_items'][$key]['total'];
			$nii->tax=$invoice['invoice_items'][$key]['tax'];
			$nii_id = $nii->insert_item();
		}

		return $ni_id;
	}
開發者ID:CalhounGaming,項目名稱:simpleinvoices,代碼行數:34,代碼來源:invoice.php

示例2: recur

 public function recur()
 {
     $invoice = $this->select($this->id, $this->domain_id);
     $ni = new invoice();
     $ni->domain_id = $invoice['domain_id'];
     // Next Index is obtained during insert
     // $ni->index_id     = $invoice['index_id'];
     $ni->biller_id = $invoice['biller_id'];
     $ni->customer_id = $invoice['customer_id'];
     $ni->type_id = $invoice['type_id'];
     $ni->preference_id = $invoice['preference_id'];
     //$ni->date = $invoice['date_original'];
     // Use todays date
     $ni->date = date('Y-m-d');
     $ni->custom_field1 = $invoice['custom_field1'];
     $ni->custom_field2 = $invoice['custom_field2'];
     $ni->custom_field3 = $invoice['custom_field3'];
     $ni->custom_field4 = $invoice['custom_field4'];
     $ni->note = $invoice['note'];
     $ni_id = $ni->insert();
     //insert each line item
     $nii = new invoice();
     $nii->invoice_id = $ni_id;
     $nii->domain_id = $ni->domain_id;
     foreach ($invoice['invoice_items'] as $k => $v) {
         $nii->quantity = $v['quantity'];
         $nii->product_id = $v['product_id'];
         $nii->unit_price = $v['unit_price'];
         $nii->tax_amount = $v['tax_amount'];
         $nii->gross_total = $v['gross_total'];
         $nii->description = $v['description'];
         $nii->total = $v['total'];
         $nii->attribute = $v['attribute'];
         $nii->tax = $v['tax'];
         $nii_id = $nii->insert_item();
     }
     return $ni_id;
 }
開發者ID:JPG-Consulting,項目名稱:simpleinvoices,代碼行數:38,代碼來源:invoice.php


注:本文中的invoice::insert方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。