PHP code example of ar-ras / bea-cukai

1. Go to this page and download the library: Download ar-ras/bea-cukai library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ar-ras / bea-cukai example snippets


    $myPrice = $insuranceCost = $shipmentCost = $goodsCost = 0;
    $entryTax = $ppn = $ppnBm = $pph = 0;
    
    Configurator::setPphJsonPath('C:\xampp\htdocs\beacukai\vendor\ar-ras\bea-cukai\database\pph.json');
    Configurator::setPphJsonContent();
 
    $myProduct = new Product();
    $myProduct->setPrice($goodsCost);
    $myProduct->setEntryTax($entryTax);
    $myProduct->setPpn($ppn);
    $myProduct->setPpnBm($ppnBm);
 
    $taxCalc = new CalculateTax($myProduct);
    $taxCalc->calculateCIF($insuranceCost, $shipmentCost);
 
    $taxCalc->calculatePDRI($pph);
 
    $myPrice = $taxCalc->calculateTotal();