Posty bez odpowiedzi |oraz Aktywne tematy Dzisiaj jest 2024-03-28, 12:29x



Odpowiedz w temacie  [ Posty: 2 ] 
Własne pola dla dok. sprzedaży i magazynowych na wydruku 
Autor Wiadomość

Rejestracja: 2019-12-09, 19:32
Posty: 2
Post Własne pola dla dok. sprzedaży i magazynowych na wydruku
Witam,

mam pytanie - jak umieścić na wydruku nazwy pól własnych i ich wartości wprowadzone na dokumencie WZ (jeśli własne pola są zdefiniowane dla dokumentu magazynowego) lub dokumencie sprzedaży np. FVS?

Znalazłem wątek na forum na temat wymiarów towarów i tam rzeczywiście działa to dobrze (ale to są wymiary towarów, a nie dokumentów):
viewtopic.php?f=15&t=9333

Niestety nie wiem gdzie znajdę obiekt dla dokumentu magazynowego i sprzedaży który zwróci mi wartości wprowadzonych wartości w "Pola własne".

Używając xDocument.wartosciwymiarow.wartosc oraz xDocument.wartosciwymiarow.wymiar.definicja.nazwa pojawia się komunikat "Obiekt nie obsługuje właściwości lub metody o nazwie: "WartosciWymiarow" ".

Program to Symfonia Handel ERP 2020.1.


2019-12-12, 14:23
Wyświetl profil
Autor Wiadomość
 



Rejestracja: 2013-10-02, 08:42
Posty: 23
Pomógł: 2
Post Re: Własne pola dla dok. sprzedaży i magazynowych na wydruku
Stare wydruki (AmBasic)?
Robiłem coś takiego, bez obiektów, myślę, że mogę pomóc.
Raport "Drukowanie wymiarów"
Kod:
dispatch con = GetAdoConnection()

dispatch sub RsFromSql(string sSQL, dispatch con)   
   dispatch recordset = "ADODB.Recordset"
   if recordset.State == 1 then recordset.Close()
   recordset.Open(sSQL,con,3)
   if recordset.RecordCount > 0 then recordset.MoveFirst()
   RSFromSql = recordset
endsub

//RS typy danych:
#define adSmallInt   2   //This data type indicates a 2-byte (16-bit) signed integer (DBTYPE_I2).
#define adInteger   3   //This data type indicates a 4-byte (32bit) signed integer (DBTYPE_I4).
#define adSingle   4   //This data type indicates a 4-byte (32-bit) single-precision IEEE floating-point number (DBTYPE_R4).
#define adDouble   5   //This data type indicates an 8-byte (64-bit) double-precision IEEE floating-point number (DBTYPE_R8).
#define adCurrency   6   //A data type indicates a currency value (DBTYPE_CY). Currency is a fixed-point number with four digits to the right of the decimal point. It is stored in an 8-byte signed integer scaled by 10,000. This data type is not supported by the Microsoft® OLE DB Provider for AS/400 and VSAM or the Microsoft OLE DB Provider for DB2.
#define adDate   7      //This data type indicates a date value stored as a Double, the whole part of which is the number of days since December 30, 1899, and the fractional part of which is the fraction of a day. This data type is not supported by the OLE DB Provider for AS/400 and VSAM or the OLE DB Provider for DB2.
#define adBoolean   11   //Indicates a Boolean value (DBTYPE_BOOL).
#define adVarChar   200   //This data type indicates variable-length character data (DBTYPE_STR).
#define adLongVarChar   201      //This data type indicates a long string value.
#define adVarWChar   202         //This data type indicates a Unicode string value. This data type is not supported by the OLE DB Provider for AS/400 and VSAM or the OLE DB Provider for DB2.
#define adLongVarWChar   203      //This data type indicates a long Unicode string value. This data type is not supported by the OLE DB Provider for AS/400 and VSAM or the OLE DB Provider for DB2.
#define adDBDate   133         //This data type indicates an OLE DB date structure (DBTYPE_DATE).
#define adDBTimeStamp   135   //Indicates a date/time stamp (yyyymmddhhmmss plus a fraction in billionths) (DBTYPE_DBTIMESTAMP).

string sub DajNazweWymiaru(string sSkrot)
   string sSQL = using " SELECT [Name] FROM [SSCommon].[STDimensions] WHERE Symbol='%s' ", sSkrot
   dispatch rs = RsFromSQL(sSQL,con)
   if rs.Recordcount > 0 then DajNazweWymiaru = rs.Fields(0).Value
endsub

record rWym
   string sNazwa[200]
   string sWartosc[200]
   int iWartosc
endrec
rWym w(1)

int sub GenerujWymiary(long iddk, string sKartoteka)
   string sTabZ
   int i
   if lcase(sKartoteka) == "zo" then sTabZ = "HMF_SalesOrderClassification"
   if lcase(sKartoteka) == "zw" then sTabZ = "HMF_PurchasingOrderClassification"
   if lcase(sKartoteka) == "sp" then sTabZ = "HMF_SalesInvoiceClassification"
   if lcase(sKartoteka) == "mg" then sTabZ = "HMF_WarehouseDocumentClassification"
   if lcase(sKartoteka) == "zk" then sTabZ = "HMF_PurchasingInvoiceClassification"
   if lcase(sKartoteka) == "zw" then sTabZ = "HMF_PurchasingOrderClassification"
   
   string sSQL = ""
   sSQL = " SELECT * "
   sSQL+= using "  FROM [SSCommon].%s WHERE ElementId=%L", sTabZ, iddk
   dispatch rs = RsFromSQL(sSQL, con)

   if rs.RecordCount > 0 then
      for i=0 to i>rs.Fields.Count-1
         if rs.Fields(i).Value && UCASE(mid(rs.Fields(i).Name,1,4)) == "CDIM" then
            buf = mid(rs.Fields(i).Name,6,len(rs.Fields(i).Name))
            w(i+1).sNazwa = DajNazweWymiaru(buf)
            select case rs.Fields(i).Type
            case adInteger,adSmallInt
               w(i+1).iWartosc = rs.Fields(i).Value
               if w(i+1).iWartosc != 0 then GenerujWymiary = 1
            case else
               w(i+1).sWartosc = rs.Fields(i).Value
               if w(i+1).sWartosc != "" then GenerujWymiary = 1
            endselect
            
         endif
         Grow w,1
      next i
   endif
   if size(w)>1 then shrink w,1
endsub

int sub DrukujWymiary(long iddk, string sKartoteka)
   int iCzySaWymiary = GenerujWymiary(iddk, sKartoteka)
   int i
   int nl = Styl ( "tekst", -1, "nl" )
   int nc = Styl ( "tekst", 0, "nc" )
   int nr = Styl ( "tekst", 1, "nr" )
   int kr = Styl ( "kwota", 1, "kr" )
   int nb = CopyFont ( "tekst",1,35 )
   int nbl = Styl ( nb, -1, "nbl" )

   int kolTab(2) = 600,(str.szer-600)
   int stylTab(2) = nbl, nl

   int tab = Tabela 1,  10, kolTab, stylTab
   if iCzySaWymiary !=0 then
      Tabela #tab, od 0,#B+10 // tylko po to by zrobić odstęp
      Koniec
      for i=1 to i>size(w)
         if w(i).sWartosc != "" then
            Tabela #tab
               kolumna 1, w(i).sNazwa
               kolumna 2, w(i).sWartosc
            Koniec
         endif
      next i   
      print LF
   endif
endsub


I później dodajesz w raporcie drukującym WZ pod nagłówkiem, przed pozycjami 2 linie:
Kod:
#include "Drukowanie wymiarów"
DrukujWymiary(xDocument.id, "mg")


2020-01-02, 22:41
Wyświetl profil
Wyświetl posty nie starsze niż:  Sortuj wg  
Odpowiedz w temacie   [ Posty: 2 ] 
   Podobne tematy   Autor   Odpowiedzi   Odsłony   Ostatni post 
Na tym forum nie ma nowych nieprzeczytanych postów. Własne pola dla dok. sprzedaży i magazynowych na wydruku

w Programy Handlowe

symfoniahandel2019

0

3577

2019-12-09, 20:06

symfoniahandel2019 Wyświetl najnowszy post

Na tym forum nie ma nowych nieprzeczytanych postów. Pola własne kartoteki kontrahentów i towarów - pola wymagane

w Programowanie

KrzysztofK

0

10823

2022-10-24, 10:45

KrzysztofK Wyświetl najnowszy post

Na tym forum nie ma nowych nieprzeczytanych postów. Własne pola ZMO i Pozycje - jak pobrać?

w Programowanie

wojtek

2

4050

2020-02-29, 09:52

wojtek Wyświetl najnowszy post

Na tym forum nie ma nowych nieprzeczytanych postów. [HMF2009a] Błąd wyszukiwania dok. magazynowych

w Programy Handlowe

Maciek

8

4249

2009-07-09, 13:50

krzysiek Wyświetl najnowszy post



Kto jest online

Użytkownicy przeglądający to forum: Nie ma żadnego zarejestrowanego użytkownika i 10 gości


Nie możesz tworzyć nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz dodawać załączników

Szukaj:
Przejdź do:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Support forum phpbb by phpBB Assistant