Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions ajax_forms/getCostForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
$baseWidth = 345;
$numCols = 6;
if ($enhancedCostFlag){
$baseWidth += 388;
$numCols += 5; // year, sub start, sub end, cost details, invoice num
$baseWidth += 688;
$numCols += 8; // year, sub start, sub end, cost details, invoice num
}
?>
<div id='div_resourceForm'>
Expand All @@ -64,6 +64,11 @@
<td style='vertical-align:top;text-align:left;font-weight:bold;'><?php echo _("Sub End");?></td>
<?php } ?>
<td style='vertical-align:top;text-align:left;font-weight:bold;'><?php echo _("Fund");?></td>
<?php if ($enhancedCostFlag){ ?>
<td style='vertical-align:top;text-align:left;font-weight:bold;'><?php echo _("Tax Excl.");?></td>
<td style='vertical-align:top;text-align:left;font-weight:bold;'><?php echo _("Tax Rate");?></td>
<td style='vertical-align:top;text-align:left;font-weight:bold;'><?php echo _("Tax Incl.");?></td>
<?php } ?>
<td style='vertical-align:top;text-align:left;font-weight:bold;' colspan=2><?php echo _("Payment");?></td>
<td style='vertical-align:top;text-align:left;font-weight:bold;'><?php echo _("Type");?></td>
<?php if ($enhancedCostFlag){ ?>
Expand All @@ -88,9 +93,17 @@
<td style='vertical-align:top;text-align:left;background:white;'>
<input type='text' value='' style='width:60px;' class='changeDefaultWhite changeInput fundName' />
</td>
<?php if ($enhancedCostFlag){ ?>
<td style='vertical-align:top;text-align:left;background:white;'>
<input type='text' value='' style='width:60px;' class='changeDefaultWhite changeInput priceTaxExcluded' /></td>
<td style='vertical-align:top;text-align:left;background:white;'>
<input type='text' value='' style='width:60px;' class='changeDefaultWhite changeInput taxRate' /></td>
<td style='vertical-align:top;text-align:left;background:white;'>
<input type='text' value='' style='width:60px;' class='changeDefaultWhite changeInput priceTaxIncluded' /></td>
<td style='vertical-align:top;text-align:left;background:white;'>
<input type='text' value='' style='width:50px;' class='changeDefaultWhite changeInput paymentAmount' />
</td>
<?php } ?>
<td style='vertical-align:top;text-align:left;'>
<select style='width:50px;' class='changeSelect currencyCode'>
<?php
Expand Down Expand Up @@ -146,12 +159,14 @@
</tr>
</table>
<table class='noBorder smallPadding paymentTable' style='margin:7px 15px 0 15px;'>

<?php
if (count($paymentArray) > 0){
foreach ($paymentArray as $payment){
?>
<tr>
<?php if ($enhancedCostFlag){ ?>

<td style='vertical-align:top;text-align:left;'>
<input type='text' value='<?php echo $payment['year']; ?>' style='width:53px;' class='changeInput year' />
</td>
Expand All @@ -163,6 +178,17 @@
<td style='vertical-align:top;text-align:left;'>
<input type='text' value='<?php echo $payment['fundName']; ?>' style='width:60px;' class='changeInput fundName' />
</td>
<?php if ($enhancedCostFlag){ ?>
<td style='vertical-align:top;text-align:left;'>
<input type='text' value='<?php echo integer_to_cost($payment['priceTaxExcluded']); ?>' style='width:60px;' class='changeInput priceTaxExcluded' />
</td>
<td style='vertical-align:top;text-align:left;'>
<input type='text' value='<?php echo integer_to_cost($payment['taxRate']); ?>' style='width:60px;' class='changeInput taxRate' />
</td>
<td style='vertical-align:top;text-align:left;'>
<input type='text' value='<?php echo integer_to_cost($payment['priceTaxIncluded']); ?>' style='width:60px;' class='changeInput priceTaxIncluded' />
</td>
<?php } ?>
<td style='vertical-align:top;text-align:left;'>
<input type='text' value='<?php echo integer_to_cost($payment['paymentAmount']); ?>' style='width:50px;' class='changeInput paymentAmount' />
</td>
Expand Down
35 changes: 24 additions & 11 deletions ajax_htmldata/getAcquisitionsDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
$enhancedCostFlag = ((isset($config->settings->enhancedCostHistory)) && (strtoupper($config->settings->enhancedCostHistory) == 'Y')) ? 1 : 0;
$enhancedCostFlag = (strtoupper($config->settings->enhancedCostHistory) == 'Y') ? 1 : 0;
if ($enhancedCostFlag){
$numCols = 9;
$numCols = 12;
$tableWidth = 760;
$formWidth = 784;
$formWidth = 1084;
?>
<!-- Hide the helpful links, etc. -->
<script>
Expand Down Expand Up @@ -180,6 +180,11 @@
<th><?php echo _("Sub End");?></th>
<?php } ?>
<th><?php echo _("Fund");?></th>
<?php if ($enhancedCostFlag){ ?>
<th><?php echo _("Tax Excl.");?></th>
<th><?php echo _("Tax Rate");?></th>
<th><?php echo _("Tax Incl.");?></th>
<?php } ?>
<th><?php echo _("Payment");?></th>
<?php if ($enhancedCostFlag && 0){ ?>
<th style='text-align: right'>%</th>
Expand Down Expand Up @@ -210,11 +215,14 @@
$subStart = $payment['subscriptionStartDate'] ? normalize_date($payment['subscriptionStartDate']) : "&nbsp;";
$subEnd = $payment['subscriptionEndDate'] ? normalize_date($payment['subscriptionEndDate']) : "&nbsp;";
$fundName = $payment['fundName'] ? $payment['fundName'] : "&nbsp;";
if (integer_to_cost($payment['paymentAmount'])){
$cost = $payment['currencyCode'] . " " . integer_to_cost($payment['paymentAmount']);
}else{
$cost = "&nbsp;";
}
$taxRate = $payment['taxRate'] ? integer_to_cost($payment['taxRate']) . '&nbsp;%' : "&nbsp;";
foreach (Array('priceTaxExcluded', 'priceTaxIncluded', 'paymentAmount') as $amount) {
if (integer_to_cost($payment[$amount])){
$cost[$amount] = $payment['currencyCode'] . " " . integer_to_cost($payment[$amount]);
}else{
$cost[$amount] = "&nbsp;";
}
}
$costDetails = $payment['costDetails'] ? $payment['costDetails'] : "&nbsp;";
$costNote = $payment['costNote'] ? $payment['costNote'] : "&nbsp;";
$invoiceNum = $payment['invoiceNum'] ? $payment['invoiceNum'] : "&nbsp;";
Expand All @@ -226,12 +234,17 @@
<td <?php echo $classAdd;?> ><?php echo $subStart; ?></td>
<td <?php echo $classAdd;?> ><?php echo $subEnd; ?></td>
<?php } ?>
<td <?php echo $classAdd;?> ><?php echo $fundName; ?></td>
<td <?php echo $classAdd;?> ><?php echo $cost; ?></td>
<td <?php echo $classAdd;?>><?php echo $fundName; ?></td>
<?php if ($enhancedCostFlag && 0){ ?>
<td <?php echo $classAdd;?> style='text-align: right'><?php echo $payment['amountChange']; ?></td>
<?php } ?>
<td <?php echo $classAdd;?> ><?php echo $payment['orderType']; ?></td>
<?php } ?>
<?php if ($enhancedCostFlag){ ?>
<td <?php echo $classAdd;?>><?php echo $cost['priceTaxExcluded']; ?></td>
<td <?php echo $classAdd;?>><?php echo $taxRate; ?></td>
<td <?php echo $classAdd;?>><?php echo $cost['priceTaxIncluded']; ?></td>
<?php } ?>
<td <?php echo $classAdd;?>><?php echo $cost['paymentAmount']; ?></td>
<td <?php echo $classAdd;?>><?php echo $payment['orderType']; ?></td>
<?php if ($enhancedCostFlag){ ?>
<td <?php echo $classAdd;?> ><?php echo $costDetails; ?></td>
<?php } ?>
Expand Down
6 changes: 6 additions & 0 deletions ajax_processing/submitCost.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
$subStartArray = array(); $subStartArray = explode(':::',$_POST['subStarts']);
$subEndArray = array(); $subEndArray = explode(':::',$_POST['subEnds']);
$fundNameArray = array(); $fundNameArray = explode(':::',$_POST['fundNames']);
$pteArray = array(); $pteArray = explode(':::',$_POST['pricesTaxExcluded']);
$taxRateArray = array(); $taxRateArray = explode(':::',$_POST['taxRates']);
$ptiArray = array(); $ptiArray = explode(':::',$_POST['pricesTaxIncluded']);
$paymentAmountArray = array(); $paymentAmountArray = explode(':::',$_POST['paymentAmounts']);
$currencyCodeArray = array(); $currencyCodeArray = explode(':::',$_POST['currencyCodes']);
$orderTypeArray = array(); $orderTypeArray = explode(':::',$_POST['orderTypes']);
Expand All @@ -28,6 +31,9 @@
$resourcePayment->subscriptionStartDate = $start;
$resourcePayment->subscriptionEndDate = $end;
$resourcePayment->fundName = $fundNameArray[$key];
$resourcePayment->priceTaxExcluded = cost_to_integer($pteArray[$key]);
$resourcePayment->taxRate = cost_to_integer($taxRateArray[$key]);
$resourcePayment->priceTaxIncluded = cost_to_integer($ptiArray[$key]);
$resourcePayment->paymentAmount = cost_to_integer($paymentAmountArray[$key]);
$resourcePayment->currencyCode = $currencyCodeArray[$key];
$resourcePayment->orderTypeID = $value;
Expand Down
3 changes: 3 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,9 @@ table.noMargin { border:0px;margin:0px; padding:0px;text-align:center; }
table.noMargin tr { border:0px;margin:0px; padding:0px; vertical-align:middle; }
table.noMargin td { border:0px;margin:0px; padding:0px; }

table.newPaymentTable td { padding:2px;}
table.paymentTable td { padding-right:8px;}


.formText {font-weight:bold;}

Expand Down
3 changes: 3 additions & 0 deletions install/protected/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ CREATE TABLE `ResourcePayment` (
`resourceID` int(10) unsigned NOT NULL,
`fundName` varchar(200) default NULL,
`selectorLoginID` varchar(45) default NULL,
`priceTaxExcluded` int(10) unsigned default NULL,
`taxRate` int(10) unsigned default NULL,
`priceTaxIncluded` int(10) unsigned default NULL,
`paymentAmount` int(10) unsigned default NULL,
`orderTypeID` int(10) unsigned default NULL,
`currencyCode` varchar(3) NOT NULL,
Expand Down
3 changes: 3 additions & 0 deletions install/update_acquisitions_enhancements.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE ResourcePayment ADD COLUMN `priceTaxExcluded` int(10) unsigned default NULL AFTER selectorLoginID;
ALTER TABLE ResourcePayment ADD COLUMN `taxRate` int(10) unsigned default NULL AFTER priceTaxExcluded;
ALTER TABLE ResourcePayment ADD COLUMN `priceTaxIncluded` int(10) unsigned default NULL AFTER taxRate;
59 changes: 57 additions & 2 deletions js/forms/costForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,36 @@ $(function(){
return false;
});


$(".priceTaxExcluded").change(function() {
pte = $(this).val();
taxRate = $(this).parent().next().children(".taxRate").val();
if (pte && taxRate) {
amount = parseFloat(pte) + (pte * taxRate / 100);
$(this).parent().next().next().children(".priceTaxIncluded").val(amount);
$(this).parent().next().next().next().children(".paymentAmount").val(amount);
}
});

$(".taxRate").change(function() {
taxRate = $(this).val();
pte = $(this).parent().prev().children(".priceTaxExcluded").val();
if (pte && taxRate) {
amount = parseFloat(pte) + (pte * taxRate / 100);
$(this).parent().next().children(".priceTaxIncluded").val(amount);
$(this).parent().next().next().children(".paymentAmount").val(amount);

}
});

$(".addPayment").live('click', function () {

var y = $('.newPaymentTable').children().children().children().children('.year').val();
var ssd = $('.newPaymentTable').children().children().children().children('.susbcriptionStartDate').val();
var sed = $('.newPaymentTable').children().children().children().children('.susbcriptionEndDate').val();
var fName = $('.newPaymentTable').children().children().children().children('.fundName').val();
var pte = $('.newPaymentTable').children().children().children().children('.priceTaxExcluded').val();
var tr = $('.newPaymentTable').children().children().children().children('.taxRate').val();
var pti = $('.newPaymentTable').children().children().children().children('.priceTaxIncluded').val();
var typeID = $('.newPaymentTable').children().children().children().children('.orderTypeID').val();
var detailsID = $('.newPaymentTable').children().children().children().children('.costDetailsID').val();
var pAmount = $('.newPaymentTable').children().children().children().children('.paymentAmount').val();
Expand Down Expand Up @@ -147,6 +169,9 @@ $(function(){
$('.newPaymentTable').children().children().children().children('.subscriptionStartDate').val('');
$('.newPaymentTable').children().children().children().children('.subscriptionEndDate').val('');
$('.newPaymentTable').children().children().children().children('.fundName').val('');
$('.newPaymentTable').children().children().children().children('.priceTaxExcluded').val('');
$('.newPaymentTable').children().children().children().children('.taxRate').val('');
$('.newPaymentTable').children().children().children().children('.priceTaxIncluded').val('');
$('.newPaymentTable').children().children().children().children('.paymentAmount').val('');
$('.newPaymentTable').children().children().children().children('.orderTypeID').val('');
$('.newPaymentTable').children().children().children().children('.costDetailsID').val('');
Expand Down Expand Up @@ -196,6 +221,21 @@ function submitCostForm(){
fundNameList += $(this).val() + ":::";
});

priceTaxExcludedList ='';
$(".priceTaxExcluded").each(function(id) {
priceTaxExcludedList += $(this).val() + ":::";
});

taxRateList ='';
$(".taxRate").each(function(id) {
taxRateList += $(this).val() + ":::";
});

priceTaxIncludedList ='';
$(".priceTaxIncluded").each(function(id) {
priceTaxIncludedList += $(this).val() + ":::";
});

paymentAmountList ='';
$(".paymentAmount").each(function(id) {
paymentAmountList += $(this).val() + ":::";
Expand Down Expand Up @@ -237,6 +277,9 @@ function submitCostForm(){
subStarts: subStartList,
subEnds: subEndList,
fundNames: fundNameList,
pricesTaxExcluded: priceTaxExcludedList,
taxRates: taxRateList,
pricesTaxIncluded: priceTaxIncludedList,
paymentAmounts: paymentAmountList,
currencyCodes: currencyCodeList,
orderTypes: orderTypeList,
Expand Down Expand Up @@ -275,6 +318,8 @@ function submitCostForm(){
var fName = $('.newPaymentTable').children().children().children().children('.fundName').val();
var typeID = $('.newPaymentTable').children().children().children().children('.orderTypeID').val();
var detailsID = $('.newPaymentTable').children().children().children().children('.costDetailsID').val();
var pte = $('.newPaymentTable').children().children().children().children('.priceTaxIncluded').val();
var pti = $('.newPaymentTable').children().children().children().children('.priceTaxExcluded').val();
var pAmount = $('.newPaymentTable').children().children().children().children('.paymentAmount').val();
var cNote = $('.newPaymentTable').children().children().children().children('.costNote').val();

Expand All @@ -295,7 +340,17 @@ function submitCostForm(){
$('#div_errorPayment').html(_("Error - price is not numeric"));
myReturn="1";
}


if ((pte != '') && (pte != null) && (isAmount(pte) === false)){
$('#div_errorPayment').html('Error - Price (tax excluded) is not numeric');
myReturn="1";
}

if ((pti != '') && (pti != null) && (isAmount(pti) === false)){
$('#div_errorPayment').html('Error - Price (tax included) is not numeric');
myReturn="1";
}


if (myReturn == "1"){
return false;
Expand Down