Added Text String prices to Line Items
This commit is contained in:
parent
7e4f59f322
commit
66870227db
|
|
@ -13,10 +13,10 @@
|
||||||
echo $form->input('LineItem.title');
|
echo $form->input('LineItem.title');
|
||||||
echo $form->input('LineItem.description');
|
echo $form->input('LineItem.description');
|
||||||
echo $form->input('LineItem.product_id', array('type'=>'hidden'));
|
echo $form->input('LineItem.product_id', array('type'=>'hidden'));
|
||||||
|
echo $form->input('LineItem.has_text_prices', array('options' => array('1' => 'Yes', '0' => 'No')));
|
||||||
?>
|
?>
|
||||||
<div id="noCosting">
|
<div id="noCosting">
|
||||||
<?
|
<?
|
||||||
echo $form->input('gross_unit_price', array('class'=>'number_input quickpricing'));
|
echo $form->input('gross_unit_price', array('class'=>'number_input quickpricing'));
|
||||||
echo $form->input('discount_percent', array('class'=>'number_input quickpricing'));
|
echo $form->input('discount_percent', array('class'=>'number_input quickpricing'));
|
||||||
echo $form->input('discount_amount_unit', array('class'=>'number_input quickpricing'));
|
echo $form->input('discount_amount_unit', array('class'=>'number_input quickpricing'));
|
||||||
|
|
@ -24,8 +24,16 @@
|
||||||
echo $form->input('gross_price', array('class'=>'number_input quickpricing'));
|
echo $form->input('gross_price', array('class'=>'number_input quickpricing'));
|
||||||
echo $form->input('discount_amount_total', array('class'=>'number_input quickpricing'));
|
echo $form->input('discount_amount_total', array('class'=>'number_input quickpricing'));
|
||||||
echo $form->input('net_price', array('class'=>'number_input quickpricing'));
|
echo $form->input('net_price', array('class'=>'number_input quickpricing'));
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="textPrices">
|
||||||
|
<?
|
||||||
|
echo $form->input('unit_price_string');
|
||||||
|
echo $form->input('gross_price_string');
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?
|
<?
|
||||||
echo $form->end();
|
echo $form->end();
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -33,24 +33,39 @@
|
||||||
<?=$li['description'];?>
|
<?=$li['description'];?>
|
||||||
</td>
|
</td>
|
||||||
<td width="<?=$colWidths['unit'];?>" align="center" valign="top">
|
<td width="<?=$colWidths['unit'];?>" align="center" valign="top">
|
||||||
|
<?
|
||||||
<?=$number->currency($li['gross_unit_price'], $currencyCode);?>
|
if($li['has_text_prices']):
|
||||||
<? if($li['discount_percent']):?>
|
echo $li['unit_price_string'];
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
else:
|
||||||
|
?>
|
||||||
|
<?=$number->currency($li['gross_unit_price'], $currencyCode);?>
|
||||||
|
<? if($li['discount_percent']):?>
|
||||||
<br>less<br><?=$li['discount_percent']?>%<br>
|
<br>less<br><?=$li['discount_percent']?>%<br>
|
||||||
discount<br>
|
discount<br>
|
||||||
(-<?=$number->currency($li['discount_amount_unit'], $currencyCode);?>)<br>
|
(-<?=$number->currency($li['discount_amount_unit'], $currencyCode);?>)<br>
|
||||||
=<br>
|
=<br>
|
||||||
<?=$number->currency($li['net_unit_price'], $currencyCode);?>
|
<?=$number->currency($li['net_unit_price'], $currencyCode);?>
|
||||||
|
<?endif;?>
|
||||||
<?endif;?>
|
<?endif;?>
|
||||||
</td>
|
</td>
|
||||||
<td width="<?=$colWidths['total'];?>" align="center" valign="top">
|
<td width="<?=$colWidths['total'];?>" align="center" valign="top">
|
||||||
<?=$number->currency($li['gross_price'], $currencyCode);?>
|
<?
|
||||||
<? if($li['discount_percent']):?>
|
if($li['has_text_prices']):
|
||||||
|
echo $li['gross_price_string'];
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
else:
|
||||||
|
?>
|
||||||
|
<?=$number->currency($li['gross_price'], $currencyCode);?>
|
||||||
|
<? if($li['discount_percent']):?>
|
||||||
<br>less<br><?=$li['discount_percent']?>%<br>
|
<br>less<br><?=$li['discount_percent']?>%<br>
|
||||||
discount*<br>
|
discount*<br>
|
||||||
(<?=$number->currency($li['discount_amount_total'], $currencyCode);?>)<br>
|
(<?=$number->currency($li['discount_amount_total'], $currencyCode);?>)<br>
|
||||||
=<br>
|
=<br>
|
||||||
<?=$number->currency($li['net_price'], $currencyCode);?>
|
<?=$number->currency($li['net_price'], $currencyCode);?>
|
||||||
|
<?endif;?>
|
||||||
<?endif;?>
|
<?endif;?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -46,24 +46,39 @@
|
||||||
<?=$li['description'];?>
|
<?=$li['description'];?>
|
||||||
</td>
|
</td>
|
||||||
<td class="price">
|
<td class="price">
|
||||||
|
<?
|
||||||
<?=$number->currency($li['gross_unit_price'], $currencyCode);?>
|
if($li['has_text_prices']):
|
||||||
<? if($li['discount_percent']):?>
|
echo $li['unit_price_string'];
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
else:
|
||||||
|
?>
|
||||||
|
<?=$number->currency($li['gross_unit_price'], $currencyCode);?>
|
||||||
|
<? if($li['discount_percent']):?>
|
||||||
<br>less<br><?=$li['discount_percent']?>%<br>
|
<br>less<br><?=$li['discount_percent']?>%<br>
|
||||||
discount<br>
|
discount<br>
|
||||||
(-<?=$number->currency($li['discount_amount_unit'], $currencyCode);?>)<br>
|
(-<?=$number->currency($li['discount_amount_unit'], $currencyCode);?>)<br>
|
||||||
=<br>
|
=<br>
|
||||||
<?=$number->currency($li['net_unit_price'], $currencyCode);?>
|
<?=$number->currency($li['net_unit_price'], $currencyCode);?>
|
||||||
<?endif;?>
|
<?endif;?>
|
||||||
|
<? endif;?>
|
||||||
</td>
|
</td>
|
||||||
<td class="price">
|
<td class="price">
|
||||||
<?=$number->currency($li['gross_price'], $currencyCode);?>
|
<?
|
||||||
<? if($li['discount_percent']):?>
|
if($li['has_text_prices']):
|
||||||
|
echo $li['gross_price_string'];
|
||||||
|
?>
|
||||||
|
<?
|
||||||
|
else:
|
||||||
|
?>
|
||||||
|
<?=$number->currency($li['gross_price'], $currencyCode);?>
|
||||||
|
<? if($li['discount_percent']):?>
|
||||||
<br>less<br><?=$li['discount_percent']?>%<br>
|
<br>less<br><?=$li['discount_percent']?>%<br>
|
||||||
discount<br>
|
discount<br>
|
||||||
<?=$number->currency($li['discount_amount_total'], $currencyCode);?>)<br>
|
<?=$number->currency($li['discount_amount_total'], $currencyCode);?>)<br>
|
||||||
=<br>
|
=<br>
|
||||||
<?=$number->currency($li['net_price'], $currencyCode);?>
|
<?=$number->currency($li['net_price'], $currencyCode);?>
|
||||||
|
<?endif;?>
|
||||||
<?endif;?>
|
<?endif;?>
|
||||||
</td>
|
</td>
|
||||||
<td id="<?=$li['id'];?>">
|
<td id="<?=$li['id'];?>">
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,9 @@ $(function() {
|
||||||
$("#productDetails").hide();
|
$("#productDetails").hide();
|
||||||
|
|
||||||
$('#LineItemDescription').ckeditor(config);
|
$('#LineItemDescription').ckeditor(config);
|
||||||
|
|
||||||
|
showHideTextPrices();
|
||||||
|
|
||||||
$( "#addLineItemModal" ).dialog('open');
|
$( "#addLineItemModal" ).dialog('open');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -233,6 +236,7 @@ $(function() {
|
||||||
$("#editLineItemModal").html(data);
|
$("#editLineItemModal").html(data);
|
||||||
$("#productDetails").hide();
|
$("#productDetails").hide();
|
||||||
$('#LineItemDescription').ckeditor(config);
|
$('#LineItemDescription').ckeditor(config);
|
||||||
|
showHideTextPrices();
|
||||||
$( "#editLineItemModal" ).dialog('open');
|
$( "#editLineItemModal" ).dialog('open');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -272,6 +276,10 @@ $(function() {
|
||||||
$('.page').ckeditor(config);
|
$('.page').ckeditor(config);
|
||||||
|
|
||||||
|
|
||||||
|
$("#LineItemHasTextPrices").live('change', function() {
|
||||||
|
showHideTextPrices();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//Remove this Page
|
//Remove this Page
|
||||||
$(".removePage").live('click',function() {
|
$(".removePage").live('click',function() {
|
||||||
|
|
@ -444,6 +452,18 @@ $('.generateCommercialComments').live('click', function(event) {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function showHideTextPrices() {
|
||||||
|
if( $('#LineItemHasTextPrices').val() == 1) {
|
||||||
|
$("#noCosting").hide();
|
||||||
|
$("#noCosting").find('input').val('');
|
||||||
|
$("#textPrices").show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#noCosting").show();
|
||||||
|
$("#textPrices").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function updateTextFields() {
|
function updateTextFields() {
|
||||||
$('#shippingDetails').ckeditor(function() {
|
$('#shippingDetails').ckeditor(function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue