浏览代码

implement new way generate invoice_number

hajar
父节点
当前提交
c54af81943

+ 3
- 3
app/Http/Controllers/DS/DealerClaimController.php 查看文件

'total_form_by_month' => '', 'total_form_by_month' => '',
'agent' => $formD->dealer_id, 'agent' => $formD->dealer_id,
'dealer' => $formD->company_id, 'dealer' => $formD->company_id,
'invoice_no' => $this->generateInvoiceNumber($formD->type_application, $formD->company_id, date('m', strtotime($docket->end_job)), date('Y', strtotime($docket->end_job))),
'invoice_no' => $this->generateInvoiceNumber($formD->project_type,$formD->type_application, $formD->company_id, date('m', strtotime($docket->end_job)), date('Y', strtotime($docket->end_job))),
]; ];


DealerClaim::create($subsData); DealerClaim::create($subsData);
dd($data_not_activated); dd($data_not_activated);
} }


public function generateInvoiceNumber($formT, $dealer, $month, $year)
public function generateInvoiceNumber($projectT, $formT, $dealer, $month, $year)
{ {
$claim = DealerClaim::where('formT', $formT)->where('dealer', $dealer)->where('activated_my', $month . '/' . $year)->first();
$claim = DealerClaim::where('projectT',$projectT)->where('formT', $formT)->where('dealer', $dealer)->where('activated_my', $month . '/' . $year)->first();


if (!empty($claim->invoice_no)) { if (!empty($claim->invoice_no)) {
return $claim->invoice_no; return $claim->invoice_no;

+ 0
- 4
app/Http/Controllers/DS/DealerController.php 查看文件



foreach ($dataClaim as $f) { foreach ($dataClaim as $f) {
$basic_total += $f->total_claim; $basic_total += $f->total_claim;

if (!empty($f->invoice_no)) {
$invoice_no = $f->invoice_no;
}
} }


// Calculate extra incentves // Calculate extra incentves

+ 2
- 0
resources/views/pdf/agent-claim.blade.php 查看文件

<div class="invoice"> <div class="invoice">
<table width="100%" style="font-size: 15px; font-weight:bold"> <table width="100%" style="font-size: 15px; font-weight:bold">
<tr> <tr>
@if ($invoice_no!=null)
<td style="border: none" >Invoice Number : {{$invoice_no}}</td> <td style="border: none" >Invoice Number : {{$invoice_no}}</td>
@endif
<td style="border: none" align="right">Issue Date: {{ date("d/m/Y H:i:s") }}</td> <td style="border: none" align="right">Issue Date: {{ date("d/m/Y H:i:s") }}</td>
</tr> </tr>
<tr> <tr>

正在加载...
取消
保存