diff --git a/Src/Include/Pp.h b/Src/Include/Pp.h index a105a3f1d..30f2ce82f 100644 --- a/Src/Include/Pp.h +++ b/Src/Include/Pp.h @@ -39446,7 +39446,13 @@ class PPViewBill : public PPView { int GetPacket(PPID billID, PPBillPacket * pPack) const; // < P_BPOX==0} PoolInsertionParam Pip; // PrcssrAlcReport * P_Arp; // + PPBillPacket * P_Dl600BPackCache; // @v12.2.0 enum { stNoTempTbl = 0x0001, // Экземпляр не будет создавать временную таблицу, даже если условия фильтрации этого требуют. stCtrlX = 0x0002, @@ -57546,8 +57553,12 @@ class PPChZnPrcssr : private PPEmbeddedLogger { public: struct Param { Param(); + enum { + fTestMode = 0x0001 + }; PPID GuaID; PPID LocID; + long Flags; // @v12.2.0 DateRange Period; }; struct QueryParam { diff --git a/Src/Include/ued-id.h b/Src/Include/ued-id.h index 57f5bcd6c..abb5eee00 100644 --- a/Src/Include/ued-id.h +++ b/Src/Include/ued-id.h @@ -1,9 +1,9 @@ -// UED-ID-TEMP.H +// UED-ID.H // version: 36 // sha256: 30e57f6807209c82ededb4610622268085372e2295a608dc2a01fc98fa6e8173 // -#ifndef __UED_ID_TEMP_H -#define __UED_ID_TEMP_H +#ifndef __UED_ID_H +#define __UED_ID_H #define UED_META_META 0x100000001ULL #define UED_META_PREDEFVALUE 0x100000002ULL @@ -3693,4 +3693,4 @@ #define UED_META_INTEGER 0x197000000ULL #define UED_META_DECIMAL 0x198000000ULL -#endif // __UED_ID_TEMP_H +#endif // __UED_ID_H diff --git a/Src/PPEquip/dls.cpp b/Src/PPEquip/dls.cpp index bcb3e1f7f..9b529cb14 100644 --- a/Src/PPEquip/dls.cpp +++ b/Src/PPEquip/dls.cpp @@ -34,10 +34,7 @@ int DeviceLoadingStat::Fetch(PPID statID, DvcLoadingStatTbl::Rec * pRec) return ok; } -int DeviceLoadingStat::Search(PPID statID, DvcLoadingStatTbl::Rec * pRec) -{ - return SearchByID(this, 0, statID, pRec); -} +int DeviceLoadingStat::Search(PPID statID, DvcLoadingStatTbl::Rec * pRec) { return SearchByID(this, 0, statID, pRec); } int DeviceLoadingStat::GetPrev(PPID curStatID, PPID * pStatID, DvcLoadingStatTbl::Rec * pRec) { diff --git a/Src/PPLib/Account.cpp b/Src/PPLib/Account.cpp index e3c4953bc..437247f6a 100644 --- a/Src/PPLib/Account.cpp +++ b/Src/PPLib/Account.cpp @@ -82,10 +82,7 @@ ArticleCore::ArticleCore() : ArticleTbl() { } -int ArticleCore::Search(PPID id, void * b) -{ - return SearchByID(this, PPOBJ_ARTICLE, id, b); -} +int ArticleCore::Search(PPID id, void * b) { return SearchByID(this, PPOBJ_ARTICLE, id, b); } int ArticleCore::SearchName(PPID accSheetID, const char * pName, void * b) { @@ -229,10 +226,7 @@ AcctRel::AcctRel() : AcctRelTbl() { } -int AcctRel::Search(PPID id, AcctRelTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_ACCTREL, id, pRec); -} +int AcctRel::Search(PPID id, AcctRelTbl::Rec * pRec) { return SearchByID(this, PPOBJ_ACCTREL, id, pRec); } int AcctRel::SearchAcctID(const AcctID * pAcctId, AcctRelTbl::Rec * pRec) { diff --git a/Src/PPLib/BILL.CPP b/Src/PPLib/BILL.CPP index 0d755732b..f0cce56b1 100644 --- a/Src/PPLib/BILL.CPP +++ b/Src/PPLib/BILL.CPP @@ -117,8 +117,7 @@ BillCore::BillCore() : BillTbl() { } -int BillCore::Search(PPID id, BillTbl::Rec * pRec) - { return SearchByID(this, PPOBJ_BILL, id, pRec); } +int BillCore::Search(PPID id, BillTbl::Rec * pRec) { return SearchByID(this, PPOBJ_BILL, id, pRec); } int BillCore::PutItemMemo(PPID id, SString * pBuf, int use_ta) // @v11.1.12 { diff --git a/Src/PPLib/Billdlg.cpp b/Src/PPLib/Billdlg.cpp index 99703ba94..226d840d7 100644 --- a/Src/PPLib/Billdlg.cpp +++ b/Src/PPLib/Billdlg.cpp @@ -3040,8 +3040,8 @@ int BillDialog::getDTS(int onCancel) for(uint i = 0; P_Pack->EnumTItems(&i, &p_ti);) SETFLAG(p_ti->Flags, PPTFR_COSTWSTAX, BIN(P_Pack->Rec.Flags & BILLF_RMVEXCISE)); } - /* @v12.1.12 getCtrlData(CTL_BILL_DOC, P_Pack->Rec.Code); + /* @v12.1.12 getCtrlData(CTL_BILL_DATE, &P_Pack->Rec.Dt); P_Pack->Rec.Dt = P_Pack->Rec.Dt.getactual(ZERODATE); getCtrlData(CTL_BILL_DUEDATE, &P_Pack->Rec.DueDate); diff --git a/Src/PPLib/CCHECK.CPP b/Src/PPLib/CCHECK.CPP index dc55eed07..8856e0f1c 100644 --- a/Src/PPLib/CCHECK.CPP +++ b/Src/PPLib/CCHECK.CPP @@ -1889,7 +1889,7 @@ CCheckCore::~CCheckCore() ZDELETE(P_ChkOpJrnl); } -const PPEquipConfig & CCheckCore::GetEqCfg() const { return EqCfg; } // @v10.9.9 +const PPEquipConfig & CCheckCore::GetEqCfg() const { return EqCfg; } CheckOpJrnl * CCheckCore::GetOpJrnl() { return P_ChkOpJrnl; } // @v11.6.2 int CCheckCore::HasExt() @@ -1903,10 +1903,7 @@ int CCheckCore::HasExt() return 0; } -int CCheckCore::Search(PPID id, CCheckTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_CCHECK, id, pRec); -} +int CCheckCore::Search(PPID id, CCheckTbl::Rec * pRec) { return SearchByID(this, PPOBJ_CCHECK, id, pRec); } int CCheckCore::Search(PPID cashID, LDATE dt, LTIME tm, CCheckTbl::Rec * pRec) { diff --git a/Src/PPLib/Goods.cpp b/Src/PPLib/Goods.cpp index df0764ff0..ed73394f2 100644 --- a/Src/PPLib/Goods.cpp +++ b/Src/PPLib/Goods.cpp @@ -1284,10 +1284,7 @@ int GoodsCore::GetListByBrandList(const PPIDArray & rBrandList, PPIDArray & rGoo return ok; } -int GoodsCore::Search(PPID id, void * b) -{ - return SearchByID(this, PPOBJ_GOODS, id, b); -} +int GoodsCore::Search(PPID id, void * b) { return SearchByID(this, PPOBJ_GOODS, id, b); } int GoodsCore::GetExt(PPID id, GoodsExtTbl::Rec * pRec) { diff --git a/Src/PPLib/LOCATION.CPP b/Src/PPLib/LOCATION.CPP index d12986b2f..2fcc40979 100644 --- a/Src/PPLib/LOCATION.CPP +++ b/Src/PPLib/LOCATION.CPP @@ -166,10 +166,7 @@ LocationCore::~LocationCore() ZDELETE(P_Eac); } -int LocationCore::Search(PPID id, LocationTbl::Rec * b) -{ - return SearchByID(this, PPOBJ_LOCATION, id, b); -} +int LocationCore::Search(PPID id, LocationTbl::Rec * b) { return SearchByID(this, PPOBJ_LOCATION, id, b); } int LocationCore::GetListByCode(PPID locTyp, const char * pCode, PPIDArray * pIdList) { @@ -1027,10 +1024,7 @@ EAddrCore::EAddrCore() : EAddrTbl() { } -int EAddrCore::Search(PPID id, EAddrTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_EADDR, id, pRec); -} +int EAddrCore::Search(PPID id, EAddrTbl::Rec * pRec) { return SearchByID(this, PPOBJ_EADDR, id, pRec); } int EAddrCore::Put(PPID * pID, const PPEAddr * pAddr, const PPObjID * pObjId, int use_ta) { diff --git a/Src/PPLib/OBJASSOC.CPP b/Src/PPLib/OBJASSOC.CPP index 8b80ecb2f..1d05e51ef 100644 --- a/Src/PPLib/OBJASSOC.CPP +++ b/Src/PPLib/OBJASSOC.CPP @@ -1,5 +1,5 @@ // OBJASSOC.CPP -// Copyright (c) A.Sobolev 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013, 2015, 2016, 2017, 2019 +// Copyright (c) A.Sobolev 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013, 2015, 2016, 2017, 2019, 2024 // @Kernel // #include @@ -54,15 +54,8 @@ int ObjAssoc::Remove(PPID id, int use_ta) return 0; } -int ObjAssoc::Search(PPID id, ObjAssocTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_OBJASSOC, id, pRec); -} - -int ObjAssoc::SearchNum(PPID asscTyp, PPID prmr, long num, ObjAssocTbl::Rec * pRec) -{ - return _SearchNum(asscTyp, prmr, num, num ? spEq : spGe, pRec); -} +int ObjAssoc::Search(PPID id, ObjAssocTbl::Rec * pRec) { return SearchByID(this, PPOBJ_OBJASSOC, id, pRec); } +int ObjAssoc::SearchNum(PPID asscTyp, PPID prmr, long num, ObjAssocTbl::Rec * pRec) { return _SearchNum(asscTyp, prmr, num, num ? spEq : spGe, pRec); } int ObjAssoc::_SearchNum(PPID asscTyp, PPID prmr, long num, int spMode, ObjAssocTbl::Rec * b) { diff --git a/Src/PPLib/OBJQCERT.CPP b/Src/PPLib/OBJQCERT.CPP index 274599435..50783e42c 100644 --- a/Src/PPLib/OBJQCERT.CPP +++ b/Src/PPLib/OBJQCERT.CPP @@ -17,10 +17,7 @@ PPObjQCert::~PPObjQCert() TLP_CLOSE(P_Tbl); } -int PPObjQCert::Search(PPID id, void * b) -{ - return SearchByID(P_Tbl, Obj, id, b); -} +int PPObjQCert::Search(PPID id, void * b) { return SearchByID(P_Tbl, Obj, id, b); } int PPObjQCert::SearchByCode(const char * pCode, PPID * pID, QualityCertTbl::Rec * pRec) { diff --git a/Src/PPLib/Objstaff.cpp b/Src/PPLib/Objstaff.cpp index dc5cc78b5..42513af48 100644 --- a/Src/PPLib/Objstaff.cpp +++ b/Src/PPLib/Objstaff.cpp @@ -407,10 +407,7 @@ int PPObjStaffList::AssignPersonToStaff(PPID psnID, PPID staffID, LDATE dt, int return PutPostPacket(&post_id, &pack, use_ta); } -int PPObjStaffList::SearchPost(PPID postID, PersonPostTbl::Rec * pRec) -{ - return SearchByID(P_PostTbl, PPOBJ_PERSONPOST, postID, pRec); -} +int PPObjStaffList::SearchPost(PPID postID, PersonPostTbl::Rec * pRec) { return SearchByID(P_PostTbl, PPOBJ_PERSONPOST, postID, pRec); } int PPObjStaffList::GetPostPacket(PPID postID, PPPsnPostPacket * pPack) { diff --git a/Src/PPLib/PACKAGE.CPP b/Src/PPLib/PACKAGE.CPP index fb0895f4f..a1a4a4cc4 100644 --- a/Src/PPLib/PACKAGE.CPP +++ b/Src/PPLib/PACKAGE.CPP @@ -247,10 +247,7 @@ PackageCore::PackageCore() : PackageTbl() { } -int PackageCore::Search(PPID id, PackageTbl::Rec * pPckg) -{ - return SearchByID(this, PPOBJ_PACKAGE, id, pPckg); -} +int PackageCore::Search(PPID id, PackageTbl::Rec * pPckg) { return SearchByID(this, PPOBJ_PACKAGE, id, pPckg); } int PackageCore::SearchPrev(PPID prevID, PackageTbl::Rec * pPckg) { diff --git a/Src/PPLib/Person.cpp b/Src/PPLib/Person.cpp index 4916d33e8..28611cc63 100644 --- a/Src/PPLib/Person.cpp +++ b/Src/PPLib/Person.cpp @@ -959,10 +959,7 @@ PersonCore::PersonCore() : PersonTbl() { } -int PersonCore::Search(PPID id, PersonTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_PERSON, id, pRec); -} +int PersonCore::Search(PPID id, PersonTbl::Rec * pRec) { return SearchByID(this, PPOBJ_PERSON, id, pRec); } SString & PersonCore::GetItemMemo(PPID id, SString & rBuf) // @v11.1.12 { diff --git a/Src/PPLib/Psnevent.cpp b/Src/PPLib/Psnevent.cpp index 4b4df8904..685279c33 100644 --- a/Src/PPLib/Psnevent.cpp +++ b/Src/PPLib/Psnevent.cpp @@ -16,12 +16,10 @@ PersonEventCore::PersonEventCore() : PersonEventTbl() { } -int PersonEventCore::Search(PPID id, PersonEventTbl::Rec * pRec) - { return SearchByID(this, PPOBJ_PERSONEVENT, id, pRec); } -int PersonEventCore::Add(PPID * pID, PersonEventTbl::Rec * pRec, int use_ta) - { return (IncDateKey(this, 1, pRec->Dt, &pRec->OprNo) && AddObjRecByID(this, PPOBJ_PERSONEVENT, pID, pRec, use_ta)); } -int PersonEventCore::Update(PPID id, PersonEventTbl::Rec * pRec, int use_ta) - { return UpdateByID(this, PPOBJ_PERSONEVENT, id, pRec, use_ta); } +int PersonEventCore::Search(PPID id, PersonEventTbl::Rec * pRec) { return SearchByID(this, PPOBJ_PERSONEVENT, id, pRec); } +int PersonEventCore::Add(PPID * pID, PersonEventTbl::Rec * pRec, int use_ta) { return (IncDateKey(this, 1, pRec->Dt, &pRec->OprNo) && AddObjRecByID(this, PPOBJ_PERSONEVENT, pID, pRec, use_ta)); } +int PersonEventCore::Update(PPID id, PersonEventTbl::Rec * pRec, int use_ta) { return UpdateByID(this, PPOBJ_PERSONEVENT, id, pRec, use_ta); } + int PersonEventCore::Remove(PPID id, int use_ta) { int ok = 1; diff --git a/Src/PPLib/QUOTCORE.CPP b/Src/PPLib/QUOTCORE.CPP index a79025b07..993c5d710 100644 --- a/Src/PPLib/QUOTCORE.CPP +++ b/Src/PPLib/QUOTCORE.CPP @@ -116,7 +116,7 @@ int PPQuotItem_::Serialize(int dir, SBuffer & rBuf, SSerializeContext * pSCtx) IMPL_CMPFUNC(PPQuotItem_, i1, i2) { RET_CMPCASCADE6(static_cast(i1), static_cast(i2), GoodsID, KindID, LocID, ArID, CurID, Period); } -PPQuotItemArray::PPQuotItemArray() : TSVector () // @v9.8.4 TSArray-->TSVector +PPQuotItemArray::PPQuotItemArray() : TSVector () { } @@ -371,8 +371,6 @@ int FASTCALL PPQuot::GetValFromStr(const char * pStr) if(flags & PPQuot::fZero) rBuf.CatChar('Z'); else { - //long fmt = (flags & (fPctOnCost|fPctOnPrice|fPctOnAddition|fPctOnBase)) ? - //MKSFMTD(0, 2, NMBF_NOTRAILZ|NMBF_NOZERO) : MKSFMTD(0, 5, NMBF_NOZERO); // @v9.5.1 MKSFMTD(0, 2, NMBF_NOZERO)-->MKSFMTD(0, 5, NMBF_NOZERO) long fmt = 0; if(flags & fAggrCount) fmt = MKSFMTD(0, 0, NMBF_NOZERO); @@ -476,11 +474,11 @@ IMPL_CMPFUNC(PPQuot, i1, i2) // // PPQuotArray // -PPQuotArray::PPQuotArray(PPID goodsID) : TSVector (), GoodsID(goodsID) // @v9.8.4 TSArray-->TSVector +PPQuotArray::PPQuotArray(PPID goodsID) : TSVector (), GoodsID(goodsID) { } -PPQuotArray::PPQuotArray(const PPQuotArray & s) : TSVector (s), GoodsID(s.GoodsID) // @v9.8.4 TSArray-->TSVector +PPQuotArray::PPQuotArray(const PPQuotArray & s) : TSVector (s), GoodsID(s.GoodsID) { } @@ -509,7 +507,7 @@ void PPQuotArray::SetManagedLocList(const PPIDArray * pList) if(pList) ManagedLocList = *pList; else - ManagedLocList.clear(); // @v10.7.3 freeAll()-->clear() + ManagedLocList.clear(); } int FASTCALL PPQuotArray::CanUpdateQuot(const PPQuot & rQuot) const @@ -608,7 +606,7 @@ bool FASTCALL PPQuotArray::SearchQi(const QuotIdent & rQi, uint * pPos) const const bool use_period = LOGIC(rQi.Flags & QuotIdent::fUsePeriod); for(uint i = 0; i < c; i++) { const PPQuot & rq = at(i); - if(rq.Kind == rQi.QuotKindID /* @v11.9.4{*/&& (!(rQi.Flags & QuotIdent::fIgnoreTimeLimitValues) || rq.Period.IsZero())/* }@v11.9.4 */) { + if(rq.Kind == rQi.QuotKindID && (!(rQi.Flags & QuotIdent::fIgnoreTimeLimitValues) || rq.Period.IsZero())) { if(rq.LocID == rQi.LocID && rq.CurID == rQi.CurID && rq.ArID == rQi.ArID && (!rq.IsEmpty() || (rq.Flags & PPQuot::fPctDisabled))) { if((!use_period || rq.Period == rQi.Period) && (!(rQi.Flags & QuotIdent::fUseQtty) || rq.MinQtty == (long)rQi.Qtty_)) { const double q_min_qtty = (double)rq.MinQtty; @@ -857,15 +855,14 @@ QuotationCore::QuotationCore() : QuotationTbl() { } -int QuotationCore::Search(PPID id, void * b) -{ - return SearchByID(this, PPOBJ_QUOT, id, b); -} +int QuotationCore::Search(PPID id, void * b) { return SearchByID(this, PPOBJ_QUOT, id, b); } int QuotationCore::SetCurr(PPID * pID, const PPQuot * pQuot, int logSj, int use_ta) { int ok = -1; - int is_mtx_upd = 0, is_mtx_restr_upd = 0, is_suppl_deal_upd = 0; + int is_mtx_upd = 0; + int is_mtx_restr_upd = 0; + int is_suppl_deal_upd = 0; PPID goods_id = 0; // для записи в SysJournal PPID loc_id = 0; // для записи в SysJournal PPID ar_id = 0; // для записи в SysJournal @@ -904,16 +901,13 @@ int QuotationCore::SetCurr(PPID * pID, const PPQuot * pQuot, int logSj, int use_ ok = qk_obj.CheckRights(QUOTRT_UPDMTXRESTR) ? (is_mtx_restr_upd = 1) : LogDeclineMsg(pQuot, PPQC_MATRIXRESTR); else if(spc.IsSupplDealKind(rec.Kind)) { ok = qk_obj.CheckRights(QUOTRT_UPDSUPPLCOST) ? 1 : LogDeclineMsg(pQuot, PPQC_SUPPLDEAL); - // @v7.1.10 { if(rec.Kind == spc.SupplDealID) is_suppl_deal_upd = 1; - // } @v7.1.10 } else ok = qk_obj.CheckRights(QUOTRT_UPDQUOTS) ? 1 : LogDeclineMsg(pQuot, PPQC_PRICE); if(ok > 0) { - THROW(RemoveByID(this, *pID, 0)); // @v7.9.0 - // @v7.9.0 THROW_DB(deleteRec()); + THROW(RemoveByID(this, *pID, 0)); } else pQuot = 0; @@ -931,7 +925,7 @@ int QuotationCore::SetCurr(PPID * pID, const PPQuot * pQuot, int logSj, int use_ rec.Kind = pQuot->Kind; rec.CurID = pQuot->CurID; rec.Flags = pQuot->Flags; - rec.Flags = (pQuot->Flags & PPQuot::fDbMask); // @v7.2.1 (& PPQuot::fDbMask) + rec.Flags = (pQuot->Flags & PPQuot::fDbMask); rec.ArID = pQuot->ArID; rec.Quot = pQuot->Quot; rec.MinQtty = pQuot->MinQtty; @@ -946,10 +940,8 @@ int QuotationCore::SetCurr(PPID * pID, const PPQuot * pQuot, int logSj, int use_ ok = qk_obj.CheckRights(QUOTRT_UPDMTXRESTR) ? (is_mtx_restr_upd = 1) : LogDeclineMsg(pQuot, PPQC_MATRIXRESTR); else if(spc.IsSupplDealKind(rec.Kind)) { ok = qk_obj.CheckRights(QUOTRT_UPDSUPPLCOST) ? 1 : LogDeclineMsg(pQuot, PPQC_SUPPLDEAL); - // @v7.1.10 { if(rec.Kind == spc.SupplDealID) is_suppl_deal_upd = 1; - // } @v7.1.10 } else ok = qk_obj.CheckRights(QUOTRT_UPDQUOTS) ? 1 : LogDeclineMsg(pQuot, PPQC_PRICE); @@ -968,10 +960,8 @@ int QuotationCore::SetCurr(PPID * pID, const PPQuot * pQuot, int logSj, int use_ DS.LogAction(PPACN_GOODSMTXUPD, PPOBJ_GOODS, goods_id, loc_id, 0); else if(is_mtx_restr_upd) DS.LogAction(PPACN_GOODSMTXRESTRUPD, PPOBJ_GOODS, goods_id, loc_id, 0); - // @v7.1.10 { else if(is_suppl_deal_upd) DS.LogAction(PPACN_SUPPLDEALUPD, PPOBJ_GOODS, goods_id, ar_id, 0); - // } @v7.1.10 } if(is_mtx_upd) ok = 1000; @@ -1186,7 +1176,7 @@ int QuotationCore::GetMatrixListByLoc(PPID mtxQkID, PPID locID, PPIDArray & rLis { int ok = 1; QuotationTbl::Key0 k0; - BExtQuery q(this, 0, 256); // @v7.1.4 (256) + BExtQuery q(this, 0, 256); q.select(this->GoodsID, this->Quot, 0). where(this->Kind == mtxQkID && this->Actual > 0L && this->Location == locID); MEMSZERO(k0); @@ -1229,7 +1219,7 @@ static int Helper_GetMatrix(int quotProviderGeneration, void * pQuotProvider, PP assert(oneof2(quotProviderGeneration, 1, 2)); assert(pQuotProvider); if(mtxQkID && pQuotProvider) { - PPUserFuncProfiler ufp(PPUPRF_GETMTXLISTBYLOC); // @v8.1.3 + PPUserFuncProfiler ufp(PPUPRF_GETMTXLISTBYLOC); uint i; PPObjGoods goods_obj; const int ignore_folder_mtx = BIN(goods_obj.GetConfig().Flags & GCF_IGNOREFOLDERMATRIX); @@ -1266,7 +1256,7 @@ static int Helper_GetMatrix(int quotProviderGeneration, void * pQuotProvider, PP // добавляем в loc_list только те элементы по родительскому складу, которые не числятся // // среди "определенно Нет" для указанного склада. // - list.addExclusive(&_list, &neg_list); // @v8.0.4 addUniqueExclusive-->addExclusive + list.addExclusive(&_list, &neg_list); // // Так как котировка по складу имеет больший приоритет, чем по родительскому складу, то // добавляем в list только те элементы по родительскому складу, которые не числятся // @@ -1275,10 +1265,10 @@ static int Helper_GetMatrix(int quotProviderGeneration, void * pQuotProvider, PP // list уже включает в себя "определенно Да" для заданного склада и элементы "без склада". // В соответствии с правилом "Да-Нет приоритета" такая операция логична. // - neg_list.addExclusive(&_neg_list, &_list); // @v8.0.4 addUniqueExclusive-->addExclusive + neg_list.addExclusive(&_neg_list, &_list); // - list.sortAndUndup(); // @v8.0.4 sort-->sortAndUndup - neg_list.sortAndUndup(); // @v8.0.4 sort-->sortAndUndup + list.sortAndUndup(); + neg_list.sortAndUndup(); } while(loc_id); } // @@ -1290,7 +1280,7 @@ static int Helper_GetMatrix(int quotProviderGeneration, void * pQuotProvider, PP for(i = 0; i < list.getCount(); i++) { const PPID goods_id = list.get(i); if(grp_list.bsearch(goods_id)) { - if(!ignore_folder_mtx || terminal_grp_list.bsearch(goods_id)) { // @v8.3.4 + if(!ignore_folder_mtx || terminal_grp_list.bsearch(goods_id)) { inner_list.clear(); THROW(GoodsIterator::GetListByGroup(goods_id, &inner_list)); for(uint j = 0; j < inner_list.getCount(); j++) { @@ -1330,8 +1320,8 @@ static int Helper_GetMatrix(int quotProviderGeneration, void * pQuotProvider, PP final_list.add(goods_id); } } - ufp.SetFactor(0, (double)final_list.getCount()); // @v8.1.3 - ufp.Commit(); // @v8.1.3 + ufp.SetFactor(0, (double)final_list.getCount()); + ufp.Commit(); } else ok = -1; @@ -1378,7 +1368,7 @@ protected: void FASTCALL SetQuotProvider(void * p) { P_QuotProvider = p; } const int QuotProviderGeneration; PPID MtxQkID; // Вид котировки товарной матрицы - int IgnoreFolderMtx; // @v8.3.4 Если !0, то матрица по группе верхнего уровня игнорируется // + int IgnoreFolderMtx; // Если !0, то матрица по группе верхнего уровня игнорируется // long AdvCookie; uint HalfSize; void * P_QuotProvider; @@ -1459,7 +1449,7 @@ int QuotCacheBase::Implement_GetMatrix(int qpg, void * pProvider, ReadWriteLock if(goods_rec.Kind == PPGDSK_GOODS) finish_list.add(goods_id); else if(goods_rec.Kind == PPGDSK_GROUP) { - if(!ignore_folder_mtx || !(goods_rec.Flags & GF_FOLDER)) // @v8.3.4 + if(!ignore_folder_mtx || !(goods_rec.Flags & GF_FOLDER)) dirty_all = 1; /* temp_list.clear(); @@ -1485,7 +1475,6 @@ int QuotCacheBase::Implement_GetMatrix(int qpg, void * pProvider, ReadWriteLock int QuotCacheBase::Implement_DirtyMatrix(const PPIDArray * pGoodsList, const PPIDArray * pMtxLocList, int deferred) { const uint _threshould = 100; - int ok = -1; uint pos; // @v7.1.4 (Блокировка вызывается в функции QuotationCore::DirtyMatrix()) Lock(); @@ -1534,8 +1523,6 @@ int QuotCacheBase::Implement_DirtyMatrix(const PPIDArray * pGoodsList, const PPI ok = 1; } else { - // PPUserFuncProfiler ufp(PPUPRF_MTXCACHEACTUALIZE); // @v8.1.6 - // double ufp_factor = 0.0; // @v8.1.6 PPObjGoods goods_obj; PPObjLocation loc_obj; PPIDArray loc_list; @@ -1597,7 +1584,7 @@ int QuotCacheBase::Implement_DirtyMatrix(const PPIDArray * pGoodsList, const PPI for(n = 0; n < prev_loc_mtx_list.getCount(); n++) { const PPID loc_id = prev_loc_mtx_list.at(n).Key; long val = 0; - if(!loc_mtx_list.Search(loc_id, &val, 0) || val == 0) { // @v7.3.0 (|| val==0) + if(!loc_mtx_list.Search(loc_id, &val, 0) || val == 0) { loc_mtx_list.Add(loc_id, prev_loc_mtx_list.at(n).Val, 0); } } @@ -1668,13 +1655,12 @@ int QuotCacheBase::Implement_DirtyMatrix(const PPIDArray * pGoodsList, const PPI for(k = 0; k < loc_mtx_list.getCount(); k++) { const LAssoc & r_item = loc_mtx_list.at(k); if(r_item.Val > 0 && !to_rmv_list.bsearch(r_item.Key)) { - // @v8.0.9 if(loc_list.addUnique(r_item.Key) > 0) - if(loc_list.add(r_item.Key) > 0) // @v8.0.9 + if(loc_list.add(r_item.Key) > 0) ok = 1; } } } - loc_list.sortAndUndup(); // @v8.0.9 + loc_list.sortAndUndup(); // for(uint i = 0; i < mc; i++) { MatrixEntry * p_entry = Matrix.at(i); @@ -1690,8 +1676,6 @@ int QuotCacheBase::Implement_DirtyMatrix(const PPIDArray * pGoodsList, const PPI LogDirtyMatrix(goods_id); PROFILE_END } - // ufp.SetFactor(1, ufp_factor); // @v8.1.6 - // ufp.Commit(); // @v8.1.6 } } } @@ -2904,7 +2888,7 @@ int Quotation2Core::Implement_Set(const PPQuot & rQ, long qtaID, int logSj, bool THROW_DB(getPosition(&ri)); THROW_SL(ri_list.insert(&ri)); last_actual_rec = data; - } while(search(2, &k2, spNext) && data.Actual && data.RelID == rel_id && data.GoodsID == rQ.GoodsID); // @v8.2.6 searchForUpdate-->search + } while(search(2, &k2, spNext) && data.Actual && data.RelID == rel_id && data.GoodsID == rQ.GoodsID); } PROFILE_END if(ri_list.getCount()) { @@ -2961,8 +2945,7 @@ int Quotation2Core::Implement_Set(const PPQuot & rQ, long qtaID, int logSj, bool else ok = qk_obj.CheckRights(QUOTRT_UPDQUOTS) ? 1 : LogDeclineMsg(&rQ, PPQC_PRICE); if(ok > 0) { - // @v9.9.1 @fix const long mask = (PPQuot::fZero|PPQuot::fPctOnCost|PPQuot::fPctOnPrice|PPQuot::fPctOnAddition|PPQuot::fPctOnBase); - const long mask = PPQuot::fDbMask; // @v9.9.1 @fix + const long mask = PPQuot::fDbMask; if((rec.Flags & mask) || rec.Quot != 0.0) { // @v11.3.0 { if(keepTime && checkdate(rQ.Dtm.d) && checktime(rQ.Dtm.t)) { @@ -3207,7 +3190,7 @@ int Quotation2Core::Helper_ReplaceRel(PPID replacedRelID, PPID newRelID, int use int Quotation2Core::ReplaceObj(PPID objType, PPID replacedID, PPID newID, int use_ta) { int ok = -1; - TSVector rel_list; // @v9.8.4 TSArray-->TSVector + TSVector rel_list; if(objType == PPOBJ_ARTICLE) { Quot2RelTbl::Key3 k3; MEMSZERO(k3); diff --git a/Src/PPLib/RECEIPT.CPP b/Src/PPLib/RECEIPT.CPP index 6fdaf1ce2..45443c3a6 100644 --- a/Src/PPLib/RECEIPT.CPP +++ b/Src/PPLib/RECEIPT.CPP @@ -99,12 +99,9 @@ ReceiptCore::ReceiptCore() : ReceiptTbl(), IgnoreGpretMostRecentFlags(-1) { } -int ReceiptCore::Search(PPID id, ReceiptTbl::Rec * pRec) - { return SearchByID(this, PPOBJ_LOT, id, pRec); } -int ReceiptCore::Update(PPID id, ReceiptTbl::Rec * pRec, int use_ta) - { return UpdateByID(this, PPOBJ_LOT, id, pRec, use_ta); } -int ReceiptCore::Add(PPID * pID, ReceiptTbl::Rec * pRec, int use_ta) - { return AddByID(this, pID, pRec, use_ta); } +int ReceiptCore::Search(PPID id, ReceiptTbl::Rec * pRec) { return SearchByID(this, PPOBJ_LOT, id, pRec); } +int ReceiptCore::Update(PPID id, ReceiptTbl::Rec * pRec, int use_ta) { return UpdateByID(this, PPOBJ_LOT, id, pRec, use_ta); } +int ReceiptCore::Add(PPID * pID, ReceiptTbl::Rec * pRec, int use_ta) { return AddByID(this, pID, pRec, use_ta); } int ReceiptCore::Remove(PPID id, int use_ta) { diff --git a/Src/PPLib/Register.cpp b/Src/PPLib/Register.cpp index 14af35db9..76b1b0d86 100644 --- a/Src/PPLib/Register.cpp +++ b/Src/PPLib/Register.cpp @@ -431,11 +431,9 @@ int RegisterArray::ProcessObjRefs(PPObjIDArray * ary, int replace) if(r_reg_rec.RegTypeID == PPREGT_BANKACCOUNT) { THROW(PPObject::ProcessObjRefInArray(PPOBJ_BNKACCTYPE, &r_reg_rec.ExtID, ary, replace)); } - // @v10.7.5 { else if(r_reg_rec.RegTypeID == PPREGT_TAXSYSTEM) { THROW(PPObject::ProcessObjRefInArray(PPOBJ_TAXSYSTEMKIND, &r_reg_rec.ExtID, ary, replace)); } - // } @v10.7.5 } CATCHZOK return ok; @@ -447,10 +445,7 @@ RegisterCore::RegisterCore() : RegisterTbl() { } -int RegisterCore::Search(PPID id, RegisterTbl::Rec * b) -{ - return SearchByID(this, PPOBJ_REGISTER, id, b); -} +int RegisterCore::Search(PPID id, RegisterTbl::Rec * b) { return SearchByID(this, PPOBJ_REGISTER, id, b); } int RegisterCore::SearchByNumber(PPID * pID, PPID regTypeID, const char * pSerial, const char * pNumber, RegisterTbl::Rec * pBuf) { diff --git a/Src/PPLib/SCARD.CPP b/Src/PPLib/SCARD.CPP index dbcbfee6f..e11c5e267 100644 --- a/Src/PPLib/SCARD.CPP +++ b/Src/PPLib/SCARD.CPP @@ -53,10 +53,7 @@ SCardCore::SCardCore() : SCardTbl() { } -int SCardCore::Search(PPID id, SCardTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_SCARD, id, pRec); -} +int SCardCore::Search(PPID id, SCardTbl::Rec * pRec) { return SearchByID(this, PPOBJ_SCARD, id, pRec); } int SCardCore::SearchCode(PPID seriesID, const char * pCode, SCardTbl::Rec * pRec) { diff --git a/Src/PPLib/V_bill.cpp b/Src/PPLib/V_bill.cpp index 9f72e7365..f1f7b51dd 100644 --- a/Src/PPLib/V_bill.cpp +++ b/Src/PPLib/V_bill.cpp @@ -1152,7 +1152,7 @@ PPViewBill::PoolInsertionParam::PoolInsertionParam() : Verb(2), AddedBillKind(bb } PPViewBill::PPViewBill() : PPView(0, &Filt, PPVIEW_BILL, implUseQuickTagEditFunc, 0), P_TempTbl(0), P_TempOrd(0), P_BPOX(0), P_Arp(0), - P_BObj(BillObj), State(0), P_IterState(0), LastSelID(0) + P_BObj(BillObj), State(0), P_IterState(0), LastSelID(0), P_Dl600BPackCache(0) { } @@ -1162,6 +1162,7 @@ PPViewBill::~PPViewBill() delete P_TempOrd; delete P_BPOX; delete P_Arp; + delete P_Dl600BPackCache; // @v12.2.0 SAlloc::F(P_IterState); DBRemoveTempFiles(); } @@ -2370,9 +2371,37 @@ int PPViewBill::SetIterState(const void * pSt, size_t sz) return -1; } -const void * PPViewBill::GetIterState() const +void * PPViewBill::GetIterState() { return P_IterState; } + +const PPBillPacket * PPViewBill::GetIterCachedBillPack(PPID billID) { - return P_IterState; + const PPBillPacket * p_result = 0; + if(!P_Dl600BPackCache) { + if(billID) { + P_Dl600BPackCache = new PPBillPacket; + if(P_BObj->ExtractPacket(billID, P_Dl600BPackCache) > 0) { + p_result = P_Dl600BPackCache; + } + else { + ZDELETE(P_Dl600BPackCache); + } + } + } + else { + if(P_Dl600BPackCache->Rec.ID == billID) { + p_result = P_Dl600BPackCache; + } + else { + P_Dl600BPackCache->destroy(); + if(P_BObj->ExtractPacket(billID, P_Dl600BPackCache) > 0) { + p_result = P_Dl600BPackCache; + } + else { + ZDELETE(P_Dl600BPackCache); + } + } + } + return p_result; } // // @@ -7092,21 +7121,17 @@ PPALDD_CONSTRUCTOR(GoodsBillBase) PPALDD_DESTRUCTOR(GoodsBillBase) { - // @v10.3.6 PPBillPacket * p_pack = static_cast(Extra[0].Ptr); - // @v10.3.6 CALLPTRMEMB(p_pack, RemoveVirtualTItems()); - DlGoodsBillBaseBlock * p_extra = static_cast(Extra[0].Ptr); // @v10.3.6 + DlGoodsBillBaseBlock * p_extra = static_cast(Extra[0].Ptr); if(p_extra && p_extra->P_Pack) - p_extra->P_Pack->RemoveVirtualTItems(); // @v10.3.6 + p_extra->P_Pack->RemoveVirtualTItems(); Destroy(); } int PPALDD_GoodsBillBase::InitData(PPFilt & rFilt, long rsrv) { - // @v10.3.6 Extra[0].Ptr = rFilt.Ptr; - // @v10.3.6 PPBillPacket * p_pack = static_cast(Extra[0].Ptr); - DlGoodsBillBaseBlock * p_extra = new DlGoodsBillBaseBlock(static_cast(rFilt.Ptr)); // @v10.3.6 - Extra[0].Ptr = p_extra; // @v10.3.6 - PPBillPacket * p_pack = p_extra->P_Pack; // @v10.3.6 + DlGoodsBillBaseBlock * p_extra = new DlGoodsBillBaseBlock(static_cast(rFilt.Ptr)); + Extra[0].Ptr = p_extra; + PPBillPacket * p_pack = p_extra->P_Pack; PPOprKind op_rec; const long bill_f = p_pack->Rec.Flags; const PPID optype = p_pack->OpTypeID; @@ -7276,9 +7301,8 @@ int PPALDD_GoodsBillBase::InitIteration(PPIterID iterId, int sortId, long) if(sortId >= 0) SortIdx = sortId; I.nn = 0; - // @v10.3.6 PPBillPacket * p_pack = static_cast(Extra[0].Ptr); - DlGoodsBillBaseBlock * p_extra = static_cast(Extra[0].Ptr); // @v10.3.6 - PPBillPacket * p_pack = p_extra->P_Pack; // @v10.3.6 + DlGoodsBillBaseBlock * p_extra = static_cast(Extra[0].Ptr); + PPBillPacket * p_pack = p_extra->P_Pack; long f = H.fMergeSameGoods ? (ETIEF_UNITEBYGOODS|ETIEF_DIFFBYPACK|ETIEF_DIFFBYQCERT|ETIEF_DIFFBYNETPRICE) : 0; PPID filt_grp_id = 0; if(p_pack->ProcessFlags & PPBillPacket::pfPrintTareSaldo) { @@ -7288,20 +7312,16 @@ int PPALDD_GoodsBillBase::InitIteration(PPIterID iterId, int sortId, long) f |= ETIEF_SALDOFILTGRP; } } - // @v10.3.6 p_pack->InitExtTIter(f, filt_grp_id, static_cast(H.RowOrder)); - p_extra->Iter.Init(p_pack, f, filt_grp_id, static_cast(H.RowOrder)); // @v10.3.6 + p_extra->Iter.Init(p_pack, f, filt_grp_id, static_cast(H.RowOrder)); return 1; } int PPALDD_GoodsBillBase::NextIteration(PPIterID iterId) { IterProlog(iterId, 0); - // @v10.3.7 PPBillPacket * p_pack = static_cast(Extra[0].Ptr); - // @v10.3.7 { DlGoodsBillBaseBlock * p_extra = static_cast(Extra[0].Ptr); PPBillPacket * p_pack = p_extra ? p_extra->P_Pack : 0; CALLPTRMEMB(p_extra, ResetRow()); - // } @v10.3.7 // // Возможны два алгоритма расчета налогов по объединенным строкам документа: // 1. Объединенная строка обсчитывается сама по себе, как единая @@ -7435,7 +7455,7 @@ int PPALDD_GoodsBillBase::NextIteration(PPIterID iterId) I.UnitsPerPack = upp; I.FullPack = 0; if(upp > 0.0) - I.FullPack = floor(fabs(I.Qtty) / upp); // @v10.3.4 (long)-->floor + I.FullPack = floor(fabs(I.Qtty) / upp); { I.VATRate = 0.0; I.VATSum = 0.0; @@ -7522,7 +7542,6 @@ int PPALDD_GoodsBillBase::NextIteration(PPIterID iterId) } else p_extra->Item.Clb.CopyTo(I.CLB, sizeof(I.CLB)); - // @v10.3.7 { { p_extra->Qtty = I.Qtty; p_extra->Cost = I.Cost; @@ -7536,7 +7555,6 @@ int PPALDD_GoodsBillBase::NextIteration(PPIterID iterId) p_extra->ExcSum = I.ExcSum; p_extra->ExtPrice = I.ExtPrice; } - // } @v10.3.7 return DlRtm::NextIteration(iterId); } @@ -7575,12 +7593,8 @@ void PPALDD_GoodsBillBase::EvaluateFunc(const DlFunc * pF, SV_Uint32 * pApl, Rtm _RET_DBL = saldo; } else if(pF->Name == "?UnlimGoodsOnly") { - // @v10.3.6 const PPBillPacket * p_pack = static_cast(Extra[0].Ptr); _RET_INT = BIN(p_pack && p_pack->ProcessFlags & PPBillPacket::pfAllGoodsUnlim); } - /* @v10.2.12 @construction else if(pF->Name == "?GetEgaisMarkCount") { - // - }*/ else if(pF->Name == "?GetRowAmount") { // iterator _RET_DBL = p_extra ? p_extra->GetValueBySymb(_ARG_STR(1)) : 0.0; } @@ -8060,7 +8074,10 @@ void PPALDD_Bill::EvaluateFunc(const DlFunc * pF, SV_Uint32 * pApl, RtmStack & r PPObjAmountType amt_obj; PPID amt_id = 0; if(amt_obj.SearchSymb(&amt_id, _ARG_STR(1)) > 0) - p_billcore->GetAmount(H.ID, amt_id, 0 /* curID */, &amt); + p_billcore->GetAmount(H.ID, amt_id, 0/*curID*/, &amt); + else { + ; + } } _RET_DBL = amt; } @@ -8514,12 +8531,9 @@ int PPALDD_GoodsReval::NextIteration(PPIterID iterId) { IterProlog(iterId, 0); { - // @v10.3.6 const PPBillPacket * p_pack = static_cast(Extra[0].Ptr); - // @v10.3.8 { DlGoodsBillBaseBlock * p_extra = static_cast(Extra[0].Ptr); const PPBillPacket * p_pack = p_extra ? p_extra->P_Pack : 0; CALLPTRMEMB(p_extra, ResetRow()); - // } @v10.3.8 PPTransferItem * p_ti; uint nn = static_cast(I.nn); if(p_pack && p_pack->EnumTItems(&nn, &p_ti)) { @@ -8541,12 +8555,10 @@ int PPALDD_GoodsReval::NextIteration(PPIterID iterId) PPGoodsTaxEntry gtx_cost; PPGoodsTaxEntry gtx_price; { - // @v10.3.4 { LDATE tax_dt = p_ti->Date; if(p_pack->OpTypeID == PPOPT_CORRECTION && p_pack->Rec.LinkBillID && BillObj->Fetch(p_pack->Rec.LinkBillID, &link_bill_rec) > 0) tax_dt = link_bill_rec.Dt; - // } @v10.3.4 - gobj.FetchTax(labs(p_ti->GoodsID), tax_dt, 0, >x_price); // @v10.3.4 @fix p_ti->LotDate-->p_ti->Date + gobj.FetchTax(labs(p_ti->GoodsID), tax_dt, 0, >x_price); } if(p_ti->LotTaxGrpID) { gobj.GTxObj.Fetch(p_ti->LotTaxGrpID, p_ti->LotDate, 0, >x_cost); @@ -8619,16 +8631,7 @@ int PPALDD_GoodsReval::NextIteration(PPIterID iterId) gt_vect.Calc_(>x_cost, old_cost, tax_old_qtty, amt_flags, excl_flags); old_cost = gt_vect.GetValue(~GTAXVF_BEFORETAXES & ~GTAXVF_VAT); } - // @v10.3.8 { { - /*if(p_ti->Flags & PPTFR_CORRECTION) { - p_extra->Qtty = fabs(p_ti->Quantity_); - p_extra->OldQtty = fabs(p_ti->QuotPrice); - } - else { - p_extra->Qtty = qtty; - p_extra->OldQtty = qtty; - }*/ p_extra->OldCostVat = vatsum_oldcost; p_extra->NewCostVat = vatsum_newcost; p_extra->OldPriceVat = fdivnz(vatsum_oldprice, old_qtty); @@ -8673,15 +8676,14 @@ int PPALDD_GoodsReval::NextIteration(PPIterID iterId) } p_extra->MainSumWoVat = p_extra->MainSum - p_extra->VATSum; } - // } @v10.3.8 { I.nn = nn; I.RByBill = p_ti->RByBill; // @v11.1.7 I.OrgRByBill = org_rbybill; // @v11.1.7 I.GoodsID = p_ti->GoodsID; I.LotID = p_ti->LotID; - I.Quantity = p_extra->Qtty; // @v10.3.8 - I.OldQtty = p_extra->OldQtty; // @v10.3.8 + I.Quantity = p_extra->Qtty; + I.OldQtty = p_extra->OldQtty; I.NewPrice = new_price; I.NewCost = new_cost; I.OldPrice = old_price; @@ -8691,13 +8693,6 @@ int PPALDD_GoodsReval::NextIteration(PPIterID iterId) I.VATSumNewCost = p_extra->VatSum_NewCost; I.VATSumOldPrice = p_extra->VatSum_OldPrice; I.VATSumNewPrice = p_extra->VatSum_NewPrice; - /* @v10.3.8 if(p_ti->Flags & PPTFR_CORRECTION) { - I.Quantity = fabs(p_ti->Quantity_); - I.OldQtty = fabs(p_ti->QuotPrice); - } - else { - I.Quantity = qtty; - }*/ } } else @@ -8712,10 +8707,9 @@ void PPALDD_GoodsReval::EvaluateFunc(const DlFunc * pF, SV_Uint32 * pApl, RtmSta #define _ARG_STR(n) (**static_cast(rS.GetPtr(pApl->Get(n)))) #define _RET_DBL (*static_cast(rS.GetPtr(pApl->Get(0)))) #define _RET_INT (*static_cast(rS.GetPtr(pApl->Get(0)))) - const DlGoodsBillBaseBlock * p_extra = static_cast(Extra[0].Ptr); // @v10.3.6 - const PPBillPacket * p_pack = p_extra ? p_extra->P_Pack : 0; // @v10.3.6 + const DlGoodsBillBaseBlock * p_extra = static_cast(Extra[0].Ptr); + const PPBillPacket * p_pack = p_extra ? p_extra->P_Pack : 0; if(pF->Name == "?UnlimGoodsOnly") { - // @v10.3.6 PPBillPacket * p_pack = static_cast(Extra[0].Ptr); _RET_INT = BIN(p_pack && p_pack->ProcessFlags & PPBillPacket::pfAllGoodsUnlim); } else if(pF->Name == "?GetRowAmount") { @@ -9109,14 +9103,17 @@ int PPALDD_ContentBList::InitIteration(PPIterID iterId, int sortId, long /*rsrv* return 1; } +struct PPALDD_ContentBList_VIterState { + PPALDD_ContentBList_VIterState(PPID billID, bool isDraft) : BillID(billID), IsDraft(isDraft), Rbb(0) + { + } + const PPID BillID; + const bool IsDraft; + int Rbb; +}; + int PPALDD_ContentBList::NextIteration(PPIterID iterId) { - struct VIterState { - VIterState(int isDraft) : IsDraft(isDraft) - { - } - int IsDraft; - }; IterProlog(iterId, 0); PPViewBill * p_v = static_cast(NZOR(Extra[1].Ptr, Extra[0].Ptr)); PPObjBill * p_bobj = BillObj; @@ -9127,18 +9124,27 @@ int PPALDD_ContentBList::NextIteration(PPIterID iterId) if(!I.recNo) { I.BillID = item.ID; I.grpNo++; - VIterState vis(IsDraftOp(item.OpID)); + PPALDD_ContentBList_VIterState vis(I.BillID, IsDraftOp(item.OpID)); p_v->SetIterState(&vis, sizeof(vis)); } int r = 0; - const VIterState * p_vis = static_cast(p_v->GetIterState()); - if(p_vis && p_vis->IsDraft) { - if(p_bobj->P_CpTrfr) - r = p_bobj->P_CpTrfr->EnumItems(I.BillID, reinterpret_cast(&I.recNo), &ti, &ext); + PPALDD_ContentBList_VIterState * p_vis = static_cast(p_v->GetIterState()); + if(p_vis) { + p_vis->Rbb = 0; + if(p_vis->IsDraft) { + if(p_bobj->P_CpTrfr) { + r = p_bobj->P_CpTrfr->EnumItems(I.BillID, reinterpret_cast(&I.recNo), &ti, &ext); + } + } + else { + r = p_bobj->trfr->EnumItems(I.BillID, reinterpret_cast(&I.recNo), &ti); + } } - else - r = p_bobj->trfr->EnumItems(I.BillID, reinterpret_cast(&I.recNo), &ti); if(r > 0) { + assert(p_vis != 0); + if(p_vis) { + p_vis->Rbb = ti.RByBill; + } double cost = 0.0; double old_cost = 0.0; double price = 0.0; @@ -9241,6 +9247,173 @@ int PPALDD_ContentBList::NextIteration(PPIterID iterId) return -1; } +void PPALDD_ContentBList::EvaluateFunc(const DlFunc * pF, SV_Uint32 * pApl, RtmStack & rS) // @v12.2.0 +{ + #define _ARG_INT(n) (*static_cast(rS.GetPtr(pApl->Get(n)))) + #define _ARG_STR(n) (**static_cast(rS.GetPtr(pApl->Get(n)))) + #define _RET_DBL (*static_cast(rS.GetPtr(pApl->Get(0)))) + #define _RET_INT (*static_cast(rS.GetPtr(pApl->Get(0)))) + PPViewBill * p_v = static_cast(NZOR(Extra[1].Ptr, Extra[0].Ptr)); + if(pF->Name == "?GetRowAmount") { // iterator + double result = 0.0; + if(p_v) { + PPALDD_ContentBList_VIterState * p_vis = static_cast(p_v->GetIterState()); + if(p_vis && p_vis->BillID && p_vis->Rbb) { + const PPBillPacket * p_bp = p_v->GetIterCachedBillPack(p_vis->BillID); + uint tiidx = 0; + if(p_bp && p_bp->SearchTI(p_vis->Rbb, &tiidx)) { + const PPTransferItem & r_ti = p_bp->ConstTI(tiidx); + SString & r_buf = SLS.AcquireRvlStr(); + (r_buf = _ARG_STR(1)).Strip().ToLower().ReplaceStr("-", 0, 0).ReplaceStr("_", 0, 0).ReplaceStr(" ", 0, 0); + SString symb(r_buf); + /* + vect.CalcTI(rTi, opID, TIAMT_PRICE); + item.PRate = vect.GetTaxRate(GTAX_VAT, 0); + item.Cost = 0.0; + item.CVATSum = 0.0; + item.Price = vect.GetValue(GTAXVF_AFTERTAXES | GTAXVF_VAT | GTAXVF_EXCISE); + item.PVATSum = vect.GetValue(GTAXVF_VAT); + THROW(Add(&item)); + vect.CalcTI(rTi, opID, TIAMT_COST, GTAXVF_VAT); + item.CRate = vect.GetTaxRate(GTAX_VAT, 0); + item.Cost = vect.GetValue(GTAXVF_AFTERTAXES | GTAXVF_VAT); + item.CVATSum = vect.GetValue(GTAXVF_VAT); + item.Price = 0.0; + item.PVATSum = 0.0; + THROW(Add(&item)); + */ + const double qtty = r_ti.Qtty(); + const double absqtty = fabs(r_ti.Qtty()); + if(symb == "qtty" || symb == "quantity" || symb == "qty") { + result = absqtty; + } + else if(symb == "oldqtty") { + } + else if(symb == "cost") { + result = fabs(r_ti.Cost); + } + else if(symb == "price") { + result = fabs(r_ti.Price); + } + else if(symb == "discount") { + result = r_ti.Discount; + } + else if(symb == "curprice") { + } + else if(symb == "cursum") { + } + else if(symb == "mainprice") { + } + else if(symb == "mainsum") { + } + else if(symb == "mainsumwovat") { + } + else if(symb == "extprice") { + } + else if(symb == "excrate") { + } + else if(symb == "excsum") { + } + else if(symb == "strate") { + } + else if(symb == "stsum") { + } + else if(symb == "newprice") { + } + else if(symb == "newpricewovat") { + } + else if(symb == "newcost") { + } + else if(symb == "newcostwovat") { + } + else if(symb == "newpricesum") { + } + else if(symb == "newcostsum") { + } + else if(symb == "newpricesumwovat") { + } + else if(symb == "newcostsumwovat") { + } + else if(symb == "oldprice") { + } + else if(symb == "oldpricewovat") { + } + else if(symb == "oldcost") { + } + else if(symb == "oldcostwovat") { + } + else if(symb == "oldpricesum") { + } + else if(symb == "oldcostsum") { + } + else if(symb == "oldpricesumwovat") { + } + else if(symb == "oldcostsumwovat") { + } + else if(symb == "vatsumoldcost") { + } + else if(symb == "vatsumnewcost") { + } + else if(symb == "vatsumoldprice") { + } + else if(symb == "vatsumnewprice") { + } + else if(symb == "oldpricevat") { + } + else if(symb == "oldcostvat") { + } + else if(symb == "newpricevat") { + } + else if(symb == "newcostvat") { + } + else if(symb == "vatrate") { + } + else if(symb == "vat") { + } + else if(symb == "vatsum") { + } + else if(symb == "costvatrate") { // ставка НДС в ценах поступления // + GTaxVect v; + v.CalcTI(r_ti, p_bp->Rec.OpID, TIAMT_COST, 0); + result = v.GetTaxRate(GTAX_VAT, 0); + } + else if(symb == "costvat") { // величина НДС в цене поступления // + if(absqtty != 0.0) { + GTaxVect v; + v.CalcTI(r_ti, p_bp->Rec.OpID, TIAMT_COST, 0); + result = fabs(v.GetValue(GTAXVF_VAT)) / absqtty; + } + } + else if(symb == "costvatsum") { // величина НДС в сумме поступления (в цене поступления, умноженной на количество) + GTaxVect v; + v.CalcTI(r_ti, p_bp->Rec.OpID, TIAMT_COST, 0); + result = fabs(v.GetValue(GTAXVF_VAT)); + } + else if(symb == "pricevatrate") { + GTaxVect v; + v.CalcTI(r_ti, p_bp->Rec.OpID, TIAMT_PRICE, 0); + result = v.GetTaxRate(GTAX_VAT, 0); + } + else if(symb == "pricevat") { + if(absqtty != 0.0) { + GTaxVect v; + v.CalcTI(r_ti, p_bp->Rec.OpID, TIAMT_PRICE, 0); + result = fabs(v.GetValue(GTAX_VAT)) / absqtty; + } + } + else if(symb == "pricevatsum") { + GTaxVect v; + v.CalcTI(r_ti, p_bp->Rec.OpID, TIAMT_PRICE, 0); + result = fabs(v.GetValue(GTAX_VAT)); + } + } + } + } + _RET_DBL = result; // p_extra ? p_extra->GetValueBySymb(_ARG_STR(1)) : 0.0; + + } +} + void PPALDD_ContentBList::Destroy() { DESTROY_PPVIEW_ALDD(Bill); } // // Implementation of PPALDD_AmountType diff --git a/Src/PPLib/chzn.cpp b/Src/PPLib/chzn.cpp index f25c198bd..6a7861e20 100644 --- a/Src/PPLib/chzn.cpp +++ b/Src/PPLib/chzn.cpp @@ -2484,7 +2484,7 @@ int ChZnInterface::TransmitDocument2(const InitBlock & rIb, const ChZnInterface: } } } - else if(rIb.ProtocolId == rIb.protidGisMt) { // @v10.9.9 + else if(rIb.ProtocolId == rIb.protidGisMt) { ScURL c; MakeHeaderFields(rIb.Token, mhffAuthBearer, &hdr_flds, temp_buf); // @v11.1.11 /* @@ -2506,7 +2506,6 @@ int ChZnInterface::TransmitDocument2(const InitBlock & rIb, const ChZnInterface: bicycle – Велосипеды и велосипедные рамы wheelchairs – Кресла-коляски type: ChZnDocTypeList - { "document_format": "string", "product_document": "string", @@ -3128,7 +3127,7 @@ int ChZnInterface::Connect(InitBlock & rIb) // // // -PPChZnPrcssr::Param::Param() : GuaID(0), LocID(0) +PPChZnPrcssr::Param::Param() : GuaID(0), LocID(0), Flags(0) { Period.Z(); } @@ -3408,7 +3407,6 @@ int PPChZnPrcssr::Run(const Param & rP) } } } - // @v10.9.10 { if(base_op_list.Z().addnz(alcr_cfg.ExpndEtcOpID) > 0) { PPObjOprKind::ExpandOpList(base_op_list, op_list); for(uint i = 0; i < op_list.getCount(); i++) { @@ -3431,9 +3429,7 @@ int PPChZnPrcssr::Run(const Param & rP) } } } - // } @v10.9.10 } - // @v10.9.1 { if(p_ib->ProtocolId == ChZnInterface::InitBlock::protidMdlp) { PPObjOprKind op_obj; PPOprKind en_op_rec; @@ -3447,7 +3443,6 @@ int PPChZnPrcssr::Run(const Param & rP) op_assoc_list.Add(chzn_252_op_id, ChZnInterface::doctypMdlpRefusalReceiver); } } - // } @v10.9.1 if(op_assoc_list.getCount()) { for(uint opidx = 0; opidx < op_assoc_list.getCount(); opidx++) { const PPID op_id = op_assoc_list.at(opidx).Key; @@ -3486,7 +3481,6 @@ int PPChZnPrcssr::Run(const Param & rP) const PPID psn_id = bill_rec.Object ? ObjectToPerson(bill_rec.Object, 0) : 0; if(psn_id && p_ref->Ot.GetTagStr(PPOBJ_PERSON, psn_id, PPTAG_PERSON_CHZNCODE, temp_buf) > 0) { PPID local_chzn_op_id = chzn_op_id; - // @v10.9.7 { if(chzn_op_id == ChZnInterface::doctypMdlpReceiveOrder) { if(p_ref->Ot.GetTagStr(PPOBJ_BILL, bill_rec.ID, PPTAG_BILL_KEYWORDS, temp_buf) > 0) { if(temp_buf.Search("chzn-702", 0, 1, 0) || temp_buf.Search("chzn702", 0, 1, 0)) { @@ -3494,7 +3488,6 @@ int PPChZnPrcssr::Run(const Param & rP) } } } - // } @v10.9.7 THROW_SL(p_pack = new ChZnInterface::Packet(local_chzn_op_id)); if(PrepareBillPacketForSending(bill_rec.ID, p_pack) > 0) { suited = 1; @@ -3514,20 +3507,7 @@ int PPChZnPrcssr::Run(const Param & rP) } } if(pending_list.getCount() || pack_list.getCount()) { - if(ifc.Connect(*p_ib) > 0) { - { - SString pending_ident; - SString ticket_buf; - SString path; - PPIDArray bill_id_list; - ifc.GetDebugPath(*p_ib, path); - for(uint ssp = 0; pending_list.get(&ssp, pending_ident);) { - if(ifc.GetDocumentTicket(*p_ib, pending_ident, ticket_buf) > 0) { - if(!ifc.CommitTicket(path, pending_ident, ticket_buf)) - LogLastError(); - } - } - } + if(rP.Flags & Param::fTestMode) { for(uint bpidx = 0; bpidx < pack_list.getCount(); bpidx++) { ChZnInterface::Packet * p_inner_pack = pack_list.at(bpidx); int tdr = ifc.TransmitDocument2(*p_ib, *p_inner_pack, result_doc_ident); @@ -3536,9 +3516,10 @@ int PPChZnPrcssr::Run(const Param & rP) PPBillPacket * p_bp = static_cast(p_inner_pack->P_Data); ObjTagItem tag_item; if(tag_item.SetStr(PPTAG_BILL_EDIIDENT, result_doc_ident)) { - // @v10.8.5 @construction p_bobj->P_Tbl->SetRecFlag2(p_bp->Rec.ID, BILLF2_ACKPENDING, 1, 1); + /* if(!p_ref->Ot.PutTag(PPOBJ_BILL, p_bp->Rec.ID, &tag_item, 1)) LogLastError(); + */ } } } @@ -3546,6 +3527,40 @@ int PPChZnPrcssr::Run(const Param & rP) LogLastError(); } } + else { + if(ifc.Connect(*p_ib) > 0) { + { + SString pending_ident; + SString ticket_buf; + SString path; + PPIDArray bill_id_list; + ifc.GetDebugPath(*p_ib, path); + for(uint ssp = 0; pending_list.get(&ssp, pending_ident);) { + if(ifc.GetDocumentTicket(*p_ib, pending_ident, ticket_buf) > 0) { + if(!ifc.CommitTicket(path, pending_ident, ticket_buf)) + LogLastError(); + } + } + } + for(uint bpidx = 0; bpidx < pack_list.getCount(); bpidx++) { + ChZnInterface::Packet * p_inner_pack = pack_list.at(bpidx); + int tdr = ifc.TransmitDocument2(*p_ib, *p_inner_pack, result_doc_ident); + if(tdr > 0) { + if(result_doc_ident.NotEmpty()) { + PPBillPacket * p_bp = static_cast(p_inner_pack->P_Data); + ObjTagItem tag_item; + if(tag_item.SetStr(PPTAG_BILL_EDIIDENT, result_doc_ident)) { + // @v10.8.5 @construction p_bobj->P_Tbl->SetRecFlag2(p_bp->Rec.ID, BILLF2_ACKPENDING, 1, 1); + if(!p_ref->Ot.PutTag(PPOBJ_BILL, p_bp->Rec.ID, &tag_item, 1)) + LogLastError(); + } + } + } + else if(tdr == 0) + LogLastError(); + } + } + } } CATCH LogLastError(); diff --git a/Src/PPLib/csess.cpp b/Src/PPLib/csess.cpp index aaf41c98e..de2f48f1a 100644 --- a/Src/PPLib/csess.cpp +++ b/Src/PPLib/csess.cpp @@ -12,12 +12,9 @@ CSessionCore::CSessionCore() : CSessionTbl() { } -int CSessionCore::Search(PPID id, CSessionTbl::Rec * pRec) - { return SearchByID(this, PPOBJ_CSESSION, id, pRec); } -int CSessionCore::SetSessIncompletness(PPID id, int grade, int use_ta) - { return updateFor(this, use_ta, (this->ID == id), set(this->Incomplete, dbconst((long)grade))) ? 1 : PPSetErrorDB(); } -int CSessionCore::ResetTempSessTag(PPID id, int use_ta) - { return updateFor(this, use_ta, (this->ID == id), set(this->Temporary, dbconst(0L))) ? 1 : PPSetErrorDB(); } +int CSessionCore::Search(PPID id, CSessionTbl::Rec * pRec) { return SearchByID(this, PPOBJ_CSESSION, id, pRec); } +int CSessionCore::SetSessIncompletness(PPID id, int grade, int use_ta) { return updateFor(this, use_ta, (this->ID == id), set(this->Incomplete, dbconst((long)grade))) ? 1 : PPSetErrorDB(); } +int CSessionCore::ResetTempSessTag(PPID id, int use_ta) { return updateFor(this, use_ta, (this->ID == id), set(this->Temporary, dbconst(0L))) ? 1 : PPSetErrorDB(); } int CSessionCore::SearchByNumber(PPID * pID, PPID cashNodeID, long cashN, long sessN, LDATE dt) { @@ -26,11 +23,12 @@ int CSessionCore::SearchByNumber(PPID * pID, PPID cashNodeID, long cashN, long s k.CashNumber = cashN; k.SessNumber = sessN; k.Dt = MAXDATE; - while(search(2, &k, spLt) && k.CashNodeID == cashNodeID && k.CashNumber == cashN && k.SessNumber == sessN) + while(search(2, &k, spLt) && k.CashNodeID == cashNodeID && k.CashNumber == cashN && k.SessNumber == sessN) { if(dt == 0 || labs(diffdate(&k.Dt, &dt, 0)) < 7) { ASSIGN_PTR(pID, data.ID); return 1; } + } ASSIGN_PTR(pID, 0); return -1; } diff --git a/Src/PPLib/egais.cpp b/Src/PPLib/egais.cpp index e80942c8c..0d8cbd8b0 100644 --- a/Src/PPLib/egais.cpp +++ b/Src/PPLib/egais.cpp @@ -10243,10 +10243,7 @@ EgaisRefACore::EgaisRefACore() : EgaisRefATbl() { } -int EgaisRefACore::Search(PPID id, EgaisRefATbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_EGAISREFA, id, pRec); -} +int EgaisRefACore::Search(PPID id, EgaisRefATbl::Rec * pRec) { return SearchByID(this, PPOBJ_EGAISREFA, id, pRec); } int EgaisRefACore::SearchByCode(const char * pRefACode, TSVector & rList) { diff --git a/Src/PPLib/ie_bill.cpp b/Src/PPLib/ie_bill.cpp index af78cd200..f29489bec 100644 --- a/Src/PPLib/ie_bill.cpp +++ b/Src/PPLib/ie_bill.cpp @@ -5055,6 +5055,8 @@ int PPBillImporter::Run() param.GuaID = GuaID; param.LocID = LocID; param.Period = Period; + if(Flags & PPBillImporter::fTestMode) + param.Flags |= PPChZnPrcssr::Param::fTestMode; THROW(prcssr.Run(param)); } else if(Flags & PPBillImporter::fEdiImpExp && Flags & PPBillImporter::fFullEdiProcess) { diff --git a/Src/PPLib/mrp.cpp b/Src/PPLib/mrp.cpp index be4a6e731..1d3ca54a2 100644 --- a/Src/PPLib/mrp.cpp +++ b/Src/PPLib/mrp.cpp @@ -37,10 +37,7 @@ MrpTabCore::MrpTabCore() : MrpTabTbl() { } -int MrpTabCore::Search(PPID id, MrpTabTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_MRPTAB, id, pRec); -} +int MrpTabCore::Search(PPID id, MrpTabTbl::Rec * pRec) { return SearchByID(this, PPOBJ_MRPTAB, id, pRec); } int MrpTabCore::GetSubList(PPID tabID, PPIDArray * pList) { @@ -157,15 +154,8 @@ int MrpTabCore::SearchLine(PPID tabID, PPID destID, PPID srcID, MrpLineTbl::Rec return SearchByKey(&Lines, 1, &k1, pRec); } -int MrpTabCore::GetTotalLine(PPID tabID, PPID goodsID, MrpLineTbl::Rec * pRec) -{ - return SearchLine(tabID, goodsID, MRPSRCV_TOTAL, pRec); -} - -int MrpTabCore::SearchLineByID(PPID lineID, MrpLineTbl::Rec * pRec) -{ - return SearchByID(&Lines, 0, lineID, pRec); -} +int MrpTabCore::GetTotalLine(PPID tabID, PPID goodsID, MrpLineTbl::Rec * pRec) { return SearchLine(tabID, goodsID, MRPSRCV_TOTAL, pRec); } +int MrpTabCore::SearchLineByID(PPID lineID, MrpLineTbl::Rec * pRec) { return SearchByID(&Lines, 0, lineID, pRec); } int MrpTabCore::AddLine(PPID id, PPID destID, PPID srcID, double destReqQtty, double srcReqQtty, double price, long flags, int use_ta) { diff --git a/Src/PPLib/objsync.cpp b/Src/PPLib/objsync.cpp index 3e8366144..692b2fdd3 100644 --- a/Src/PPLib/objsync.cpp +++ b/Src/PPLib/objsync.cpp @@ -586,10 +586,7 @@ ObjSyncQueueCore::ObjSyncQueueCore() : ObjSyncQueueTbl() { } -int ObjSyncQueueCore::Search(PPID queueID, ObjSyncQueueTbl::Rec * pRec) -{ - return SearchByID(this, 0, queueID, pRec); -} +int ObjSyncQueueCore::Search(PPID queueID, ObjSyncQueueTbl::Rec * pRec) { return SearchByID(this, 0, queueID, pRec); } int ObjSyncQueueCore::SearchObject_(PPID objType, PPID objID, PPID dbID, ObjSyncQueueTbl::Rec * pRec) { diff --git a/Src/PPLib/objworld.cpp b/Src/PPLib/objworld.cpp index 72673887c..a6c2431b0 100644 --- a/Src/PPLib/objworld.cpp +++ b/Src/PPLib/objworld.cpp @@ -121,7 +121,6 @@ int PPObjWorldObjStatus::AddSimple(PPID * pID, const char * pName, const char * // PPWorldPacket::PPWorldPacket() { - // @v10.8.0 (ctr of WorldTbl::Rec will do everything) Init(); } void PPWorldPacket::Init() @@ -759,10 +758,7 @@ int PPObjWorld::Edit(PPID * pID, void * extraPtr /*parent*/) return (ok > 0) ? cmOK : cmCancel; } -int PPObjWorld::Search(PPID id, void * b) -{ - return SearchByID(P_Tbl, Obj, id, b); -} +int PPObjWorld::Search(PPID id, void * b) { return SearchByID(P_Tbl, Obj, id, b); } int PPObjWorld::SearchByCode(const char * pCode, WorldTbl::Rec * pRec) { @@ -1709,10 +1705,7 @@ FiasObjCore::FiasObjCore() { } -int FiasObjCore::SearchAddr(long recID, FiasAddrObjTbl::Rec * pRec) -{ - return SearchByID(&AdrT, PPOBJ_FIAS, recID, pRec); -} +int FiasObjCore::SearchAddr(long recID, FiasAddrObjTbl::Rec * pRec) { return SearchByID(&AdrT, PPOBJ_FIAS, recID, pRec); } int FiasObjCore::SearchAddrByID(long addrID, FiasAddrObjTbl::Rec * pRec) { @@ -1729,10 +1722,7 @@ int FiasObjCore::SearchAddrByID(long addrID, FiasAddrObjTbl::Rec * pRec) return ok; } -int FiasObjCore::SearchHouse(long hseID, FiasHouseObjTbl::Rec * pRec) -{ - return SearchByID(&HseT, PPOBJ_FIAS, hseID, pRec); -} +int FiasObjCore::SearchHouse(long hseID, FiasHouseObjTbl::Rec * pRec) { return SearchByID(&HseT, PPOBJ_FIAS, hseID, pRec); } int FiasObjCore::SearchAddrByUUID(const S_GUID & rUuid, FiasAddrObjTbl::Rec * pRec) { diff --git a/Src/PPLib/processr.cpp b/Src/PPLib/processr.cpp index b4614d46c..4543aafc0 100644 --- a/Src/PPLib/processr.cpp +++ b/Src/PPLib/processr.cpp @@ -124,10 +124,8 @@ int ProcessorPlaceCodeTemplate::Parse(const char * pPattern) THROW_PP_S(sub.Len() == sub2.Len() && sub.Len() == 1, PPERR_PRCPLCCODE_ALRNGLEN, pPattern); const char c1 = sub.C(0); const char c2 = sub2.C(0); - // @v10.9.8 THROW_PP_S((c1 >= 'A' && c1 <= 'Z') || (c1 >= 'a' && c1 <= 'z') || IsLetter866(c1), PPERR_PRCPLCCODE_ALRNGSYM, pPattern); - // @v10.9.8 THROW_PP_S((c2 >= 'A' && c2 <= 'Z') || (c2 >= 'a' && c2 <= 'z') || IsLetter866(c2), PPERR_PRCPLCCODE_ALRNGSYM, pPattern); - THROW_PP_S(isasciialpha(c1) || IsLetter866(c1), PPERR_PRCPLCCODE_ALRNGSYM, pPattern); // @v10.9.8 - THROW_PP_S(isasciialpha(c2) || IsLetter866(c2), PPERR_PRCPLCCODE_ALRNGSYM, pPattern); // @v10.9.8 + THROW_PP_S(isasciialpha(c1) || IsLetter866(c1), PPERR_PRCPLCCODE_ALRNGSYM, pPattern); + THROW_PP_S(isasciialpha(c2) || IsLetter866(c2), PPERR_PRCPLCCODE_ALRNGSYM, pPattern); seq.Type = 2; seq.Start = ToUpper866(c1); seq.End = ToUpper866(c2); @@ -522,15 +520,8 @@ bool PPObjProcessor::IsPacketEq(const PPProcessorPacket & rS1, const PPProcessor return eq; } -int PPObjProcessor::Search(PPID id, void * b) -{ - return SearchByID(P_Tbl, Obj, id, b); -} - -/*virtual*/const char * PPObjProcessor::GetNamePtr() -{ - return P_Tbl->data.Name; -} +int PPObjProcessor::Search(PPID id, void * b) { return SearchByID(P_Tbl, Obj, id, b); } +/*virtual*/const char * PPObjProcessor::GetNamePtr() { return P_Tbl->data.Name; } int PPObjProcessor::SearchByName(int kind, const char * pName, PPID * pID, ProcessorTbl::Rec * pRec) { diff --git a/Src/PPLib/project.cpp b/Src/PPLib/project.cpp index 724fbc4b4..4ef047a9c 100644 --- a/Src/PPLib/project.cpp +++ b/Src/PPLib/project.cpp @@ -220,12 +220,9 @@ PPObjProject::~PPObjProject() TLP_CLOSE(P_Tbl); } -int PPObjProject::DeleteObj(PPID id) - { return PutPacket(&id, static_cast(0), 0); } -int PPObjProject::Search(PPID id, void * b) - { return SearchByID(P_Tbl, Obj, id, b); } -const char * PPObjProject::GetNamePtr() - { return MakeCodeString(&P_Tbl->data, NameBuf).cptr(); } +int PPObjProject::DeleteObj(PPID id) { return PutPacket(&id, static_cast(0), 0); } +int PPObjProject::Search(PPID id, void * b) { return SearchByID(P_Tbl, Obj, id, b); } +const char * PPObjProject::GetNamePtr() { return MakeCodeString(&P_Tbl->data, NameBuf).cptr(); } StrAssocArray * PPObjProject::MakeStrAssocList(void * extraPtr /*parentPrjID*/) { @@ -890,15 +887,9 @@ PrjTaskCore::PrjTaskCore() : PrjTaskTbl() { } -int PrjTaskCore::Search(PPID id, PrjTaskTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_PRJTASK, id, pRec); -} - -int PrjTaskCore::NextEnum(long enumHandle, PrjTaskTbl::Rec * pRec) - { return (EnumList.NextIter(enumHandle) > 0) ? (copyBufTo(pRec), 1) : -1; } -int PrjTaskCore::DestroyIter(long enumHandle) - { return EnumList.DestroyIterHandler(enumHandle); } +int PrjTaskCore::Search(PPID id, PrjTaskTbl::Rec * pRec) { return SearchByID(this, PPOBJ_PRJTASK, id, pRec); } +int PrjTaskCore::NextEnum(long enumHandle, PrjTaskTbl::Rec * pRec) { return (EnumList.NextIter(enumHandle) > 0) ? (copyBufTo(pRec), 1) : -1; } +int PrjTaskCore::DestroyIter(long enumHandle) { return EnumList.DestroyIterHandler(enumHandle); } BExtQuery * PrjTaskCore::StartupEnumQuery(int idx, int options) { diff --git a/Src/PPLib/salary.cpp b/Src/PPLib/salary.cpp index 274cc1c89..866149535 100644 --- a/Src/PPLib/salary.cpp +++ b/Src/PPLib/salary.cpp @@ -31,10 +31,7 @@ int SalaryCore::Validate(const SalaryTbl::Rec * pRec) return ok; } -int SalaryCore::Search(PPID id, SalaryTbl::Rec * pRec) -{ - return SearchByID(this, 0, id, pRec); -} +int SalaryCore::Search(PPID id, SalaryTbl::Rec * pRec) { return SearchByID(this, 0, id, pRec); } int SalaryCore::Put(PPID * pID, SalaryTbl::Rec * pRec, int use_ta) { diff --git a/Src/PPLib/specsn.cpp b/Src/PPLib/specsn.cpp index 7364ec063..ce0ef6bdc 100644 --- a/Src/PPLib/specsn.cpp +++ b/Src/PPLib/specsn.cpp @@ -43,10 +43,7 @@ SpecSeriesCore::SpecSeriesCore() : SpecSeries2Tbl() { } -int SpecSeriesCore::Search(PPID id, SpecSeries2Tbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_SPECSERIES, id, pRec); -} +int SpecSeriesCore::Search(PPID id, SpecSeries2Tbl::Rec * pRec) { return SearchByID(this, PPOBJ_SPECSERIES, id, pRec); } int SpecSeriesCore::Put(PPID * pID, SpecSeries2Tbl::Rec * pRec, int use_ta) { diff --git a/Src/PPLib/tsess.cpp b/Src/PPLib/tsess.cpp index 3c19ad21b..b8f869293 100644 --- a/Src/PPLib/tsess.cpp +++ b/Src/PPLib/tsess.cpp @@ -1,5 +1,5 @@ // TSESS.CPP -// Copyright (c) A.Sobolev 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2015, 2016, 2019, 2020, 2021 +// Copyright (c) A.Sobolev 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2015, 2016, 2019, 2020, 2021, 2024 // @codepage UTF-8 // #include @@ -86,10 +86,7 @@ TSessionCore::TSessionCore() : TSessionTbl() { } -int TSessionCore::Search(PPID id, TSessionTbl::Rec * pRec) -{ - return SearchByID(this, PPOBJ_TSESSION, id, pRec); -} +int TSessionCore::Search(PPID id, TSessionTbl::Rec * pRec) { return SearchByID(this, PPOBJ_TSESSION, id, pRec); } int TSessionCore::SearchAnyRef(PPID objType, PPID objID, PPID * pID) { diff --git a/Src/PPLib/v_goods.cpp b/Src/PPLib/v_goods.cpp index 87932acf9..7d16a9cbb 100644 --- a/Src/PPLib/v_goods.cpp +++ b/Src/PPLib/v_goods.cpp @@ -5001,8 +5001,7 @@ void PPALDD_Goods::EvaluateFunc(const DlFunc * pF, SV_Uint32 * pApl, RtmStack & else _RET_LONG = 0; } - else if(pF->Name == "?GetAverageCost") { // @v10.2.6 - //double GetAverageCost(date dt, long locID, string serial); + else if(pF->Name == "?GetAverageCost") { LDATE dt = _ARG_DT(1); PPID loc_id = _ARG_LONG(2); const SString & r_serial = _ARG_STR(3); diff --git a/Src/PPLib/vetis.cpp b/Src/PPLib/vetis.cpp index 52147679b..336d3d0b2 100644 --- a/Src/PPLib/vetis.cpp +++ b/Src/PPLib/vetis.cpp @@ -2222,14 +2222,12 @@ int VetisEntityCore::SetEntity(Entity & rE, TSVector * pUreLi } } CATCHZOK - ASSIGN_PTR(pID, rE.ID); // @v10.6.3 + ASSIGN_PTR(pID, rE.ID); return ok; } -int VetisEntityCore::SearchPerson(PPID id, VetisPersonTbl::Rec * pRec) - { return SearchByID(&BT, 0, id, pRec); } -int VetisEntityCore::SearchDocument(PPID id, VetisDocumentTbl::Rec * pRec) - { return SearchByID(&DT, 0, id, pRec); } +int VetisEntityCore::SearchPerson(PPID id, VetisPersonTbl::Rec * pRec) { return SearchByID(&BT, 0, id, pRec); } +int VetisEntityCore::SearchDocument(PPID id, VetisDocumentTbl::Rec * pRec) { return SearchByID(&DT, 0, id, pRec); } int VetisEntityCore::MatchDocument(PPID docEntityID, PPID billID, int rowN, int fromBill, int use_ta) { diff --git a/Src/PPLib/workbook.cpp b/Src/PPLib/workbook.cpp index b4c8ba363..62b7d6820 100644 --- a/Src/PPLib/workbook.cpp +++ b/Src/PPLib/workbook.cpp @@ -185,12 +185,9 @@ void PPWorkbookPacket::destroy() ExtString.Z(); } -int PPWorkbookPacket::GetExtStrData(int fldID, SString & rBuf) const - { return PPGetExtStrData(fldID, ExtString, rBuf); } -int PPWorkbookPacket::PutExtStrData(int fldID, const char * pBuf) - { return PPPutExtStrData(fldID, ExtString, pBuf); } -int PPWorkbookPacket::SetLongSymb(const char * pSymb) - { return TagL.PutItemStrNE(PPTAG_WORKBOOK_LONGCODE, pSymb); } +int PPWorkbookPacket::GetExtStrData(int fldID, SString & rBuf) const { return PPGetExtStrData(fldID, ExtString, rBuf); } +int PPWorkbookPacket::PutExtStrData(int fldID, const char * pBuf) { return PPPutExtStrData(fldID, ExtString, pBuf); } +int PPWorkbookPacket::SetLongSymb(const char * pSymb) { return TagL.PutItemStrNE(PPTAG_WORKBOOK_LONGCODE, pSymb); } // // // @@ -335,10 +332,7 @@ PPObjWorkbook::~PPObjWorkbook() TLP_CLOSE(P_Tbl); } -int PPObjWorkbook::Search(PPID id, void * pRec) -{ - return SearchByID(P_Tbl, Obj, id, pRec); -} +int PPObjWorkbook::Search(PPID id, void * pRec) { return SearchByID(P_Tbl, Obj, id, pRec); } int PPObjWorkbook::SearchByName(const char * pName, PPID * pID, WorkbookTbl::Rec * pRec) { diff --git a/Src/PPMain/wsctl-main.cpp b/Src/PPMain/wsctl-main.cpp index 090881b3d..8e3490c6a 100644 --- a/Src/PPMain/wsctl-main.cpp +++ b/Src/PPMain/wsctl-main.cpp @@ -233,12 +233,9 @@ class WsCtl_ImGuiSceneBlock : public ImGuiSceneBase { PPID MainOrgID; // @v12.1.11 Идентификатор персоналии главной организации }; struct QuotKindEntry { - QuotKindEntry() : ID(0), Rank(0), DaysOfWeek(0) - { - ApplyTm.Z(); - } - bool HasWeekDayRestriction() const { return (DaysOfWeek && ((DaysOfWeek & 0x7f) != 0x7f)); } - bool CheckWeekDay(LDATE dt) const { return (!DaysOfWeek || !dt || (DaysOfWeek & (1 << (dayofweek(&dt, 1)-1)))); } + QuotKindEntry(); + bool HasWeekDayRestriction() const; + bool CheckWeekDay(LDATE dt) const; PPID ID; int Rank; @@ -247,35 +244,20 @@ class WsCtl_ImGuiSceneBlock : public ImGuiSceneBase { SString NameUtf8; }; struct QuotEntry { - QuotEntry() : QkID(0), Value(0.0) - { - } + QuotEntry(); PPID QkID; double Value; }; struct TechEntry { - TechEntry() : ID(0) - { - CodeUtf8[0] = 0; - } + TechEntry(); PPID ID; char CodeUtf8[48]; }; struct GoodsEntry { - GoodsEntry() : ID(0) - { - } - GoodsEntry(const GoodsEntry & rS) : ID(rS.ID), NameUtf8(rS.NameUtf8), QuotList(rS.QuotList) - { - } - GoodsEntry & FASTCALL operator = (const GoodsEntry & rS) - { - ID = rS.ID; - NameUtf8 = rS.NameUtf8; - TechList = rS.TechList; - QuotList = rS.QuotList; - return *this; - } + GoodsEntry(); + GoodsEntry(const GoodsEntry & rS); + GoodsEntry & FASTCALL operator = (const GoodsEntry & rS); + PPID ID; SString NameUtf8; TSVector TechList; @@ -1220,6 +1202,40 @@ WsCtl_ImGuiSceneBlock::DComputerCategoryList & WsCtl_ImGuiSceneBlock::DComputerC return *this; } +WsCtl_ImGuiSceneBlock::QuotKindEntry::QuotKindEntry() : ID(0), Rank(0), DaysOfWeek(0) +{ + ApplyTm.Z(); +} + +bool WsCtl_ImGuiSceneBlock::QuotKindEntry::HasWeekDayRestriction() const { return (DaysOfWeek && ((DaysOfWeek & 0x7f) != 0x7f)); } +bool WsCtl_ImGuiSceneBlock::QuotKindEntry::CheckWeekDay(LDATE dt) const { return (!DaysOfWeek || !dt || (DaysOfWeek & (1 << (dayofweek(&dt, 1)-1)))); } + +WsCtl_ImGuiSceneBlock::QuotEntry::QuotEntry() : QkID(0), Value(0.0) +{ +} + +WsCtl_ImGuiSceneBlock::TechEntry::TechEntry() : ID(0) +{ + CodeUtf8[0] = 0; +} + +WsCtl_ImGuiSceneBlock::GoodsEntry::GoodsEntry() : ID(0) +{ +} + +WsCtl_ImGuiSceneBlock::GoodsEntry::GoodsEntry(const GoodsEntry & rS) : ID(rS.ID), NameUtf8(rS.NameUtf8), QuotList(rS.QuotList) +{ +} + +WsCtl_ImGuiSceneBlock::GoodsEntry & FASTCALL WsCtl_ImGuiSceneBlock::GoodsEntry::operator = (const GoodsEntry & rS) +{ + ID = rS.ID; + NameUtf8 = rS.NameUtf8; + TechList = rS.TechList; + QuotList = rS.QuotList; + return *this; +} + WsCtl_ImGuiSceneBlock::DServerError::DServerError() : _Status(0) { } diff --git a/Src/Rsrc/Version/genver-open.dat b/Src/Rsrc/Version/genver-open.dat index 281d7b5b8..693369028 100644 --- a/Src/Rsrc/Version/genver-open.dat +++ b/Src/Rsrc/Version/genver-open.dat @@ -15,7 +15,7 @@ OpenSource = 1 MajorVer =12 MinorVer =1 Revision =12 -AssemblyVer=40763 +AssemblyVer=40772 MinMajorVer =9 MinMinorVer =8 MinRevision =11 diff --git a/Src/Rsrc/dl600/ppexp.dl6 b/Src/Rsrc/dl600/ppexp.dl6 index 49c5ba63b..f92e616ed 100644 --- a/Src/Rsrc/dl600/ppexp.dl6 +++ b/Src/Rsrc/dl600/ppexp.dl6 @@ -2351,11 +2351,11 @@ data GoodsBillBase { // "pricesum" // "discount" // "vatrate" - // "vat" - // "vatsum" ( , ) + // "vat" + // "vatsum" ( , ) // "costvatrate" // "costvat" - // "costvatsum" ( , ) + // "costvatsum" ( , ) // "pricevatrate" // "pricevat" // "pricevatsum" @@ -3214,6 +3214,30 @@ data ContentBList { OpName = BillID.OprKindID.Name; CostRevalSum = (Cost - OldCost) * Quantity; PriceRevalSum = (Price - OldPrice) * Quantity; + // + // Descr: . amtSymb[] + // amtSymb: + // * "qty" | "qtty" | "quantity" + // "cost" + // "costsum" + // "price" + // "pricesum" + // "discount" + // "vatrate" + // "vat" + // "vatsum" ( , ) + // * "costvatrate" + // * "costvat" + // * "costvatsum" ( , ) + // * "pricevatrate" + // * "pricevat" + // * "pricevatsum" + // + double GetRowAmount(string amtSymb[32]); // @v12.2.0 + + //TestAmount01 = GetRowAmount("qtty"); // @debug + //TestAmount02 = GetRowAmount("pricevat"); // @debug + //TestAmount03 = GetRowAmount("costvatsum"); // @debug } } //