Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flexydial
/
hdfc-beu-v2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
dc79404a
authored
2019-01-21 16:41:27 +0530
by
pramila
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Calculate income on client site (onchange lc and lcamt calculate Income Achievement)
1 parent
c92ad136
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
application/resources/views/layout/module/outputreport/outputreport.blade.php
application/resources/views/layout/module/outputreport/outputreport.blade.php
View file @
dc79404
...
...
@@ -35,7 +35,7 @@ if(Auth::user()->id=="1" || Auth::user()->id == "199"){ ?>
</tr>
<tr>
<th>
Income Achievement
</th>
<th>
{{$totalIncome}}
</th>
<th>
<span
id=
"showCalculatedAmt"
>
{{$totalIncome}}
</span>
</th>
</tr>
<tr>
...
...
@@ -54,10 +54,10 @@ if(Auth::user()->id=="1" || Auth::user()->id == "199"){ ?>
<tr>
<td>
<input
type=
"hidden"
name=
"products[
<?=
$i
?>
][productId]"
value=
"{{$value['productId']}}"
>
<input
type=
"hidden"
name=
"products[
<?=
$i
?>
][product]"
value=
"{{ $value['name'] }} "
>
{{ $value['name'] }}
</td>
<td><input
type=
"number"
name=
"products[
<?=
$i
?>
][lg]"
value=
"{{isset($value['lead_generated'])?$value['lead_generated']:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
name=
"products[
<?=
$i
?>
][lg]"
min=
"0"
value=
"{{isset($value['lead_generated'])?$value['lead_generated']:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
min=
"0"
step=
"0.01"
name=
"products[
<?=
$i
?>
][lgAmt]"
value=
"{{isset($value['lead_generated_amount'])?$value['lead_generated_amount']:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
name=
"products[
<?=
$i
?>
][lc]"
value=
"{{isset($value['lead_closed'])?$value['lead_closed']:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
min=
"0"
step=
"0.01"
name=
"products[
<?=
$i
?>
][lcAmt]"
value=
"{{isset($value['lead_closed_amount'])?$value['lead_closed_amount']:'0'}}"
$
disabled
></td>
<td><input
type=
"number"
min=
"0"
name=
"products[
<?=
$i
?>
][lc]"
value=
"{{isset($value['lead_closed'])?$value['lead_closed']:'0'}}"
class=
"calculateIncome"
id=
"products
<?=
$i
?>
Lc"
$
disabled
></td>
<td><input
type=
"number"
min=
"0"
step=
"0.01"
name=
"products[
<?=
$i
?>
][lcAmt]"
value=
"{{isset($value['lead_closed_amount'])?$value['lead_closed_amount']:'0'}}"
class=
"calculateIncome"
id=
"products
<?=
$i
?>
LcAmt"
$
disabled
></td>
</tr>
<?php
$i
++
;
...
...
@@ -73,11 +73,12 @@ if(Auth::user()->id=="1" || Auth::user()->id == "199"){ ?>
</table>
</div>
</form>
<script>
<script>
function
createOutputReport
()
{
var
putdata
=
$
(
'#output-report'
).
serialize
();
function
createOutputReport
()
{
var
putdata
=
$
(
'#output-report'
).
serialize
();
//console.log("--->"+putdata);
doAjax
(
'outputreport?action=createOutputReport'
,
putdata
,
'__fake__div__'
,
'ajax_create_output_report'
,
'singlethis'
,
'POST'
,
function
(
retstr
)
{
...
...
@@ -93,6 +94,28 @@ if(Auth::user()->id=="1" || Auth::user()->id == "199"){ ?>
});
}
$
(
document
).
ready
(
function
()
{
$
(
".calculateIncome"
).
change
(
function
()
{
var
numItems
=
$
(
'.calculateIncome'
).
length
;
var
lc
=
0
;
var
lcAmt
=
0
;
var
totalIncome
=
0
;
for
(
var
i
=
1
;
i
<=
(
numItems
/
2
);
i
++
)
{
lc
=
$
(
'#products'
+
i
+
'Lc'
).
val
();
lcAmt
=
$
(
'#products'
+
i
+
'LcAmt'
).
val
();
if
(
lc
!=
''
&&
lcAmt
!=
''
){
totalIncome
=
totalIncome
+
(
lc
*
lcAmt
);
}
}
$
(
'#showCalculatedAmt'
).
html
(
totalIncome
);
});
});
</script>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment