If (Berikat.value() == NoYes::Yes)
{
}
void OK_Button()
{
GG_FPJVoucher _GG_FPJVoucher1, GG_FPJVoucher2, GG_FPJVoucher_UpdateSO_Status, GG_FPJVoucher_Cek_Batal;
str TempTxt1, TempTxt2;
Args _Args;
// added by adit
Salesline _salesline;
SalesIdBase _SalesIdBase;
BIT_ReferenceRealisasi _BIT_ReferenceRealisasi;
DialogButton _DialogButton;
;
/*
if(Realisasi.value() == noyes::Yes
&& GG_FPJVoucher_FPJVoucherType.selection() == GG_FPJVoucherType::CashReceipt)
{
error("Maaf, Anda belum memilih Reference Realisasi");
return;
}
if(cash.value() == noyes::Yes
&& GG_FPJVoucher_FPJVoucherType.selection() == GG_FPJVoucherType::CashReceipt)
{
error("Maaf, Anda belum memilih Reference Realisasi");
return;
}
*/
if(Realisasi.value() == noyes::No && Cash.value() == noyes::No && Credit.value() == noyes::No && Advance.value() == noyes::No)
{
error("Maaf, Anda belum memilih jenis transaksi");
return;
}
if(BIT_GG_FPJVoucher_DPPBaseAmount.realValue() != GG_FPJVoucher_DPPBaseAmount.realValue())
{
if(box::yesNo("Amount nilainya tidak sama, apakah kamu ingin tetap menyimpan ?",dialogButton::Yes, "Confirmation") == dialogButton::No )
{
if(_DialogButton == DialogButton::Yes)
{
return;
}
else if(_dialogButton == dialogButton::No)
{
return;
}
/*
error("Nilai Base amount dan Voucher Amount tidak sama");
return;*/
}
}
_SalesIdBase = GGSalesID.valueStr();
_BIT_ReferenceRealisasi = str2enum(_BIT_ReferenceRealisasi, ReferenceRealisasi.valueStr());
// ended by adit
if (GG_FPJVoucher_TotalVoucherAmount.realValue() != 0)
{
If ((PPNPercent.realValue() == 0 && Berikat.value() == NoYes::Yes) ||
(PPNPercent.realValue() != 0 && Berikat.value() == NoYes::No) ||
(PPNPercent.realValue() == 0 && Element.CreateFaktur(GG_FPJVoucher2.Voucher)))
{
if (box::yesNo("Are you sure to save ?", dialogButton::No, "Confirmation") == dialogButton::Yes)
{
select _GG_FPJVoucher1 index hint voucheridx where _GG_FPJVoucher1.Voucher == GG_FPJVoucher_Voucher.text();
// ================================== Untuk input voucher baru ============================================
if (!_GG_FPJVoucher1)
{
if (element.checkDateValidation(GG_FPJVoucher_CustAccount.text(), GGSalesID.text(), GG_FPJVoucher_VoucherDate.dateValue()))
{
//num seq
TempTxt2 = GG_FPJParameter::getnextStrId(1, OverwriteNextNum.value());
Try
{
ttsbegin;
GG_FPJVoucher2.clear();
GG_FPJVoucher2.Voucher = GG_FPJVoucher_Voucher.text();
GG_FPJVoucher2.CurrencyCode = GG_FPJVoucher_CurrencyCode.text();
GG_FPJVoucher2.JournalId = GG_FPJVoucher_JournalId.text();
GG_FPJVoucher2.VoucherDate = GG_FPJVoucher_VoucherDate.dateValue();
GG_FPJVoucher2.FPJVoucherId = TempTxt2;
GG_FPJVoucher2.CustAccount = GG_FPJVoucher_CustAccount.text();
GG_FPJVoucher2.TotalVoucherAmount = GG_FPJVoucher_TotalVoucherAmount.realValue();
GG_FPJVoucher2.DPPBaseAmount = GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.PPNBaseAmount = GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.PPhBaseAmount = GG_FPJVoucher_PPhBaseAmount.realValue();
GG_FPJVoucher2.FPJExchRate = GG_FPJVoucher_FPJExchRate.realValue();
GG_FPJVoucher2.PPhExchRate = GG_FPJVoucher_PPhExchRate.realValue();
GG_FPJVoucher2.FPJVoucherType = GG_FPJVoucher_FPJVoucherType.selection();
GG_FPJVoucher2.SalesId = GGSalesID.text();
GG_FPJVoucher2.VATPercent = PPNPercent.realValue();
GG_FPJVoucher2.PPhPercent = PPhPercent.realValue();
GG_FPJVoucher2.RetensiPercent = RetensiPercent.realValue();
GG_FPJVoucher2.RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.UangMuka = Advance.value();
// added by adit
GG_FPJVoucher2.BIT_RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.BIT_RetensiReturn = BIT_Retensireturn.realValue();
GG_FPJVoucher2.BIT_Realisasi = Realisasi.value();
GG_FPJVoucher2.BIT_Cash = Cash.value();
GG_FPJVoucher2.BIT_Credit = Credit.value();
GG_FPJVoucher2.BIT_KodePajak = BIT_KodePajak.valueStr();
GG_FPJVoucher2.BIT_FPJReference = GG_FPJFakturPajakNum.valuestr();
// Jika tipenya = Invoice && Return maka Update Status SO menjadi closed jika sudah pernah di input
// 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::CashReceipt)
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;
}
// add by adit - Tambahkan Base Amount
if(Realisasi.value() == NoYes::Yes)
{
GG_FPJVoucher2.BIT_DPPBaseAmount = BIT_GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPNBaseAmount = BIT_GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPHBaseAmount = BIT_GG_FPJVoucher_PPHBaseAmount.realValue();
GG_FPJVoucher2.BIT_TotalVoucherAmount = BIT_GG_FPJVoucher_TotalBaseAmount.realValue();
}
else
// ended by adit
GG_FPJVoucher2.AlocFPJNum = OthFaktur.text();
GG_FPJVoucher2.Berikat = Berikat.value();
/*
//Breakpoint;
If ((Element.CreateFaktur(GG_FPJVoucher2.Voucher)) && ((GG_FPJVoucher2.VATPercent || GG_FPJVoucher2.PPhPercent) || Berikat.value()==NoYes::Yes))
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = element.calculateAmountFakturTRY(GG_FPJVoucher2.Voucher, GG_FPJVoucher2.SalesId);
Else
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = [0, 0, 0];
//Breakpoint;
IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
GG_FPJVoucher2.Status = GG_OpenClose::OpenVAT;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
{
If (Berikat.value() != NoYes::Yes)
GG_FPJVoucher2.Status = GG_OpenClose::OpenPPh;
}
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
{
GG_FPJVoucher2.Status = GG_OpenClose::Closed;
}
If ((Berikat.value() == NoYes::Yes) && (GG_FPJVoucher2.AmountDPPFaktur != 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
IF (SalesTable::find(GG_FPJVoucher2.SalesId).GGRetensi)
GG_FPJVoucher2.calculateAmountFakturRetensi();
*/
IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
GG_FPJVoucher2.Status = GG_OpenClose::OpenVAT;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
{
If (Berikat.value() != NoYes::Yes)
GG_FPJVoucher2.Status = GG_OpenClose::OpenPPh;
}
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
{
GG_FPJVoucher2.Status = GG_OpenClose::Closed;
}
If ((Berikat.value() == NoYes::Yes) && (GG_FPJVoucher2.AmountDPPFaktur != 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
// IF (SalesTable::find(GG_FPJVoucher2.SalesId).GGRetensi)
// {
GG_FPJVoucher2.calculateAmountFakturRetensi();
GG_FPJVoucher2.insert();
ttscommit;
info(strfmt("Data Inserted (Id : %1)", GG_FPJVoucher2.FPJVoucherId));
element.close();
// }
}
catch
{
error("Process error");
ttsabort;
}
}
//else
// warning("Older Voucher date already exist in the same Customer account, please check transaction");
}
//=============== Untuk voucher yang sudah pernah di input dan ingin dibatalkan ========================
if(_GG_FPJVoucher1 && GG_FpjVoucher::FindVoucher(GG_FPJVoucher_Voucher.valueStr()).BIT_Batal == noyes::Yes)
{
TempTxt2 = GG_FPJParameter::getnextStrId(1, OverwriteNextNum.value());
Try
{
ttsbegin;
GG_FPJVoucher2.clear();
GG_FPJVoucher2.Voucher = GG_FPJVoucher_Voucher.text();
GG_FPJVoucher2.CurrencyCode = GG_FPJVoucher_CurrencyCode.text();
GG_FPJVoucher2.JournalId = GG_FPJVoucher_JournalId.text();
GG_FPJVoucher2.VoucherDate = GG_FPJVoucher_VoucherDate.dateValue();
GG_FPJVoucher2.FPJVoucherId = TempTxt2;
GG_FPJVoucher2.CustAccount = GG_FPJVoucher_CustAccount.text();
GG_FPJVoucher2.TotalVoucherAmount = GG_FPJVoucher_TotalVoucherAmount.realValue();
GG_FPJVoucher2.DPPBaseAmount = GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.PPNBaseAmount = GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.PPhBaseAmount = GG_FPJVoucher_PPhBaseAmount.realValue();
GG_FPJVoucher2.FPJExchRate = GG_FPJVoucher_FPJExchRate.realValue();
GG_FPJVoucher2.PPhExchRate = GG_FPJVoucher_PPhExchRate.realValue();
GG_FPJVoucher2.FPJVoucherType = GG_FPJVoucher_FPJVoucherType.selection();
GG_FPJVoucher2.SalesId = GGSalesID.text();
GG_FPJVoucher2.VATPercent = PPNPercent.realValue();
GG_FPJVoucher2.PPhPercent = PPhPercent.realValue();
GG_FPJVoucher2.RetensiPercent = RetensiPercent.realValue();
GG_FPJVoucher2.RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.UangMuka = Advance.value();
// added by adit
//select _GG_FPJVoucher1 index hint voucheridx where _GG_FPJVoucher1.Voucher == GG_FPJVoucher_Voucher.text();
while select GG_FPJVoucher_Cek_Batal where GG_FPJVoucher_Cek_Batal.Voucher == GG_FPJVoucher_Voucher.valueStr()
&& GG_FPJVoucher_Cek_Batal.BIT_Batal == noyes::no
{
throw error ("voucher / invoice already exist");
}
GG_FPJVoucher2.BIT_RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.BIT_RetensiReturn = BIT_Retensireturn.realValue();
GG_FPJVoucher2.BIT_Realisasi = Realisasi.value();
GG_FPJVoucher2.BIT_Cash = Cash.value();
GG_FPJVoucher2.BIT_Credit = Credit.value();
GG_FPJVoucher2.BIT_KodePajak = BIT_KodePajak.valueStr();
GG_FPJVoucher2.BIT_FPJReference = GG_FPJFakturPajakNum.valuestr();
// Jika tipenya = Invoice && Return maka Update Status SO menjadi closed jika sudah pernah di input
// 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::CashReceipt)
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;
}
// Tambahkan Base Amount
GG_FPJVoucher2.BIT_DPPBaseAmount = BIT_GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPNBaseAmount = BIT_GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPHBaseAmount = BIT_GG_FPJVoucher_PPHBaseAmount.realValue();
GG_FPJVoucher2.BIT_TotalVoucherAmount = BIT_GG_FPJVoucher_TotalBaseAmount.realValue();
// ended by adit
GG_FPJVoucher2.AlocFPJNum = OthFaktur.text();
GG_FPJVoucher2.Berikat = Berikat.value();
//Breakpoint;
If ((Element.CreateFaktur(GG_FPJVoucher2.Voucher)) && ((GG_FPJVoucher2.VATPercent || GG_FPJVoucher2.PPhPercent) || Berikat.value()==NoYes::Yes))
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = element.calculateAmountFakturTRY(GG_FPJVoucher2.Voucher, GG_FPJVoucher2.SalesId);
Else
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = [0, 0, 0];
//Breakpoint;
IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
GG_FPJVoucher2.Status = GG_OpenClose::OpenVAT;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
{
If (Berikat.value() != NoYes::Yes)
GG_FPJVoucher2.Status = GG_OpenClose::OpenPPh;
}
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
{
GG_FPJVoucher2.Status = GG_OpenClose::Closed;
}
If ((Berikat.value() == NoYes::Yes) && (GG_FPJVoucher2.AmountDPPFaktur != 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
IF (SalesTable::find(GG_FPJVoucher2.SalesId).GGRetensi)
GG_FPJVoucher2.calculateAmountFakturRetensi();
GG_FPJVoucher2.insert();
ttscommit;
info(strfmt("Data Inserted (Id : %1)", GG_FPJVoucher2.FPJVoucherId));
element.close();
}
catch (exception::error)
{
error ("Process was aborted");
}
catch
{
error("Process error");
ttsabort;
}
}
}
//=============== Untuk voucher yang sudah pernah di input dan ingin diganti ========================
if (_GG_FPJVoucher1 && substr(BIT_KodePajak.valueStr(), 3, 1) == "1")
{
TempTxt2 = GG_FPJParameter::getnextStrId(1, OverwriteNextNum.value());
//
Try
{
ttsbegin;
GG_FPJVoucher2.clear();
GG_FPJVoucher2.Voucher = GG_FPJVoucher_Voucher.text();
GG_FPJVoucher2.CurrencyCode = GG_FPJVoucher_CurrencyCode.text();
GG_FPJVoucher2.JournalId = GG_FPJVoucher_JournalId.text();
GG_FPJVoucher2.VoucherDate = GG_FPJVoucher_VoucherDate.dateValue();
GG_FPJVoucher2.FPJVoucherId = TempTxt2;
GG_FPJVoucher2.CustAccount = GG_FPJVoucher_CustAccount.text();
GG_FPJVoucher2.TotalVoucherAmount = GG_FPJVoucher_TotalVoucherAmount.realValue();
GG_FPJVoucher2.DPPBaseAmount = GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.PPNBaseAmount = GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.PPhBaseAmount = GG_FPJVoucher_PPhBaseAmount.realValue();
GG_FPJVoucher2.FPJExchRate = GG_FPJVoucher_FPJExchRate.realValue();
GG_FPJVoucher2.PPhExchRate = GG_FPJVoucher_PPhExchRate.realValue();
GG_FPJVoucher2.FPJVoucherType = GG_FPJVoucher_FPJVoucherType.selection();
GG_FPJVoucher2.SalesId = GGSalesID.text();
GG_FPJVoucher2.VATPercent = PPNPercent.realValue();
GG_FPJVoucher2.PPhPercent = PPhPercent.realValue();
GG_FPJVoucher2.RetensiPercent = RetensiPercent.realValue();
GG_FPJVoucher2.RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.UangMuka = Advance.value();
// added by adit
GG_FPJVoucher2.BIT_RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.BIT_RetensiReturn = BIT_Retensireturn.realValue();
GG_FPJVoucher2.BIT_Realisasi = Realisasi.value();
GG_FPJVoucher2.BIT_Cash = Cash.value();
GG_FPJVoucher2.BIT_Credit = Credit.value();
GG_FPJVoucher2.BIT_KodePajak = BIT_KodePajak.valueStr();
GG_FPJVoucher2.BIT_FPJReference = GG_FPJFakturPajakNum.valuestr();
// Jika tipenya = Invoice && Return maka Update Status SO menjadi closed jika sudah pernah di input
// 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::CashReceipt)
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;
}
// Tambahkan Base Amount
GG_FPJVoucher2.BIT_DPPBaseAmount = BIT_GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPNBaseAmount = BIT_GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPHBaseAmount = BIT_GG_FPJVoucher_PPHBaseAmount.realValue();
GG_FPJVoucher2.BIT_TotalVoucherAmount = BIT_GG_FPJVoucher_TotalBaseAmount.realValue();
// ended by adit
GG_FPJVoucher2.AlocFPJNum = OthFaktur.text();
GG_FPJVoucher2.Berikat = Berikat.value();
//Breakpoint;
If ((Element.CreateFaktur(GG_FPJVoucher2.Voucher)) && ((GG_FPJVoucher2.VATPercent || GG_FPJVoucher2.PPhPercent) || Berikat.value()==NoYes::Yes))
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = element.calculateAmountFakturTRY(GG_FPJVoucher2.Voucher, GG_FPJVoucher2.SalesId);
Else
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = [0, 0, 0];
//Breakpoint;
IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
GG_FPJVoucher2.Status = GG_OpenClose::OpenVAT;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
{
If (Berikat.value() != NoYes::Yes)
GG_FPJVoucher2.Status = GG_OpenClose::OpenPPh;
}
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
{
GG_FPJVoucher2.Status = GG_OpenClose::Closed;
}
If ((Berikat.value() == NoYes::Yes) && (GG_FPJVoucher2.AmountDPPFaktur != 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
IF (SalesTable::find(GG_FPJVoucher2.SalesId).GGRetensi)
GG_FPJVoucher2.calculateAmountFakturRetensi();
GG_FPJVoucher2.insert();
ttscommit;
info(strfmt("Data Inserted (Id : %1)", GG_FPJVoucher2.FPJVoucherId));
element.close();
}
catch
{
error("Process error");
ttsabort;
}
}
// warning("voucher already exist");
element.close();
}
else
warning ("Cannot proceed, because PPNPercent for Berikat Customer, must be NULL");
}
else
warning ("Cannot proceed because Voucher Amount is zero");
}
{
}
void OK_Button()
{
GG_FPJVoucher _GG_FPJVoucher1, GG_FPJVoucher2, GG_FPJVoucher_UpdateSO_Status, GG_FPJVoucher_Cek_Batal;
str TempTxt1, TempTxt2;
Args _Args;
// added by adit
Salesline _salesline;
SalesIdBase _SalesIdBase;
BIT_ReferenceRealisasi _BIT_ReferenceRealisasi;
DialogButton _DialogButton;
;
/*
if(Realisasi.value() == noyes::Yes
&& GG_FPJVoucher_FPJVoucherType.selection() == GG_FPJVoucherType::CashReceipt)
{
error("Maaf, Anda belum memilih Reference Realisasi");
return;
}
if(cash.value() == noyes::Yes
&& GG_FPJVoucher_FPJVoucherType.selection() == GG_FPJVoucherType::CashReceipt)
{
error("Maaf, Anda belum memilih Reference Realisasi");
return;
}
*/
if(Realisasi.value() == noyes::No && Cash.value() == noyes::No && Credit.value() == noyes::No && Advance.value() == noyes::No)
{
error("Maaf, Anda belum memilih jenis transaksi");
return;
}
if(BIT_GG_FPJVoucher_DPPBaseAmount.realValue() != GG_FPJVoucher_DPPBaseAmount.realValue())
{
if(box::yesNo("Amount nilainya tidak sama, apakah kamu ingin tetap menyimpan ?",dialogButton::Yes, "Confirmation") == dialogButton::No )
{
if(_DialogButton == DialogButton::Yes)
{
return;
}
else if(_dialogButton == dialogButton::No)
{
return;
}
/*
error("Nilai Base amount dan Voucher Amount tidak sama");
return;*/
}
}
_SalesIdBase = GGSalesID.valueStr();
_BIT_ReferenceRealisasi = str2enum(_BIT_ReferenceRealisasi, ReferenceRealisasi.valueStr());
// ended by adit
if (GG_FPJVoucher_TotalVoucherAmount.realValue() != 0)
{
If ((PPNPercent.realValue() == 0 && Berikat.value() == NoYes::Yes) ||
(PPNPercent.realValue() != 0 && Berikat.value() == NoYes::No) ||
(PPNPercent.realValue() == 0 && Element.CreateFaktur(GG_FPJVoucher2.Voucher)))
{
if (box::yesNo("Are you sure to save ?", dialogButton::No, "Confirmation") == dialogButton::Yes)
{
select _GG_FPJVoucher1 index hint voucheridx where _GG_FPJVoucher1.Voucher == GG_FPJVoucher_Voucher.text();
// ================================== Untuk input voucher baru ============================================
if (!_GG_FPJVoucher1)
{
if (element.checkDateValidation(GG_FPJVoucher_CustAccount.text(), GGSalesID.text(), GG_FPJVoucher_VoucherDate.dateValue()))
{
//num seq
TempTxt2 = GG_FPJParameter::getnextStrId(1, OverwriteNextNum.value());
Try
{
ttsbegin;
GG_FPJVoucher2.clear();
GG_FPJVoucher2.Voucher = GG_FPJVoucher_Voucher.text();
GG_FPJVoucher2.CurrencyCode = GG_FPJVoucher_CurrencyCode.text();
GG_FPJVoucher2.JournalId = GG_FPJVoucher_JournalId.text();
GG_FPJVoucher2.VoucherDate = GG_FPJVoucher_VoucherDate.dateValue();
GG_FPJVoucher2.FPJVoucherId = TempTxt2;
GG_FPJVoucher2.CustAccount = GG_FPJVoucher_CustAccount.text();
GG_FPJVoucher2.TotalVoucherAmount = GG_FPJVoucher_TotalVoucherAmount.realValue();
GG_FPJVoucher2.DPPBaseAmount = GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.PPNBaseAmount = GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.PPhBaseAmount = GG_FPJVoucher_PPhBaseAmount.realValue();
GG_FPJVoucher2.FPJExchRate = GG_FPJVoucher_FPJExchRate.realValue();
GG_FPJVoucher2.PPhExchRate = GG_FPJVoucher_PPhExchRate.realValue();
GG_FPJVoucher2.FPJVoucherType = GG_FPJVoucher_FPJVoucherType.selection();
GG_FPJVoucher2.SalesId = GGSalesID.text();
GG_FPJVoucher2.VATPercent = PPNPercent.realValue();
GG_FPJVoucher2.PPhPercent = PPhPercent.realValue();
GG_FPJVoucher2.RetensiPercent = RetensiPercent.realValue();
GG_FPJVoucher2.RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.UangMuka = Advance.value();
// added by adit
GG_FPJVoucher2.BIT_RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.BIT_RetensiReturn = BIT_Retensireturn.realValue();
GG_FPJVoucher2.BIT_Realisasi = Realisasi.value();
GG_FPJVoucher2.BIT_Cash = Cash.value();
GG_FPJVoucher2.BIT_Credit = Credit.value();
GG_FPJVoucher2.BIT_KodePajak = BIT_KodePajak.valueStr();
GG_FPJVoucher2.BIT_FPJReference = GG_FPJFakturPajakNum.valuestr();
// Jika tipenya = Invoice && Return maka Update Status SO menjadi closed jika sudah pernah di input
// 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::CashReceipt)
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;
}
// add by adit - Tambahkan Base Amount
if(Realisasi.value() == NoYes::Yes)
{
GG_FPJVoucher2.BIT_DPPBaseAmount = BIT_GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPNBaseAmount = BIT_GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPHBaseAmount = BIT_GG_FPJVoucher_PPHBaseAmount.realValue();
GG_FPJVoucher2.BIT_TotalVoucherAmount = BIT_GG_FPJVoucher_TotalBaseAmount.realValue();
}
else
// ended by adit
GG_FPJVoucher2.AlocFPJNum = OthFaktur.text();
GG_FPJVoucher2.Berikat = Berikat.value();
/*
//Breakpoint;
If ((Element.CreateFaktur(GG_FPJVoucher2.Voucher)) && ((GG_FPJVoucher2.VATPercent || GG_FPJVoucher2.PPhPercent) || Berikat.value()==NoYes::Yes))
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = element.calculateAmountFakturTRY(GG_FPJVoucher2.Voucher, GG_FPJVoucher2.SalesId);
Else
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = [0, 0, 0];
//Breakpoint;
IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
GG_FPJVoucher2.Status = GG_OpenClose::OpenVAT;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
{
If (Berikat.value() != NoYes::Yes)
GG_FPJVoucher2.Status = GG_OpenClose::OpenPPh;
}
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
{
GG_FPJVoucher2.Status = GG_OpenClose::Closed;
}
If ((Berikat.value() == NoYes::Yes) && (GG_FPJVoucher2.AmountDPPFaktur != 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
IF (SalesTable::find(GG_FPJVoucher2.SalesId).GGRetensi)
GG_FPJVoucher2.calculateAmountFakturRetensi();
*/
IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
GG_FPJVoucher2.Status = GG_OpenClose::OpenVAT;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
{
If (Berikat.value() != NoYes::Yes)
GG_FPJVoucher2.Status = GG_OpenClose::OpenPPh;
}
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
{
GG_FPJVoucher2.Status = GG_OpenClose::Closed;
}
If ((Berikat.value() == NoYes::Yes) && (GG_FPJVoucher2.AmountDPPFaktur != 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
// IF (SalesTable::find(GG_FPJVoucher2.SalesId).GGRetensi)
// {
GG_FPJVoucher2.calculateAmountFakturRetensi();
GG_FPJVoucher2.insert();
ttscommit;
info(strfmt("Data Inserted (Id : %1)", GG_FPJVoucher2.FPJVoucherId));
element.close();
// }
}
catch
{
error("Process error");
ttsabort;
}
}
//else
// warning("Older Voucher date already exist in the same Customer account, please check transaction");
}
//=============== Untuk voucher yang sudah pernah di input dan ingin dibatalkan ========================
if(_GG_FPJVoucher1 && GG_FpjVoucher::FindVoucher(GG_FPJVoucher_Voucher.valueStr()).BIT_Batal == noyes::Yes)
{
TempTxt2 = GG_FPJParameter::getnextStrId(1, OverwriteNextNum.value());
Try
{
ttsbegin;
GG_FPJVoucher2.clear();
GG_FPJVoucher2.Voucher = GG_FPJVoucher_Voucher.text();
GG_FPJVoucher2.CurrencyCode = GG_FPJVoucher_CurrencyCode.text();
GG_FPJVoucher2.JournalId = GG_FPJVoucher_JournalId.text();
GG_FPJVoucher2.VoucherDate = GG_FPJVoucher_VoucherDate.dateValue();
GG_FPJVoucher2.FPJVoucherId = TempTxt2;
GG_FPJVoucher2.CustAccount = GG_FPJVoucher_CustAccount.text();
GG_FPJVoucher2.TotalVoucherAmount = GG_FPJVoucher_TotalVoucherAmount.realValue();
GG_FPJVoucher2.DPPBaseAmount = GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.PPNBaseAmount = GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.PPhBaseAmount = GG_FPJVoucher_PPhBaseAmount.realValue();
GG_FPJVoucher2.FPJExchRate = GG_FPJVoucher_FPJExchRate.realValue();
GG_FPJVoucher2.PPhExchRate = GG_FPJVoucher_PPhExchRate.realValue();
GG_FPJVoucher2.FPJVoucherType = GG_FPJVoucher_FPJVoucherType.selection();
GG_FPJVoucher2.SalesId = GGSalesID.text();
GG_FPJVoucher2.VATPercent = PPNPercent.realValue();
GG_FPJVoucher2.PPhPercent = PPhPercent.realValue();
GG_FPJVoucher2.RetensiPercent = RetensiPercent.realValue();
GG_FPJVoucher2.RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.UangMuka = Advance.value();
// added by adit
//select _GG_FPJVoucher1 index hint voucheridx where _GG_FPJVoucher1.Voucher == GG_FPJVoucher_Voucher.text();
while select GG_FPJVoucher_Cek_Batal where GG_FPJVoucher_Cek_Batal.Voucher == GG_FPJVoucher_Voucher.valueStr()
&& GG_FPJVoucher_Cek_Batal.BIT_Batal == noyes::no
{
throw error ("voucher / invoice already exist");
}
GG_FPJVoucher2.BIT_RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.BIT_RetensiReturn = BIT_Retensireturn.realValue();
GG_FPJVoucher2.BIT_Realisasi = Realisasi.value();
GG_FPJVoucher2.BIT_Cash = Cash.value();
GG_FPJVoucher2.BIT_Credit = Credit.value();
GG_FPJVoucher2.BIT_KodePajak = BIT_KodePajak.valueStr();
GG_FPJVoucher2.BIT_FPJReference = GG_FPJFakturPajakNum.valuestr();
// Jika tipenya = Invoice && Return maka Update Status SO menjadi closed jika sudah pernah di input
// 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::CashReceipt)
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;
}
// Tambahkan Base Amount
GG_FPJVoucher2.BIT_DPPBaseAmount = BIT_GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPNBaseAmount = BIT_GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPHBaseAmount = BIT_GG_FPJVoucher_PPHBaseAmount.realValue();
GG_FPJVoucher2.BIT_TotalVoucherAmount = BIT_GG_FPJVoucher_TotalBaseAmount.realValue();
// ended by adit
GG_FPJVoucher2.AlocFPJNum = OthFaktur.text();
GG_FPJVoucher2.Berikat = Berikat.value();
//Breakpoint;
If ((Element.CreateFaktur(GG_FPJVoucher2.Voucher)) && ((GG_FPJVoucher2.VATPercent || GG_FPJVoucher2.PPhPercent) || Berikat.value()==NoYes::Yes))
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = element.calculateAmountFakturTRY(GG_FPJVoucher2.Voucher, GG_FPJVoucher2.SalesId);
Else
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = [0, 0, 0];
//Breakpoint;
IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
GG_FPJVoucher2.Status = GG_OpenClose::OpenVAT;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
{
If (Berikat.value() != NoYes::Yes)
GG_FPJVoucher2.Status = GG_OpenClose::OpenPPh;
}
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
{
GG_FPJVoucher2.Status = GG_OpenClose::Closed;
}
If ((Berikat.value() == NoYes::Yes) && (GG_FPJVoucher2.AmountDPPFaktur != 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
IF (SalesTable::find(GG_FPJVoucher2.SalesId).GGRetensi)
GG_FPJVoucher2.calculateAmountFakturRetensi();
GG_FPJVoucher2.insert();
ttscommit;
info(strfmt("Data Inserted (Id : %1)", GG_FPJVoucher2.FPJVoucherId));
element.close();
}
catch (exception::error)
{
error ("Process was aborted");
}
catch
{
error("Process error");
ttsabort;
}
}
}
//=============== Untuk voucher yang sudah pernah di input dan ingin diganti ========================
if (_GG_FPJVoucher1 && substr(BIT_KodePajak.valueStr(), 3, 1) == "1")
{
TempTxt2 = GG_FPJParameter::getnextStrId(1, OverwriteNextNum.value());
//
Try
{
ttsbegin;
GG_FPJVoucher2.clear();
GG_FPJVoucher2.Voucher = GG_FPJVoucher_Voucher.text();
GG_FPJVoucher2.CurrencyCode = GG_FPJVoucher_CurrencyCode.text();
GG_FPJVoucher2.JournalId = GG_FPJVoucher_JournalId.text();
GG_FPJVoucher2.VoucherDate = GG_FPJVoucher_VoucherDate.dateValue();
GG_FPJVoucher2.FPJVoucherId = TempTxt2;
GG_FPJVoucher2.CustAccount = GG_FPJVoucher_CustAccount.text();
GG_FPJVoucher2.TotalVoucherAmount = GG_FPJVoucher_TotalVoucherAmount.realValue();
GG_FPJVoucher2.DPPBaseAmount = GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.PPNBaseAmount = GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.PPhBaseAmount = GG_FPJVoucher_PPhBaseAmount.realValue();
GG_FPJVoucher2.FPJExchRate = GG_FPJVoucher_FPJExchRate.realValue();
GG_FPJVoucher2.PPhExchRate = GG_FPJVoucher_PPhExchRate.realValue();
GG_FPJVoucher2.FPJVoucherType = GG_FPJVoucher_FPJVoucherType.selection();
GG_FPJVoucher2.SalesId = GGSalesID.text();
GG_FPJVoucher2.VATPercent = PPNPercent.realValue();
GG_FPJVoucher2.PPhPercent = PPhPercent.realValue();
GG_FPJVoucher2.RetensiPercent = RetensiPercent.realValue();
GG_FPJVoucher2.RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.UangMuka = Advance.value();
// added by adit
GG_FPJVoucher2.BIT_RetensiAmount = RetensiAmount.realValue();
GG_FPJVoucher2.BIT_RetensiReturn = BIT_Retensireturn.realValue();
GG_FPJVoucher2.BIT_Realisasi = Realisasi.value();
GG_FPJVoucher2.BIT_Cash = Cash.value();
GG_FPJVoucher2.BIT_Credit = Credit.value();
GG_FPJVoucher2.BIT_KodePajak = BIT_KodePajak.valueStr();
GG_FPJVoucher2.BIT_FPJReference = GG_FPJFakturPajakNum.valuestr();
// Jika tipenya = Invoice && Return maka Update Status SO menjadi closed jika sudah pernah di input
// 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::CashReceipt)
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;
}
// Tambahkan Base Amount
GG_FPJVoucher2.BIT_DPPBaseAmount = BIT_GG_FPJVoucher_DPPBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPNBaseAmount = BIT_GG_FPJVoucher_PPNBaseAmount.realValue();
GG_FPJVoucher2.BIT_PPHBaseAmount = BIT_GG_FPJVoucher_PPHBaseAmount.realValue();
GG_FPJVoucher2.BIT_TotalVoucherAmount = BIT_GG_FPJVoucher_TotalBaseAmount.realValue();
// ended by adit
GG_FPJVoucher2.AlocFPJNum = OthFaktur.text();
GG_FPJVoucher2.Berikat = Berikat.value();
//Breakpoint;
If ((Element.CreateFaktur(GG_FPJVoucher2.Voucher)) && ((GG_FPJVoucher2.VATPercent || GG_FPJVoucher2.PPhPercent) || Berikat.value()==NoYes::Yes))
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = element.calculateAmountFakturTRY(GG_FPJVoucher2.Voucher, GG_FPJVoucher2.SalesId);
Else
[GG_FPJVoucher2.AmountDPPFaktur, GG_FPJVoucher2.AmountPPNFaktur, GG_FPJVoucher2.AmountPPhFaktur] = [0, 0, 0];
//Breakpoint;
IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
GG_FPJVoucher2.Status = GG_OpenClose::OpenVAT;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
{
If (Berikat.value() != NoYes::Yes)
GG_FPJVoucher2.Status = GG_OpenClose::OpenPPh;
}
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur > 0) && (GG_FPJVoucher2.AmountPPhFaktur > 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
ELSE IF ((GG_FPJVoucher2.AmountPPNFaktur == 0) && (GG_FPJVoucher2.AmountPPhFaktur == 0))
{
GG_FPJVoucher2.Status = GG_OpenClose::Closed;
}
If ((Berikat.value() == NoYes::Yes) && (GG_FPJVoucher2.AmountDPPFaktur != 0))
GG_FPJVoucher2.Status = GG_OpenClose::Open;
IF (SalesTable::find(GG_FPJVoucher2.SalesId).GGRetensi)
GG_FPJVoucher2.calculateAmountFakturRetensi();
GG_FPJVoucher2.insert();
ttscommit;
info(strfmt("Data Inserted (Id : %1)", GG_FPJVoucher2.FPJVoucherId));
element.close();
}
catch
{
error("Process error");
ttsabort;
}
}
// warning("voucher already exist");
element.close();
}
else
warning ("Cannot proceed, because PPNPercent for Berikat Customer, must be NULL");
}
else
warning ("Cannot proceed because Voucher Amount is zero");
}
0 comments:
Post a Comment