Skip to content

Commit

Permalink
Version 11.9.9-ii
Browse files Browse the repository at this point in the history
  • Loading branch information
papyrussolution committed Mar 14, 2024
1 parent 9cfcbdd commit 4065473
Show file tree
Hide file tree
Showing 19 changed files with 474 additions and 491 deletions.
4 changes: 4 additions & 0 deletions Src/Include/Pp.h
Original file line number Diff line number Diff line change
Expand Up @@ -55441,6 +55441,10 @@ class DocNalogRu_Generator : public DocNalogRu_Base {
//
int WriteInvoiceItems(const PPBillImpExpParam & rParam, const FileInfo & rHi, const PPBillPacket & rBp, bool correction = false);
int WriteAddress(const PPLocationPacket & rP, int regionCode, int hdrTag /*PPHSC_RU_ADDRESS||PPHSC_RU_ORGADDR*/);
//
// Descr: Специализированная функция, реализующая запись адреса в формате EDI SBIS
//
int WriteAddress_SBIS(const PPLocationPacket & rP, int regionCode, int hdrTag /*PPHSC_RU_ADDRESS||PPHSC_RU_ORGADDR*/);
//
// Descr: Флаги функции WriteOrgInfo
//
Expand Down
2 changes: 1 addition & 1 deletion Src/Include/SLIB.H
Original file line number Diff line number Diff line change
Expand Up @@ -7199,7 +7199,7 @@ public:
// result = Fun(0, pData, dataSize)
// -- если необходимо получить хэш в несколько итераций, то делаем так:
// SlHash hs;
// while(isThereMoreDate) {
// while(isThereMoreData) {
// Func(&hs, data_chunk_ptr, data_chunk_size);
// }
// result = Func(&hs, 0, 0); // final
Expand Down
8 changes: 4 additions & 4 deletions Src/Include/ued-id.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// UED-ID.H
// UED-ID-TEMP.H
// version: 31
// sha256: 59cf320d941a0bcd7a19ae576fa9c3b18f98248d46c373f772bff89846b62306
//
#ifndef __UED_ID_H
#define __UED_ID_H
#ifndef __UED_ID_TEMP_H
#define __UED_ID_TEMP_H

#define UED_META_META 0x100000001ULL
#define UED_META_PREDEFVALUE 0x100000002ULL
Expand Down Expand Up @@ -3691,4 +3691,4 @@
#define UED_META_INTEGER 0x197000000ULL
#define UED_META_DECIMAL 0x198000000ULL

#endif // __UED_ID_H
#endif // __UED_ID_TEMP_H
7 changes: 3 additions & 4 deletions Src/OSF/SQLite/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -86030,11 +86030,10 @@ static const Mem * columnNullValue(void){
** If iCol is not valid, return a pointer to a Mem which has a value
** of NULL.
*/
static Mem * columnMem(sqlite3_stmt * pStmt, int i){
Vdbe * pVm;
static Mem * columnMem(sqlite3_stmt * pStmt, int i)
{
Mem * pOut;

pVm = (Vdbe*)pStmt;
Vdbe * pVm = (Vdbe*)pStmt;
if(pVm==0) return (Mem*)columnNullValue();
assert(pVm->db);
sqlite3_mutex_enter(pVm->db->mutex);
Expand Down
53 changes: 43 additions & 10 deletions Src/PPLib/Goods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,50 @@ int BarcodeArray::GetSingle(uint sifFlags/*BarcodeArray::sifXXX*/, SString & rBu
return ok;
}

/*
const BarcodeTbl::Rec * FASTCALL BarcodeArray::GetSingleItem(uint * pPos) const
{
const BarcodeTbl::Rec * p_ret = 0;
const uint c = getCount();
if(c) {
uint i, p = 0;
if(c > 1) {
const BarcodeTbl::Rec * p_pref_item = GetPreferredItem(&i);
if(p_pref_item)
p = i;
else {
int done = 0;
for(int get_any = 0; !done && get_any <= 1; get_any++) {
for(i = 0; !done && i < c; i++) {
const BarcodeTbl::Rec & r_item = at(i);
if((r_item.Qtty == 1.0 && sstrlen(r_item.Code) <= 13) || get_any) {
p = i;
done = 1;
}
}
}
}
}
p_ret = &at(p);
ASSIGN_PTR(pPos, p);
}
return p_ret;
}
*/

const BarcodeTbl::Rec * BarcodeArray::GetSingleItem(uint * pPos, uint sifFlags/*BarcodeArray::sifXXX*/) const
{
const BarcodeTbl::Rec * p_ret = 0;
const uint c = getCount();
if(c) {
uint i;
uint p = 0;
int diag = 0;
int std = 0;
SString norm_code;
if(c > 1) {
const BarcodeTbl::Rec * p_pref_item = GetPreferredItem(&i);
bool is_pref_suitable = false;
uint p = 0; // result index +1 (0 - suitable entry is not found)
if(p_pref_item) {
if(sifFlags & sifValidEanUpcOnly) {
const int dbcr = PPObjGoods::DiagBarcode(p_pref_item->Code, &diag, &std, &norm_code);
Expand All @@ -257,29 +288,31 @@ const BarcodeTbl::Rec * BarcodeArray::GetSingleItem(uint * pPos, uint sifFlags/*
else
is_pref_suitable = true;
}
if(is_pref_suitable)
p = i;
if(is_pref_suitable) {
p = i+1;
}
else {
bool done = false;
for(int get_any = 0; !done && get_any <= 1; get_any++) {
for(i = 0; !done && i < c; i++) {
for(int get_any = 0; !p && get_any <= 1; get_any++) {
for(i = 0; !p && i < c; i++) {
const BarcodeTbl::Rec & r_item = at(i);
if((r_item.Qtty == 1.0 && sstrlen(r_item.Code) <= 13) || get_any) {
if(sifFlags & sifValidEanUpcOnly) {
const int dbcr = PPObjGoods::DiagBarcode(r_item.Code, &diag, &std, &norm_code);
if(dbcr > 0 && oneof4(std, BARCSTD_EAN13, BARCSTD_EAN8, BARCSTD_UPCA, BARCSTD_UPCE)) {
p = i;
done = true;
p = i+1;
}
}
else {
p = i;
done = true;
p = i+1;
}
}
}
}
}
if(p) {
p_ret = &at(p-1);
ASSIGN_PTR(pPos, p-1);
}
}
else {
const BarcodeTbl::Rec & r_item = at(0);
Expand Down
34 changes: 34 additions & 0 deletions Src/PPLib/Goodsdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,40 @@ class BarcodeListDialog : public PPListDialog {
return pData->copy(Data) ? 1 : PPSetErrorSLib();
}
private:
DECL_HANDLE_EVENT
{
PPListDialog::handleEvent(event);
if(event.isCmd(cmCopyToClipboard)) {
long cur_pos = 0;
long cur_id = 0;
SString text_buf;
if(getCurItem(&cur_pos, &cur_id)) {
if(cur_pos >= 0 && cur_pos < Data.getCountI()) {
const BarcodeTbl::Rec & r_rec = Data.at(static_cast<uint>(cur_pos));
text_buf.Cat(r_rec.Code).Tab().Cat(r_rec.Qtty).Tab();
if(oneof2(r_rec.BarcodeType, BARCODE_TYPE_PREFERRED, BARCODE_TYPE_PREFMARK))
text_buf.Cat("preferred");
SClipboard::Copy_Text(text_buf, text_buf.Len());
}
}
}
else if(event.isCmd(cmCopyToClipboardAll)) {
if(Data.getCount()) {
SString text_buf;
for(uint i = 0; i < Data.getCount(); i++) {
const BarcodeTbl::Rec & r_rec = Data.at(static_cast<uint>(i));
text_buf.Cat(r_rec.Code).Tab().Cat(r_rec.Qtty).Tab();
if(oneof2(r_rec.BarcodeType, BARCODE_TYPE_PREFERRED, BARCODE_TYPE_PREFMARK))
text_buf.Cat("preferred");
text_buf.CR();
}
SClipboard::Copy_Text(text_buf, text_buf.Len());
}
}
else
return;
clearEvent(event);
}
virtual int setupList();
virtual int addItem(long * pPos, long * pID);
virtual int editItem(long pos, long id);
Expand Down
2 changes: 0 additions & 2 deletions Src/PPLib/Objloctn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,9 @@ int PPObjLocation::GetCountry(const LocationTbl::Rec * pLocRec, PPID * pCountryI
pBlk->Name = w_rec.Name;
pBlk->Abbr = w_rec.Abbr;
pBlk->Code = w_rec.Code;
// @v9.7.8 {
pBlk->IsNative = 1;
if(pBlk->Code.NotEmpty() && DS.GetConstTLA().MainOrgCountryCode != pBlk->Code)
pBlk->IsNative = 0;
// } @v9.7.8
}
ASSIGN_PTR(pCountryID, w_rec.ID);
ok = 1;
Expand Down
68 changes: 33 additions & 35 deletions Src/PPLib/Pplog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// PPLOG.CPP
// Copyright (c) A.Sobolev, A.Osolotkin 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023
// Copyright (c) A.Sobolev, A.Osolotkin 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024
// @codepage UTF-8
//
#include <pp.h>
Expand Down Expand Up @@ -585,41 +585,39 @@ long PPMsgLog::Init()
AllCount = 0;
CurMsg = 0;
P_Index = new SArray(sizeof(long));
if(!P_Index)
return 0;
{
SString fname;
PPMakeTempFileName("logl", 0, 0, FileName);
PPMakeTempFileName("logi", 0, 0, InFileName);
}
Stream = creat(FileName, S_IWRITE);
if(Stream < 0) {
FileName = 0;
ZDELETE(P_Index);
return 0;
}
else {
close(Stream);
Stream = open(FileName, O_RDWR|O_BINARY);
}
InStream = creat(InFileName, S_IWRITE);
if(InStream < 0) {
InFileName = 0;
close(Stream);
Stream = -1;
SFile::Remove(FileName);
ZDELETE(P_Index);
return 0;
}
else {
close(InStream);
InStream = open(InFileName, O_RDWR|O_BINARY);
if(P_Index) {
{
SString fname;
PPMakeTempFileName("logl", 0, 0, FileName);
PPMakeTempFileName("logi", 0, 0, InFileName);
}
Stream = creat(FileName, S_IWRITE);
if(Stream < 0) {
FileName = 0;
ZDELETE(P_Index);
}
else {
close(Stream);
Stream = open(FileName, O_RDWR|O_BINARY);
InStream = creat(InFileName, S_IWRITE);
if(InStream < 0) {
InFileName = 0;
close(Stream);
Stream = -1;
SFile::Remove(FileName);
ZDELETE(P_Index);
}
else {
close(InStream);
InStream = open(InFileName, O_RDWR|O_BINARY);
PPLogIdx li;
li.flags = 0;
li.address = 0;
_write(InStream, &li, sizeof(PPLogIdx));
Valid = 1;
}
}
}
PPLogIdx li;
li.flags = 0;
li.address = 0;
_write(InStream, &li, sizeof(PPLogIdx));
Valid = 1;
return Valid;
}

Expand Down
12 changes: 2 additions & 10 deletions Src/PPLib/bitmbrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,12 +1488,7 @@ int BillItemBrowser::_GetDataForBrowser(SBrowserDataProcBlock * pBlk)
}
break;
case 23: // Связанное количество
if(!is_total) {
real_val = GetLinkQtty(*p_ti);
pBlk->Set(real_val);
}
else
pBlk->Set(Total.LinkQtty);
pBlk->Set(is_total ? Total.LinkQtty : GetLinkQtty(*p_ti));
break;
case 24: // Остаток по заказу
if(is_total)
Expand All @@ -1505,10 +1500,7 @@ int BillItemBrowser::_GetDataForBrowser(SBrowserDataProcBlock * pBlk)
}
break;
case 25: // Распределенная себестоимость
if(is_total)
pBlk->Set(Total.ExtCost);
else
pBlk->Set(p_ti->ExtCost);
pBlk->Set(is_total ? Total.ExtCost : p_ti->ExtCost);
break;
case 26: // Складская ячейка
if(is_total)
Expand Down
Loading

0 comments on commit 4065473

Please sign in to comment.