you have to try first run test system .
static void xxx(Args _args)
{
invoiceId NumFacturaDesde;
invoiceId NumFacturaHasta;
CustInvoiceJour _custinvoicejour;
CustInvoiceSalesLink _custinvoicesaleslink;
CustInvoiceTrans _custinvoicetrans;
LedgerTrans _ledgertrans;
CustTrans _custtrans;
CustTransOpen _custtransopen;
InventTrans _inventtrans;
TaxTrans _taxtrans;
CustBillOfExchangeInvoice _CustBillOfExchangeInvoice;
CustBillOfExchangeTrans _CustBillOfExchangeTrans;
CustSetTlement _CustSetTlement;
InvoiceDate FechaBuena;
;
//Inicializamos variables
NumFacturaDesde = '035884';
NumFacturaHasta = '035884';
FechaBuena = str2date("22.04.2005",123);
ttsbegin;
_custinvoicejour.clear();
SELECT FORUPDATE * FROM _custinvoicejour
WHERE _custinvoicejour.InvoiceId>=NumFacturaDesde &&
_custinvoicejour.InvoiceId<=NumFacturaHasta;
while(_custinvoicejour.RecId)
{
_custinvoicesaleslink.clear();
SELECT FORUPDATE * FROM _custinvoicesaleslink
WHERE _custinvoicesaleslink.invoiceId == _custinvoicejour.InvoiceId;
while(_custinvoicesaleslink.RecId)
{
_custinvoicesaleslink.invoiceDate = FechaBuena;
_custinvoicesaleslink.update();
next _custinvoicesaleslink;
}
_custinvoicetrans.clear();
SELECT FORUPDATE * FROM _custinvoicetrans
WHERE _custinvoicetrans.InvoiceId == _custinvoicejour.InvoiceId;
while(_custinvoicetrans.RecId)
{
_custinvoicetrans.InvoiceDate = FechaBuena;
_custinvoicetrans.update();
next _custinvoicetrans;
}
_ledgertrans.clear();
SELECT FORUPDATE * FROM _ledgertrans
WHERE _ledgertrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_ledgertrans.RecId)
{
_ledgertrans.TransDate = FechaBuena;
_ledgertrans.update();
next _ledgertrans;
}
_custtrans.clear();
SELECT FORUPDATE * FROM _custtrans
WHERE _custtrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_custtrans.RecId)
{
SELECT FORUPDATE * FROM _custtransopen
WHERE _custtransopen.RefRecId == _custtrans.RecId;
while(_custtransopen.RecId)
{
_custtransopen.TransDate = FechaBuena;
_custtransopen.update();
next _custtransopen;
}
_custtrans.TransDate = FechaBuena;
_custtrans.update();
next _custtrans;
}
_inventtrans.clear();
SELECT FORUPDATE * FROM _inventtrans
WHERE _inventtrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_inventtrans.RecId)
{
_inventtrans.DateFinancial = FechaBuena;
_inventtrans.update();
next _inventtrans;
}
_taxtrans.clear();
SELECT FORUPDATE * FROM _taxtrans
WHERE _taxtrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_taxtrans.RecId)
{
_taxtrans.TransDate = FechaBuena;
_taxtrans.update();
next _taxtrans;
}
_CustBillOfExchangeInvoice.clear();
SELECT FORUPDATE * FROM _CustBillOfExchangeInvoice
WHERE _CustBillOfExchangeInvoice.InvoiceVoucher ==
_custinvoicejour.LedgerVoucher;
while(_CustBillOfExchangeInvoice.RecId)
{
_CustBillOfExchangeInvoice.TransDate = FechaBuena;
_CustBillOfExchangeInvoice.InvoiceDate = FechaBuena;
_CustBillOfExchangeInvoice.update();
next _CustBillOfExchangeInvoice;
}
_CustBillOfExchangeTrans.clear();
SELECT FORUPDATE * FROM _CustBillOfExchangeTrans
WHERE _CustBillOfExchangeTrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_CustBillOfExchangeTrans.RecId)
{
_CustBillOfExchangeTrans.TransDate = FechaBuena;
_CustBillOfExchangeTrans.update();
next _CustBillOfExchangeTrans;
}
_CustSetTlement.clear();
SELECT FORUPDATE * FROM _CustSetTlement
WHERE _CustSetTlement.OffsetTransVoucher == _custinvoicejour.LedgerVoucher;
while(_CustSetTlement.RecId)
{
_CustSetTlement.TransDate = FechaBuena;
_CustSetTlement.update();
next _CustSetTlement;
}
_custinvoicejour.InvoiceDate = FechaBuena;
_custinvoicejour.update();
next _custinvoicejour;
}
ttscommit;
}
static void xxx(Args _args)
{
invoiceId NumFacturaDesde;
invoiceId NumFacturaHasta;
CustInvoiceJour _custinvoicejour;
CustInvoiceSalesLink _custinvoicesaleslink;
CustInvoiceTrans _custinvoicetrans;
LedgerTrans _ledgertrans;
CustTrans _custtrans;
CustTransOpen _custtransopen;
InventTrans _inventtrans;
TaxTrans _taxtrans;
CustBillOfExchangeInvoice _CustBillOfExchangeInvoice;
CustBillOfExchangeTrans _CustBillOfExchangeTrans;
CustSetTlement _CustSetTlement;
InvoiceDate FechaBuena;
;
//Inicializamos variables
NumFacturaDesde = '035884';
NumFacturaHasta = '035884';
FechaBuena = str2date("22.04.2005",123);
ttsbegin;
_custinvoicejour.clear();
SELECT FORUPDATE * FROM _custinvoicejour
WHERE _custinvoicejour.InvoiceId>=NumFacturaDesde &&
_custinvoicejour.InvoiceId<=NumFacturaHasta;
while(_custinvoicejour.RecId)
{
_custinvoicesaleslink.clear();
SELECT FORUPDATE * FROM _custinvoicesaleslink
WHERE _custinvoicesaleslink.invoiceId == _custinvoicejour.InvoiceId;
while(_custinvoicesaleslink.RecId)
{
_custinvoicesaleslink.invoiceDate = FechaBuena;
_custinvoicesaleslink.update();
next _custinvoicesaleslink;
}
_custinvoicetrans.clear();
SELECT FORUPDATE * FROM _custinvoicetrans
WHERE _custinvoicetrans.InvoiceId == _custinvoicejour.InvoiceId;
while(_custinvoicetrans.RecId)
{
_custinvoicetrans.InvoiceDate = FechaBuena;
_custinvoicetrans.update();
next _custinvoicetrans;
}
_ledgertrans.clear();
SELECT FORUPDATE * FROM _ledgertrans
WHERE _ledgertrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_ledgertrans.RecId)
{
_ledgertrans.TransDate = FechaBuena;
_ledgertrans.update();
next _ledgertrans;
}
_custtrans.clear();
SELECT FORUPDATE * FROM _custtrans
WHERE _custtrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_custtrans.RecId)
{
SELECT FORUPDATE * FROM _custtransopen
WHERE _custtransopen.RefRecId == _custtrans.RecId;
while(_custtransopen.RecId)
{
_custtransopen.TransDate = FechaBuena;
_custtransopen.update();
next _custtransopen;
}
_custtrans.TransDate = FechaBuena;
_custtrans.update();
next _custtrans;
}
_inventtrans.clear();
SELECT FORUPDATE * FROM _inventtrans
WHERE _inventtrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_inventtrans.RecId)
{
_inventtrans.DateFinancial = FechaBuena;
_inventtrans.update();
next _inventtrans;
}
_taxtrans.clear();
SELECT FORUPDATE * FROM _taxtrans
WHERE _taxtrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_taxtrans.RecId)
{
_taxtrans.TransDate = FechaBuena;
_taxtrans.update();
next _taxtrans;
}
_CustBillOfExchangeInvoice.clear();
SELECT FORUPDATE * FROM _CustBillOfExchangeInvoice
WHERE _CustBillOfExchangeInvoice.InvoiceVoucher ==
_custinvoicejour.LedgerVoucher;
while(_CustBillOfExchangeInvoice.RecId)
{
_CustBillOfExchangeInvoice.TransDate = FechaBuena;
_CustBillOfExchangeInvoice.InvoiceDate = FechaBuena;
_CustBillOfExchangeInvoice.update();
next _CustBillOfExchangeInvoice;
}
_CustBillOfExchangeTrans.clear();
SELECT FORUPDATE * FROM _CustBillOfExchangeTrans
WHERE _CustBillOfExchangeTrans.Voucher == _custinvoicejour.LedgerVoucher;
while(_CustBillOfExchangeTrans.RecId)
{
_CustBillOfExchangeTrans.TransDate = FechaBuena;
_CustBillOfExchangeTrans.update();
next _CustBillOfExchangeTrans;
}
_CustSetTlement.clear();
SELECT FORUPDATE * FROM _CustSetTlement
WHERE _CustSetTlement.OffsetTransVoucher == _custinvoicejour.LedgerVoucher;
while(_CustSetTlement.RecId)
{
_CustSetTlement.TransDate = FechaBuena;
_CustSetTlement.update();
next _CustSetTlement;
}
_custinvoicejour.InvoiceDate = FechaBuena;
_custinvoicejour.update();
next _custinvoicejour;
}
ttscommit;
}