当前位置: 首页>>代码示例>>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;未经允许,请勿转载。