Pages

Banner 468 x 60px

 

Monday, March 27, 2017

IF with checkbox in x++

0 comments
void BIT_calculateDPP_VAT_PPh()
{
    Amount      _AmountTotal;
    int         _VoucherType;
    Amount      _DPP, _VAT, _PPh;
    Real        _Pr;
    ;

    _AmountTotal    = BIT_GG_FPJVoucher_TotalBaseAmount.realValue();

    _Pr     = PPNPercent.realValue() + PPhPercent.realValue();
    _DPP    = abs(_AmountTotal * (100/(100 + _Pr)));
    _VAT    = abs(_DPP * PPNPercent.realValue() / 100);
    _PPh    = abs(_DPP * PPhPercent.realValue() / 100);

    if (GG_FPJVoucher_FPJVoucherType.selection() == GG_FPJVoucherType::CashReceipt ||
        GG_FPJVoucher_FPJVoucherType.selection() == GG_FPJVoucherType::ReturnInv)
    {
        BIT_GG_FPJVoucher_DPPBaseAmount.realValue(- _DPP);
        BIT_GG_FPJVoucher_PPNBaseAmount.realValue(- _VAT);
        BIT_GG_FPJVoucher_PPHBaseAmount.realValue(- _PPh);
    }
    else
    {
        BIT_GG_FPJVoucher_DPPBaseAmount.realValue(_DPP);
        BIT_GG_FPJVoucher_PPNBaseAmount.realValue(_VAT);
        BIT_GG_FPJVoucher_PPHBaseAmount.realValue(_PPh);
    }
}


 // added by adit - Tampilkan nilai Base Amount setelah modified
        // Jika tipenya = Invoice && Return maka tidak bisa memilih Reference Realisasi, jadi nilai Total Base amount dan Total Voucher amount sama
        // Jika tipenya = Cash Receipt = maka bisa memilih Reference Realisasi, jadi nilai Total Base amount dan Total Voucher amount beda
        /*if(GG_FPJVoucher::findbyVoucher(GG_FPJVoucher_Voucher.text()).FPJVoucherType == GG_FPJVoucherType::Invoice || GG_FPJVoucherType::ReturnCR || GG_FPJVoucherType::ReturnInv)
        {
            ReferenceRealisasi.enabled(false);
            BIT_GG_FPJVoucher_TotalBaseAmount.realValue(conpeek(_Cont, 5));
        }
        if(GG_FPJVoucher::findbyVoucher(GG_FPJVoucher_Voucher.text()).FPJVoucherType == GG_FPJVoucherType::CashReceipt)
        {
            ReferenceRealisasi.enabled(true);
            //BIT_GG_FPJVoucher_TotalBaseAmount.realValue(conpeek(_Cont, 13));
            //element.BIT_calculateDPP_VAT_PPh();
        }*/
        /*
         if(GG_FPJVoucher_FPJVoucherType.selection() == GG_FPJVoucherType::CashReceipt)
         {
            ReferenceRealisasi.enabled(true);
         }
        else
         {
            ReferenceRealisasi.enabled(false);
            BIT_GG_FPJVoucher_TotalBaseAmount.realValue(conpeek(_Cont, 5));
         }
         */
        // ended by adit - Tampilkan nilai Base Amount setelah modified







==========================================
  if(GG_FPJVoucher_FPJVoucherType.selection() == GG_FPJVoucherType::CashReceipt)
                                    {
                                           ttsbegin;
                                               while Select forupdate _salesline where _salesline.SalesId == _SalesIdBase
                                                               && _salesline.BIT_ReferenceRealisasi == _BIT_ReferenceRealisasi
                                                               {
                                                                  _salesline.BIT_StatusSO = BIT_statusSO::Closed;
                                                                  _salesline.update();
                                                               }
                                           ttscommit;
                                           GG_Fpjvoucher2.BIT_ReferenceRealisasi   = _BIT_ReferenceRealisasi;
                                    }
==================================================

0 comments:

A financial dimension value is based on the LAND-00013 record and has been used on a transaction. You cannot delete the LAND-00013 record AX 2012

 A financial dimension value is based on the LAND-00013 record and has been used on a  transaction. You cannot delete the LAND-00013 record ...