1.0.14 • Published 5 years ago
rca-money v1.0.14
rca-money
RCA-Money is a library for handling packet values and their installments in Magento.
Installation
Requirements
- None
$ npm install rca-money
Configuration
To configure, you will need the json objects.
var priceFormat = {
decimalSymbol: ",",
groupLength: 3,
groupSymbol: ".",
integerRequired: 1,
pattern: "R$%s",
precision: 2,
requiredPrecision: 2
}
var interestFactor = [
[1]={//number of installment
factor: 1, //factor to corretion of installment
use_interest: false //will it be used?
},
...,
[12] = {
factor: 0.09719,
use_interest: true
}
];
var boleto = {
boletoDiscount: "2",
boletoDayProcess: 4
}
var conf = {
boleto: boleto,
freee_sale: null,
isShowInstallments: true,
maxParcel: 10
minValueParcel: "5",
priceFormat: priceFormat,
interestFactor: interestFactor
}
Usage
<script type="text/javascript">
let money = new RcaMoney(conf);
money.formatedOnlyParcel(1347.09, '#body');
money.formatedPriceAndParcelLong(1571.04, 1546214400000, '#body2');
jQuery('.comission-info').balloon({ classname: "balloonTip"});
</script>