ソースを参照

generate invoice number

ifah
コミット
e25a17a0c9

+ 9
- 0
app/Http/Controllers/DS/DealerClaimController.php ファイルの表示

@@ -68,6 +68,7 @@ class DealerClaimController extends Controller
'total_form_by_month' => '',
'agent' => $formD->dealer_id,
'dealer' => $formD->company_id,
'invoice_no' => $this->generateInvoiceNumber($formD->type_application,$formD->dealer_id,date('m', strtotime($docket->end_job)),date('Y', strtotime($docket->end_job))),
];

DealerClaim::create($subsData);
@@ -282,4 +283,12 @@ class DealerClaimController extends Controller
dd($data_not_activated);
}

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

foreach ($claim as $key => $c){
$c->invoice_no = 'B000000004';
$c->save();
}
}
}

+ 6
- 1
app/Http/Controllers/DS/DealerController.php ファイルの表示

@@ -632,6 +632,11 @@ class DealerController extends Controller

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

$invoice_no = '';
if(!empty($f->invoice_no)){
$invoice_no = $f->invoice_no;
}
}
// Calculate extra incentves
@@ -703,7 +708,7 @@ class DealerController extends Controller

$totals = $basic_total + $extra;
$pdf = PDF::loadView('pdf.agent-claim', compact('final', 'month', 'year','com','basic_total','extra','totals'));
$pdf = PDF::loadView('pdf.agent-claim', compact('final', 'month', 'year','com','basic_total','extra','totals','invoice_no'));
$pdf->setPaper('A4', 'landscape');
$pdfName = preg_replace('/\s+/', '-', $com->name).'-'.$month.'-'.$year.'.pdf';


+ 6
- 1
app/Http/Controllers/DS/MarketingController.php ファイルの表示

@@ -3819,6 +3819,11 @@ class MarketingController extends Controller

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

$invoice_no = '';
if(!empty($f->invoice_no)){
$invoice_no = $f->invoice_no;
}
}
// Calculate extra incentves
@@ -3870,7 +3875,7 @@ class MarketingController extends Controller

$totals = $basic_total + $extra;

$pdf = PDF::loadView('pdf.agent-claim', compact('final', 'month', 'year','com','basic_total','extra','totals'));
$pdf = PDF::loadView('pdf.agent-claim', compact('final', 'month', 'year','com','basic_total','extra','totals', 'invoice_no'));
$pdf->setPaper('A4', 'landscape');
$pdfName = preg_replace('/\s+/', '-', $com->name).'-'.$month.'-'.$year.'.pdf';


+ 3
- 3
resources/views/customer-service/view_wo.blade.php ファイルの表示

@@ -156,8 +156,8 @@
<th>Installer</th>
<th>Date</th>
<th width="60">Time</th>
<th>Status</th>
<th width="120">Actions</th>
<th>Installer's Remark</th>
<th width="100">Actions</th>
</tr>
</thead>
</table>
@@ -179,7 +179,7 @@
<th>Installer</th>
<th>Date</th>
<th width="60">Time</th>
<th>Status</th>
<th>Installer's Remark</th>
<th width="100">Actions</th>
</tr>
</thead>

+ 1
- 0
resources/views/pdf/agent-claim.blade.php ファイルの表示

@@ -87,6 +87,7 @@
<br/>

<div class="invoice">
<h3>Invoice Number : {{$invoice_no}}</h3>
<h3>Invoice Claim: {{ $month }} / {{ $year}}</h3>
<h5>Issue Date: {{ date("d/m/Y H:i:s") }}</h5>
<table width="100%" cellpadding="0" cellpadding="0">

+ 2
- 0
routes/web.php ファイルの表示

@@ -36,6 +36,8 @@ Route::get('/store/dealer/claim', 'DS\DealerClaimController@getDealerCompany');
Route::get('/store/dealer/claim2', 'DS\DealerClaimController@getDealerCompany2');
Route::get('/get/dealer/claim/special', 'DS\DealerClaimController@updateIncentives');

Route::get('/generate-invoice-number/{formT}/{dealer}/{month}/{year}', 'DS\DealerClaimController@generateInvoiceNumber');

// Application Form Residential
Route::get('/residential/{package}/application-form/address', 'Form\ResidentialController@viewFormAddress')->name('residential');
Route::post('/residential/{package}/application-form/information', 'Form\ResidentialController@viewFormApplication')->name('application');

読み込み中…
キャンセル
保存