commit a53bb1dcc9cf64479a71325bf7c07217468b46c3 Author: Marius Mutu Date: Wed Jul 8 18:38:49 2026 +0300 Initial commit — sursa ROAIMOB Co-Authored-By: Claude Sonnet 5 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf374fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,53 @@ +# Subversion (legacy working copy metadata) +.svn/ + +# COMUN is a separate, shared git repo (its own .git) - not tracked here +COMUN/ + +# Visual FoxPro - compiled/generated artifacts +*.fxp +*.app +*.exe +*.err +*.bak +*.tmp +*.qpx +*.mpx +*.mpr +*.dct +LOG.txt +*.ARM +*.Stats +roaimob_ref.CDX +roaimob_ref.DBF +roaimob_ref.FPT + +# Windows +*.lnk +Thumbs.db +Desktop.ini +bash.exe.stackdump + +# Visual FoxPro - editor/backup copies of source files +*.scx~ +*.sct~ +*.vcx~ +*.vct~ +*.frx~ +*.frt~ +*.lbx~ +*.lbt~ +*.mnx~ +*.mnt~ +*.pjx~ +*.pjt~ +*.dbc~ +*.dct~ +*.dcx~ + +# Visual FoxPro - runtime resource/lock files +FoxUser.dbf +FoxUser.fpt +*.dbf.lock +*.fpt.lock +*.cdx.lock diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..27e3420 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,49 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project overview + +ROAIMOB is the "Imobilizari" (Fixed Assets) module of ROA, a large Romanian ERP suite built by ROA Romfast SRL. It is a **Visual FoxPro 9** desktop application (not Delphi) backed by an **Oracle** database. The app manages Romanian fixed-asset accounting: asset registration, depreciation (amortizare), revaluation (reevaluare), custodian/location transfers (gestiune), transformation of in-progress assets into tangible/intangible fixed assets, inventory lists, and related reports. + +This repo (`D:\ROA\ROAIMOB`) is just one module. It lives alongside dozens of sibling `ROA*` apps under `D:\ROA` (ROACASA, ROAFACTURARE, ROASAL, ROAHOTEL, ROAGEST, etc.), all sharing a common library normally found at `D:\ROA\COMUNROA` (outside this repo). This repo also vendors its own local snapshot of shared code under `./COMUN` (clase, ferestre, programe, rapoarte, meniuri, utile) — treat `./COMUN` as this app's copy of shared infrastructure, not ROAIMOB-specific business logic, unless a file clearly deals with `imob_*`/asset concerns. + +Version control here is **Subversion** (`.svn` present at the root) — use `svn`, not `git`. + +## Common commands + +No build scripts, Makefiles, package manifests, CI config, or test suite exist in this repo — do not invent any. + +- **Build**: There is no scripted/CLI build. `roaimob.PJX`/`.PJT` is a Visual FoxPro project file; building means opening it in the Visual FoxPro 9 IDE and using Project > Build to recompile `.prg` → `.FXP` and relink `roaimob.exe`. Individual source files can be recompiled with `COMPILE .prg` from the VFP command window. +- **Run**: The compiled `roaimob.exe` is **not** meant to be launched directly in production — `Programe/roaimob.prg` checks `verific_start()` and refuses to run unless started by the central ROA launcher ("START"), which passes a single semicolon-delimited parameter string (`host;user;password;idutil;idprogram;...`) including the Oracle schema (`gcS`, e.g. `CONTAFIN`), company id (`gnIdFirma`), and fiscal period (`gnAn`/`gnLuna`). A `Debug_Start()` bypass exists for local/dev launches (defined outside this repo, in the shared COMUNROA tree). +- **Lint/tests**: none present. + +## Searching inside compiled VFP binaries (foxbin2prg) + +Most method/procedure code lives inside compiled `.vcx/.vct` (classes), `.scx/.sct` (forms), `.frx/.frt` (reports), `.mnx/.mnt` (menus) — grepping these binaries directly is unreliable. Use the shared `foxbin2prg` tool (already built at `D:\ROA\UTIL\foxbin2prg\FoxBin2Prg.EXE`) to decompile to readable text, then grep the text: + +```powershell +& 'D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1' -Project 'D:\ROA\ROAIMOB\roaimob.PJX' -ProjectRoot 'D:\ROA\ROAIMOB' -CacheRoot 'D:\ROA\UTIL\foxbin2prg\_textcache_roaimob' -Types vcx,scx,frx,mnx +``` + +Reads the file list straight from `roaimob.PJX`, so it only converts files this project actually references (not all of `COMUN\`); incremental, safe to re-run after IDE edits. Output lands in `_textcache_roaimob/` as `.vc2/.sc2/.fr2/.mn2` text mirrors — grep those. **Read-only cache**: any real code change must be made in the VFP IDE on the original binary, then re-run the script to refresh the cache. + +## Architecture + +- **Thin client / DB-heavy split**: VFP forms (`Ferestre/*.scx`, `Clase/*.vcx`) only collect input and display data. Actual persistence and business rules live in Oracle **PL/SQL packages** (e.g. `pack_imob.inreg_majorare`, `pack_imob.inreg_reevaluare`), invoked through a shared `goExecutor` object (`oExecutor` class, registered from the `DECABAZA` classlib) via SQL strings like `begin pack_imob.inreg_reevaluare(...); end;`. When tracing a feature, expect to jump from a VFP form/procedure straight into an Oracle package call — the interesting logic is often server-side, not in the `.prg`. + +- **Asset operations funnel through `Programe/oproceduri_operatii.prg`**, keyed by a fixed "cod operatie" enum documented in a comment block at the top of that file (1 introducere, 2 preluare, 3 transformare in MF, 4 iesire din gestiune, 5 intrare in gestiune, 6 majorare, 7 reevaluare, 8 schimbarea DNS, 9 recalculare cota, 10 conservare, 11 scoatere din conservare, 12 modificare cu istoric, 13 inchidere, 14 schimbare DNS + reevaluare). Each `op_*` procedure (`op_majorare`, `op_reevaluare`, `op_schimbaredns_reevaluare`, `op_conservare`, `op_schimbaredns`, `op_gest`, `op_modificare`, `op_transformare_mf`, `op_adaugare_la_mf`) follows the same pattern: show a modal form to collect data, then call the matching Oracle package procedure through `goExecutor` and return an `Empty` object with a `lSucces` flag plus the collected fields. + +- **Data model** uses Oracle views/tables prefixed `IMOB_` (`imob_vnom_mf` = asset master/nomenclator, `imob_voperatii_mf` = operation history, `imob_vlista_mf` = current asset list, `imob_vcalcul_rate` = depreciation rate calculations, `imob_conturi` = account-code mapping). "MF" throughout the codebase means *mijloc fix* (fixed asset). Root-level `.sql` files (`istoric_amortizare_contabila.sql`, `istoric_amortizare_fiscala.sql`) are ad hoc reporting/audit queries against this schema, not migrations. `COMUN/Drepturi utilizatori/*.sql` define the user-rights/permission object catalog, shared across this and sibling apps (subfolders reference ROACASA, ROADEF, ROALUCRARI). + +- **Startup wiring** (`Programe/roaimob.prg`) is the place to look when something "isn't found": it builds `SET PATH TO` across `Date;Include;Ferestre;Grafice;Clase;Meniuri;Programe;Rapoarte;COMUN;COMUN\...` and then issues a long, order-sensitive sequence of `SET PROCEDURE TO ... ADDITIVE` and `SET CLASSLIB TO ... ADDITIVE` statements to register dozens of shared `.prg` procedure libraries and `.vcx` class libraries globally. Later entries can shadow earlier ones with the same procedure/class name, so order in this file matters when debugging "wrong version of a procedure ran" issues. + +- **Multi-tenant context**: the app operates against one Oracle schema per company (`gcS`, default `'CONTAFIN'`) and tracks the active company/fiscal period in globals `gnIdFirma`/`gnAn`/`gnLuna`, plus branch (`id_sucursala`). Most business queries and package calls are scoped by these. + +- **Self-update**: on startup the app calls `oUpdate.updatecheck()` (`oupdate.prg`/`wwcodeupdate.prg`) against an update server; `versiune_db.txt` records the expected DB schema stamp (format `YYYY_MM_DD_NN`) checked against the server on launch. + +- **Localization**: `Locale/` + the `locale` classlib + a `goLocale` object read `settings.ini` (`[locale] lang`, `llocale`) to select the UI language; Romanian is the default and the translation path is largely dormant (`glTraducere` defaults to `.F.`). + +- **Changelog convention**: `changelog_roaimob.txt` holds HTML-comment-wrapped, dated (`dd/mm/yyyy`) entries per version (`ROAIMOB - X.Y.Z`), each with Romanian-language notes tagged `:nou:` (new), `:modificare:` (change), `:eroare:` (bug fix), or `:adaugare:` (addition). Follow this exact format/tagging when documenting a change here. + +- **Unrelated nested project**: `COMUN/utile/chatbot/` is a standalone Flowise-embed HTML support chatbot (`chatbot_maria.html`) with its own README.md and CLAUDE.md. It has no relation to the FoxPro/Oracle asset-management app — don't conflate its guidance with ROAIMOB itself. diff --git a/Clase/Vechi/APPWIZ.VCT b/Clase/Vechi/APPWIZ.VCT new file mode 100644 index 0000000..752fe26 Binary files /dev/null and b/Clase/Vechi/APPWIZ.VCT differ diff --git a/Clase/Vechi/CautMF.vct b/Clase/Vechi/CautMF.vct new file mode 100644 index 0000000..43b3edb Binary files /dev/null and b/Clase/Vechi/CautMF.vct differ diff --git a/Clase/Vechi/MFIX2000.VCT b/Clase/Vechi/MFIX2000.VCT new file mode 100644 index 0000000..f2bb322 Binary files /dev/null and b/Clase/Vechi/MFIX2000.VCT differ diff --git a/Clase/Vechi/SOLUTION.VCT b/Clase/Vechi/SOLUTION.VCT new file mode 100644 index 0000000..4541d9d Binary files /dev/null and b/Clase/Vechi/SOLUTION.VCT differ diff --git a/Clase/Vechi/SOLUTION.VCX b/Clase/Vechi/SOLUTION.VCX new file mode 100644 index 0000000..fd6939e Binary files /dev/null and b/Clase/Vechi/SOLUTION.VCX differ diff --git a/Clase/Vechi/Utility.vct b/Clase/Vechi/Utility.vct new file mode 100644 index 0000000..e1743ac Binary files /dev/null and b/Clase/Vechi/Utility.vct differ diff --git a/Clase/Vechi/appwiz.vcx b/Clase/Vechi/appwiz.vcx new file mode 100644 index 0000000..1273c3d Binary files /dev/null and b/Clase/Vechi/appwiz.vcx differ diff --git a/Clase/Vechi/caut.VCT b/Clase/Vechi/caut.VCT new file mode 100644 index 0000000..004540d Binary files /dev/null and b/Clase/Vechi/caut.VCT differ diff --git a/Clase/Vechi/caut.vcx b/Clase/Vechi/caut.vcx new file mode 100644 index 0000000..109667a Binary files /dev/null and b/Clase/Vechi/caut.vcx differ diff --git a/Clase/Vechi/cautmf.vcx b/Clase/Vechi/cautmf.vcx new file mode 100644 index 0000000..3a70cc0 Binary files /dev/null and b/Clase/Vechi/cautmf.vcx differ diff --git a/Clase/Vechi/cont2000-2.VCT b/Clase/Vechi/cont2000-2.VCT new file mode 100644 index 0000000..0f237ef Binary files /dev/null and b/Clase/Vechi/cont2000-2.VCT differ diff --git a/Clase/Vechi/cont2000-2.vcx b/Clase/Vechi/cont2000-2.vcx new file mode 100644 index 0000000..89db87e Binary files /dev/null and b/Clase/Vechi/cont2000-2.vcx differ diff --git a/Clase/Vechi/cont2000-3.VCT b/Clase/Vechi/cont2000-3.VCT new file mode 100644 index 0000000..99c5fc6 Binary files /dev/null and b/Clase/Vechi/cont2000-3.VCT differ diff --git a/Clase/Vechi/cont2000-3.vcx b/Clase/Vechi/cont2000-3.vcx new file mode 100644 index 0000000..0f5fc07 Binary files /dev/null and b/Clase/Vechi/cont2000-3.vcx differ diff --git a/Clase/Vechi/ferestrebaza.VCT b/Clase/Vechi/ferestrebaza.VCT new file mode 100644 index 0000000..83f63e9 Binary files /dev/null and b/Clase/Vechi/ferestrebaza.VCT differ diff --git a/Clase/Vechi/ferestrebaza.vcx b/Clase/Vechi/ferestrebaza.vcx new file mode 100644 index 0000000..1aa47c2 Binary files /dev/null and b/Clase/Vechi/ferestrebaza.vcx differ diff --git a/Clase/Vechi/imob_2005.VCT b/Clase/Vechi/imob_2005.VCT new file mode 100644 index 0000000..65fc506 Binary files /dev/null and b/Clase/Vechi/imob_2005.VCT differ diff --git a/Clase/Vechi/imob_2005.vcx b/Clase/Vechi/imob_2005.vcx new file mode 100644 index 0000000..440b14c Binary files /dev/null and b/Clase/Vechi/imob_2005.vcx differ diff --git a/Clase/Vechi/mfix2000.vcx b/Clase/Vechi/mfix2000.vcx new file mode 100644 index 0000000..d13c098 Binary files /dev/null and b/Clase/Vechi/mfix2000.vcx differ diff --git a/Clase/Vechi/oimobilizari.vct b/Clase/Vechi/oimobilizari.vct new file mode 100644 index 0000000..fda0a87 Binary files /dev/null and b/Clase/Vechi/oimobilizari.vct differ diff --git a/Clase/Vechi/oimobilizari.vcx b/Clase/Vechi/oimobilizari.vcx new file mode 100644 index 0000000..0404408 Binary files /dev/null and b/Clase/Vechi/oimobilizari.vcx differ diff --git a/Clase/Vechi/registry.vct b/Clase/Vechi/registry.vct new file mode 100644 index 0000000..72e402b Binary files /dev/null and b/Clase/Vechi/registry.vct differ diff --git a/Clase/Vechi/registry.vcx b/Clase/Vechi/registry.vcx new file mode 100644 index 0000000..3ea85a8 Binary files /dev/null and b/Clase/Vechi/registry.vcx differ diff --git a/Clase/Vechi/utile.VCT b/Clase/Vechi/utile.VCT new file mode 100644 index 0000000..c54920b Binary files /dev/null and b/Clase/Vechi/utile.VCT differ diff --git a/Clase/Vechi/utile.vcx b/Clase/Vechi/utile.vcx new file mode 100644 index 0000000..7a7d0ff Binary files /dev/null and b/Clase/Vechi/utile.vcx differ diff --git a/Clase/Vechi/utility.vcx b/Clase/Vechi/utility.vcx new file mode 100644 index 0000000..05d791f Binary files /dev/null and b/Clase/Vechi/utility.vcx differ diff --git a/Clase/ofundal_imob.VCT b/Clase/ofundal_imob.VCT new file mode 100644 index 0000000..3fbccf4 Binary files /dev/null and b/Clase/ofundal_imob.VCT differ diff --git a/Clase/ofundal_imob.vcx b/Clase/ofundal_imob.vcx new file mode 100644 index 0000000..fd1e262 Binary files /dev/null and b/Clase/ofundal_imob.vcx differ diff --git a/Clase/oimobilizari.vct b/Clase/oimobilizari.vct new file mode 100644 index 0000000..8a5c0ba Binary files /dev/null and b/Clase/oimobilizari.vct differ diff --git a/Clase/oimobilizari.vcx b/Clase/oimobilizari.vcx new file mode 100644 index 0000000..0e08bd6 Binary files /dev/null and b/Clase/oimobilizari.vcx differ diff --git a/Clase/onom_imob.VCT b/Clase/onom_imob.VCT new file mode 100644 index 0000000..5691c8d Binary files /dev/null and b/Clase/onom_imob.VCT differ diff --git a/Clase/onom_imob.vcx b/Clase/onom_imob.vcx new file mode 100644 index 0000000..48c2237 Binary files /dev/null and b/Clase/onom_imob.vcx differ diff --git a/Ferestre/Vechi/FISA.SCT b/Ferestre/Vechi/FISA.SCT new file mode 100644 index 0000000..e5d62c5 Binary files /dev/null and b/Ferestre/Vechi/FISA.SCT differ diff --git a/Ferestre/Vechi/FISA.SCX b/Ferestre/Vechi/FISA.SCX new file mode 100644 index 0000000..0c06b6c Binary files /dev/null and b/Ferestre/Vechi/FISA.SCX differ diff --git a/Ferestre/Vechi/FUNDALMF.SCT b/Ferestre/Vechi/FUNDALMF.SCT new file mode 100644 index 0000000..ea31609 Binary files /dev/null and b/Ferestre/Vechi/FUNDALMF.SCT differ diff --git a/Ferestre/Vechi/FUNDALMF.SCX b/Ferestre/Vechi/FUNDALMF.SCX new file mode 100644 index 0000000..87976a4 Binary files /dev/null and b/Ferestre/Vechi/FUNDALMF.SCX differ diff --git a/Ferestre/Vechi/INTROD.SCT b/Ferestre/Vechi/INTROD.SCT new file mode 100644 index 0000000..45e5bc2 Binary files /dev/null and b/Ferestre/Vechi/INTROD.SCT differ diff --git a/Ferestre/Vechi/INTROD.SCX b/Ferestre/Vechi/INTROD.SCX new file mode 100644 index 0000000..420d9a3 Binary files /dev/null and b/Ferestre/Vechi/INTROD.SCX differ diff --git a/Ferestre/Vechi/QCKSTART.SCT b/Ferestre/Vechi/QCKSTART.SCT new file mode 100644 index 0000000..7c697b2 Binary files /dev/null and b/Ferestre/Vechi/QCKSTART.SCT differ diff --git a/Ferestre/Vechi/QCKSTART.SCX b/Ferestre/Vechi/QCKSTART.SCX new file mode 100644 index 0000000..52fe72e Binary files /dev/null and b/Ferestre/Vechi/QCKSTART.SCX differ diff --git a/Ferestre/Vechi/VIZ.SCT b/Ferestre/Vechi/VIZ.SCT new file mode 100644 index 0000000..e57d2c9 Binary files /dev/null and b/Ferestre/Vechi/VIZ.SCT differ diff --git a/Ferestre/Vechi/VIZ.SCX b/Ferestre/Vechi/VIZ.SCX new file mode 100644 index 0000000..13a7e10 Binary files /dev/null and b/Ferestre/Vechi/VIZ.SCX differ diff --git a/Ferestre/Vechi/about.SCT b/Ferestre/Vechi/about.SCT new file mode 100644 index 0000000..3931110 Binary files /dev/null and b/Ferestre/Vechi/about.SCT differ diff --git a/Ferestre/Vechi/about.scx b/Ferestre/Vechi/about.scx new file mode 100644 index 0000000..98ea41a Binary files /dev/null and b/Ferestre/Vechi/about.scx differ diff --git a/Ferestre/Vechi/contamort.SCT b/Ferestre/Vechi/contamort.SCT new file mode 100644 index 0000000..841aabe Binary files /dev/null and b/Ferestre/Vechi/contamort.SCT differ diff --git a/Ferestre/Vechi/contamort.scx b/Ferestre/Vechi/contamort.scx new file mode 100644 index 0000000..6b06a69 Binary files /dev/null and b/Ferestre/Vechi/contamort.scx differ diff --git a/Ferestre/Vechi/conversie.SCT b/Ferestre/Vechi/conversie.SCT new file mode 100644 index 0000000..f280595 Binary files /dev/null and b/Ferestre/Vechi/conversie.SCT differ diff --git a/Ferestre/Vechi/conversie.scx b/Ferestre/Vechi/conversie.scx new file mode 100644 index 0000000..6ed9d67 Binary files /dev/null and b/Ferestre/Vechi/conversie.scx differ diff --git a/Ferestre/Vechi/conversie_2005.SCT b/Ferestre/Vechi/conversie_2005.SCT new file mode 100644 index 0000000..b997978 Binary files /dev/null and b/Ferestre/Vechi/conversie_2005.SCT differ diff --git a/Ferestre/Vechi/conversie_2005.scx b/Ferestre/Vechi/conversie_2005.scx new file mode 100644 index 0000000..1e48ca3 Binary files /dev/null and b/Ferestre/Vechi/conversie_2005.scx differ diff --git a/Ferestre/Vechi/frm_calcul.SCT b/Ferestre/Vechi/frm_calcul.SCT new file mode 100644 index 0000000..54c84a2 Binary files /dev/null and b/Ferestre/Vechi/frm_calcul.SCT differ diff --git a/Ferestre/Vechi/frm_calcul.scx b/Ferestre/Vechi/frm_calcul.scx new file mode 100644 index 0000000..e676c88 Binary files /dev/null and b/Ferestre/Vechi/frm_calcul.scx differ diff --git a/Ferestre/Vechi/frm_calcul_reevaluare.SCT b/Ferestre/Vechi/frm_calcul_reevaluare.SCT new file mode 100644 index 0000000..2100c8d Binary files /dev/null and b/Ferestre/Vechi/frm_calcul_reevaluare.SCT differ diff --git a/Ferestre/Vechi/frm_calcul_reevaluare.scx b/Ferestre/Vechi/frm_calcul_reevaluare.scx new file mode 100644 index 0000000..eaff7c4 Binary files /dev/null and b/Ferestre/Vechi/frm_calcul_reevaluare.scx differ diff --git a/Ferestre/Vechi/frm_filtru_numar.SCT b/Ferestre/Vechi/frm_filtru_numar.SCT new file mode 100644 index 0000000..a66b6ac Binary files /dev/null and b/Ferestre/Vechi/frm_filtru_numar.SCT differ diff --git a/Ferestre/Vechi/frm_filtru_numar.scx b/Ferestre/Vechi/frm_filtru_numar.scx new file mode 100644 index 0000000..064a5b3 Binary files /dev/null and b/Ferestre/Vechi/frm_filtru_numar.scx differ diff --git a/Ferestre/Vechi/frm_filtru_text.SCT b/Ferestre/Vechi/frm_filtru_text.SCT new file mode 100644 index 0000000..fc7a8d5 Binary files /dev/null and b/Ferestre/Vechi/frm_filtru_text.SCT differ diff --git a/Ferestre/Vechi/frm_filtru_text.scx b/Ferestre/Vechi/frm_filtru_text.scx new file mode 100644 index 0000000..f28fca7 Binary files /dev/null and b/Ferestre/Vechi/frm_filtru_text.scx differ diff --git a/Ferestre/Vechi/frm_introd_titlu.SCT b/Ferestre/Vechi/frm_introd_titlu.SCT new file mode 100644 index 0000000..9f45edc Binary files /dev/null and b/Ferestre/Vechi/frm_introd_titlu.SCT differ diff --git a/Ferestre/Vechi/frm_introd_titlu.scx b/Ferestre/Vechi/frm_introd_titlu.scx new file mode 100644 index 0000000..800b71d Binary files /dev/null and b/Ferestre/Vechi/frm_introd_titlu.scx differ diff --git a/Ferestre/Vechi/frm_major_valoare.SCT b/Ferestre/Vechi/frm_major_valoare.SCT new file mode 100644 index 0000000..6e6f74f Binary files /dev/null and b/Ferestre/Vechi/frm_major_valoare.SCT differ diff --git a/Ferestre/Vechi/frm_major_valoare.scx b/Ferestre/Vechi/frm_major_valoare.scx new file mode 100644 index 0000000..5a699d9 Binary files /dev/null and b/Ferestre/Vechi/frm_major_valoare.scx differ diff --git a/Ferestre/Vechi/frm_sch_valoare.SCT b/Ferestre/Vechi/frm_sch_valoare.SCT new file mode 100644 index 0000000..870244f Binary files /dev/null and b/Ferestre/Vechi/frm_sch_valoare.SCT differ diff --git a/Ferestre/Vechi/frm_sch_valoare.scx b/Ferestre/Vechi/frm_sch_valoare.scx new file mode 100644 index 0000000..ce7e6a3 Binary files /dev/null and b/Ferestre/Vechi/frm_sch_valoare.scx differ diff --git a/Ferestre/Vechi/frm_schimb_dns.SCT b/Ferestre/Vechi/frm_schimb_dns.SCT new file mode 100644 index 0000000..f8e7ee9 Binary files /dev/null and b/Ferestre/Vechi/frm_schimb_dns.SCT differ diff --git a/Ferestre/Vechi/frm_schimb_dns.scx b/Ferestre/Vechi/frm_schimb_dns.scx new file mode 100644 index 0000000..53a9da2 Binary files /dev/null and b/Ferestre/Vechi/frm_schimb_dns.scx differ diff --git a/Ferestre/Vechi/frm_schimb_dns_o.SCT b/Ferestre/Vechi/frm_schimb_dns_o.SCT new file mode 100644 index 0000000..859e9b5 Binary files /dev/null and b/Ferestre/Vechi/frm_schimb_dns_o.SCT differ diff --git a/Ferestre/Vechi/frm_schimb_dns_o.scx b/Ferestre/Vechi/frm_schimb_dns_o.scx new file mode 100644 index 0000000..9a909cf Binary files /dev/null and b/Ferestre/Vechi/frm_schimb_dns_o.scx differ diff --git a/Ferestre/Vechi/frm_schimb_valoare.SCT b/Ferestre/Vechi/frm_schimb_valoare.SCT new file mode 100644 index 0000000..5021e78 Binary files /dev/null and b/Ferestre/Vechi/frm_schimb_valoare.SCT differ diff --git a/Ferestre/Vechi/frm_schimb_valoare.scx b/Ferestre/Vechi/frm_schimb_valoare.scx new file mode 100644 index 0000000..83a4f67 Binary files /dev/null and b/Ferestre/Vechi/frm_schimb_valoare.scx differ diff --git a/Ferestre/Vechi/frm_schimb_valoare2.SCT b/Ferestre/Vechi/frm_schimb_valoare2.SCT new file mode 100644 index 0000000..1af92a2 Binary files /dev/null and b/Ferestre/Vechi/frm_schimb_valoare2.SCT differ diff --git a/Ferestre/Vechi/frm_schimb_valoare2.scx b/Ferestre/Vechi/frm_schimb_valoare2.scx new file mode 100644 index 0000000..148360a Binary files /dev/null and b/Ferestre/Vechi/frm_schimb_valoare2.scx differ diff --git a/Ferestre/Vechi/fundal.SCT b/Ferestre/Vechi/fundal.SCT new file mode 100644 index 0000000..6d0814c Binary files /dev/null and b/Ferestre/Vechi/fundal.SCT differ diff --git a/Ferestre/Vechi/fundal.scx b/Ferestre/Vechi/fundal.scx new file mode 100644 index 0000000..52fb033 Binary files /dev/null and b/Ferestre/Vechi/fundal.scx differ diff --git a/Ferestre/Vechi/inchidluni.SCT b/Ferestre/Vechi/inchidluni.SCT new file mode 100644 index 0000000..c900a86 Binary files /dev/null and b/Ferestre/Vechi/inchidluni.SCT differ diff --git a/Ferestre/Vechi/inchidluni.scx b/Ferestre/Vechi/inchidluni.scx new file mode 100644 index 0000000..a9af784 Binary files /dev/null and b/Ferestre/Vechi/inchidluni.scx differ diff --git a/Ferestre/Vechi/ingest.SCT b/Ferestre/Vechi/ingest.SCT new file mode 100644 index 0000000..26277df Binary files /dev/null and b/Ferestre/Vechi/ingest.SCT differ diff --git a/Ferestre/Vechi/ingest.scx b/Ferestre/Vechi/ingest.scx new file mode 100644 index 0000000..2b7b475 Binary files /dev/null and b/Ferestre/Vechi/ingest.scx differ diff --git a/Ferestre/Vechi/optiuni.SCT b/Ferestre/Vechi/optiuni.SCT new file mode 100644 index 0000000..20e2914 Binary files /dev/null and b/Ferestre/Vechi/optiuni.SCT differ diff --git a/Ferestre/Vechi/optiuni.scx b/Ferestre/Vechi/optiuni.scx new file mode 100644 index 0000000..78c35e0 Binary files /dev/null and b/Ferestre/Vechi/optiuni.scx differ diff --git a/Ferestre/Vechi/start00.SCT b/Ferestre/Vechi/start00.SCT new file mode 100644 index 0000000..7724910 Binary files /dev/null and b/Ferestre/Vechi/start00.SCT differ diff --git a/Ferestre/Vechi/start00.scx b/Ferestre/Vechi/start00.scx new file mode 100644 index 0000000..edcc841 Binary files /dev/null and b/Ferestre/Vechi/start00.scx differ diff --git a/Ferestre/Vechi/startfirma.SCT b/Ferestre/Vechi/startfirma.SCT new file mode 100644 index 0000000..1b25fa2 Binary files /dev/null and b/Ferestre/Vechi/startfirma.SCT differ diff --git a/Ferestre/Vechi/startfirma.scx b/Ferestre/Vechi/startfirma.scx new file mode 100644 index 0000000..7de4e41 Binary files /dev/null and b/Ferestre/Vechi/startfirma.scx differ diff --git a/Ferestre/Vechi/valoare.SCT b/Ferestre/Vechi/valoare.SCT new file mode 100644 index 0000000..1207dc4 Binary files /dev/null and b/Ferestre/Vechi/valoare.SCT differ diff --git a/Ferestre/Vechi/valoare.scx b/Ferestre/Vechi/valoare.scx new file mode 100644 index 0000000..d73fec3 Binary files /dev/null and b/Ferestre/Vechi/valoare.scx differ diff --git a/Ferestre/Vechi/valori.SCT b/Ferestre/Vechi/valori.SCT new file mode 100644 index 0000000..dfcffb7 Binary files /dev/null and b/Ferestre/Vechi/valori.SCT differ diff --git a/Ferestre/Vechi/valori.scx b/Ferestre/Vechi/valori.scx new file mode 100644 index 0000000..ac83aa9 Binary files /dev/null and b/Ferestre/Vechi/valori.scx differ diff --git a/Ferestre/frm_modificare.SCT b/Ferestre/frm_modificare.SCT new file mode 100644 index 0000000..9c39229 Binary files /dev/null and b/Ferestre/frm_modificare.SCT differ diff --git a/Ferestre/frm_modificare.scx b/Ferestre/frm_modificare.scx new file mode 100644 index 0000000..9346c43 Binary files /dev/null and b/Ferestre/frm_modificare.scx differ diff --git a/Ferestre/fundal.SCT b/Ferestre/fundal.SCT new file mode 100644 index 0000000..52d69b4 Binary files /dev/null and b/Ferestre/fundal.SCT differ diff --git a/Ferestre/fundal.scx b/Ferestre/fundal.scx new file mode 100644 index 0000000..bc023d5 Binary files /dev/null and b/Ferestre/fundal.scx differ diff --git a/Ferestre/rap_lista_inventar.SCT b/Ferestre/rap_lista_inventar.SCT new file mode 100644 index 0000000..7ceb9e0 Binary files /dev/null and b/Ferestre/rap_lista_inventar.SCT differ diff --git a/Ferestre/rap_lista_inventar.scx b/Ferestre/rap_lista_inventar.scx new file mode 100644 index 0000000..40613ac Binary files /dev/null and b/Ferestre/rap_lista_inventar.scx differ diff --git a/Ferestre/rap_situatie_lunara.SCT b/Ferestre/rap_situatie_lunara.SCT new file mode 100644 index 0000000..2f7a19c Binary files /dev/null and b/Ferestre/rap_situatie_lunara.SCT differ diff --git a/Ferestre/rap_situatie_lunara.scx b/Ferestre/rap_situatie_lunara.scx new file mode 100644 index 0000000..920d44a Binary files /dev/null and b/Ferestre/rap_situatie_lunara.scx differ diff --git a/Grafice/Vechi/ARW01LT.ICO b/Grafice/Vechi/ARW01LT.ICO new file mode 100644 index 0000000..066451f Binary files /dev/null and b/Grafice/Vechi/ARW01LT.ICO differ diff --git a/Grafice/Vechi/ARW01RT.ICO b/Grafice/Vechi/ARW01RT.ICO new file mode 100644 index 0000000..38ddb04 Binary files /dev/null and b/Grafice/Vechi/ARW01RT.ICO differ diff --git a/Grafice/Vechi/BACKGRND.bmp b/Grafice/Vechi/BACKGRND.bmp new file mode 100644 index 0000000..b496478 Binary files /dev/null and b/Grafice/Vechi/BACKGRND.bmp differ diff --git a/Grafice/Vechi/BOOK01A.ICO b/Grafice/Vechi/BOOK01A.ICO new file mode 100644 index 0000000..ac45768 Binary files /dev/null and b/Grafice/Vechi/BOOK01A.ICO differ diff --git a/Grafice/Vechi/BOOK01B.ICO b/Grafice/Vechi/BOOK01B.ICO new file mode 100644 index 0000000..53eb2c4 Binary files /dev/null and b/Grafice/Vechi/BOOK01B.ICO differ diff --git a/Grafice/Vechi/BOOK01C.ICO b/Grafice/Vechi/BOOK01C.ICO new file mode 100644 index 0000000..b21898e Binary files /dev/null and b/Grafice/Vechi/BOOK01C.ICO differ diff --git a/Grafice/Vechi/C.ico b/Grafice/Vechi/C.ico new file mode 100644 index 0000000..ce97f71 Binary files /dev/null and b/Grafice/Vechi/C.ico differ diff --git a/Grafice/Vechi/CLOUDS.BMP b/Grafice/Vechi/CLOUDS.BMP new file mode 100644 index 0000000..2964f10 Binary files /dev/null and b/Grafice/Vechi/CLOUDS.BMP differ diff --git a/Grafice/Vechi/CONT-AL.BMP b/Grafice/Vechi/CONT-AL.BMP new file mode 100644 index 0000000..a81be02 Binary files /dev/null and b/Grafice/Vechi/CONT-AL.BMP differ diff --git a/Grafice/Vechi/CONT-GA.BMP b/Grafice/Vechi/CONT-GA.BMP new file mode 100644 index 0000000..55d682e Binary files /dev/null and b/Grafice/Vechi/CONT-GA.BMP differ diff --git a/Grafice/Vechi/CVERDE1v.BMP b/Grafice/Vechi/CVERDE1v.BMP new file mode 100644 index 0000000..51e383b Binary files /dev/null and b/Grafice/Vechi/CVERDE1v.BMP differ diff --git a/Grafice/Vechi/DELETE.BMP b/Grafice/Vechi/DELETE.BMP new file mode 100644 index 0000000..76d9a77 Binary files /dev/null and b/Grafice/Vechi/DELETE.BMP differ diff --git a/Grafice/Vechi/EDIT1.BMP b/Grafice/Vechi/EDIT1.BMP new file mode 100644 index 0000000..87c5211 Binary files /dev/null and b/Grafice/Vechi/EDIT1.BMP differ diff --git a/Grafice/Vechi/EXCLAM1.ICO b/Grafice/Vechi/EXCLAM1.ICO new file mode 100644 index 0000000..42fcf59 Binary files /dev/null and b/Grafice/Vechi/EXCLAM1.ICO differ diff --git a/Grafice/Vechi/EXCLAM2.ICO b/Grafice/Vechi/EXCLAM2.ICO new file mode 100644 index 0000000..351aa72 Binary files /dev/null and b/Grafice/Vechi/EXCLAM2.ICO differ diff --git a/Grafice/Vechi/EXCLEM.ICO b/Grafice/Vechi/EXCLEM.ICO new file mode 100644 index 0000000..90fe0f2 Binary files /dev/null and b/Grafice/Vechi/EXCLEM.ICO differ diff --git a/Grafice/Vechi/FOXQSTRT.BMP b/Grafice/Vechi/FOXQSTRT.BMP new file mode 100644 index 0000000..c7a4d3f Binary files /dev/null and b/Grafice/Vechi/FOXQSTRT.BMP differ diff --git a/Grafice/Vechi/HAND.BMP b/Grafice/Vechi/HAND.BMP new file mode 100644 index 0000000..2a72376 Binary files /dev/null and b/Grafice/Vechi/HAND.BMP differ diff --git a/Grafice/Vechi/H_POINT.CUR b/Grafice/Vechi/H_POINT.CUR new file mode 100644 index 0000000..6d1096b Binary files /dev/null and b/Grafice/Vechi/H_POINT.CUR differ diff --git a/Grafice/Vechi/Intreb.ico b/Grafice/Vechi/Intreb.ico new file mode 100644 index 0000000..a63d9c3 Binary files /dev/null and b/Grafice/Vechi/Intreb.ico differ diff --git a/Grafice/Vechi/MFIX.ICO b/Grafice/Vechi/MFIX.ICO new file mode 100644 index 0000000..dccf6bb Binary files /dev/null and b/Grafice/Vechi/MFIX.ICO differ diff --git a/Grafice/Vechi/MIJ-AL.BMP b/Grafice/Vechi/MIJ-AL.BMP new file mode 100644 index 0000000..3b25757 Binary files /dev/null and b/Grafice/Vechi/MIJ-AL.BMP differ diff --git a/Grafice/Vechi/MIJ-GA.BMP b/Grafice/Vechi/MIJ-GA.BMP new file mode 100644 index 0000000..4fb2978 Binary files /dev/null and b/Grafice/Vechi/MIJ-GA.BMP differ diff --git a/Grafice/Vechi/NET13.ICO b/Grafice/Vechi/NET13.ICO new file mode 100644 index 0000000..184201c Binary files /dev/null and b/Grafice/Vechi/NET13.ICO differ diff --git a/Grafice/Vechi/NEW.BMP b/Grafice/Vechi/NEW.BMP new file mode 100644 index 0000000..025abea Binary files /dev/null and b/Grafice/Vechi/NEW.BMP differ diff --git a/Grafice/Vechi/NOTE16.ICO b/Grafice/Vechi/NOTE16.ICO new file mode 100644 index 0000000..94b185c Binary files /dev/null and b/Grafice/Vechi/NOTE16.ICO differ diff --git a/Grafice/Vechi/PAINT.BMP b/Grafice/Vechi/PAINT.BMP new file mode 100644 index 0000000..fcb6a6e Binary files /dev/null and b/Grafice/Vechi/PAINT.BMP differ diff --git a/Grafice/Vechi/PER-AL.BMP b/Grafice/Vechi/PER-AL.BMP new file mode 100644 index 0000000..2dd3c63 Binary files /dev/null and b/Grafice/Vechi/PER-AL.BMP differ diff --git a/Grafice/Vechi/PER-GA.BMP b/Grafice/Vechi/PER-GA.BMP new file mode 100644 index 0000000..6cbe702 Binary files /dev/null and b/Grafice/Vechi/PER-GA.BMP differ diff --git a/Grafice/Vechi/POINT.CUR b/Grafice/Vechi/POINT.CUR new file mode 100644 index 0000000..e4feb3e Binary files /dev/null and b/Grafice/Vechi/POINT.CUR differ diff --git a/Grafice/Vechi/POINT04.ICO b/Grafice/Vechi/POINT04.ICO new file mode 100644 index 0000000..c18a12c Binary files /dev/null and b/Grafice/Vechi/POINT04.ICO differ diff --git a/Grafice/Vechi/SAA.ICO b/Grafice/Vechi/SAA.ICO new file mode 100644 index 0000000..1c96ab5 Binary files /dev/null and b/Grafice/Vechi/SAA.ICO differ diff --git a/Grafice/Vechi/SECUR05.ICO b/Grafice/Vechi/SECUR05.ICO new file mode 100644 index 0000000..6037ffd Binary files /dev/null and b/Grafice/Vechi/SECUR05.ICO differ diff --git a/Grafice/Vechi/SGG.ICO b/Grafice/Vechi/SGG.ICO new file mode 100644 index 0000000..1661e47 Binary files /dev/null and b/Grafice/Vechi/SGG.ICO differ diff --git a/Grafice/Vechi/START.bmp b/Grafice/Vechi/START.bmp new file mode 100644 index 0000000..82b951e Binary files /dev/null and b/Grafice/Vechi/START.bmp differ diff --git a/Grafice/Vechi/TER-AL.BMP b/Grafice/Vechi/TER-AL.BMP new file mode 100644 index 0000000..2af255d Binary files /dev/null and b/Grafice/Vechi/TER-AL.BMP differ diff --git a/Grafice/Vechi/TER-GA.BMP b/Grafice/Vechi/TER-GA.BMP new file mode 100644 index 0000000..40f9be1 Binary files /dev/null and b/Grafice/Vechi/TER-GA.BMP differ diff --git a/Grafice/Vechi/conimob.bmp b/Grafice/Vechi/conimob.bmp new file mode 100644 index 0000000..ac57f60 Binary files /dev/null and b/Grafice/Vechi/conimob.bmp differ diff --git a/Grafice/Vechi/cverde.bmp b/Grafice/Vechi/cverde.bmp new file mode 100644 index 0000000..0e7f41d Binary files /dev/null and b/Grafice/Vechi/cverde.bmp differ diff --git a/Grafice/Vechi/fundal_imob2003.bmp b/Grafice/Vechi/fundal_imob2003.bmp new file mode 100644 index 0000000..0b5d177 Binary files /dev/null and b/Grafice/Vechi/fundal_imob2003.bmp differ diff --git a/Grafice/Vechi/mfix.bmp b/Grafice/Vechi/mfix.bmp new file mode 100644 index 0000000..f7d5294 Binary files /dev/null and b/Grafice/Vechi/mfix.bmp differ diff --git a/Grafice/Vechi/pericol.ico b/Grafice/Vechi/pericol.ico new file mode 100644 index 0000000..36043c8 Binary files /dev/null and b/Grafice/Vechi/pericol.ico differ diff --git a/Grafice/Vechi/plus.BMP b/Grafice/Vechi/plus.BMP new file mode 100644 index 0000000..b9d43d8 Binary files /dev/null and b/Grafice/Vechi/plus.BMP differ diff --git a/Grafice/Vechi/sa.ico b/Grafice/Vechi/sa.ico new file mode 100644 index 0000000..63f8083 Binary files /dev/null and b/Grafice/Vechi/sa.ico differ diff --git a/Grafice/Vechi/sg.ico b/Grafice/Vechi/sg.ico new file mode 100644 index 0000000..d1e1ba6 Binary files /dev/null and b/Grafice/Vechi/sg.ico differ diff --git a/Grafice/Vechi/siglaromfast.bmp b/Grafice/Vechi/siglaromfast.bmp new file mode 100644 index 0000000..9bfd428 Binary files /dev/null and b/Grafice/Vechi/siglaromfast.bmp differ diff --git a/Grafice/Vechi/start_albastru.bmp b/Grafice/Vechi/start_albastru.bmp new file mode 100644 index 0000000..2ce7b06 Binary files /dev/null and b/Grafice/Vechi/start_albastru.bmp differ diff --git a/Grafice/Vechi/start_galben.bmp b/Grafice/Vechi/start_galben.bmp new file mode 100644 index 0000000..7f35b70 Binary files /dev/null and b/Grafice/Vechi/start_galben.bmp differ diff --git a/Grafice/Vechi/terminat_a.bmp b/Grafice/Vechi/terminat_a.bmp new file mode 100644 index 0000000..5da69bf Binary files /dev/null and b/Grafice/Vechi/terminat_a.bmp differ diff --git a/Grafice/Vechi/terminat_g.bmp b/Grafice/Vechi/terminat_g.bmp new file mode 100644 index 0000000..059b6c0 Binary files /dev/null and b/Grafice/Vechi/terminat_g.bmp differ diff --git a/Grafice/f1.jpg b/Grafice/f1.jpg new file mode 100644 index 0000000..3bff03e Binary files /dev/null and b/Grafice/f1.jpg differ diff --git a/Grafice/f2.jpg b/Grafice/f2.jpg new file mode 100644 index 0000000..8e53539 Binary files /dev/null and b/Grafice/f2.jpg differ diff --git a/Grafice/f3.jpg b/Grafice/f3.jpg new file mode 100644 index 0000000..21fd7cd Binary files /dev/null and b/Grafice/f3.jpg differ diff --git a/Grafice/fact1.bmp b/Grafice/fact1.bmp new file mode 100644 index 0000000..0c62598 Binary files /dev/null and b/Grafice/fact1.bmp differ diff --git a/Grafice/fact2.bmp b/Grafice/fact2.bmp new file mode 100644 index 0000000..a046a2e Binary files /dev/null and b/Grafice/fact2.bmp differ diff --git a/Grafice/gene1.bmp b/Grafice/gene1.bmp new file mode 100644 index 0000000..1aaba59 Binary files /dev/null and b/Grafice/gene1.bmp differ diff --git a/Grafice/gene2.bmp b/Grafice/gene2.bmp new file mode 100644 index 0000000..3a1f6c6 Binary files /dev/null and b/Grafice/gene2.bmp differ diff --git a/Grafice/roaimob.bmp b/Grafice/roaimob.bmp new file mode 100644 index 0000000..c309baa Binary files /dev/null and b/Grafice/roaimob.bmp differ diff --git a/Grafice/viz1.bmp b/Grafice/viz1.bmp new file mode 100644 index 0000000..7670e57 Binary files /dev/null and b/Grafice/viz1.bmp differ diff --git a/Grafice/viz2.bmp b/Grafice/viz2.bmp new file mode 100644 index 0000000..699c9b1 Binary files /dev/null and b/Grafice/viz2.bmp differ diff --git a/Locale/Locale.DBF b/Locale/Locale.DBF new file mode 100644 index 0000000..e13322b Binary files /dev/null and b/Locale/Locale.DBF differ diff --git a/Locale/Locale_back.CDX b/Locale/Locale_back.CDX new file mode 100644 index 0000000..f085856 Binary files /dev/null and b/Locale/Locale_back.CDX differ diff --git a/Locale/Locale_back.DBF b/Locale/Locale_back.DBF new file mode 100644 index 0000000..76289e1 Binary files /dev/null and b/Locale/Locale_back.DBF differ diff --git a/Locale/Locale_back.FPT b/Locale/Locale_back.FPT new file mode 100644 index 0000000..8effa46 Binary files /dev/null and b/Locale/Locale_back.FPT differ diff --git a/Locale/Locale_xref.CDX b/Locale/Locale_xref.CDX new file mode 100644 index 0000000..429cc6e Binary files /dev/null and b/Locale/Locale_xref.CDX differ diff --git a/Locale/locale.CDX b/Locale/locale.CDX new file mode 100644 index 0000000..e777572 Binary files /dev/null and b/Locale/locale.CDX differ diff --git a/Locale/locale.DCX b/Locale/locale.DCX new file mode 100644 index 0000000..74b10af Binary files /dev/null and b/Locale/locale.DCX differ diff --git a/Locale/locale.FPT b/Locale/locale.FPT new file mode 100644 index 0000000..8c86f3a Binary files /dev/null and b/Locale/locale.FPT differ diff --git a/Locale/locale.dbc b/Locale/locale.dbc new file mode 100644 index 0000000..fc0f219 Binary files /dev/null and b/Locale/locale.dbc differ diff --git a/Locale/locale_lang.FPT b/Locale/locale_lang.FPT new file mode 100644 index 0000000..94aa1fd Binary files /dev/null and b/Locale/locale_lang.FPT differ diff --git a/Locale/locale_lang.cdx b/Locale/locale_lang.cdx new file mode 100644 index 0000000..1623f82 Binary files /dev/null and b/Locale/locale_lang.cdx differ diff --git a/Locale/locale_lang.dbf b/Locale/locale_lang.dbf new file mode 100644 index 0000000..2f4a179 Binary files /dev/null and b/Locale/locale_lang.dbf differ diff --git a/Locale/locale_source.CDX b/Locale/locale_source.CDX new file mode 100644 index 0000000..754b91f Binary files /dev/null and b/Locale/locale_source.CDX differ diff --git a/Locale/locale_source.DBF b/Locale/locale_source.DBF new file mode 100644 index 0000000..60ba760 Binary files /dev/null and b/Locale/locale_source.DBF differ diff --git a/Locale/locale_source.FPT b/Locale/locale_source.FPT new file mode 100644 index 0000000..697f721 Binary files /dev/null and b/Locale/locale_source.FPT differ diff --git a/Locale/locale_xref.DBF b/Locale/locale_xref.DBF new file mode 100644 index 0000000..16d75bc Binary files /dev/null and b/Locale/locale_xref.DBF differ diff --git a/Meniuri/Vechi/editscurt.MNT b/Meniuri/Vechi/editscurt.MNT new file mode 100644 index 0000000..876409d Binary files /dev/null and b/Meniuri/Vechi/editscurt.MNT differ diff --git a/Meniuri/Vechi/editscurt.mnx b/Meniuri/Vechi/editscurt.mnx new file mode 100644 index 0000000..a3b1e27 Binary files /dev/null and b/Meniuri/Vechi/editscurt.mnx differ diff --git a/Meniuri/Vechi/listcorp.MNT b/Meniuri/Vechi/listcorp.MNT new file mode 100644 index 0000000..089babf Binary files /dev/null and b/Meniuri/Vechi/listcorp.MNT differ diff --git a/Meniuri/Vechi/listcorp.mnx b/Meniuri/Vechi/listcorp.mnx new file mode 100644 index 0000000..98d2b0e Binary files /dev/null and b/Meniuri/Vechi/listcorp.mnx differ diff --git a/Meniuri/Vechi/listincurs.MNT b/Meniuri/Vechi/listincurs.MNT new file mode 100644 index 0000000..1a1fa5a Binary files /dev/null and b/Meniuri/Vechi/listincurs.MNT differ diff --git a/Meniuri/Vechi/listincurs.mnx b/Meniuri/Vechi/listincurs.mnx new file mode 100644 index 0000000..9adcf66 Binary files /dev/null and b/Meniuri/Vechi/listincurs.mnx differ diff --git a/Meniuri/Vechi/listnecorp.MNT b/Meniuri/Vechi/listnecorp.MNT new file mode 100644 index 0000000..59dd50e Binary files /dev/null and b/Meniuri/Vechi/listnecorp.MNT differ diff --git a/Meniuri/Vechi/listnecorp.mnx b/Meniuri/Vechi/listnecorp.mnx new file mode 100644 index 0000000..d4ae85c Binary files /dev/null and b/Meniuri/Vechi/listnecorp.mnx differ diff --git a/Meniuri/Vechi/mfix2000.MNT b/Meniuri/Vechi/mfix2000.MNT new file mode 100644 index 0000000..28de78b Binary files /dev/null and b/Meniuri/Vechi/mfix2000.MNT differ diff --git a/Meniuri/Vechi/mfix2000.mnx b/Meniuri/Vechi/mfix2000.mnx new file mode 100644 index 0000000..73105d1 Binary files /dev/null and b/Meniuri/Vechi/mfix2000.mnx differ diff --git a/Meniuri/Vechi/sitana.MNT b/Meniuri/Vechi/sitana.MNT new file mode 100644 index 0000000..e4ffd01 Binary files /dev/null and b/Meniuri/Vechi/sitana.MNT differ diff --git a/Meniuri/Vechi/sitana.mnx b/Meniuri/Vechi/sitana.mnx new file mode 100644 index 0000000..a8c9f41 Binary files /dev/null and b/Meniuri/Vechi/sitana.mnx differ diff --git a/Meniuri/listcorp.MNT b/Meniuri/listcorp.MNT new file mode 100644 index 0000000..14f69cf Binary files /dev/null and b/Meniuri/listcorp.MNT differ diff --git a/Meniuri/listcorp.mnx b/Meniuri/listcorp.mnx new file mode 100644 index 0000000..eff5f6a Binary files /dev/null and b/Meniuri/listcorp.mnx differ diff --git a/Meniuri/listincurs.MNT b/Meniuri/listincurs.MNT new file mode 100644 index 0000000..bbb1dfd Binary files /dev/null and b/Meniuri/listincurs.MNT differ diff --git a/Meniuri/listincurs.mnx b/Meniuri/listincurs.mnx new file mode 100644 index 0000000..f482773 Binary files /dev/null and b/Meniuri/listincurs.mnx differ diff --git a/Meniuri/listnecorp.MNT b/Meniuri/listnecorp.MNT new file mode 100644 index 0000000..4fd5f21 Binary files /dev/null and b/Meniuri/listnecorp.MNT differ diff --git a/Meniuri/listnecorp.mnx b/Meniuri/listnecorp.mnx new file mode 100644 index 0000000..746e239 Binary files /dev/null and b/Meniuri/listnecorp.mnx differ diff --git a/Meniuri/roaimob.MNT b/Meniuri/roaimob.MNT new file mode 100644 index 0000000..7fedde0 Binary files /dev/null and b/Meniuri/roaimob.MNT differ diff --git a/Meniuri/roaimob.mnx b/Meniuri/roaimob.mnx new file mode 100644 index 0000000..53d91f4 Binary files /dev/null and b/Meniuri/roaimob.mnx differ diff --git a/Meniuri/sitana.MNT b/Meniuri/sitana.MNT new file mode 100644 index 0000000..5871e9a Binary files /dev/null and b/Meniuri/sitana.MNT differ diff --git a/Meniuri/sitana.mnx b/Meniuri/sitana.mnx new file mode 100644 index 0000000..23a90be Binary files /dev/null and b/Meniuri/sitana.mnx differ diff --git a/Programe/Vechi/DATAPIF.PRG b/Programe/Vechi/DATAPIF.PRG new file mode 100644 index 0000000..a3c03d3 --- /dev/null +++ b/Programe/Vechi/DATAPIF.PRG @@ -0,0 +1,19 @@ + +local d,l,a,t +public m.dat + +sele mf +d=day(datapif) + +l=month(datapif)+mod(normat,12) +a=year(datapif)+int(normat/12) +if l>12 + l=l-12 + a=a+1 +endif + + +t=str(d,2)+'/'+str(l,2)+'/'+str(a,4) + +m.dat=ctod(t) + diff --git a/Programe/Vechi/SITAN1.PRG b/Programe/Vechi/SITAN1.PRG new file mode 100644 index 0000000..4cfb517 --- /dev/null +++ b/Programe/Vechi/SITAN1.PRG @@ -0,0 +1,39 @@ +SET SAFETY OFF + + +local i,t,k +public m.an m.nl m.t_2121 m.t_2122 m.t_2123 m.t_2124 m.t_2125 m.t_2126 an nl +*store ' ' to m.an, m.nl +store 0 to i, k, m.t_2121, m.t_2122, m.t_2123, m.t_2124, m.t_2125, m.t_2126 + +sele 0 +use &DIRGEN\MFIX2000\datE\sitmf.dbf EXCLUSIVE ALIAS SITMF +ZAP + +sele mf +use + +SELE CALENDAR +scan +scatter memvar + +*cale = 'c:\delta\data\an'+m.an+'\date'+m.nl +SELECT 0 +use &DATE\mf.dbf again alias mf + +for i=1 to 6 + t='sum ceiling(valoare/normat) to m.t_212' +str(i,1)+' for scd = "212'+str(i,1)+'" ' + &t +next +sele sitmf +appe blank +gather memvar +SELE MF +USE +endscan + +SELE SITMF +report form sitmf1 TO PRINTER PROMPT PREVIEW +USE + +do totv \ No newline at end of file diff --git a/Programe/Vechi/actualizari.prg b/Programe/Vechi/actualizari.prg new file mode 100644 index 0000000..ddc75f3 --- /dev/null +++ b/Programe/Vechi/actualizari.prg @@ -0,0 +1,85 @@ +CLOSE DATABASE +SELE 0 +USE &calefirma\datean\calendar ALIAS calendar +SELE calendar +SCAN + SCATTER MEMVAR + DATE=calefirma+'\AN'+m.an+'\DATE'+M.nl + DO pmf1 +ENDSCAN +*** + +DO totv + + + + +*____________________________________________ +PROCEDURE pmf1 +IF !FILE('&date\mf.DBF') + RETURN +ENDIF +DELE FILE &DATE\mfa.* +DELE FILE &DATE\mfv.* +COPY FILE &dirgen\mfix2000\DATE\mf.* TO &DATE\mfa.* +SELE 0 +USE &DATE\mfa.DBF AGAIN ALIAS mfa EXCLUSIVE +SELE mfa +ZAP +SELE mfa +APPEND FROM &DATE\mf +SELE mfa +REINDEX +USE +RENAME &DATE\mf.* TO &DATE\mfv.* +RENAME &DATE\mfa.* TO &DATE\mf.* +RETURN + + + + + + + +*__________________________________ +PROC pmf2 +SELE 0 +USE &DATE\mf.DBF EXCL ALIAS mf +IF !existacimp('mf','amorttot') + ALTER TABLE mf ADD COLUMN amorttot N(14) +ENDIF +IF !existacimp('mf','amortlun') + ALTER TABLE mf ADD COLUMN amortlun N(14) +ENDIF +IF !existacimp('mf','amortprec') + ALTER TABLE mf ADD COLUMN amortprec N(14) +ENDIF +IF !existacimp('mf','uzuraprec') + ALTER TABLE mf ADD COLUMN uzuraprec N(5) +ENDIF +USE + +RETURN + + + + +*_____________________________ +FUNCTION existacimp +PARAM numet,numec +FOR i=1 TO FCOUNT() + IF UPPER(ALLT(FIELD(i)))=UPPER(ALLT(numec)) + RETURN .T. + ENDIF +NEXT +RETURN .F. + + + + + + + + + + diff --git a/Programe/Vechi/calcamort.prg b/Programe/Vechi/calcamort.prg new file mode 100644 index 0000000..1d3a023 --- /dev/null +++ b/Programe/Vechi/calcamort.prg @@ -0,0 +1,28 @@ +local cond,c,t,i,a,m.amortlun +cond='month(datapif)=val(m.nl) and year(datapif)=val(m.an) and uzuraprec=0' +sele mf +scan +do case + case UPPER(left(tipamort,1))='L'&&LINIARA + repl amortlun with IIF(UZURA>NORMAT or &cond ,0,iif(uzura=normat,valoare-AMORTprec,ROUND((valoare-AMORTprec)/(normat-UZURA+1),0))) + repl amortan with amortlun*12 + case UPPER(left(tipamort,1))='A'&&ACCELERATA + IF (P>0 AND P<=0.5) AND UZURA<=12 + repl amortlun with IIF(UZURA>NORMAT or &cond ,0,iif(uzura=normat,valoare-AMORTprec,ROUND(valoare*P/12,0))) + ELSE + repl amortlun with IIF(UZURA>NORMAT or &cond ,0,iif(uzura=normat,valoare-AMORTprec,ROUND((valoare*(1-p))/(normat-12),0))) + ENDIF + repl amortan with amortlun*12 + case UPPER(left(tipamort,1))='D'&&DEGRESIVA + if mod(uzura,12)=1 + c=12*k/normat + repl amortan with iif(uzura>normat,0,round((valoare-amortprec)*c,0)) + if amortan<12*valoare/normat + repl amortan with iif(uzura>normat,0,(valoare-amortprec)/(normat/12-round(uzura/12,0))) + endif + endif + + REPL AMORTLUN WITH IIF(UZURA>NORMAT or &cond ,0,iif(uzura=normat,valoare-AMORTprec,round(amortan/12,0))) +ENDCASE +repl amorttot with amortprec+amortlun +endscan \ No newline at end of file diff --git a/Programe/Vechi/calcamortm.prg b/Programe/Vechi/calcamortm.prg new file mode 100644 index 0000000..ca7425b --- /dev/null +++ b/Programe/Vechi/calcamortm.prg @@ -0,0 +1,82 @@ +LOCAL cond,c + +lnValRez = m.valrez +IF VAL(m.an) >= 2004 + m.valrez = 0 && din 2004 trece ca si valoare amortizata +ENDIF + +cond='month(m.datapif)=val(m.nl) and year(m.datapif)=val(m.an) and m.uzuraprec=0' +m.normaan=ROUND(m.normat/12,3) + +IF m.valramasa = 0 AND m.dataeval = m.datapif + m.valramasa = m.valin - m.valrez +ENDIF + +IF m.normat2=0 + m.normat2=m.normaan +ENDIF + +IF m.normat2lun=0 + m.normat2lun=m.normat +ENDIF + +DO CASE + CASE UPPER(LEFT(m.tipamort,1))='L' &&LINIARA + DO amortlin + m.amortan=ROUND(m.amortlun*12,gnZ) + CASE UPPER(LEFT(m.tipamort,1))='A' &&ACCELERATA + IF (m.P>0 AND m.P<=0.5) AND m.UZURA<=12 + m.amortlun = IIF(m.UZURA>m.normat OR &cond ,0,IIF(M.UZURA=M.normat,M.valin-m.valrez-M.AMORTprec,ROUND((m.valin-m.valrez)*m.P/12,gnZ))) + ELSE + m.amortlun = IIF(m.UZURA>m.normat OR &cond ,0,IIF(M.UZURA=M.normat,M.valin-m.valrez-M.AMORTprec,ROUND(((m.valin-m.valrez)*(1-m.P))/(m.normat-12),gnZ))) + ENDIF + m.amortan=ROUND(m.amortlun*12,gnZ) + CASE UPPER(LEFT(m.tipamort,1))='D' &&DEGRESIVA + IF MOD(m.UZURA,12)=1 + c=12*m.k/m.normat + m.amortan = IIF(m.UZURA>m.normat,0,ROUND((m.valin-m.valrez-m.AMORTprec)*c,gnZ)) + IF m.amortanm.normat OR &cond ,0,IIF(m.UZURA=m.normat,M.valin-m.valrez-M.AMORTprec,ROUND(m.amortan/12,gnZ))) +ENDCASE + +m.amorttot=m.amortlun+m.AMORTprec +m.valrez = lnValRez + +RETURN +***------------------------------------------------------------------------------------------ + +PROCEDURE amortlin +LOCAL cond,c,cond2 +cond='(month(m.datapif)=val(m.nl) and year(m.datapif)=val(m.an) and m.uzuraprec=0)' && in luna punerii in functiune + +IF ROUND(12*VAL(m.an)+VAL(m.nl),0)>12*YEAR(m.dataeval)+MONTH(m.dataeval)+m.normat2lun + cond2='(M.AMORTPREC>=M.valin-m.valrez)' && total amortizare din luna precedenta a ajuns la valoare-valoarea reziduala +ELSE + cond2 = '.f.' +ENDIF + +IF &cond OR &cond2 + m.amortlun =0 +ELSE + IF ROUND(12*VAL(m.an)+VAL(m.nl),0)=12*YEAR(m.dataeval)+MONTH(m.dataeval)+m.normat2lun AND m.cota <> 0 + m.amortlun = M.valin - m.valrez - M.AMORTprec + IF m.amortlun<0 + m.amortlun=0 + ENDIF + ELSE + m.amortlun = ROUND(m.valramasa*m.cota/12/100,gnZ) + ENDIF +ENDIF + +IF M.AMORTprec+M.amortlun>m.valin-m.valrez AND m.valin = m.valoare && cele care nu au fost reevaluate + m.amortlun=M.valin-m.valrez-M.AMORTprec + IF M.amortlun<0 + m.amortlun=0 + ENDIF +ENDIF + +***------------------------------------------------------------------------------------------------ + diff --git a/Programe/Vechi/calcamortmv.prg b/Programe/Vechi/calcamortmv.prg new file mode 100644 index 0000000..1667623 --- /dev/null +++ b/Programe/Vechi/calcamortmv.prg @@ -0,0 +1,88 @@ +Local cond,c +cond='month(m.datapif)=val(m.nl) and year(m.datapif)=val(m.an) and m.uzuraprec=0' +m.normaan=Round(m.normat/12,0) +*!* If m.normat2<0 +*!* m.normat2=0 +*!* Endif + +*WAIT WINDOW STR(m.tipcalcul) + +Do Case + Case Upper(Left(m.tipamort,1))='L' &&LINIARA +*m.amortlun = IIF(m.UZURA>m.NORMAT or &cond ,0,iif(M.uzura=M.normat,M.valoare-M.AMORTprec,ROUND((m.valoare-m.AMORTprec)/(m.normat-m.UZURA+1),0))) + Do amortlin + m.amortan=m.amortlun*12 + Case Upper(Left(m.tipamort,1))='A' &&ACCELERATA + If (m.P>0 And m.P<=0.5) And m.UZURA<=12 + m.amortlun = Iif(m.UZURA>m.normat Or &cond ,0,Iif(M.UZURA=M.normat,M.valramasa-M.AMORTprec,Round(m.valramasa*m.P/12,0))) + Else + m.amortlun = Iif(m.UZURA>m.normat Or &cond ,0,Iif(M.UZURA=M.normat,M.valramasa-M.AMORTprec,Round((m.valramasa*(1-m.P))/(m.normat-12),0))) + Endif + m.amortan=m.amortlun*12 + Case Upper(Left(m.tipamort,1))='D' &&DEGRESIVA + If Mod(m.UZURA,12)=1 + c=12*m.k/m.normat + m.amortan = Iif(m.UZURA>m.normat,0,Round((m.valramasa-m.AMORTprec)*c,0)) + If m.amortan<12*m.valramasa/m.normat + m.amortan = (m.valramasa-m.AMORTprec)/(m.normat/12-Round(m.UZURA/12,0)) + Endif + Endif + m.amortlun = Iif(m.UZURA>m.normat Or &cond ,0,Iif(m.UZURA=m.normat,M.valramasa-M.AMORTprec,Round(m.amortan/12,0))) +Endcase + + + +m.amorttot=m.amortlun+m.AMORTprec +*wait wind m.denumire +Return + + + + +*__________________________________________________________ +Proc amortlin + Local cond,c,cond2 + cond='(month(m.datapif)=val(m.nl) and year(m.datapif)=val(m.an) and m.uzuraprec=0)' && in luna punerii in functiune +*cond2='((M.AMORTPREC>=M.VALRAMASA AND m.normat2#0) OR (M.AMORTPREC>=M.VALOARE AND m.normat2=0))' + cond2='(M.AMORTPREC>=M.valramasa-m.valrez)' && total amortizare din luna precedenta a ajuns la valoare-valoarea reziduala + + +IF m.normat2=0 +m.normat2=m.normaan +ENDIF +IF m.normat2lun=0 +m.normat2lun=m.normat2*12 +ENDIF + +*!* If m.normat2=0 +*!* m.valramasa=m.valoare + *m.cota=Round(1/m.normaan*100,1) +*!* Else + m.cota=Round(1/m.normat2*100,1) +*!* Endif + + + If &cond Or &cond2 + m.amortlun =0 + Else + If M.UZURA=M.normat + m.amortlun =M.valramasa-M.AMORTprec +*!* IF m.amortlun<0 +*!* m.amortlun=0 +*!* endif + Else + *If m.tipcalcul=0 + m.amortlun = Round(m.valramasa*m.cota/12/100,0) + *Else + * m.amortlun = Round((m.valramasa-m.AMORTprec)/(m.normat-m.UZURA+1),0) + *Endif + Endif + Endif + + If M.AMORTprec+M.amortlun>M.valramasa + m.amortlun=M.valramasa-M.AMORTprec + If M.amortlun<0 + m.amortlun=0 + Endif + Endif +return \ No newline at end of file diff --git a/Programe/Vechi/calcul_cota.prg b/Programe/Vechi/calcul_cota.prg new file mode 100644 index 0000000..0013398 --- /dev/null +++ b/Programe/Vechi/calcul_cota.prg @@ -0,0 +1,11 @@ +PARAMETERS tnDurataRamasa + +&& tnDurataRamasa este exprimata in luni + +*!* IF EMPTY(tnDurataRamasa) OR TYPE('tnDurataRamasa') # 'N' +*!* RETURN 0 +*!* ENDIF + +lnCota = ROUND((1/tnDurataRamasa)*100*12,2) && cota pe an + +RETURN lnCota \ No newline at end of file diff --git a/Programe/Vechi/calcuzura.prg b/Programe/Vechi/calcuzura.prg new file mode 100644 index 0000000..b21a80e --- /dev/null +++ b/Programe/Vechi/calcuzura.prg @@ -0,0 +1,22 @@ +PARAMETERS toXmf + +IF TYPE('toXmf') # 'O' + RETURN .f. +ENDIF + +lnLunaCrt = VAL(M.NL) +lnAnCrt = VAL(M.AN) +lnUzura = toXmf.uzura +IF toXmf.cota # 0 AND toXmf.codop <> 12 && conservare +&& toXmf.codop <> 12 conditie necesara pt ca, deocamdata la calculul amortizarii tine cont de uzura si nu doar de cota + lnUzPrec = toXmf.uzuraprec + lnLunaPif=MONTH(toXmf.DATAPIF) + lnAnPif=YEAR(toXmf.DATAPIF) + UZ=IIF(lnAnCrt < lnAnPif, 0, 12*(lnAnCrt-lnAnPif)+lnLunaCrt-lnLunaPif) && 12*(an crt - an pif) + luna crt - luna pif + + if UZ=0 and lnUzPrec#0 + UZ=1 + ENDIF + lnUzura = UZ+lnUzPrec +ENDIF +RETURN lnUzura \ No newline at end of file diff --git a/Programe/Vechi/calcuzurav.prg b/Programe/Vechi/calcuzurav.prg new file mode 100644 index 0000000..4be7e8d --- /dev/null +++ b/Programe/Vechi/calcuzurav.prg @@ -0,0 +1,22 @@ +LOCAL NRL,NRA,L,A,UZ,lnUzPrec +STORE 0 TO L,A,UZ,lnUzPrec +NRL=VAL(M.NL) +NRA=VAL(M.AN) + +SELE XMF +SCAN FOR !casat AND codop <> 12 && necasate si neconservate + lnUzPrec = uzuraprec + if empty(datapif) + do mesaj with 'Trebuie introdusa data punerii in functiune','la '+allt(denumire) + *return + ENDIF + L=MONTH(DATAPIF) + A=YEAR(DATAPIF) + UZ=IIF(NRA 0 && compar calendarele, update calendarmf +* USE &lcCaleFisierCont IN 0 shared ALIAS calendar_cont + SELECT (lcAliasImob) + CALCULATE MAX(12*VAL(an)+VAL(nl)) TO lnMaxData + APPEND FROM &lcCaleFisierCont FOR (12*VAL(an)+VAL(nl))>lnMaxData AND !DELETED() AND (12*VAL(an)+VAL(nl))# 0 && IN CAZUL UNUI CALENDAR CU LINII GOALE + ENDIF +ENDIF + +IF USED(lcAliasImob) + USE IN &lcAliasImob +ENDIF +IF USED('start_prg') + USE IN start_prg +ENDIF + +RETURN lnSucces \ No newline at end of file diff --git a/Programe/Vechi/danu_ingest.prg b/Programe/Vechi/danu_ingest.prg new file mode 100644 index 0000000..a33f795 --- /dev/null +++ b/Programe/Vechi/danu_ingest.prg @@ -0,0 +1,14 @@ +*________________________________________ +PROCEDURE danu_ingest +PARAMETERS cas,txt1,txt2 +SELECT mf +oi=CREATEOBJECT('ingest') +oi.label1.caption=txt1 +oi.label2.caption=txt2 + IF cas + oi.label2.visible=.f. + oi.text1.visible=.f. + ENDIF +oi.show(1) +RETURN +*________________________________________ \ No newline at end of file diff --git a/Programe/Vechi/deschidV.prg b/Programe/Vechi/deschidV.prg new file mode 100644 index 0000000..75ad630 --- /dev/null +++ b/Programe/Vechi/deschidV.prg @@ -0,0 +1,42 @@ +local lunatrec,antrec,lunacrt,ancrt,dattrec,datcrt +set safety off + +lunacrt=m.nl +ancrt=m.an + +sele calendar +locate for m.an=an and m.nl=nl +skip -1 +if bof() + *este prima luna deschisa__________ + + copy file &dirgen\mfix2000\date\*.* to &date\*.* + + else + *nu este prima luna deschisa__________ + lunatrec=nl + antrec=an + dattrec=calefirma+'\AN'+antrec+'\DATE'+lunatrec+'\'+'mf.*' + LOCAL DATTREC1 + dattrec1=calefirma+'\AN'+antrec+'\DATE'+lunatrec+'\'+'mf.DBF' + + + *dar daca nici luna precedenta nu a fost dechisa__________ + if !file('&dattrec1') + + copy file &dirgen\mfix2000\date\*.* to &date\*.* + + else + + copy file &dattrec to &date\*.* + + endif + SELECT 0 + USE &date\mf.dbf; + AGAIN ALIAS mf + repl all cod with 0 + sele mf + use +endif + +return diff --git a/Programe/Vechi/deschidl.prg b/Programe/Vechi/deschidl.prg new file mode 100644 index 0000000..9095c47 --- /dev/null +++ b/Programe/Vechi/deschidl.prg @@ -0,0 +1,70 @@ +Local valan,a,b,datea,dateb,nfrm +DIRFIRM=loc+'\'+NFSCURT + +Set Safety Off +Set Exclusive On + +b=Iif(M.NNLMAX<10,'0'+Str(M.NNLMAX,1),Str(M.NNLMAX,2)) +dateb='an'+m.an+'\'+'DATE'+b +m.NNLMAX=M.NNLMAX+1 +a=Iif(M.NNLMAX<10,'0'+Str(M.NNLMAX,1),Str(M.NNLMAX,2)) +m.nl=a + +If m.NNLMAX=13 + m.NNLMAX=1 + a='01' + valan=m.anmax+1 + m.an=Alltrim(Str(valan)) + m.anmax=m.an + m.nl=a +Endif +datea='an'+m.an+'\'+'DATE'+a +Date=datea + +Set Defa To &calefirma +If !Directory('&datea') + Md &datea +Endif +Close Database +*DO DES WITH 'CALENDAR' + +*Do DESCHID.PRG +************** + +Set Defa To .. +Set Defa To .. +Set Defa To .. +Set Defa To .. + +m.anmax=m.an +m.nlmax=m.nl +m.NNL=M.NNLMAX +Show Gets +Set Exclusive Off + +Do totv.PRG +Sele CALENDAR +*loca for SCONT=.f. +* +*if eof() then +Appe Blank +*endif +* +Repl nl With a +Repl an With m.an +*REPL SCONT WITH .T. +Goto Recno()-1 +Scatter Fiel CTVAI,CTVAM,plafoncasa,plafonplat Memvar +Goto Recno()+1 +*repl ctvai with m.ctvai +*repl ctvam with m.ctvam +Gath Fiel CTVAI,CTVAM,plafoncasa,plafonplat Memvar + +Return +********************************** +* sfarsit procedura deschid luna * +********************************** + + + + diff --git a/Programe/Vechi/exportare.prg b/Programe/Vechi/exportare.prg new file mode 100644 index 0000000..d6ac05b --- /dev/null +++ b/Programe/Vechi/exportare.prg @@ -0,0 +1,60 @@ +LPARAMETERS tabel, initial, final +LOCAL nrc, i, c +STORE 0 TO nrc, i +STORE '' TO c +curentdir=SYS(5)+SYS(2003) +A='C:\MY DOCUMENTS' +B='C:\DOCUMENTS AND SETTINGS' +DO CASE +CASE DIRECTORY('&A') + SET DEFAULT TO '&A' +CASE DIRECTORY('&B') + SET DEFAULT TO '&B' +OTHERWISE + MD &A + SET DEFAULT TO '&A' +ENDCASE + + +exista_excel=.F. + +initial = ','+initial+',' &&Pentru a recunoste coloanele' +final = ','+final+',' &&---||--- + +nrc = OCCURS(',', '&initial') +nrc=nrc-1 && scade virgula din fata + +LOCAL ARRAY c_initial(nrc) +LOCAL ARRAY c_final(nrc) + +FOR i = 1 TO nrc + n = AT(',', '&initial', i) + n2 =AT(',', '&initial', i+1) + c_Initial[i] = SUBSTR('&initial', n+1, n2-n-1) + *MESSAGEBOX(c_initial[i]) + n = AT(',', '&final', i) + n2 =AT(',', '&final', i+1) + c_final[i] = SUBSTR('&final', n+1, n2-n-1) + *MESSAGEBOX(c_final[i]) +ENDFOR + +FOR i=1 TO nrc + IF i=nrc + c=c+c_initial[i]+' as '+c_final[i] + ELSE + c=c+c_initial[i]+' as '+c_final[i]+',' + ENDIF +ENDFOR + +calea_fis = PUTFILE('Nume fisier:', 'Foaie_Excel', 'XLS') +IF EMPTY(calea_fis) && Esc pressed + SET DEFAULT TO &curentdir + RETURN +ENDIF + +SELECT &c FROM &tabel INTO CURSOR cur +SELECT cur +EXPORT TO (calea_fis) TYPE XL5 + +*SET DEFAULT TO &DIRGEN +SET DEFAULT TO &curentdir diff --git a/Programe/Vechi/imob2003.prg b/Programe/Vechi/imob2003.prg new file mode 100644 index 0000000..9374854 --- /dev/null +++ b/Programe/Vechi/imob2003.prg @@ -0,0 +1,664 @@ +PARAMETERS tparam + +&&& imob2003 + + +SET CENTURY ON +SET DELETED ON +SET DATE TO DMY +SET EXCLUSIVE OFF +SET CPDIALOG OFF +SET TALK OFF +SET SAFETY OFF +SET ESCAPE OFF +SET EXACT ON +SET ANSI ON +SET CONSOLE OFF +SET NOTIFY OFF +SET SECONDS OFF +_SCREEN.AUTOCENTER=.T. +_SCREEN.VISIBLE=.F. + +LOCAL lcMainClassLib +LOCAL lcLastSetTalk,lcLastSetPath,lcLastSetClassLib,lcOnShutdown +PUBLIC pofirma,poCalendar + +PUBLIC dirgen,dirfirm,DATE,datean,calet,nfscurt,m.an,m.nl,M.NUME_2,M.NUMEGEST,m.suma,buton,pc_nume,M.FLUNG,m.id_sectie +PUBLIC m.cod,m.nract,m.dataact,m.datapif,m.nrpif,m.denumire,m.nrinv,m.codmf,m.normat,titlu +PUBLIC m.valoare,m.uzura,m.tipamort,m.gest,m.respons,m.caract,m.scd,m.fdoc,M.EXPLICATIA +PUBLIC totval,PRIMADATA,m.text,m.nr1,m.nr2,_nract,_dataact,_cod,m.sumat,pamort1,pamort2,pnrinv1,pnrinv2,pdata1,pdata2 +PUBLIC Tden,Tsuma,Tgest,tscd,m.suma1,m.suma2,m.data1,m.data2,m.suma,bden,bsuma,bgest,bscd,bnrinv,bresp,bcasat +PUBLIC m.an, m.nl, m.t_2121, m.t_2122, m.t_2123, m.t_2124, m.t_2125, m.t_2126, an, nl +PUBLIC s,s1,s2,s3,s4,s5,s6,CALEFIRMA,M.CALEFIRM,parolaactiva,parola,corect +PUBLIC M.R_2121,M.R_2122,M.R_2123,M.R_2124,M.R_2125,M.R_2126 +PUBLIC M.V_2121,M.V_2122,M.V_2123,M.V_2124,M.V_2125,M.V_2126 +PUBLIC M.Vr_2121,M.Vr_2122,M.Vr_2123,M.Vr_2124,M.Vr_2125,M.Vr_2126 +PUBLIC m.uzuraprec,m.amorttot,m.amortlun,m.amortprec,M.P,M.K,m.amortan,anul,luna,m.valin,m.dataeval +PUBLIC OSTART,uz,STARE,m.cota,m.valramasa,m.normat2,m.normaan,m.normat2lun +PUBLIC TVALOARE,ultima_luna,M.NUMELUNA,M.luna,M.ANTET,felul,M.NIVEL,m.tipcalcul +PUBLIC E_INDEPENDENT,LUNA_NEPLATITA,PRIMADATA1,NUMEPROGRAM,op_imob,gnZ +STORE 0 TO gnZ +*E_INDEPENDENT=.T. +PUBLIC luna_inchisa + +STORE '' TO dirgen,dirfirm,DATE,datean,calet,nfscurt,m.an,m.nl +STORE 0 TO m.nract,m.valoare,m.normat,m.gest,m.cod,m.uzura,m.suma,buton,totval,_nract,_cod,m.normaan +STORE 0 TO s,s1,s2,s3,s4,s5,s6,M.R_2121,M.R_2122,M.R_2123,M.R_2124,M.R_2125,M.R_2126,M.V_2121,M.V_2122,M.V_2123,M.V_2124,M.V_2125,M.V_2126 +STORE 0 TO M.Vr_2121,M.Vr_2122,M.Vr_2123,M.Vr_2124,M.Vr_2125,M.Vr_2126,STARE,m.cota,m.valramasa,m.normat2,m.normat2lun,m.valin +STORE 0 TO m.uzuraprec,m.amorttot,m.amortlun,m.amortprec,uz,M.P,M.K,m.amortan,TVALOARE +STORE '' TO m.denumire,m.nrpif,m.codmf,m.nrinv,m.tipamort,m.respons,m.scd,m.caract,m.fdoc,DATE,pc_nume,M.FLUNG,M.NUMELUNA,M.luna,M.ANTET +STORE '' TO nfscurt,M.NUME_2,M.NUMEGEST,M.EXPLICATIA,m.text,CALEFIRMA,M.CALEFIRM,parolaactiva,parola,anul,luna,titlu,felul,m.id_sectie +STORE DATE() TO m.dataact,m.datapif,_dataact,m.data1,m.data2,pdata1,pdata2 +STORE .T. TO PRIMADATA,LUNA_NEPLATITA,PRIMADATA1 +STORE .F. TO ultima_luna,corect +STORE 0 TO m.tipcalcul +STORE .F. to luna_inchisa + + + +*-- Save and configure environment. +lcLastSetTalk=SET("TALK") +SET TALK OFF +lcLastSetPath=SET("PATH") + +SET PATH TO ;DATE;INCLUDE;FERESTRE;GRAFICE;HELP;CLASE;MENIURI;PROGRAME;RAPOARTE; + PUSH MENU _MSYSMENU + +*** +lcLastSetClassLib=SET("CLASSLIB") +lcMainClassLib="clase\mfix2000" +SET CLASSLIB TO (lcMainClassLib) ADDITIVE +SET CLASSLIB TO appwiz ADDITIVE +SET CLASSLIB TO FERESTREBAZA ADDITIVE +SET CLASSLIB TO CAUT ADDITIVE +SET CLASSLIB TO CAUTmf ADDITIVE +SET CLASSLIB TO cont2000-2 ADDITIVE +SET CLASSLIB TO cont2000-3 ADDITIVE +SET CLASSLIB TO registry ADDITIVE +SET CLASSLIB TO imob_2005 ADDITIVE +*** +SET PROCEDURE TO PROCEDURI ADDITIVE +SET PROCEDURE TO PROC_menu ADDITIVE +SET PROCEDURE TO TOTV ADDI +SET PROCEDURE TO proceduri_comune ADDITIVE + +SET PROCEDURE TO quitapp ADDITIVE +SET PROCEDURE TO init_program ADDITIVE +SET PROCEDURE TO proceduri_verificare_luna.prg ADDITIVE + + +PUBLIC glVerificTabel && daca se verifica structura tabelelor in totv.prg +glVerificTabel=.T. + +PUBLIC glQuit +glQuit = .F. + +PUBLIC gnIdIstoric +STORE 0 TO gnIdIstoric + +PUBLIC gcAppPath,gcAppName,gcAppDataPath, gcTempPath, gcCaleServerDate,gcAppCaption + +gcAppPath = ADDBS(JUSTPATH(SYS(16,0))) +gcAppName = JUSTSTEM(SYS(16,0)) +gcAppDataPath=gcAppPath+"Date_"+gcAppName+"\" && D:\CONTAFIN\TRANS\DATE_TRANS && PT OPTIUNI , FISIERE SPECIFICE PROGRAMULUI SI +gcAppCaption = 'CONTAFIN IMOBILIZARI' +STORE "" TO gcTempPath, gcCaleServerDate + +IF !DIRECTORY(gcAppDataPath) + MD (gcAppDataPath) +ENDIF + +liat=RAT("\",gcAppPath,2) +dirgen=ADDBS(LEFT(gcAppPath,liat-1)) +CD &dirgen + + +IF verificari() + _SCREEN.VISIBLE=.T. + DO mesaj WITH "Se fac verificari programului","Va rugam reveniti" + glQuit= .T. + QUIT +ENDIF + + +IF !Debug_Start() + lcParam=tparam + IF EMPTY(tparam) OR (TYPE('tParam')='C' AND !verific_start(tparam,dirgen,gcAppName)) + _SCREEN.VISIBLE=.T. + DO mesaj WITH "Programul trebuie pornit doar din START","" + QUIT + ENDIF +ENDIF + +*** verificare serie permanenta +PUBLIC tipar,exista_excel,SER_PERM,SER_PERI,VERSIUNE +STORE .F. TO SER_PERM,SER_PERI + +USE &gcAppPath\SER IN 0 ALIAS SER SHARED +SELECT SER +GO TOP +tipar=TIP +SER_PERM=SER_PERMAN +SER_PERI=SER_PERIOD +VERSIUNE=VERcont +MODEL_PROGRAM=MODEL +USE IN SER +PAROLAMEA=SUBSTR(tipar,MONTH(DATE()),1) +PAROLAMEA=PAROLAMEA+ALLT(STR(DAY(DATE())))+ALLT(STR(MONTH(DATE()))) + +IF !_DEBUG() + IF SER_PERM AND !verif_ser_perm() + QUIT + ENDIF +ENDIF +*********************************************************************** +*** INITIALIZEZ CAI DATE +PUBLIC cales,eserver,loc,utilizator +IF !Start_Nou() + + CD C:\ + IF !DIRECTORY('contafin') + MD contafin + ENDIF + CD contafin + IF !DIRECTORY('temp') + MD temp + ENDIF + + eserver=.F. + STORE '' TO cales,loc + IF !FILE('c:\contafin\temp\ceprogram.dbf') + COPY FILE &DIRGEN\_ALFA\TEMPO\CEPROGRAM.* TO c:\contafin\temp\CEPROGRAM.* + ENDIF + + IF FILE('&DIRGEN\START2000\DATA\RETEA.DBF') + IF !FILE('c:\contafin\temp\RETEA.dbf') + COPY FILE &dirgen\START2000\DATA\RETEA.* TO C:\contafin\temp\RETEA.* + ENDIF + SELE 0 + USE C:\contafin\temp\RETEA + eserver=SERVER + cales=ALLT(CALESERVER) + USE IN RETEA + ENDIF + + + UTILIZATOR='' + IF FILE('c:\contafin\temp\CEPROGRAM.dbf') + + SELE 0 + USE C:\contafin\temp\CEPROGRAM ALIAS CEPROGRAM + GO TOP + SCAT MEMV + UTILIZATOR=m.util + USE IN CEPROGRAM + ENDIF + CD &dirgen +ELSE + gcTempPath = Init_Cale_Temp(dirgen) + IF !DIRECTORY(gcTempPath) + MD (gcTempPath) + ENDIF + + CALES = Init_Cale_Server_Date(dirgen) + ESERVER = .T. + NUMESTATIE = Init_Nume_Statie(dirgen) + utilizator = Init_Nume_Utilizator(dirgen) + M.nivel = ROUND(VAL(Init_Nivel_Utilizator(dirgen)),0) + M.CONTAB = UPPER(ALLTRIM(Init_NumeAlternativ(dirgen))) + + lcQuitData = ADDBS(ALLTRIM(DIRGEN))+"dateretea" + lcQuitName = "start_quitapp" + PRIVATE goQuitApp && I'm making it private so it will die with the application. + goQuitApp = quitapp(lcQuitData,lcQuitName) + gnIdIstoric = Start_Istoric(m.utilizator, gcAppName, NUMESTATIE, ADDBS(ALLTRIM(DIRGEN))+"DATERETEA\", "START_ISTORIC","start_ids") + +ENDIF +************************************************************************************** + + + + _SCREEN.AUTOCENTER=.T. + _SCREEN.WINDOWSTATE=2 + + + + + + lcOnShutdown="ShutDown()" + ON SHUTDOWN &lcOnShutdown + ON ERROR ErrorHandler(ERROR(),PROGRAM(),LINENO()) + _SHELL="DO Cleanup IN progs\Imob2003" + +*-- Instantiate application object. + RELEASE goApp + PUBLIC goApp + goApp=CREATEOBJECT("cApplication") + + +*-- Configure application object. + goApp.SetCaption("CONTAFIN IMOBILIZARI") + goApp.cStartupMenu=ADDBS(gcAppPath) + "meniuri\mfix2000" + goApp.cStartupForm=ADDBS(gcAppPath) + "ferestre\fundal" + + +*-- Show application. + goApp.SHOW + +*-- Release application. + RELEASE goApp + +*-- Restore default menu. + POP MENU _MSYSMENU + +*-- Restore environment. + ON ERROR + ON SHUTDOWN + IF NOT lcLastSetClassLib==SET("classlib") + RELEASE CLASSLIB (lcMainClassLib) + ENDIF + IF EMPTY(lcLastSetPath) + SET PATH TO + ELSE + SET PATH TO &lcLastSetPath + ENDIF + IF lcLastSetTalk=="ON" + SET TALK ON + ELSE + SET TALK OFF + ENDIF + RETURN + + + +FUNCTION ErrorHandler(nError,cMethod,nLine) + LOCAL lcErrorMsg,lcCodeLineMsg + + WAIT CLEAR + lcErrorMsg=MESSAGE()+CHR(13)+CHR(13) + lcErrorMsg=lcErrorMsg+"Method: "+cMethod + lcCodeLineMsg=MESSAGE(1) + IF BETWEEN(nLine,1,10000) AND NOT lcCodeLineMsg="..." + lcErrorMsg=lcErrorMsg+CHR(13)+"Line: "+ALLTRIM(STR(nLine)) + IF NOT EMPTY(lcCodeLineMsg) + lcErrorMsg=lcErrorMsg+CHR(13)+CHR(13)+lcCodeLineMsg + ENDIF + ENDIF + IF MESSAGEBOX(lcErrorMsg,17,_SCREEN.CAPTION)#1 + ON ERROR + RETURN .F. + ENDIF +ENDFUNC + + + +FUNCTION SHUTDOWN + + =End_Istoric(gnIdIstoric, ADDBS(DIRGEN)+"DATERETEA\", "START_ISTORIC") + IF TYPE("goApp")=="O" AND NOT ISNULL(goApp) + RETURN goApp.OnShutDown() + ENDIF + Cleanup() + QUIT +ENDFUNC + + +FUNCTION Cleanup + + IF CNTBAR("_msysmenu")=7 + RETURN + ENDIF + ON ERROR + ON SHUTDOWN + SET CLASSLIB TO + SET PATH TO + CLEAR ALL + CLOSE ALL + POP MENU _MSYSMENU + RETURN + + + + + + +*----------------------------------------------------- + +FUNCTION verif_ser_perm + CLEAR + + RETURN PORNIRE() +******** +*?pornire() + +FUNCTION PORNIRE + SET EXACT ON + PRIVATE calewin,calesys,checksum1,checksum2,serinreg,serdisk,file1,file2,valret,serdisktemp,ser1,ser2,key1,KEY2 + STORE '' TO calewin,serinreg,serdisk,calesys,serdisktemp,catehd,ser1,ser2,key1,KEY2 + STORE 0 TO checksum1,checksum2 + STORE .T. TO valret + DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ; + INTEGER hwndOwner, ; + INTEGER nFolder, ; + INTEGER hToken, ; + INTEGER dwFlags, ; + STRING @ pszPath + DECLARE INTEGER GetActiveWindow IN WIN32API + #DEFINE CSIDL_WINDOWS 36 + #DEFINE CSIDL_SYSTEM 37 + #DEFINE CSIDL_PROGRAMS 38 + lcPath = REPL(CHR(0),261) + =SHGetFolderPath(GetActiveWindow(),CSIDL_WINDOWS,0,0,@lcPath) + calewin=LEFT(lcPath,AT(CHR(0),lcPath)-1) + lcPath = REPL(CHR(0),261) + =SHGetFolderPath(GetActiveWindow(),CSIDL_SYSTEM,0,0,@lcPath) + calesys=LEFT(lcPath,AT(CHR(0),lcPath)-1) +&&se verifica existenta celor trei fisiere + IF (NOT FILE(calesys+'\diskserial.dll')) OR (NOT FILE(calesys+'\getmacip.dll')) OR (NOT FILE(calewin+'\comdir.snr')) + valret=.F. + ENDIF + IF valret + file1=FILETOSTR(calesys+'\diskserial.dll') + checksum1=SYS(2007,file1) + file2=FILETOSTR(calesys+'\getmacip.dll') + checksum2=SYS(2007,file2) +&&severifica daca dll-urile nu au fost modificate + IF (VAL(checksum1) != 58755) OR (VAL(checksum2) != 30476) + valret=.F. + ENDIF + ENDIF +&&se citesc seriile tutturor celor patru hard disk-uri posibile(pe IDE primary master,primary slave...) +&&se tine minte primul cu seria nenula-daca nu s-a putut citi seria de la nici unul se pune o serie default +&&seria default este "NUAREHAR" + IF valret + DECLARE INTEGER GetSerialNumber IN diskSerial.DLL INTEGER ,STRING + catehd=0 + FOR i=0 TO 3 + serdisktemp=SPACE(40) + GetSerialNumber(i,@serdisktemp) + IF (LEN(ALLTRIM(serdisktemp))!=0) AND (catehd=0) + serdisktemp=sircaracter(serdisktemp) + serdisk=serdisktemp + catehd=catehd+1 + ENDIF + ENDFOR + IF (LEN(ALLTRIM(serdisk))=0) + serdisk='NUAREHAR' + ELSE + IF ((LEN(ALLTRIM(serdisk))>0) AND (LEN(ALLTRIM(serdisk))<8)) + serdisk=serdisk+REPLICATE('1',8-LEN(ALLTRIM(serdisk))) + ENDIF + ENDIF + serdisk=SUBSTR(ALLTRIM(serdisk),LEN(ALLTRIM(serdisk))-7,8) + ENDIF +&&se citeste din comdir.snr seria de inregistrare si se verifica egalitatea cu seria obtinuta anterior + IF valret + gnFileHandle = FOPEN(calewin+'\comdir.snr') + nSize = FSEEK(gnFileHandle, 0, 2) && Move pointer to EOF + IF nSize!=9 + valret=.F. + ELSE + = FSEEK(gnFileHandle, 0, 0) && Move pointer to BOF + cString = FREAD(gnFileHandle,9) + ser1=SUBSTR(cString,1,4) + ser2=SUBSTR(cString,5,4) + key1=SUBSTR(cString,9,1) + KEY2=DECTOBIN(ALLTRIM(HEXDEC(key1))) + serinreg=decodare1(ALLTRIM(UPPER(ser1)),KEY2)+decodare1(ALLTRIM(UPPER(ser2)),KEY2) + IF serdisk!=serinreg + valret=.F. + ENDIF + ENDIF + = FCLOSE(gnFileHandle) + ENDIF + seriedisk1=serdisk + serieinreg1=serinreg + ON ERROR valret=.F. + RETURN valret +************* +FUNCTION decodare1 + PARAMETERS lstring,CHEIE + LOCAL lens,poz1,poz2,POZ3,lret,LRET2,lcstring,val1,lret1 + lret='' + lret1='' + LRET2='' + lcstring=ALLTRIM(UPPER(lstring)) + lens=LEN(lcstring) + FOR i=1 TO 4 + poz1=SUBSTR(lcstring,i,1) + val1=ASC(poz1) + POZ3=SUBSTR(CHEIE,i,1) + DO CASE + CASE val1>=48 AND val1<=57 + IF ((val1-47)+INT(VAL(POZ3)))<=10 + poz2=CHR(val1+INT(VAL(POZ3))) + ELSE + poz2=CHR(val1+INT(VAL(POZ3))-10) + ENDIF + CASE val1>=65 AND val1<=90 + IF ((val1-64)+2*INT(VAL(POZ3)))<=26 + poz2=CHR(val1+2*INT(VAL(POZ3))) + ELSE + poz2=CHR(val1+2*INT(VAL(POZ3))-26) + ENDIF + ENDCASE + LRET2=LRET2+poz2 + ENDFOR + FOR i=1 TO lens + poz1=SUBSTR(LRET2,i,1) + val1=ASC(poz1) + DO CASE + CASE val1>=48 AND val1<=57 + IF ((val1-47)+i)<=10 + poz2=CHR(val1+i) + ELSE + poz2=CHR(val1+i-10) + ENDIF + CASE val1>=65 AND val1<=90 + IF ((val1-64)+2*i)<=26 + poz2=CHR(val1+2*i) + ELSE + poz2=CHR(val1+2*i-26) + ENDIF + ENDCASE + lret=lret+poz2 + ENDFOR + lens=LEN(lret) + FOR i=1 TO lens + poz1=SUBSTR(lret,i,1) + val1=ASC(poz1) + DO CASE + CASE val1>=48 AND val1<=57 + poz2=CHR(val1+17)&& din 0-9 in A-J + CASE val1>=65 AND val1<=74 + poz2=CHR(val1-17)&& din A-J in 0-9 + CASE val1>=75 AND val1<=82 + poz2=CHR(val1+8)&&din K-R in S-Z + CASE val1>=83 AND val1<=90 + poz2=CHR(val1-8)&&din S-Z in K-R + ENDCASE + lret1=lret1+poz2 + ENDFOR + RETURN lret1 +*********** +&&transformarea in decimal a unui caracter hexa +FUNCTION HEXDEC + LPARAMETERS LC + LOCAL LV + DO CASE + CASE LC=='0' + LV='0' + CASE LC=='1' + LV='1' + CASE LC=='2' + LV='2' + CASE LC=='3' + LV='3' + CASE LC=='4' + LV='4' + CASE LC=='5' + LV='5' + CASE LC=='6' + LV='6' + CASE LC=='7' + LV='7' + CASE LC=='8' + LV='8' + CASE LC=='9' + LV='9' + CASE LC=='A' + LV='10' + CASE LC=='B' + LV='11' + CASE LC=='C' + LV='12' + CASE LC=='D' + LV='13' + CASE LC=='E' + LV='14' + CASE LC=='F' + LV='15' + ENDCASE + RETURN LV +**************** +&&codarea binara din hexa pe patru biti +FUNCTION DECTOBIN + PARAMETERS sc + LOCAL lretf + DO CASE + CASE sc=='0' + lretf='0000' + CASE sc=='1' + lretf='0001' + CASE sc=='2' + lretf='0010' + CASE sc=='3' + lretf='0011' + CASE sc=='4' + lretf='0100' + CASE sc=='5' + lretf='0101' + CASE sc=='6' + lretf='0110' + CASE sc=='7' + lretf='0111' + CASE sc=='8' + lretf='1000' + CASE sc=='9' + lretf='1001' + CASE sc=='10' + lretf='1010' + CASE sc=='11' + lretf='1011' + CASE sc=='12' + lretf='1100' + CASE sc=='13' + lretf='1101' + CASE sc=='14' + lretf='1110' + CASE sc=='15' + lretf='1111' + ENDCASE + RETURN lretf +*********** +FUNCTION ECARACTER + PARAMETERS strg1 + PRIVATE pz,ch,lcstring,vret,lg1 + STORE 0 TO pz,lg1 + STORE '' TO ch,lcstring + STORE .T. TO vret + lcstring=UPPER(strg1) + lg1=LEN(lcstring) + FOR ind1=1 TO lg1 + ch=SUBSTR(lcstring,ind1,1) + IF (NOT BETWEEN(ASC(ch),48,57)) AND (NOT BETWEEN(ASC(ch),65,90)) + vret=.F. + EXIT + ENDIF + ENDFOR + RETURN vret +************ +FUNCTION sircaracter + PARAMETERS strg1 + PRIVATE pz,ch,lcstring,vret,lg1,lciesire + STORE 0 TO pz,lg1 + STORE '' TO ch,lcstring,lciesire + STORE .T. TO vret + strg1=STRTRAN(strg1,ALLTRIM(CHR(39)),'')&&caracterul ' + strg1=STRTRAN(strg1,ALLTRIM(CHR(39)),'')&&caracterul " + lcstring=UPPER(ALLTRIM(strg1)) + lg1=LEN(lcstring) + FOR ind1=1 TO lg1 + ch=SUBSTR(lcstring,ind1,1) + IF BETWEEN(ASC(ch),48,57) OR BETWEEN(ASC(ch),65,90) + lciesire=lciesire+ch + ENDIF + ENDFOR + RETURN lciesire + + + +***------------------------------------- +PROCEDURE _DEBUG + + PRIVATE lcret,lcfisier,lcPath,lccalewin + DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ; + INTEGER hwndOwner, ; + INTEGER nFolder, ; + INTEGER hToken, ; + INTEGER dwFlags, ; + STRING @ pszPath + DECLARE INTEGER GetActiveWindow IN WIN32API + #DEFINE CSIDL_WINDOWS 36 + + + lcPath = REPL(CHR(0),261) + =SHGetFolderPath(GetActiveWindow(),CSIDL_WINDOWS,0,0,@lcPath) + lccalewin=LEFT(lcPath,AT(CHR(0),lcPath)-1) + + lcret=.F. + lcfisier=ADDBS(lccalewin)+[DEBUG.TXT] + + IF FILE(lcfisier) + LCVAL=FILETOSTR(lcfisier) + + LNVAL1=MOD(VAL(RIGHT(LCVAL,1)),2) && restul 1 sau 0; daca e impar e 1 + lnval2=VAL(LEFT(LCVAL,LEN(LCVAL)-1)) + IF LNVAL1=1 OR YEAR(DATE())-MONTH(DATE())=lnval2 + lcret=.T. + ENDIF + ENDIF + RETURN lcret + +ENDPROC + + +FUNCTION Start_Nou + + RETURN Exista_Branch(,,dirgen) + +ENDFUNC && start_nou + +PROCEDURE Debug_Start + + lcFile = gcAppPath + "debug.txt" + + IF FILE(lcFile) OR !Start_Nou() + RETURN .T. + ENDIF + RETURN .F. + +ENDPROC && Debug_Start +************************************************************************ +PROCEDURE verificari + PARAMETERS tcFisierVerif + + lcverificari = ADDBS(gcAppPath)+gcAppName+".txt" + + + IF FILE(lcverificari) + RETURN .T. + ENDIF + RETURN .F. + +ENDPROC && verificari diff --git a/Programe/Vechi/init_optiuni.prg b/Programe/Vechi/init_optiuni.prg new file mode 100644 index 0000000..e9a4def --- /dev/null +++ b/Programe/Vechi/init_optiuni.prg @@ -0,0 +1,191 @@ +lcOldAlias=Alias() + +*------------------------------------------------------------------- + +*-- COMPLETEZ FISIERUL DE OPTIUNI cu valorile default (OPTIUNILE SE AFLA ACUM IN DIRGEN\PROGRAM\, AR PUTEA SA SE AFLE SI IN FIRMA\DATEAN) +LCFIS_OPT_P="OPTIUNI_PROGRAM" +LCFIS_OPT_F="OPTIUNI_FIRMA" +LCFIS_OPT_L="OPTIUNI_LOCAL" + + +IF !USED(LCFIS_OPT_P) OR !USED(LCFIS_OPT_F) OR !USED(LCFIS_OPT_L) + DO mesaj WITH 'Nu exista fisierele '+ LCFIS_OPT_P + ' ' + LCFIS_OPT_F + ' ' + LCFIS_OPT_L,'Sugeram iesirea din program!' + QUIT +ENDIF + + Select (LCFIS_OPT_P) + + + *** variabile care se reinitializeaza la inceputul programului automat + Loca For Allt(Lower(varname))='eroripath' + If !Found() + Appe Blan + Endif + Repl varname With 'EroriPath',Vartype With "CHARACTER",varvalue With gcAppPath+"Erori\",vardesc With "Calea catre tabelul " + + lcDir=gcAppPath+"Erori" + If !Directory(lcDir) + Md (lcDir) + Endif + +**** OPTIUNI LOCALE + + Select (LCFIS_OPT_L) + + *** + Loca For Allt(Lower(varname))='nl' + If !Found() + Appe Blan + Endif + Repl varname With 'NL',Vartype With "CHARACTER",varvalue With m.nl,vardesc With "Luna contabila curenta" + *** + Loca For Allt(Lower(varname))='an' + If !Found() + Appe Blan + Endif + Repl varname With 'AN',Vartype With "CHARACTER",varvalue With m.an,vardesc With "Anul contabil curent" + + *** + + + Loca For Allt(Lower(varname))='date' + If !Found() + Appe Blan + Endif + Repl varname With 'Date',Vartype With "CHARACTER",varvalue With Addbs(Strtran(Allt(Date),"\\","\")),vardesc With "Directorul cu datele lunare" + + Loca For Allt(Lower(varname))='datean' + If !Found() + Appe Blan + Endif + Repl varname With 'Datean',Vartype With "CHARACTER",varvalue With Addbs(Strtran(Allt(datean),"\\","\")),vardesc With "Directorul cu datele generale" + + Loca For Allt(Lower(varname))='calefirma' + If !Found() + Appe Blan + Endif + Repl varname With 'calefirma',Vartype With "CHARACTER",varvalue With Addbs(Strtran(Allt(calefirma),"\\","\")),vardesc With "Directorul firmei" + + Loca For Allt(Lower(varname))='fscurt' + If !Found() + Appe Blan + Endif + Repl varname With 'fscurt',Vartype With "CHARACTER",varvalue With ALLTRIM(nfscurt),vardesc With "Directorul firmei" + + + Loca For Allt(Lower(varname))='caletempo' + If !Found() + Appe Blan + Endif + Repl varname With 'caletempo',Vartype With "CHARACTER",varvalue With Addbs(Strtran(ALLTRIM(loc)+"\"+ALLTRIM(nfscurt)+"\tempo\","\\","\")),vardesc With "Directorul \temp\firma\tempo" + + Loca For Allt(Lower(varname))='caletemp' + If !Found() + Appe Blan + Endif + Repl varname With 'caletemp',Vartype With "CHARACTER",varvalue With Addbs(ALLTRIM(loc)),vardesc With "Directorul \temp\" + +**** OPTIUNI FIRMA + + Select (LCFIS_OPT_F) + + LOCATE FOR LOWER(ALLTRIM(varname))='campsectie' + If !Found() + Appe Blan + Repl varname With 'CampSectie',Vartype With "LOGICAL",varvalue With "T",vardesc With "Daca se introduce campul 'sectie'" + ENDIF + + LOCATE FOR LOWER(ALLTRIM(varname))='imobindependent' + If !Found() + Appe Blan + Repl varname With 'ImobIndependent',Vartype With "LOGICAL",varvalue With "F",vardesc With "Daca Imob independent de Cont" + ENDIF + + LOCATE FOR LOWER(ALLTRIM(varname))='dataron' + If !Found() + Appe Blan + Repl varname With 'dataRON',Vartype With "CHARACTER",varvalue With "07-2005",vardesc With "Data trecerii la leul greu" + lcDataRon = [07-2005] + ELSE + lcDataRon = ALLTRIM(varvalue) + ENDIF + +*!* IF 12*VAL(SUBSTR(lcDataRon,4,4))+VAL(LEFT(lcDataRon,2)) <= 12*VAL(m.an)+VAL(m.nl) +*!* lnValue = 2 +*!* ELSE +*!* lnValue = 0 +*!* ENDIF +*!* PUBLIC gnz +*!* gnz=lnValue + +lnnr_fis=3 +Dimension a[lnnr_fis] +a[1]=LCFIS_OPT_P +a[2]=LCFIS_OPT_F +a[3]=LCFIS_OPT_L +*!* a[4]=LCFIS_OPT_FL + +For i=1 To lnnr_fis + *-- DECLAR VARIABILELE PUBLICE SI LE INITIALIZEZ ex: pcEroriPath,pcServerPath + lcfis=a[i] + + Select(lcfis) + Scan For !Empty(varname) + lcvarname = Alltrim(&LCFIS..varname) + lcvartype = Upper(Alltrim(&LCFIS..Vartype)) + Do Case + Case lcvartype = "CHARACTER" + Public gc&lcvarname. + luvarvalue = Alltrim(&LCFIS..varvalue) + gc&lcvarname. = luvarvalue + Case lcvartype = "CURRENCY" + Public gy&lcvarname. + luvarvalue = Ntom(Val(&LCFIS..varvalue)) + gy&lcvarname. = luvarvalue + Case lcvartype = "NUMERIC" + Public gn&lcvarname. + luvarvalue = Val(&LCFIS..varvalue) + gn&lcvarname. = luvarvalue + Case lcvartype = "DATETIME" + Public gt&lcvarname. + luvarvalue = Ctot(&LCFIS..varvalue) + gt&lcvarname. = luvarvalue + Case lcvartype = "DATE" + Public gd&lcvarname. + luvarvalue = Ctod(&LCFIS..varvalue) + gd&lcvarname. = luvarvalue + Case lcvartype = "LOGICAL" + Public gl&lcvarname. + luvarvalue = Iif(Inlist(Upper(Left(&LCFIS..varvalue, 1)), "T", "Y"), .T., .F.) + gl&lcvarname. = luvarvalue + Otherwise + pcmsgbuff = "Tip de variabila globala invalid!" + pcmsgbuff = pcmsgbuff + Chr(13) + Chr(13) + "Numele variabilei: " + lcvarname + pcmsgbuff = pcmsgbuff + Chr(13) + "Tipul variabilei: " + lcvartype + pcmsgbuff = pcmsgbuff + Chr(13) + Chr(13) + "Contactati suportul tehnic." + =Messagebox(pcmsgbuff, 48) + pcmsgbuff = "" + Endcase + Endscan +Endfor + +PUBLIC gnZ, gnPcurs, gnPpret + +IF 12*VAL(SUBSTR(gcDataRon,4,4))+VAL(LEFT(gcDataRon,2)) <= 12*VAL(m.an)+VAL(m.nl) + IF 12*VAL(SUBSTR(gcDataRon,4,4))+VAL(LEFT(gcDataRon,2)) = 12*VAL(m.an)+VAL(m.nl) AND !verific_rolronsnr(gcCalefirma) + lnValue = 0 + gnPcurs = 0 + ELSE + lnValue = 2 + gnPcurs = 4 + ENDIF +ELSE + lnValue = 0 + gnPcurs = 0 +ENDIF +gnPpret = 3 +gnZ=lnValue + +IF !EMPTY(lcOldAlias) + Select (lcOldAlias) +ENDIF diff --git a/Programe/Vechi/init_program.prg b/Programe/Vechi/init_program.prg new file mode 100644 index 0000000..dad771f --- /dev/null +++ b/Programe/Vechi/init_program.prg @@ -0,0 +1,370 @@ +&& ------------------------------INCEPUT: Citeste_Cheie ------------------------------ +*!* Functie: Citeste_Cheie +*!* Parametri: tcKey, tcBranch, tcLeafe +*!* Data/Ora generarii: 16/02/2004 14:26:22 +*!* Autor: MARIUS.MUTU +FUNCTION Citeste_Cheie + LPARAMETERS tcKey, tnBranch, tcLeafe + + LOCAL lcRet,loApi, lcKey, lnBranch, lcLeafe + + lcKey = ALLTRIM(tcKey) + lnBranch = tnBranch + lcLeafe = ALLTRIM(tcLeafe) + lcRet = [] + + loApi = CREATE("registry") + + IF loApi.iskey(lcKey, lnBranch) + + loApi.openkey(lcKey, lnBranch,.F.) + lcRet = loApi.getkeyvalue(lcLeafe,) + ENDIF + + RELEASE loApi + RETURN lcRet + +ENDFUNC +&& ------------------------------SFARSIT: Citeste_Cheie ------------------------------ + +&& ------------------------------INCEPUT: Exista_Branch ------------------------------ +*!* Functie: Exista_Branch +*!* Parametri: tcKey +*!* Data/Ora generarii: 18/02/2004 14:01:29 +*!* Autor: MARIUS.MUTU +FUNCTION Exista_Branch +LPARAMETERS tcKey, tnBranch,tcCale + + +LOCAL lcRet,loApi, lcKey, lnBranch + +lccale="serverdate_"+STRTRAN(tccale,"\","") + +IF EMPTY(tcKey) + lcKey = [contafin\] + lcCale + [\util] +ELSE + lcKey = ALLTRIM(tcKey) +ENDIF + +IF EMPTY(tnBranch) + lnBranch = -2147483647 +ELSE + lnBranch = tnBranch +ENDIF + + +llRet = .F. +loApi = CREATE("registry") +IF loApi.iskey(lcKey, lnBranch) + llret = .T. +ENDIF + +RELEASE loApi + +RETURN llRet + +ENDFUNC +&& ------------------------------SFARSIT: Exista_Branch ------------------------------ + +&& ------------------------------INCEPUT: Verific_Start ------------------------------ +*!* Functia: Verific_Start +*!* Parametri: tcParam +*!* Data/Ora generarii: 16/02/2004 13:32:11 +*!* Autor: MARIUS.MUTU +*!* returneza TRUE daca parametrul trimis codat in binar este egal cu variabila citita din registri +FUNCTION Verific_Start + LPARAMETERS tcSesiune,tccale,tcAppName + + LOCAL llRet,loApi, lcKey, lnBranch, lcSesiune + + lccale="serverdate_"+STRTRAN(tccale,"\","") + IF EMPTY(tcAppName) + lcAppName = JUSTSTEM(SYS(16,0)) + ELSE + lcAppName = ALLTRIM(tcAppName) + ENDIF + + llRet = .T. + lcKey = [contafin\]+lccale+[\util] + lnBranch = -2147483647 + lcLeafe = [session] + lcSesiune = [] + + IF EMPTY(tcSesiune) + llRet = .F. + ELSE + lcSesiune = tcSesiune + +*!* lcSesiune1 = citeste_cheie(lcKey, lnBranch, lcLeafe) + lcSesiune2 = VAL(Citeste_Cheie(lcKey, lnBranch, lcLeafe)) + lcSesiune3 = BINTOC(lcSesiune2,4) + lcsesiune1=SUBSTR(lcSesiune3,1,1)+SUBSTR(lcSesiune3,3,2) +*!* IF EMPTY(lcSesiune1) +*!* lcSesiune1 = [] +*!* ENDIF + + lcsesiune1 = STUFF(lcsesiune1,2,0,lcAppName) + IF SYS(2007,ALLTRIM(UPPER(lcSesiune))) # SYS(2007,ALLTRIM(UPPER(lcsesiune1))) + llRet = .F. + + ENDIF + ENDIF + + + RETURN llRet + +ENDFUNC +&& ------------------------------SFARSIT: Verific_Start ------------------------------ + +&& ------------------------------INCEPUT: Init_Cale_Temp------------------------------ +*!* Functia: Init_Cale_Temp +*!* Parametri: +*!* Data/Ora generarii: 16/02/2004 13:32:11 +*!* Autor: MARIUS.MUTU +*!* citeste directorul temporar din registrii si il creeaza +FUNCTION Init_Cale_Temp + PARAMETERS tccale +* lccale="serverdate_"+STRTRAN(tccale,"\","") + + LOCAL lcTempPath,loApi, lcKey, lnBranch, lcSesiune + llRet = .T. + lcKey = [contafin\temporare] +* lcKey = [contafin\]+lccale+[\temporare] + lnBranch = -2147483647 + lcLeafe = [temp] + + + lcTempPath=Citeste_Cheie(lcKey, lnBranch, lcLeafe) + + RETURN lcTempPath + +ENDFUNC +&& ------------------------------SFARSIT: Init_Cale_Temp------------------------------ + +&& ------------------------------INCEPUT: Init_Cale_Server_Date ------------------------------ +*!* Functia: Init_Cale_Server_Date +*!* Parametri: +*!* Data/Ora generarii: 16/02/2004 13:32:11 +*!* Autor: MARIUS.MUTU +*!* citeste calea serverului de date din registri +FUNCTION Init_Cale_Server_Date + PARAMETERS tccale + lccale="serverdate_"+STRTRAN(tccale,"\","") + LOCAL lcCaleServerDate, loApi, lcKey, lnBranch, lcSesiune + lcCaleServerDate= [] + lcKey = [contafin\]+lccale + lnBranch = -2147483647 + lcLeafe = [cale] + + + lcCaleServerDate=Citeste_Cheie(lcKey, lnBranch, lcLeafe) + + + RETURN lcCaleServerDate + +ENDFUNC +&& ------------------------------SFARSIT: Init_Cale_Server_Date ------------------------------ + +&& ------------------------------INCEPUT: Init_Nume_Utilizator ------------------------------ +*!* Functia: Init_Nume_Utilizator +*!* Parametri: +*!* Data/Ora generarii: 16/02/2004 13:32:11 +*!* Autor: MARIUS.MUTU +*!* citeste numele utilizatorului logat la START din registri +FUNCTION Init_Nume_Utilizator + PARAMETERS tccale + + LOCAL lcNumeUtilizator, loApi, lcKey, lnBranch, lcSesiune + + lccale="serverdate_"+STRTRAN(tccale,"\","") + lcNumeUtilizator = [] + lcKey = [contafin\]+lccale+[\util] + lnBranch = -2147483647 + lcLeafe = [nume] + + + lcNumeUtilizator=Citeste_Cheie(lcKey, lnBranch, lcLeafe) + + + RETURN lcNumeUtilizator + +ENDFUNC +&& ------------------------------SFARSIT: Init_Nume_Utilizator------------------------------ + +&& ------------------------------INCEPUT: Init_Nivel_Utilizator ------------------------------ +*!* Functia: Init_Nivel_Utilizator +*!* Parametri: +*!* Data/Ora generarii: 16/02/2004 13:32:11 +*!* Autor: MARIUS.MUTU +*!* citeste nivelul utilizatorului logat la START din registri +FUNCTION Init_Nivel_Utilizator + PARAMETERS tccale + lccale="serverdate_"+STRTRAN(tccale,"\","") + LOCAL lcNivelUtilizator, loApi, lcKey, lnBranch, lcSesiune + lcNumeUtilizator = [] + lcKey = [contafin\]+lccale+[\prog\]+gcAppName + lnBranch = -2147483647 + lcLeafe = [nivel] + + + lcNivelUtilizator=Citeste_Cheie(lcKey, lnBranch, lcLeafe) + + + RETURN lcNivelUtilizator + +ENDFUNC +&& ------------------------------SFARSIT: Init_Nume_Utilizator------------------------------ + +&& ------------------------------INCEPUT: Init_Nume_Statie------------------------------ +*!* Functia: Init_Nume_Statie +*!* Parametri: +*!* Data/Ora generarii: 16/02/2004 13:32:11 +*!* Autor: MARIUS.MUTU +*!* citeste numele statiei +FUNCTION Init_Nume_Statie + PARAMETERS tccale + lccale="serverdate_"+STRTRAN(tccale,"\","") + LOCAL lcNumeStatie, loApi, lcKey, lnBranch + lcNumeStatie= [] + lcKey = [contafin\]+lccale + lnBranch = -2147483647 + lcLeafe = [numestatie] + + + lcNumeStatie=Citeste_Cheie(lcKey, lnBranch, lcLeafe) + + + RETURN lcNumeStatie + +ENDFUNC +&& ------------------------------SFARSIT: Init_Nume_Statie + +&& ------------------------------INCEPUT: Init_NumeAlternativ------------------------------ +*!* Functia: Init_NumeAlternativ +*!* Parametri: +*!* Data/Ora generarii: 18/02/2004 16:29:11 +*!* Autor: MARIUS.MUTU +*!* citeste nume2 ex: (CONT2003) CASA +FUNCTION Init_NumeAlternativ + PARAMETERS tccale,tcAppName + LOCAL lcNumeAlternativ, loApi, lcKey, lnBranch + lccale="serverdate_"+STRTRAN(tccale,"\","") + IF EMPTY(tcAppName) + lcAppName = JUSTSTEM(SYS(16,0)) + ELSE + lcAppName = ALLTRIM(tcAppName) + ENDIF + + lcNumeAlternativ= [] +* lcKey = [contafin\prog\]+gcAppName + lcKey = [contafin\]+lccale+[\prog\]+lcAppName + lnBranch = -2147483647 + lcLeafe = [nume2] + + + lcNumeAlternativ = Citeste_Cheie(lcKey, lnBranch, lcLeafe) + + + RETURN lcNumeAlternativ + +ENDFUNC +&& ------------------------------SFARSIT: Init_NumeAlternativ + +&& ------------------------------INCEPUT: Start_Istoric ------------------------------ +*!* Functie: Start_Istoric +*!* Parametri: tcNumeUtilizator, tcNumeProgram, tcNumeStatie +*!* Data/Ora generarii: 08/03/2004 15:31:58 +*!* Autor: MARIUS.MUTU +FUNCTION Start_Istoric + LPARAMETERS tcNumeUtilizator, tcNumeProgram, tcNumeStatie, tcCaleIstoric, tcNumeIstoric, tcNumeIds + + lcNumeUtilizator = ALLTRIM(tcNumeUtilizator) + lcNumeProgram = ALLTRIM(tcNumeProgram) + lcNumeStatie = ALLTRIM(tcNumeStatie) + lcCaleIstoric = ADDBS(tcCaleIstoric) + lcNumeIstoric = ALLTRIM(tcNumeIstoric) + lcNumeIds = ALLTRIM(tcNumeIds) + + lcNume = ALLTRIM(lcNumeIstoric) + lcFile = ADDBS(lcCaleIstoric) + lcNumeIstoric + ".dbf" + + IF !FILE(lcFile) + RETURN + ENDIF + + llUsed = .T. + IF !USED('Istoric') + USE (lcFile) IN 0 SHARED AGAIN ALIAS Istoric + llUsed = .F. + ENDIF + + lcFile = ADDBS(lcCaleIstoric) + lcNumeIDS + ".dbf" + IF !FILE(lcFile) + RETURN + ENDIF + + llUsed2 = .T. + IF !USED('ids') + USE (lcFile) IN 0 SHARED AGAIN ALIAS Ids + llUsed2 = .F. + ENDIF + + lnNewId = new_id("istoric","id",.T.) + SELECT Istoric + IF FLOCK() + APPEND BLANK + REPLACE ID WITH lnNewId, statie WITH lcNUMESTATIE, PROGRAM WITH lcNumeProgram, utilizator WITH lcNumeUtilizator, dataoraint WITH DATETIME() + UNLOCK + ENDIF + + IF !llUsed + USE IN Istoric + ENDIF + + IF !llUsed2 + USE IN ids + ENDIF + + RETURN lnNewId + +ENDFUNC +&& ------------------------------SFARSIT: Start_Istoric ------------------------------ + +&& ------------------------------INCEPUT: End_Istoric ------------------------------ +*!* Functie: End_Istoric +*!* Parametri: tnIdIstoric +*!* Data/Ora generarii: 08/03/2004 15:51:32 +*!* Autor: MARIUS.MUTU +FUNCTION End_Istoric + LPARAMETERS tnIdIstoric, tcCaleIstoric, tcNumeIstoric + + lcCaleIstoric = ADDBS(tcCaleIstoric) + lcNumeIstoric = ALLTRIM(tcNumeIstoric) + + lcNume = ALLTRIM(lcNumeIstoric) + lcFile = ADDBS(lcCaleIstoric) + lcNume + ".dbf" + IF !FILE(lcFile) + RETURN + ENDIF + + llUsed = .T. + IF !USED('Istoric') + USE (lcFile) IN 0 SHARED AGAIN ALIAS Istoric + llUsed = .F. + ENDIF + + SELECT Istoric + LOCATE FOR ID = tnIdIstoric + IF FOUND() + IF FLOCK() + REPLACE dataoraies WITH DATETIME() + UNLOCK + ENDIF + ENDIF + + IF !llUsed + USE IN Istoric + ENDIF + +ENDFUNC +&& ------------------------------SFARSIT: End_Istoric ------------------------------ diff --git a/Programe/Vechi/proc_menu.prg b/Programe/Vechi/proc_menu.prg new file mode 100644 index 0000000..ad75faf --- /dev/null +++ b/Programe/Vechi/proc_menu.prg @@ -0,0 +1,1132 @@ +PROCEDURE jurnal + IF USED('xmf') + USE IN xmf + ENDIF + USE &DATE\mflun ALIAS xmf IN 0 SHARED AGAIN + SELECT xmf +* INDEX ON denumire+ALLTRIM(nrinv)+DTOS(dataora) TAG numeinv OF &LOC\&NFSCURT\TEMPO\mfj + primadata1=.F. + PRIVATE pnsuma1,pnsuma2 + STORE 0 TO pnsuma1,pnsuma2 + SELECT xmf + omisc=CREATEOBJECT('jurnal_nou') + omisc.gridb1.column5.inputmask = get_mask(12,gnZ) + omisc.gridb1.column28.inputmask = get_mask(12,gnZ) + omisc.gridb1.column19.inputmask = get_mask(12,gnZ) + omisc.gridb1.column20.inputmask = get_mask(12,gnZ) + omisc.gridb1.column29.inputmask = get_mask(12,gnZ) + omisc.gridb1.column13.inputmask = get_mask(12,gnZ) + omisc.gridb1.column15.inputmask = get_mask(12,gnZ) + omisc.gridb1.column16.inputmask = get_mask(12,gnZ) + omisc.gridb1.column30.inputmask = get_mask(12,gnZ) + omisc.SHOW(1) +ENDPROC +*---------------------------------------------- +PROCEDURE jurnal_total + IF USED('xmf') + USE IN xmf + ENDIF + USE &CALEFIRMA\DATEAN\mfanual ALIAS xmf IN 0 SHARED AGAIN + SELECT xmf +* INDEX ON denumire+ALLTRIM(nrinv)+DTOS(dataora) TAG numeinv OF &LOC\&NFSCURT\TEMPO\mfj + primadata1=.F. + + PRIVATE pnsuma1,pnsuma2 + STORE 0 TO pnsuma1,pnsuma2 + + SELECT xmf + omisc=CREATEOBJECT('jurnal_nou') + omisc.titlufrumos1.caption='JURNAL TOTAL' + omisc.gridb1.column5.inputmask = get_mask(12,gnZ) + omisc.gridb1.column28.inputmask = get_mask(12,gnZ) + omisc.gridb1.column19.inputmask = get_mask(12,gnZ) + omisc.gridb1.column20.inputmask = get_mask(12,gnZ) + omisc.gridb1.column29.inputmask = get_mask(12,gnZ) + omisc.gridb1.column13.inputmask = get_mask(12,gnZ) + omisc.gridb1.column15.inputmask = get_mask(12,gnZ) + omisc.gridb1.column16.inputmask = get_mask(12,gnZ) + omisc.gridb1.column30.inputmask = get_mask(12,gnZ) + omisc.SHOW(1) +ENDPROC +*___________________________________________ +PROCEDURE introducere_in_curs + + LOCAL lcmax + + STORE '' TO m.denumire, m.nrinv, m.numegest, m.respons, m.nrord + STORE 0 TO m.nract,m.valoare + STORE DATE() TO dataact + m.scd=' 231' + + SELE mf + + CALCULATE MAX(VAL(nrinv)) FOR ALLTRIM(UPPER(fel)) == "C" TO lcmax + lnmax = lcmax + 1 + m.nrinv = ALLTRIM(STR(lnmax)) + + ov=CREATE('incurs') + ov.cmdlist2.VISIBLE=.F. + ov.titlufrumos1.CAPTION='Introducere Imobilizari in Curs' + ov.text4.inputmask = get_mask(12,gnZ) + ov.SHOW(1) + + IF buton=2 + RETURN + ENDIF + + IF EMPTY(m.valoare) OR EMPTY(m.nract) OR EMPTY(m.nrinv) + DO mesaj WITH 'Nu s-a inregistrat aceasta imobilizare','din lipsa de date.' + RETURN + ENDIF + SELE mf + m.cod=-1 + APPE BLANK + IF FLOCK() + GATHER MEMVAR + REPLACE fel WITH 'C' + ENDIF + UNLOCK + + SELECT mflun + APPEND BLANK + IF FLOCK() + GATHER MEMVAR + REPLACE explicatia WITH 'Introducere',dataora WITH DATETIME() + REPLACE codop WITH 2 + ENDIF + UNLOCK + + SELECT mfanual + APPEND BLANK + IF FLOCK() + GATHER MEMVAR + REPLACE explicatia WITH 'Introducere',dataora WITH DATETIME() + REPLACE codop WITH 2 + ENDIF + UNLOCK + + buton=1 + odanu=CREATEOBJ('danu') + odanu.SHOW(1) + IF buton==2 + RETURN + ELSE + DO introducere_in_curs + ENDIF +ENDPROC && introducere_in_curs + +*______________________________________________ + +PROCEDURE preluare_corporale +*!* SELECT DISTINCT cod, fdoc, dataact, nract, nume, explicatia, scd, ascd, SUMA ; +*!* FROM act WHERE LEFT(scd, 2) = '21' AND LEFT(scc, 3) # '231' INTO CURSOR actcs +*!* STORE 1 TO m.tipcalcul + + SELECT mf + SCATTER MEMVAR BLANK + + SELECT DISTINCT act.cod,act.fdoc,act.dataact,act.nract,act.nume,act.explicatia,act.scd,act.SUMA, 0 as intr ; + FROM act WHERE LEFT(act.scd,2)='21' AND LEFT(act.scc,3)#'231' AND act.nract#0 INTO CURSOR actcs READWRITE + + IF _tally # 0 + SELECT actcs + SCAN + SCATTER NAME oact + lnVal = 0 + SELECT mf + SUM valoare FOR EMPTY(fel) AND nract = oact.nract AND dataact = oact.dataact AND scd = oact.scd AND !inactiv TO lnVal + DO CASE + CASE lnVal = 0 + lnIntr = 0 + CASE lnVal = oact.suma + lnIntr = 1 + CASE lnVal # oact.suma + lnIntr = 2 + ENDCASE + SELECT actcs + REPLACE intr WITH lnIntr + ENDSCAN + ENDIF + + STORE 1 TO m.tipcalcul + STORE '' TO nrord + PRIVATE INTRODUSTOT + INTRODUSTOT=.F. + OI=CREATE('frm_preluare') + OI.FEL_IMOB='C' + *OI.label10.CAPTION="INTRODUCERE IMOBILIZARI CORPORALE in luna" + oi.titlufrumos1.CAPTION="INTRODUCERE IMOBILIZARI CORPORALE in luna" + oi.text4.inputmask = get_mask(12,gnZ) + oi.grid1.column6.inputmask = get_mask(12,gnZ) + OI.SHOW(1) +ENDPROC && preluare_corporale + +*______________________________________________ +PROCEDURE preluare_necorporale +*!* SELECT DISTINCT cod, fdoc, dataact, nract, nume, explicatia, scd, ascd, SUMA ; +*!* FROM act WHERE LEFT(scd, 2) = '20' AND LEFT(scc, 3) # '233' INTO CURSOR actcs +*!* STORE 1 TO m.tipcalcul + + SELECT mf + SCATTER MEMVAR BLANK + SELECT DISTINCT act.cod,act.fdoc,act.dataact,act.nract,act.nume,act.explicatia,act.scd,act.SUMA, 0 as intr ; + FROM act WHERE LEFT(act.scd,2)='20' AND LEFT(act.scc,3)#'233' AND act.nract#0 INTO CURSOR actcs READWRITE + + IF _tally # 0 + SELECT actcs + SCAN + SCATTER NAME oact + lnVal = 0 + SELECT mf + SUM valoare FOR fel = 'N' AND nract = oact.nract AND dataact = oact.dataact AND scd = oact.scd AND !inactiv TO lnVal + DO CASE + CASE lnVal = 0 + lnIntr = 0 + CASE lnVal = oact.suma + lnIntr = 1 + CASE lnVal # oact.suma + lnIntr = 2 + ENDCASE + SELECT actcs + REPLACE intr WITH lnIntr + ENDSCAN + ENDIF + + STORE 1 TO m.tipcalcul + PRIVATE INTRODUSTOT + INTRODUSTOT=.F. + OI=CREATE('frm_preluare') + OI.FEL_IMOB='N' + *OI.label10.CAPTION="INTRODUCERE IMOBILIZARI NECORPORALE in luna" + oi.titlufrumos1.CAPTION="INTRODUCERE IMOBILIZARI NECORPORALE in luna" + oi.text4.inputmask = get_mask(12,gnZ) + oi.grid1.column6.inputmask = get_mask(12,gnZ) + OI.SHOW(1) +ENDPROC && preluare_necorporale + +*______________________________________________ + +PROCEDURE preluare_incurs +*!* SELECT DISTINCT cod, fdoc, dataact, nract, nume, explicatia, scd, ascd, SUMA ; +*!* FROM act WHERE INLIST(LEFT(scd,3),'231','233') INTO CURSOR actcs + SELECT mf + SCATTER MEMVAR BLANK + SELECT DISTINCT act.cod,act.fdoc,act.dataact,act.nract,act.nume,act.explicatia,act.scd,act.SUMA, 0 as intr ; + FROM act WHERE INLIST(LEFT(act.scd,3),'231','233') AND act.nract#0 INTO CURSOR actcs READWRITE + + IF _tally # 0 + SELECT actcs + SCAN + SCATTER NAME oact + lnVal = 0 + SELECT mf + SUM valoare FOR fel = 'C' AND nract = oact.nract AND dataact = oact.dataact AND scd = oact.scd TO lnVal + DO CASE + CASE lnVal = 0 + lnIntr = 0 + CASE lnVal = oact.suma + lnIntr = 1 + CASE lnVal # oact.suma + lnIntr = 2 + ENDCASE + SELECT actcs + REPLACE intr WITH lnIntr + ENDSCAN + ENDIF + + M.ID_SECTIE=0 + PRIVATE INTRODUSTOT + INTRODUSTOT=.F. + OI=CREATE('frm_preluare_in_curs') + *OI.label10.CAPTION="INTRODUCERE IMOBILIZARI IN CURS in luna" + oi.titlufrumos1.CAPTION="INTRODUCERE IMOBILIZARI IN CURS in luna" + oi.text4.inputmask = get_mask(12,gnZ) + oi.grid1.column6.inputmask = get_mask(12,gnZ) + OI.SHOW(1) +ENDPROC && preluare_incurs + +*______________________________________________ + +PROCEDURE introducere_corporale + SELECT mf + SCATTER MEMVAR BLANK + + CALCULATE MAX(VAL(nrinv)) FOR EMPTY(fel) TO lcmax + lnmax = lcmax+1 + m.nrinv = ALLTRIM(STR(lnmax)) + + STORE 0 TO m.valrez + STORE 1 TO m.tipcalcul + PRIVATE M.ID_SECTIE + STORE '' TO m.id_sectie + + opr=CREATEOBJECT('preluare') + opr.FEL_IMOB='C' + opr.titlufrumos1.CAPTION="Introducere imobilizari corporale" + opr.label30.visible=.f. + opr.optiongroup1.visible=.f. + opr.text4.inputmask = get_mask(12,gnZ) + opr.txt15.inputmask = get_mask(12,gnZ) + opr.text22.inputmask = get_mask(12,gnZ) + opr.SHOW(1) +ENDPROC && introducere_corporale + +*______________________________________________ + +PROCEDURE introducere_necorporale + SELECT mf + SCATTER MEMVAR BLANK + + CALCULATE MAX(VAL(nrinv)) FOR ALLTRIM(UPPER(fel)) == "N" TO lcmax + lnmax = lcmax+1 + m.nrinv = ALLTRIM(STR(lnmax)) + + STORE 0 TO m.valrez + STORE 1 TO m.tipcalcul + PRIVATE M.ID_SECTIE + STORE '' TO m.id_sectie + + oprel=CREATEOBJ('preluare') + oprel.FEL_IMOB='N' + oprel.titlufrumos1.CAPTION="Introducere imobilizari necorporale" + oprel.label30.visible=.f. + oprel.optiongroup1.visible=.f. + oprel.text4.inputmask = get_mask(12,gnZ) + oprel.txt15.inputmask = get_mask(12,gnZ) + oprel.text22.inputmask = get_mask(12,gnZ) + oprel.SHOW(1) +ENDPROC && introducere_necorporale + +*______________________________________________ + +PROCEDURE viz_corporale + IF USED('xmf') + USE IN xmf + ENDIF + USE &DATE\mf AGAIN IN 0 SHARED ALIAS xmf + + ON ERROR DO a + IF COMPARTABELE('mf')=.F. + DO MESAJ WITH 'Reindexati fisierele','' + *THIS.cmdTERMIN1.CLICK + RETURN + ENDIF + ON ERROR + + SELECT xmf + SCATTER MEMVAR BLANK + SET FILTER TO fel=" " + + REPLACE ALL dataeval WITH datapif FOR EMPTY(dataeval) + IF VAL(m.an) >= 2005 + && din 2005 s-a schimbat programul + && pana in 2005 dataeval se schimba abia la calcul_reevaluare => se stergeau reevaluarile cu valin = 0 + REPLACE ALL valin WITH valoare FOR EMPTY(valin) AND dataeval = datapif + ENDIF + + SET ORDER TO nrdata + PRIVATE FELUL,pdata3,pdata4,pnsuma1,pnsuma2,pdata5,pdata6, pnSectie,pnsuma3,pnsuma4, PcNrord + STORE ' ' TO FELUL, PcNrord + STORE DATE() TO pdata3,pdata4,pdata5,pdata6,pdata7, pdata8 + STORE 0 TO pnsuma1,pnsuma2, pnSectie,pnsuma3,pnsuma4 + + PRIVATE pcTitluA + STORE "CALCUL AMORTIZARE IN LUNA " + ALLTRIM(M.NL) + ' ' + ALLTRIM(M.AN) TO pcTitluA + + ov=CREATE('vizP') + ov.label10.CAPTION="Lista imobilizarilor corporale" + ov.grid1.column6.inputmask = get_mask(12,gnZ) + ov.grid1.column26.inputmask = get_mask(12,gnZ) + ov.grid1.column22.inputmask = get_mask(12,gnZ) + ov.grid1.column27.inputmask = get_mask(12,gnZ) + ov.grid1.column24.inputmask = get_mask(12,gnZ) + ov.grid1.column18.inputmask = get_mask(12,gnZ) + ov.grid1.column19.inputmask = get_mask(12,gnZ) + ov.grid1.column29.inputmask = get_mask(12,gnZ) + ov.grid1.column12.inputmask = get_mask(12,gnZ) + ov.t3.inputmask = get_mask(14,gnZ) + ov.text1.inputmask = get_mask(14,gnZ) + ov.text2.inputmask = get_mask(14,gnZ) + ov.pcFel = felul + ov.SHOW(1) + + SELECT mf + SET ORDER TO TAG dataact +ENDPROC && viz_corporale + +*______________________________________________ + +PROCEDURE viz_necorporale + IF USED('xmf') + USE IN xmf + ENDIF + USE &DATE\mf AGAIN IN 0 SHARED ALIAS xmf + + ON ERROR DO a + IF COMPARTABELE('mf')=.F. + DO MESAJ WITH 'Reindexati fisierele','' + RETURN + ENDIF + ON ERROR + + SELECT xmf + SCATTER MEMVAR BLANK + SET FILTER TO UPPER(fel)="N" + REPLACE ALL dataeval WITH datapif FOR EMPTY(dataeval) + IF VAL(m.an) >= 2005 + && din 2005 s-a schimbat programul + && pana in 2005 dataeval se schimba abia la calcul_reevaluare => se stergeau reevaluarile cu valin = 0 + REPLACE ALL valin WITH valoare FOR EMPTY(valin) AND dataeval = datapif + ENDIF + + SET ORDER TO nrdata +*!* INDEX ON nrinv TAG nrinv OF &LOC\&NFSCURT\TEMPO\xmf +*!* SET ORDER TO TAG nrinv + + PRIVATE FELUL,pdata3,pdata4,pnsuma1,pnsuma2,pdata5,pdata6, pnSectie, PcNrord + STORE DATE() TO pdata3,pdata4,pdata5,pdata6,pdata7, pdata8 + STORE 0 TO pnsuma1,pnsuma2, pnSectie + STORE 'N' TO FELUL + STORE '' TO PcNrord + + PRIVATE pcTitluA + STORE "CALCUL AMORTIZARE IN LUNA " + ALLTRIM(M.NL) + ' ' + ALLTRIM(M.AN) TO pcTitluA + + ov=CREATE('vizP') + ov.label10.CAPTION="Lista imobilizarilor necorporale" + ov.grid1.column6.inputmask = get_mask(12,gnZ) + ov.grid1.column26.inputmask = get_mask(12,gnZ) + ov.grid1.column22.inputmask = get_mask(12,gnZ) + ov.grid1.column27.inputmask = get_mask(12,gnZ) + ov.grid1.column24.inputmask = get_mask(12,gnZ) + ov.grid1.column18.inputmask = get_mask(12,gnZ) + ov.grid1.column19.inputmask = get_mask(12,gnZ) + ov.grid1.column29.inputmask = get_mask(12,gnZ) + ov.grid1.column12.inputmask = get_mask(12,gnZ) + ov.t3.inputmask = get_mask(14,gnZ) + ov.text1.inputmask = get_mask(14,gnZ) + ov.text2.inputmask = get_mask(14,gnZ) + ov.pcFel = felul + ov.SHOW(1) + +ENDPROC && viz_necorporale + +*______________________________________________ + +PROCEDURE viz_in_curs + PRIVATE FELUL + STORE 'C' TO FELUL + ov=CREATE('vizc') + ON ERROR DO a + ov.t3.inputmask = get_mask(14,gnZ) + ov.grid1.column6.inputmask = get_mask(12,gnZ) + ov.SHOW(1) +ENDPROC && viz_in_curs + +*______________________________________________ +PROCEDURE list_corp_general + DO caut_alf WITH 'Numegest','numegest','NUMELE GESTIUNII','M.NUMEGEST' + IF buton=2 + RETURN + ENDIF + + SELE numegest + LOCATE FOR numegest=m.numegest + SCATTER MEMVAR + + SET SAFETY OFF + SELE mf + IF m.gest=-1 + SET FILTER TO fel=" " AND !CASAT AND !inactiv + ELSE + SET FILTER TO gest=m.gest AND fel=" " AND !CASAT AND !inactiv + ENDIF + SELECT mf + INDEX ON DTOS(dataact)+nrinv TAG datapif OF &LOC\&NFSCURT\TEMPO\mfi + SELE mf + titlu="Lista imobilizarilor corporale in luna" + REPORT FORM listmfcota TO PRINTER PROMPT PREVIEW + DO totv + +ENDPROC && list_corp_general + +*__________________________________________________________________ + +PROCEDURE list_corp_peluni + + DO caut_alf WITH 'Numegest','numegest','NUMELE GESTIUNII','M.NUMEGEST' + IF buton=2 + RETURN + ENDIF + + SELE numegest + LOCATE FOR numegest=m.numegest + SCATTER MEMVAR + + + SELE mf + IF m.gest=-1 + SET FILTER TO fel=" " AND !CASAT AND !inactiv + ELSE + SET FILTER TO gest=m.gest AND fel=" " AND !CASAT AND !inactiv + ENDIF + titlu="Lista imobilizarilor corporale in luna" + SELECT mf + INDEX ON DTOS(datapif)+ALLTRIM(nrinv) TAG datapif OF &LOC\&NFSCURT\TEMPO\mfi + SELE mf + REPORT FORM listmfLUNICOTA TO PRINTER PROMPT PREVIEW + SELECT mf + SET FILTER TO + DO totv && list_corp_peluni + + *_____________________________________________________________________________ + +PROCEDURE list_corp_pegrup + DO caut_alf WITH 'Numegest','numegest','NUMELE GESTIUNII','M.NUMEGEST' + IF buton=2 + RETURN + ENDIF + + SELE numegest + LOCATE FOR numegest=m.numegest + SCATTER MEMVAR + + + SELE mf + *USE + *SELECT 0 + *USE &DATE\MF.DBF EXCLU ALIAS MF + IF m.gest=-1 + SET FILTER TO fel=" " AND !CASAT AND !inactiv + ELSE + SET FILTER TO gest=m.gest AND fel=" " AND !CASAT AND !inactiv + ENDIF + titlu="Lista imobilizarilor corporale in luna" + SELECT mf + *INDEX ON scd+DTOC(datapif)+nrinv+denumire TAG scdden of &loc\&nfscurt\tempo\mfi ascending + INDEX ON PADR(scd,4," ")+STR(VAL(nrinv)) TAG SCDNRINV OF &LOC\&NFSCURT\TEMPO\mfi ASCENDING + + SELECT mf + REPORT FORM listmfSCDCOTA TO PRINTER PROMPT PREVIEW + *sele mf + *USE + *SELECT 0 + *USE &DATE\MF.DBF ALIAS MF + DO totv +ENDPROC && list_corp_pegrup + +*__________________________________________________________________________________________ + +PROCEDURE list_necorp_general + DO caut_alf WITH 'Numegest','numegest','NUMELE GESTIUNII','M.NUMEGEST' + IF buton=2 + RETURN + ENDIF + + SELE numegest + LOCATE FOR numegest=m.numegest + SCATTER MEMVAR + + SET SAFETY OFF + SELE mf + *USE + *SELECT 0 + *USE &DATE\MF.DBF EXCLU ALIAS MF + IF m.gest=-1 + SET FILTER TO UPPER(fel)="N" AND !CASAT AND !inactiv + ELSE + SET FILTER TO gest=m.gest AND UPPER(fel)="N" AND !CASAT AND !inactiv + ENDIF + INDEX ON DTOS(dataact)+nrinv TAG datapif OF &LOC\&NFSCURT\TEMPO\mfi + SELE mf + titlu="Lista imobilizarilor necorporale in luna" + + REPORT FORM listmfcota TO PRINTER PROMPT PREVIEW + *sele mf + *USE + *SELECT 0 + *USE &DATE\MF.DBF ALIAS MF + DO totv +ENDPROC && list_necorp_general + +*_________________________________________________________________________ + +PROCEDURE list_necorp_pegrup + DO caut_alf WITH 'Numegest','numegest','NUMELE GESTIUNII','M.NUMEGEST' + IF buton=2 + RETURN + ENDIF + + SELE numegest + LOCATE FOR numegest=m.numegest + SCATTER MEMVAR + + + SELE mf + *USE + *SELECT 0 + *USE &DATE\MF.DBF EXCLU ALIAS MF + IF m.gest=-1 + SET FILTER TO UPPER(fel)="N" AND !CASAT AND !inactiv + ELSE + SET FILTER TO gest=m.gest AND UPPER(fel)="N" AND !CASAT AND !inactiv + ENDIF + + *INDEX ON scd+DTOC(dataact)+denumire TAG scdden of &loc\&nfscurt\tempo\mfi ascending + *INDEX ON SCD+ALLTRIM(nrinv)+DTOS(DATAact) TAG DATAPIF of &loc\&nfscurt\tempo\mfi + INDEX ON PADR(scd,4," ")+STR(VAL(nrinv)) TAG SCDNRINV OF &LOC\&NFSCURT\TEMPO\mfi ASCENDING + + SELE mf + titlu="Lista imobilizarilor necorporale in luna" + REPORT FORM listmfSCDCOTA TO PRINTER PROMPT PREVIEW + *sele mf + *USE + *SELECT 0 + *USE &DATE\MF.DBF ALIAS MF + DO totv + +ENDPROC && list_necorp_pegrup + +*_________________________________________________________________________ + +PROCEDURE list_necorp_peluni + DO caut_alf WITH 'Numegest','numegest','NUMELE GESTIUNII','M.NUMEGEST' + IF buton=2 + RETURN + ENDIF + + SELE numegest + LOCATE FOR numegest=m.numegest + SCATTER MEMVAR + + + SELE mf + *USE + *SELECT 0 + *USE &DATE\MF.DBF EXCLU ALIAS MF + IF m.gest=-1 + SET FILTER TO UPPER(fel)="N" AND !CASAT AND !inactiv + ELSE + SET FILTER TO gest=m.gest AND UPPER(fel)="N" AND !CASAT AND !inactiv + ENDIF + *INDEX ON DTOC(DATAPIF)+SCD TAG DATAPIF of &loc\&nfscurt\tempo\mfi + INDEX ON DTOS(datapif)+nrinv TAG datapif OF &LOC\&NFSCURT\TEMPO\mfi + SELE mf + titlu="Lista imobilizarilor necorporale in luna" + REPORT FORM listmfLUNICOTA TO PRINTER PROMPT PREVIEW + *sele mf + *USE + *SELECT 0 + *USE &DATE\MF.DBF ALIAS MF + SELECT mf + SET FILTER TO + DO totv + +ENDPROC && list_necorp_peluni + +*_________________________________________________________________________ + +PROCEDURE list_incurs + SELECT mf + SET FILTER TO UPPER(fel)="C" AND !CASAT AND !inactiv + *INDEX ON ALLTRIM(nrinv)+DTOS(dataact) TAG datapif of &loc\&nfscurt\tempo\mfi + INDEX ON PADR(scd,4," ")+STR(VAL(nrinv)) TAG SCDNRINV OF &LOC\&NFSCURT\TEMPO\mfi ASCENDING + REPORT FORM listimobcurs TO PRINTER PROMPT PREVIEW + +ENDPROC && list_incurs + +*_________________________________________________________________________ + +PROCEDURE lista_fiselor_corp + SELE mf + SET FILTER TO fel=' ' AND !inactiv && and !casat + REPORT FORM fisa_mf2 TO PRINTER PROMPT PREVIEW + SELECT mf + SET FILTER TO +ENDPROC && lista_fiselor_corp + +*_________________________________________________________________________ + +PROCEDURE lista_fiselor_corp_istoric + select *, 00000000000000 AS amortlunv from mf WHERE fel = ' ' AND !inactiv into cursor qry_mf READWRITE +* ALTER TABLE qry_mf ADD COLUMN amortlunv n(14) + + IF USED('mfold') + USE IN mfold + ENDIF + + SELECT qry_mf + SCAN FOR dataeval # datapif AND !EMPTY(dataeval) + SCATTER NAME omf + lcnl=ALLTRIM(STR(MONTH(dataeval))) + IF LEN(lcnl) = 1 + lcnl = '0' + lcnl + ENDIF + lcAn=ALLTRIM(STR(YEAR(dataeval))) + lcdate='&calefirma\an'+lcAn+'\date'+lcNl+'\mf.dbf' + IF FILE(lcDate) + USE &lcDate IN 0 ALIAS mfold SHARED + SELECT mfold + LOCATE FOR UPPER(ALLTRIM(denumire))=UPPER(ALLTRIM(omf.denumire)) AND datapif=omf.datapif AND nrpif=omf.nrpif + IF FOUND() + lnAmortLun = amortlun + SELECT qry_mf + REPLACE amortlunv WITH lnAmortlun + ENDIF + USE IN mfold + ENDIF + RELEASE omf + SELECT qry_mf + ENDSCAN + + SELE qry_mf + REPORT FORM fisa_mf_istoric TO PRINTER PROMPT PREVIEW + USE IN qry_mf +ENDPROC && lista_fiselor_corp_istoric +*_________________________________________________________________________ + +PROCEDURE lista_fiselor_necorp + SELE mf + SET FILTER TO UPPER(fel)='N' AND !inactiv && and !casat + REPORT FORM fisa_mf2 TO PRINTER PROMPT PREVIEW + SELECT mf + SET FILTER TO +ENDPROC && lista_fiselor_necorp + +*_________________________________________________________________________ + +PROCEDURE rulaj_amortizment + PRIVATE pcfelul + pcfelul=[' ','N'] + + lcAlias = sitan() && sitan.prg + lcCaleFis = rulaje('amortlun',lcAlias) && IN sitan.prg + + IF EMPTY(lcCaleFis) + RETURN + ENDIF + + USE (lcCaleFis) IN 0 ALIAS rulaje + SELECT rulaje + ov=CREATE('sit') + ov.TITLU1.CAPTION='SITUATIE ANALITICA - RULAJ AMORTIZMENTE (In anul curent pana in luna curenta)' + ov.SHOW(1) + USE IN rulaje + +ENDPROC && rulaj_amortizment + +*_________________________________________________________________________ + +PROCEDURE total_amortizment + PRIVATE pcfelul + pcfelul=[' ','N'] + + lcAlias = sitan() && sitan.prg + lcCaleFis = rulaje('amorttot',lcAlias) && IN sitan.prg + + IF EMPTY(lcCaleFis) + RETURN + ENDIF + + USE (lcCaleFis) IN 0 ALIAS rulaje + + ov=CREATE('sit') + ov.TITLU1.CAPTION='SITUATIE ANALITICA - TOTAL AMORTIZMENTE (In anul curent pana in luna curenta)' + ov.SHOW(1) + USE IN rulaje + +ENDPROC && total_amortizment + +*_________________________________________________________________________ +PROCEDURE list_inchid_amortizari + +ldDATAACT=GOMONTH(CTOD('01/'+m.nl+'/'+m.AN),1)-1 + +buton=1 +od=Create('danu') +od.label1.Caption=[Se calculeaza inchiderea dupa sectie?] +od.Show(1) +If buton = 2 + plCampSectie = .F. +Else + plCampSectie = .T. +ENDIF + +IF !USED('plcont') + USE &CALEFIRMA\DATEAN\plcont IN 0 SHARED ALIAS plcont +ENDIF + +SELECT DISTINCT sectie, id_sectie FROM sectie INTO CURSOR crsSectie + +IF plCampSectie + SELECT ldDATAACT as dataact, i.SCD, '281' + SUBSTR(i.scd,3,1) AS SCC, SUM(i.amortlun) as suma, i.id_sectie, NVL(p.cimp2,SPACE(30)) as nume_2, NVL(s.sectie,SPACE(30)) as sectie ; + FROM mf i ; + LEFT JOIN plcont p ON i.scd = p.cimp1 ; + LEFT JOIN crsSectie s ON i.id_sectie = s.id_sectie ; + WHERE ALLTRIM(i.FEL)=[] AND !i.CASAT AND !i.inactiv; + INTO CURSOR tinchid READWRITE ; + GROUP BY i.scd, i.ascd, i.id_sectie + +ELSE + SELECT ldDATAACT as dataact, i.SCD, '281' + SUBSTR(i.scd,3,1) AS SCC, SUM(i.amortlun) as suma, NVL(p.cimp2,SPACE(30)) as nume_2, SPACE(30) as sectie ; + FROM mf i ; + LEFT JOIN plcont p ON i.scd = p.cimp1 ; + WHERE ALLTRIM(i.FEL)=[] AND !i.CASAT AND !i.inactiv; + INTO CURSOR tinchid READWRITE ; + GROUP BY i.scd, i.ascd +ENDIF + +pcTitlu = [INCHIDERE AMORTIZARE - IMOBILIZARI CORPORALE] +SELECT tinchid +REPLACE ALL scd WITH [6811] +REPORT FORM act TO PRINTER PROMPT PREVIEW +IF USED('tinchid') + USE IN tinchid +ENDIF +IF USED('crsSectie') + USE IN crsSectie +ENDIF +IF USED('plcont') + USE IN plcont +ENDIF + +ENDPROC && list_inchid_amortizari + +*---------------------------------------------------- +PROCEDURE list_inchid_amortizari_nec + + +ldDATAACT=GOMONTH(CTOD('01/'+m.nl+'/'+m.AN),1)-1 + +buton=1 +od=Create('danu') +od.label1.Caption=[Se calculeaza inchiderea dupa sectie?] +od.Show(1) +If buton = 2 + plCampSectie = .F. +Else + plCampSectie = .T. +ENDIF + +IF !USED('plcont') + USE &CALEFIRMA\DATEAN\plcont IN 0 SHARED ALIAS plcont +ENDIF + +SELECT DISTINCT sectie, id_sectie FROM sectie INTO CURSOR crsSectie + +IF plCampSectie + SELECT ldDATAACT as dataact, i.SCD, '280' + SUBSTR(i.scd,3,1) AS SCC, SUM(i.amortlun) as suma, i.id_sectie, NVL(p.cimp2,SPACE(30)) as nume_2, NVL(s.sectie,SPACE(30)) as sectie ; + FROM mf i ; + LEFT JOIN plcont p ON i.scd = p.cimp1 ; + LEFT JOIN crsSectie s ON i.id_sectie = s.id_sectie ; + WHERE ALLTRIM(UPPER(i.FEL))=[N] AND !i.CASAT AND !i.inactiv; + INTO CURSOR tinchid READWRITE ; + GROUP BY i.scd, i.ascd, i.id_sectie + +ELSE + SELECT ldDATAACT as dataact, i.SCD, '280' + SUBSTR(i.scd,3,1) AS SCC, SUM(i.amortlun) as suma, NVL(p.cimp2,SPACE(30)) as nume_2, SPACE(30) as sectie ; + FROM mf i ; + LEFT JOIN plcont p ON i.scd = p.cimp1 ; + WHERE ALLTRIM(UPPER(i.FEL))=[N] AND !i.CASAT AND !i.inactiv; + INTO CURSOR tinchid READWRITE ; + GROUP BY i.scd, i.ascd +ENDIF + +pcTitlu = [INCHIDERE AMORTIZARE - IMOBILIZARI NECORPORALE] +SELECT tinchid +REPLACE ALL scd WITH [6811] +REPORT FORM act TO PRINTER PROMPT PREVIEW +IF USED('tinchid') + USE IN tinchid +ENDIF +IF USED('crsSectie') + USE IN crsSectie +ENDIF +IF USED('plcont') + USE IN plcont +ENDIF + +ENDPROC && list_inchid_amortizari_nec + + +*----------------------------------------------------------------------------------- + +PROCEDURE list_amort_tot + +SELECT xmf +SCATTER NAME omf + +pcNl=m.nl +pcAn=m.an + +loLuna=ret_luna("Selectati luna de inceput") +lddata1=Ctod('01/'+loLuna.nl+'/'+loLuna.an) && 01/01/2003 +lddata2=Ctod('01/'+pcNl+'/'+pcAn) && 01/07/2003- luna contabila curenta + +SELECT m.*, SPACE(4) as an, SPACE(2) as nl from mf m WHERE 1=2 INTO CURSOR mfsel READWRITE + +SELECT an,nl FROM calendar INTO CURSOR tcalendar + +SELECT tcalendar +SCAN FOR Ctod('01/'+nl+'/'+an)>=lddata1 AND Ctod('01/'+nl+'/'+an)<=lddata2 + lcnl=nl + lcAn=an + lcdate='&calefirma\an'+lcAn+'\date'+lcNl+'\mf.dbf' + IF FILE(lcDate) + SELECT mfsel + APPEND FROM &lcDate FOR UPPER(ALLTRIM(denumire))=UPPER(ALLTRIM(omf.denumire)) ; + AND datapif=omf.datapif AND nrpif=omf.nrpif AND !inactiv + REPLACE an WITH lcan,nl WITH lcnl + ENDIF + SELECT tcalendar +ENDSCAN + +SELECT mfsel +REPORT FORM amortanaliz2 TO PRINTER PROMPT PREVIEW +m.nl=pcNl +m.an=pcAn + +RELEASE omf +IF USED('mfsel' ) + USE IN mfsel +ENDIF +IF USED('tcalendar') + USE IN tcalendar +ENDIF + +ENDPROC + +*----------------------------------------------------------------------------- + +PROCEDURE initializ_jurnal + +*!* SELECT mf +*!* SCAN FOR normat2lun # 0 OR normat2 # 0 AND !casat + +*!* SCATTER NAME omf +*!* +*!* *!* SELECT mflun +*!* *!* IF FLOCK() +*!* *!* APPEND BLANK +*!* *!* GATHER NAME omf +*!* *!* REPLACE explicatia WITH 'Introdus',dataora WITH DATETIME(),util WITH m.util +*!* *!* REPLACE codop WITH 99 +*!* *!* ENDIF +*!* *!* UNLOCK + +*!* *!* SELECT MFANUAL +*!* *!* IF FLOCK() +*!* *!* APPEND BLANK +*!* *!* GATHER NAME omf +*!* *!* REPLACE explicatia WITH 'Introdus',dataora WITH DATETIME(),util WITH m.util +*!* *!* REPLACE codop WITH 99 +*!* *!* ENDIF +*!* *!* UNLOCK +*!* +*!* *SELECT mf +*!* REPLACE normat WITH normat2lun, normaan WITH normat2, normat2 WITH 0, normat2lun WITH 0 +*!* SCATTER NAME omf +*!* +*!* SELECT mflun +*!* IF FLOCK() +*!* APPEND BLANK +*!* GATHER NAME omf +*!* REPLACE explicatia WITH 'Transformare DNS',dataora WITH DATETIME(),util WITH m.util +*!* REPLACE codop WITH 99 +*!* ENDIF +*!* UNLOCK + +*!* SELECT MFANUAL +*!* IF FLOCK() +*!* APPEND BLANK +*!* GATHER NAME omf +*!* REPLACE explicatia WITH 'Transformare DNS',dataora WITH DATETIME(),util WITH m.util +*!* REPLACE codop WITH 99 +*!* ENDIF +*!* UNLOCK + +*!* SELECT mf +*!* ENDSCAN + +*!* DO mesaj WITH 'Transformarea s-a incheiat !','' +ENDPROC + +*---------------------------------------------------- + +PROCEDURE evidenta_mf + +SELECT scd,sum(valin) as valin,sum(amorttot) as amorttot,sum(valramasa) as valramasa, ; +sum(valin-amorttot) as valramb,sum(valrez) as valrez, sum(amortlun) as amortlun,count(*) as numar ; +FROM mf ; +WHERE !casat AND fel=' ' AND !inactiv; +GROUP BY scd INTO CURSOR tevidenta ORDER BY scd + +SELECT tevidenta +REPORT FORM evidenta_mf TO PRINTER PROMPT PREVIEW + +USE IN tevidenta + +ENDPROC +****----------------------------------------------------------------- + +PROCEDURE lista_invn + +PRIVATE pddata + +ldatacrt = "01/" + m.nl + "/" + m.an + ldata=GOMONTH(CTOD(ldatacrt),1) + dataref=ldata-1 + datarefi = dataref + ooo=CREATEOBJECT("cautintre") + ooo.text1.controlsource='dataref' + ooo.label1.caption='Data de referinta:' + ooo.text2.visible=.f. + ooo.label2.visible=.f. + ooo.show(1) + +pddata = dataref + +SELECT * from mf WHERE !casat AND !inactiv INTO CURSOR cLista +SELECT cLista +REPORT FORM nota_inv2005 TO PRINTER PROMPT PREVIEW +IF USED("cLista") + USE IN cLista +ENDIF +ENDPROC && lista_invn + +*----------------------------------------------------------------------------------- + +PROCEDURE list_amort_tot_nou +PARAMETERS tcFis + +lcFis = ALLTRIM(tcFis) +pcNl=m.nl +pcAn=m.an + +loLuna=ret_luna("Selectati luna de inceput") +lddata1=Ctod('01/'+loLuna.nl+'/'+loLuna.an) && 01/01/2003 +lddata2=Ctod('01/'+pcNl+'/'+pcAn) && 01/07/2003- luna contabila curenta + +pcTitluA = 'EVIDENTA MIJLOACE FIXE - RAPORT PENTRU PERIOADA ' + loLuna.nl+'.'+loLuna.an + ' - ' + pcNl+'.'+pcAn +DO FORM frm_introd_titlu + + +SELECT m.*, SPACE(4) as an, SPACE(2) as nl, ; +0000000000000000 as majorare, 00000000000 as id_mf ; +from (lcFis) m WHERE 1=2 INTO CURSOR mfsel READWRITE +SELECT an,nl FROM calendar INTO CURSOR tcalendar + +LOCAL i +i = 0 +SELECT (lcFis) +SCAN + SCATTER NAME omf + i = i + 1 + SELECT tcalendar + SCAN FOR Ctod('01/'+nl+'/'+an)>=lddata1 AND Ctod('01/'+nl+'/'+an)<=lddata2 + lcnl = nl + lcAn = an + lcdate = '&calefirma\an' + lcAn + '\date' + lcNl + '\mf.dbf' + IF FILE(lcDate) + SELECT mfsel + APPEND FROM &lcDate ; + FOR UPPER(ALLTRIM(denumire)) = UPPER(ALLTRIM(omf.denumire)) ; + AND datapif = omf.datapif AND nrpif = omf.nrpif AND !inactiv + REPLACE an WITH lcan, nl WITH lcnl, id_mf WITH i FOR EMPTY(an) AND EMPTY(nl) AND EMPTY(id_mf) AND UPPER(ALLTRIM(denumire)) = UPPER(ALLTRIM(omf.denumire)) AND datapif = omf.datapif AND nrpif = omf.nrpif + ENDIF + SELECT tcalendar + ENDSCAN + SELECT (lcFis) +ENDSCAN +RELEASE omf + +lnNumarDeMf = i + + +FOR i = 1 TO lnNumarDeMf + j = 0 + lnMajorare = 0 + SELECT mfsel + SCAN FOR id_mf = i + j = j + 1 + IF j = 1 + lnMajorare = valin + ELSE + REPLACE majorare WITH valin - lnMajorare + lnMajorare = valin + ENDIF + ENDSCAN +ENDFOR + + +SELECT mfsel +REPORT FORM amortanaliz_grup TO PRINTER PROMPT PREVIEW +m.nl=pcNl +m.an=pcAn + + +IF USED('mfsel' ) + USE IN mfsel +ENDIF +IF USED('tcalendar') + USE IN tcalendar +ENDIF + +ENDPROC + +*_____________________________________________________________________________ + +PROCEDURE list_corp_peSECTII +PARAMETERS tcFel + + IF TYPE('tcFel') # 'C' + lcFel = [] + ELSE + lcFel = UPPER(ALLTRIM(tcFel)) + ENDIF + + SELECT * from sectie INTO CURSOR tsectie READWRITE ORDER BY sectie, id_sectie + + SELECT tsectie + APPEND BLANK + REPLACE sectie WITH [], id_sectie WITH [-1] + + PRIVATE pcSectie + STORE [] TO pcSectie + locauta = caut_alfa_cursor('TSECTIE','SECTIE','NUMELE SECTIEI') + + IF buton=2 + RETURN + ENDIF + + IF ALLTRIM(locauta.ID_SECTIE) = [-1] AND ALLTRIM(locauta.sectie) = [] + lcCond = [.t.] + ELSE + lcCond = [id_sectie = locauta.id_SECTIE] + ENDIF + + SELECT * ; + from mf ; + WHERE UPPER(ALLTRIM(fel))= lcFel AND !CASAT AND !inactiv AND &lcCond INTO CURSOR tmf ORDER BY scd, id_sectie + + IF lcFel = [N] + titlu="Lista imobilizarilor necorporale in luna" + ELSE + titlu="Lista imobilizarilor corporale in luna" + ENDIF + pcGrup1 = [scd] + pcHeaderGrup1 = [Cont] + pcGrup2 = [id_sectie] + pcHeaderGrup2 = [sectie] + + SELECT tmf + REPORT FORM ListMf_Grup TO PRINTER PROMPT PREVIEW + + IF USED('tmf') + USE IN tmf + ENDIF + IF USED('tsectie') + USE IN tsectie + ENDIF + +ENDPROC && list_corp_peSectii \ No newline at end of file diff --git a/Programe/Vechi/proceduri.prg b/Programe/Vechi/proceduri.prg new file mode 100644 index 0000000..5e516b6 --- /dev/null +++ b/Programe/Vechi/proceduri.prg @@ -0,0 +1,1209 @@ + +FUNCTION get_explicatie +LPARAMETERS tnCodOp + +*** ISTORIC OPERATII *** +*!* *!* *!* Modificare : codop=1 *!* *!* *!* +*!* *!* *!* Introducere : codop=2 *!* *!* *!* +*!* *!* *!* Preluare : codop=3 *!* *!* *!* +*!* *!* *!* Transformare in mf : codop=4 *!* *!* *!* +*!* *!* *!* Iesire din gestiune : codop=5 *!* *!* *!* +*!* *!* *!* Intrare in gestiune : codop=6 *!* *!* *!* +*!* *!* *!* Stergere : codop=7 *!* *!* *!* +*!* *!* *!* Majorare val inv : codop=8 *!* *!* *!* +*!* *!* *!* Reevaluarea val inv : codop=9 *!* *!* *!* +*!* *!* *!* Schimbare DNS : codop=10 *!* *!* *!* +*!* *!* *!* Recalcularea cota : codop 11 *!* *!* *!* +*!* *!* *!* Conservare MF : codop 12 *!* *!* *!* +*!* *!* *!* Scoatere din conservare MF : codop 13 *!* *!* *!* + +IF PCOUNT()<1 OR ISNULL(tnCodOp) + tnCodOp = 0 +ENDIF + +DO CASE + CASE tnCodOp = 1 + lcExplic = 'Modificare' + CASE tnCodOp = 2 + lcExplic = 'Introducere' + CASE tnCodOp = 3 + lcExplic = 'Preluare din contabilitate' + CASE tnCodOp = 4 + lcExplic = 'Transformare in MF' + CASE tnCodOp = 5 + lcExplic = 'Iesire din gestiune' + CASE tnCodOp = 6 + lcExplic = 'Intrare in gestiune' + CASE tnCodOp = 7 + lcExplic = 'Stergere' + CASE tnCodOp = 8 + lcExplic = 'Majorare valoare inventar' + CASE tnCodOp = 9 + lcExplic = 'Reevaluare MF' + CASE tnCodOp = 10 + lcExplic = 'Schimbare DNS' + CASE tnCodOp = 11 + lcExplic = 'Recalculare cota, valoare ramasa' + CASE tnCodOp = 12 + lcExplic = 'Conservare MF' + CASE tnCodOp = 13 + lcExplic = 'Scoatere din conservare MF' + OTHERWISE + lcExplic = ' ' +ENDCASE +lcExplic = SUBSTR(lcExplic,1,50) +RETURN lcExplic + + +*!* *!* *!* *!* *!* *!* *!* *!* *!* +*_____________________________________________________________ + +PROCEDURE a +RETURN +ENDPROC +*_____________________________________________________________ +FUNCTION existacamp +PARAM numef,numec +SELE &numef +FOR i=1 TO FCOUNT() + IF UPPER(ALLT(FIELD(i)))=UPPER(ALLT(numec)) + RETURN .T. + ENDIF +NEXT +RETURN .F. +*_______________________________________________________ + +FUNCTION compartabele +PARAMETERS nume + +SET EXACT ON +SELECT fistotv +LOCATE FOR numef=UPPER(nume) +IF !FOUND() + RETURN +ENDIF +SCATTER MEMV +c1=ALLTRIM(m.calealfa) +c2=ALLTRIM(m.cale) +SELECT &nume +nrcol1=FCOUNT() +dat=c1+m.numef + +USE &dat IN 0 ALIAS aliasmf +*do deschidf with m.calealfa,m.calealfa,m.numeF,aliasm,m.ordine,m.exc + +SELECT aliasmf +nrcol2=FCOUNT() +USE IN aliasmf + +IF nrcol1<>nrcol2 + RETURN .F. +ELSE + RETURN .T. +ENDIF + +ENDPROC +*_______________________________________________________ +PROCEDURE redeschid +LOCAL lunatrec,antrec,lunacrt,ancrt,dattrec,datcrt +SET SAFETY OFF + +lunacrt=m.nl +ancrt=m.an + +SELE calendar +LOCATE FOR an=m.an AND nl=m.nl +SKIP -1 +IF BOF() + DO mesajatent WITH 'Luna '+m.nl+' '+m.an,'este prima luna deschisa!' + RETURN +ENDIF +lunatrec=nl +antrec=an + +dattrec=calefirma+'\AN'+antrec+'\DATE'+lunatrec+'\'+'mf.*' +dat=DIRgen+'\imob2003\date\mftemp.*' + +CLOSE DATABASE + +COPY FILE &dattrec TO &dat +dat=DIRgen+'\imob2003\date\mftemp.dbf' +SELECT 0 +USE &dat EXCLUSIVE ALIAS dat +PACK +REPL ALL cod WITH 0 +SELE dat +USE + + +SELE 0 +USE &DATE\mf.DBF EXCLUSIVE ALIAS mf +DELETE FROM mf WHERE cod=0 +PACK +USE +SELE 0 +USE &DATE\mf.DBF ALIAS mf + +dat=DIRgen+'\imob2003\date\mftemp.dbf' +SELE mf +APPEND FROM &dat +USE + +m.nl=lunacrt +m.an=ancrt +DO totv + +&&Actualizare amortizari precedente +SELE 0 +dattrec=calefirma+'\AN'+antrec+'\DATE'+lunatrec+'\'+'mf.dbf' +USE &dattrec ALIAS mftrec + +SELE mf +SCAN + SCAT MEMV + SELE mftrec +*loca for cod=m.cod and allt(denumire)=allt(m.denumire) + LOCA FOR valoare=m.valoare AND nrinv=m.nrinv AND ALLT(denumire)=ALLT(m.denumire) + IF FOUND() +* Scat Memv + lnAmorttot = amorttot + SELE mf + REPL amortprec WITH lnAmorttot + ENDIF + SELECT mf +ENDSCAN + +SELE mftrec +USE + +DO MESAJ WITH 'Lista mijloacelor fixe din luna ',m.nl+' '+m.an+' a fost actualizata!' + +m.nl=lunacrt +m.an=ancrt +DO totv + +*!* IF USED('xmf') +*!* USE IN xmf +*!* ENDIF +*!* USE mf AGAIN IN 0 SHARED ALIAS xmf +*!* SELECT xmf +*!* SET FILTER TO fel=" " +*!* INDEX ON NRINV TAG NRINV OF &LOC\&NFSCURT\TEMPO\xMF +*!* SET ORDER TO TAG NRINV +*!* ov=create('vizP') +*!* ov.label10.caption="Lista imobilizarilor " +*!* SELECT xmf +*!* SET FILTER TO +*!* ov.show(1) + + +RETURN + + + + + + + +*_________________________________________________________ +PROCEDURE CAUT_norma +PARAMETERS NUMEBAZA,NUMECIMP,CAPTEXT,VARMEM +LOCAL MC0,MC1,MC2 +SET SAFETY OFF +MC0='SELE '+NUMEBAZA +MC1='VARMEM=M.'+NUMECIMP +MC2='SET order TO TAG '+NUMECIMP + +&MC0 +IF EOF() + APPE BLANK +ENDIF +*&MC2 + +OCA=CREATEOBJECT("CAUTnorma") +OCA.CAPTION=CAPTEXT +OCA.GRID1.RECORDSOURCE=NUMEBAZA +OCA.GRID1.COLUMN1.CONTROLSOURCE=NUMECIMP +OCA.SHOW(1) + +SCATTER MEMVAR +&MC1 + +ENDPROC + + + +*_________________________________________ +PROCEDURE verifmf +LOCAL s +totval=0 +s=.T. + +SELE actan +SET FILTER TO LEFT(scc,3)='404' AND LEFT(scd,4)#'4426' AND !DELETED() +SCAN + SCATTER MEMVAR + SELE mf + LOCATE FOR cod=m.cod AND !DELETED() + IF FOUND() + SUM valoare TO totval FOR cod=m.cod AND !DELETED() + DO CASE + CASE totvalm.suma + DO erver WITH 'Introdus gresit!',totval + ENDCASE + s=.F. + ELSE + DO erver WITH 'Neintrodus!',0 + s=.F. + ENDIF +ENDSCAN + +IF s + DO MESAJ WITH 'Toate mijloacele fixe achizitionate','sunt luate in evidenta.' +ENDIF + +RETURN + + + +*_________________________________________ +PROCEDURE erver +PARAMETERS texter,totval +oer=CREATE('eroareverif') +oer.label5.CAPTION=texter +oer.text5.VALUE=totval +oer.SHOW(1) +RETURN + + + + + + +*_________________________________________________________ +PROCEDURE CAUT_ALF_vechi +PARAMETERS NUMEBAZA,NUMECIMP,CAPTEXT,VARMEM +LOCAL MC0,MC1,MC2 +SET SAFETY OFF +MC0='SELE '+NUMEBAZA +MC1='VARMEM=M.'+NUMECIMP +MC2='SET order TO TAG '+NUMECIMP + +&MC0 +IF EOF() + APPE BLANK +ENDIF +&MC2 + +OCA=CREATEOBJECT("CAUTALFa") +OCA.GRID1.RECORDSOURCE=NUMEBAZA +OCA.GRID1.COLUMN1.CONTROLSOURCE=NUMECIMP +*OCA.titlufrumos1.caption=PROPER(CAPTEXT) +OCA.CAPT=PROPER(CAPTEXT) +OCA.SHOW(1) + +IF buton=2 + &MC0 + SET FILTER TO + RETURN +ENDIF + +&MC0 +SCATTER MEMVAR +&MC1 + +ENDPROC + + +*_________________________________________________________ +PROCEDURE CAUT_ALF +PARAMETERS NUMEBAZA,NUMECIMP,CAPTEXT,VARMEM +LOCAL MC0,MC1,MC2 +SET SAFETY OFF +MC0='SELE '+NUMEBAZA +MC1='VARMEM=M.'+NUMECIMP +MC2='SET order TO TAG '+NUMECIMP + +&MC0 +GO TOP +IF EOF() + APPE BLANK +ENDIF +&MC2 + +OCA=CREATEOBJECT("CAUTALFA") +OCA.CAPTION=CAPTEXT +OCA.GRID1.RECORDSOURCE=NUMEBAZA +OCA.GRID1.COLUMN1.CONTROLSOURCE=NUMECIMP +OCA.SHOW(1) + +SCATTER MEMVAR +&MC1 +&MC0 +SET FILTER TO +RETURN + + +*_________________________________________________________ +PROCEDURE CAUT_ALFa +PARAMETERS NUMEBAZA,NUMECIMP,CAPTEXT,VARMEM +buton=1 +LOCAL MC0,MC1,MC2 +SET SAFETY OFF + +STORE .T. TO llVizibil + +LcVar=VARMEM && pt variabilele globale(varmem) pt care varmem # numecimp + +MC0='SELE '+NUMEBAZA +MC1=[VARMEM=M.]+NUMECIMP +MC2='SET order TO TAG '+NUMECIMP + +*!* &MC0 +*!* GO TOP +*!* IF EOF() +*!* APPE BLANK +*!* ENDIF + +*!* &MC2 + +LOCAL lcNumeCol2 +STORE '' TO lcNumeCol2 + +LcCol = ALLTRIM(NUMEBAZA) + '.cod_fiscal' +IF TYPE(LcCol) # 'U' + lcNumeCol2 = 'cod_fiscal' +ENDIF +LcCol = ALLTRIM(NUMEBAZA) + '.gest' +IF TYPE(LcCol) # 'U' + lcNumeCol2 = 'gest' +ENDIF +LcCol = ALLTRIM(NUMEBAZA) + '.id_sectie' +IF TYPE(LcCol) # 'U' + lcNumeCol2 = 'id_sectie' +ENDIF +IF EMPTY(lcNumeCol2) + lcNumeCol2 = 'space(4)' + llVizibil = .F. +ENDIF + +SELECT DISTINCT &NUMECIMP, &lcNumeCol2 FROM (NUMEBAZA) INTO CURSOR tnomenclator READWRITE ORDER BY &NUMECIMP + +OCA=CREATEOBJECT("CAUTALFa") +OCA.CAPTION=CAPTEXT +OCA.GRID1.RECORDSOURCE = 'tnomenclator' +OCA.GRID1.COLUMN1.CONTROLSOURCE = NUMECIMP +OCA.GRID1.COLUMN2.CONTROLSOURCE = lcNumeCol2 +OCA.GRID1.COLUMN2.VISIBLE = llVizibil +OCA.cmdrenunt1.VISIBLE=.T. +OCA.SHOW(1) + +IF buton=2 +*!* &MC0 +*!* SET FILTER TO + USE IN tnomenclator + RETURN +ENDIF +*!* &MC0 +*!* SCATTER MEMVAR + +SELECT tnomenclator +SCATTER MEMVAR + +&MC1 +&LcVar=VARMEM +*!* &MC0 +*!* SET FILTER TO +USE IN tnomenclator +RETURN + + + +*_________________________________________________________ +PROCEDURE caut_alfa_cursor +PARAMETERS NUMEBAZA,NUMECIMP,CAPTEXT,VARMEM +LOCAL llVizibil +SET SAFETY OFF +llVizibil = .T. + +IF !EMPTY(VARMEM) AND TYPE('VARMEM') = 'C' + MC1='VARMEM=M.'+NUMECIMP +ENDIF + +LOCAL lcNumeCol2 +STORE '' TO lcNumeCol2 + +LcCol = ALLTRIM(NUMEBAZA) + '.cod_fiscal' +IF TYPE(LcCol) # 'U' + lcNumeCol2 = 'cod_fiscal' +ENDIF + +LcCol = ALLTRIM(NUMEBAZA) + '.gest' +IF TYPE(LcCol) # 'U' + lcNumeCol2 = 'gest' +ENDIF + +LcCol = ALLTRIM(NUMEBAZA) + '.id_sectie' +IF TYPE(LcCol) # 'U' + lcNumeCol2 = 'id_sectie' +ENDIF + +IF EMPTY(lcNumeCol2) + lcNumeCol2 = 'space(4)' + llVizibil = .F. +ENDIF + +LcCol = ALLTRIM(NUMEBAZA) + '.id' +IF TYPE(LcCol) # 'U' + lcNumeCol3 = 'id' +ELSE + lcNumeCol3 = 'space(4)' +ENDIF + +SELECT DISTINCT &NUMECIMP, &lcNumeCol2, &lcNumeCol3 FROM (NUMEBAZA) INTO CURSOR tnomenclator READWRITE ORDER BY &NUMECIMP + +OCA=CREATEOBJECT("CAUTALFa") +OCA.CAPTION=CAPTEXT +OCA.GRID1.RECORDSOURCE='tnomenclator' +OCA.GRID1.COLUMN1.CONTROLSOURCE = NUMECIMP +OCA.GRID1.COLUMN2.CONTROLSOURCE = lcNumeCol2 +OCA.GRID1.COLUMN2.VISIBLE = llVizibil +OCA.cmdrenunt1.VISIBLE=.T. +OCA.command1.VISIBLE=.F. +OCA.command2.VISIBLE=.F. +OCA.command3.VISIBLE=.F. +OCA.SHOW(1) + +IF buton=2 + SELECT tnomenclator + SCATTER NAME onome BLANK + USE IN tnomenclator + RETURN onome +ENDIF + +SELECT tnomenclator +SCATTER MEMVAR +SCATTER NAME onome + +IF TYPE('MC1') # 'U' + &MC1 +ENDIF + +USE IN tnomenclator +RETURN onome + +*_________________________________________________________ +PROCEDURE GENERARE_ACT +LOCAL i,J,T,T1,T2,T3,T4,T5,T6,T7 +SELE varact + +OACTGEN=CREATEOBJECT("ACTGEN") +FOR i=5 TO 11 + DO CASE + CASE i=10 + J="10" + CASE i=11 + J="11" + OTHERWISE + J=CHR(48+i) + ENDCASE + GOTO i + SCATTER MEMVAR + T=".TEXT"+J+".CONTROLSOURCE=CONTROL"+J + T1=".LABEL"+J+".CAPTION=M.ETICHETA" + T2=".LABEL"+J+".VISIBLE=M.VIZIBIL" + T3=".TEXT"+J+".VISIBLE=M.VIZIBIL" + T4=".TEXT"+J+".READONLY=M.CAUTARE" + T5=".CAUT"+J+"=M.CAUTARE" + T6=".BAZA"+J+"=M.BAZA" + T7=".CIMP"+J+"=M.CIMP" + WITH OACTGEN + &T + &T1 + &T2 + &T3 + &T4 + &T5 + &T6 + &T7 + ENDWITH +ENDFOR + +OACTGEN.SHOW(1) + +ENDPROC + + + + +*TOTPROC +*********************************************************************************** +PROCEDURE CODARE +SELE cod +IF FLOCK() + GOTO BOTTOM +*SCATTER MEMVAR + m.cod=cod+1 + APPEND BLANK +*m.COD=RECNO() + GATHER MEMVAR +ENDIF +UNLOCK +RETURN +***************** + + + +*___________________________________________ +PROCEDURE MESAJ +PARAMETERS m1,m2 +ot=CREATE('text') +ot.label2.CAPTION=m1 +ot.label3.CAPTION=m2 +ot.SHOW(1) +RETURN + +*___________________________________________ +PROCEDURE mesajatent +PARAMETERS m1,m2 +ot=CREATE('atentie') +ot.label2.CAPTION=m1 +ot.label3.CAPTION=m2 +ot.SHOW(1) +RETURN + +*___________________________________________ +PROCEDURE mesajrosu +PARAMETERS m1,m2 +ot=CREATE('atentierosu') +ot.label2.CAPTION=m1 +ot.label3.CAPTION=m2 +ot.SHOW(1) +RETURN + + + +*___________________________________________ +PROCEDURE alfabeta +PARAMETERS clasa,e5,b5,c5,e6,b6,c6,e7,b7,c7,expl +m.explicatia=expl +clasaact='actverif' +oc=CREATE(clasa) +WITH oc + .eti5=e5 + .eti6=e6 + .eti7=e7 + .baza5=b5 + .baza6=b6 + .baza7=b7 + .cimp5=c5 + .cimp6=c6 + .cimp7=c7 + .num=c5 + .num2=c6 + .expl=c7 +ENDWITH +oc.SHOW(1) +RETURN + + + +*_____________________________________- +PROCEDURE IESIRE +*close tables +*close database +*set defa to &dirgen +*erase actactan.* +*erase ?temp.* +QUIT +RETURN + + +PROCEDURE EXEC_MENIU +RETURN + + +*________________________________ +PROCEDURE danu +PARAMETERS T1,T4,T5 +od=CREATE('casdanu') +WITH od + .text1.VISIBLE=.F. + .text2.VISIBLE=.F. + .label1.CAPTION=T1 + .label4.CAPTION=T4 + .label5.CAPTION=T5 +ENDWITH +od.SHOW(1) +RETURN + +*___________________________________________ +PROCEDURE danuquit +PARAMETERS m1 +od=CREATE('danu') +od.label1.CAPTION=m1 +od.SHOW(1) +IF buton=2 + QUIT +ENDIF +RETURN +*___________________________________________ + +PROCEDURE DaSauNu +PARAMETERS m1 +od=CREATE('danu') +od.label1.CAPTION=m1 +od.SHOW(1) +RETURN + +*____________________________________ +PROC PR +PARAM stare +IF stare>Maxs +*stare=0 + Maxs=2*Maxs + OP.PRBAR.MAX=Maxs +*return +ENDIF +OP.PRBAR.VALUE=stare +OP.P=ROUND(100*OP.PRBAR.VALUE/OP.PRBAR.MAX,2) +OP.REFRESH +stare=stare+1 +RETURN + +*________________________________________ +PROCEDURE danu_ingest +PARAMETERS cas,txt1,txt2 + +IF UPPER(ALLTRIM(txt2))='INTRARE' + lcLb2 = 'Cauza intrarii in gestiune' + lcLb3 = 'Data intrarii in gestiune' +ENDIF +IF UPPER(ALLTRIM(txt2))='IESIRE' + lcLb2 = 'Cauza iesirii din gestiune' + lcLb3 = 'Data iesirii dn gestiune' +ENDIF +m.dataout = ultima_zi_din_luna(m.an,m.nl) +SELECT mf +oi=CREATEOBJECT('ingest') +oi.label1.CAPTION=txt1 +oi.label2.CAPTION=lcLb2 +oi.label3.CAPTION=lcLb3 + +*!* If cas +*!* oi.label2.Visible=.F. +*!* oi.text1.Visible=.F. +*!* oi.label3.Visible=.F. +*!* oi.text2.Visible=.F. +*!* Endif +oi.SHOW(1) +RETURN + + +*_________________________________________________ +PROC err +DO MESAJ WITH 'Pentru initializare trebuie lansat','programul CONTAFIN CONT2000' +buton=2 +DO WHILE buton=2 + QUIT +ENDDO +RETURN + + + +*________________________________________________ +PROCEDURE inchidprog +LOCAL CC,M.NUMESTATIE,UU +IF FILE('c:\contafin\temp\CEPROGRAM.dbf') + + SELE 0 + USE C:\CONTAFIN\temp\ceprogram ALIAS ceprogram + UU=UTIL + SELE ceprogram + USE + + IF !FILE('&LOC\&NFSCURT\TEMPO\OPTIUNI.DBF') +*wait wind 'optiuni' + RETURN + ENDIF + IF !USED('OPTIUNI') + SELE 0 + USE &loc\&nfscurt\TEMPO\OPTIUNI SHAR ALIAS OPTIUNI + ENDIF + + SELE OPTIUNI + LOCA FOR OPTIUNE='RETEA' + IF !FOUND() OR (FOUND() AND !DA) + SELE OPTIUNI + USE +*wait wind LOC + RETURN + ENDIF + SELE OPTIUNI + USE + + IF !FILE('C:\CONTAFIN\temp\RETEA.DBF') +*wait wind 'start-retea' + RETURN + ENDIF + SELE 0 + USE C:\CONTAFIN\temp\RETEA SHAR ALIAS RETEA + m.NUMESTATIE=ALLT(NUMESTATIE) + CC=DIRgen + USE + + IF FILE('&DIRGEN\Dateretea\istoric.DBF') + SELE 0 + USE &DIRgen\Dateretea\istoric SHARE ALIAS istoric + ELSE + SELE 0 + USE &CC\START2000\DATA\istoric SHARE ALIAS istoric + ENDIF + + SELE istoric + SET ORDER TO DATAORAINT + LOCA FOR EMPTY(dataoraies) AND ALLT(statie)=m.NUMESTATIE AND ALLT(UTILIZATOR)=ALLT(UU) + IF FOUND() + IF FLOCK() + REPL dataoraies WITH DATETIME() + UNLOCK + ENDIF + ENDIF + SELE istoric + USE + + + IF FILE('&DIRGEN\Dateretea\activ.DBF') + SELE 0 + USE &DIRgen\Dateretea\ACTIV SHARE ALIAS ACTIV + ELSE + SELE 0 + USE &CC\START2000\DATA\ACTIV SHARE ALIAS ACTIV + ENDIF + + SELE ACTIV + LOCA FOR ALLT(statie)=m.NUMESTATIE + IF !FOUND() + WAIT WIND 'Aceasta statie nu este inregistrata in server!' + ELSE + SELE ACTIV + IF FLOCK() + REPL mfix2000 WITH .F. + ENDIF + UNLOCK + ENDIF + SELE ACTIV + USE +ENDIF +RETURN + + + + + + +*!* *_____________________________________- +*!* FUNCTION SERIA_LUNARA_E_CORECTA +*!* local TIPAR,LOC,L +*!* L=VAL(M.NL) +*!* LOC=L+floor((L-1)/2) +*!* TIPAR='010649161147' + +*!* sele cul +*!* GO TOP +*!* &&ESTE CORECTA ULTIMA SERIE? +*!* IF substr(TIPAR,L,1)=substr(GREEN,LOC,1); +*!* AND substr(red,1,1)=substr(GREEN,3,1); +*!* AND substr(red,2,1)=substr(GREEN,6,1); +*!* AND substr(red,3,1)=substr(GREEN,9,1); +*!* AND substr(red,4,1)=substr(GREEN,12,1); +*!* AND substr(red,5,1)=substr(GREEN,15,1) +*!* RETURN .T. +*!* ELSE +*!* RETURN .F. +*!* ENDIF +*!* RETURN +*_____________________________________- +FUNCTION SERIA_LUNARA_E_CORECTA +LOCAL loc,L +L=VAL(M.nl) +loc=L+FLOOR((L-1)/2) + +SELE cul +GO TOP +&&ESTE CORECTA ULTIMA SERIE? +IF SUBSTR(TIPAR,L,1)=SUBSTR(GREEN,loc,1); + AND SUBSTR(red,1,1)=SUBSTR(GREEN,3,1); + AND SUBSTR(red,2,1)=SUBSTR(GREEN,6,1); + AND SUBSTR(red,3,1)=SUBSTR(GREEN,9,1); + AND SUBSTR(red,4,1)=SUBSTR(GREEN,12,1); + AND SUBSTR(red,5,1)=SUBSTR(GREEN,15,1) + RETURN .T. +ELSE + RETURN .F. +ENDIF + + +*!* *------------------------------------------------ +*!* PROCEDURE seriadebaza +*!* LOCAL sb,sn +*!* STORE '' TO sb,sn + +*!* FOR i=1 TO 5 +*!* sb=sb+LITERA() +*!* NEXT + +*!* SELE cul +*!* GO TOP +*!* REPL red WITH sb +*!* sn=GREEN + + +*!* IF SUBSTR(sn,3,1)=SUBSTR(sb,1,1) AND; +*!* SUBSTR(sn,6,1)=SUBSTR(sb,2,1) AND; +*!* SUBSTR(sn,9,1)=SUBSTR(sb,3,1) AND; +*!* SUBSTR(sn,12,1)=SUBSTR(sb,4,1) AND; +*!* SUBSTR(sn,15,1)=SUBSTR(sb,5,1) AND; +*!* SUBSTR(sn,VAL(M.nl)+FLOOR((VAL(M.nl)-1)/2),1)=SUBSTR(TIPAR,VAL(M.nl),1) +*!* RETURN +*!* ELSE + +*!* FOR i=1 TO 17 +*!* sn=sn+LITERA() +*!* NEXT + +*!* FOR i=1 TO 5 +*!* sn=STUFF(sn, i*3, 1, SUBSTR(sb,i,1)) +*!* NEXT +*!* sn=STUFF(sn, VAL(M.nl)+FLOOR((VAL(M.nl)-1)/2), 1, SUBSTR(TIPAR,VAL(M.nl),1)) + +*!* SELE cul +*!* REPL GREEN WITH sn +*!* ENDIF +*!* RETURN + + + + +*_____________________________________- +FUNCTION e_ultima_luna +SELE calendar +LOCA FOR m.nl=nl AND m.an=an +SKIP +IF EOF() + ultima_luna=.T. + RETURN .T. +ELSE + ultima_luna=.F. + RETURN .F. +ENDIF +RETURN + +PROCEDURE CITESTE_ANALITICE +RETURN + +*______________________________________ + +PROCEDURE alegeprogram +PUBLIC op_imob + +IF !USED('verimob') + USE &DIRgen\IMOB2003\VERIMOB IN 0 ALIAS VERIMOB SHARED +ENDIF + +SELECT VERIMOB +DO CASE + CASE s + NUMEPROGRAM='CONTAFIN IMOBILIZARI' + op_imob=CREA('p_imob_i') + op_imob.pagefrb1.page1.cw1.VISIBLE=.F. + op_imob.pagefrb1.page1.cw3.VISIBLE=.F. + op_imob.pagefrb1.page1.shape4.VISIBLE=.F. + op_imob.pagefrb1.page1.cw4.TOP=17 + op_imob.pagefrb1.page1.cw2.TOP=53 + op_imob.pagefrb1.page1.shape3.TOP=85 + CASE i + NUMEPROGRAM='CONTAFIN IMOBILIZARI' + op_imob=CREA('p_imob_i') + CASE E + NUMEPROGRAM='CONTAFIN IMOBILIZARI' + op_imob=CREA('p_imob_e') +ENDCASE + + + +ENDPROC && alegeprogram + +*___________________________________________ + +PROCEDURE verific_cu_balanta +PARAMETERS tcFel +LOCAL ln_fel + +IF PCOUNT() > 0 + lcfel = ALLTRIM(UPPER(tcFel)) +ELSE + lcfel = '' +ENDIF + +DO CASE + CASE lcfel ='' + ln_fel=1 + CASE lcfel ='N' + ln_fel=2 + CASE lcfel ='C' + ln_fel=3 +ENDCASE + +CREATE TABLE &loc\&nfscurt\compar_amort (c_imob C(4),c_amort C(4),val_mf N(16),vald_bal N(16),amort_mf N(16),valc_bal N(16)) + +IF !USED('bal') + USE &DATE\bal IN 0 AGAIN ALIAS bal SHARED +ENDIF + +SELECT contamort +IF TYPE('contamort.fel_imob')#'U' + SELECT contamort + GO TOP + IF EMPTY(fel_imob) + DO MESAJ WITH 'Dati actualizare de fisier','INITIALIZARE / CONTURI DE AMORTIZARE' + RETURN + ENDIF +ELSE + DO MESAJ WITH 'Reindexati fisierele din DATEAN','' + RETURN +ENDIF + +SELECT contamort +SCAN FOR fel_imob=ln_fel + SCATTER NAME ocont + SELECT mf + SUM valin TO ln_valoare FOR ALLTRIM(scd)=ALLTRIM(ocont.cont_imob) AND !casat AND !inactiv AND ALLTRIM(UPPER(fel))=lcfel + SUM amorttot TO ln_amort FOR ALLTRIM(scd)=ALLTRIM(ocont.cont_imob) AND !casat AND !inactiv AND ALLTRIM(UPPER(fel))=lcfel + SELECT bal + LOCATE FOR ALLTRIM(CONT)=ALLTRIM(ocont.cont_imob) + IF !FOUND() + ln_soldD=0 + ELSE + ln_soldD=solddeb + ENDIF + LOCATE FOR CONT=ocont.cont_amort + IF !FOUND() + ln_soldC=0 + ELSE + ln_soldC=soldcred + ENDIF + SELECT compar_amort + APPEND BLANK + REPLACE c_imob WITH ocont.cont_imob,val_mf WITH ln_valoare,amort_mf WITH ln_amort + REPLACE c_amort WITH ocont.cont_amort,vald_bal WITH ln_soldD,valc_bal WITH ln_soldC + SELECT contamort +ENDSCAN + +SELECT compar_amort +SCAN + IF val_mf#vald_bal + DO MESAJ WITH 'Diferenta intre Imobilizari si Balanta','la contul '+c_imob+' este de '+ALLTRIM(STR(val_mf-vald_bal))+' lei' + ENDIF + +ENDSCAN + +SELECT c_amort,SUM(amort_mf) AS tot_amort,valc_bal FROM compar_amort; + GROUP BY c_amort; + INTO CURSOR alabala + +SELECT alabala +SCAN + IF tot_amort#valc_bal + DO MESAJ WITH 'Diferenta intre Imobilizari si Balanta','la contul '+c_amort+' este de '+ALLTRIM(STR(tot_amort-valc_bal))+' lei' + ENDIF +ENDSCAN + +DO MESAJ WITH '','Verificarea s-a incheiat!' +RELEASE ocont + +IF USED('bal') + USE IN bal +ENDIF +IF USED('compar_amort') + USE IN compar_amort +ENDIF +IF USED('alabala') + USE IN alabala +ENDIF + +ENDPROC && verific_cu_balanta + + +*ALFANUMERIC ALEATOR__________________________________________ +FUNCTION LITERA() +LOCAL Z,N,L,U,R,R1 + +Z=ROUND(RAND()*10+48,0) +N=IIF(Z=58,'0',CHR(Z)) + +Z=ROUND(RAND()*26+65,0) +L=IIF(Z=90,'X',CHR(Z)) + +U=ROUND(RAND(),0) +R=IIF(U=1,N,L) + +RETURN R +*RETURN n + +*---------------------------------------------------- +PROCEDURE intrare + +DO FORM start00 +ENDPROC && intrare + +*---------------------------------------------------- +PROCEDURE ACTUALIZARE_FISIER +PARAMETERS TFIS + +TFIS=UPPER(ALLTRIM(TFIS)) +SELECT fistotv +LOCATE FOR UPPER(ALLTRIM(numef))=TFIS +SCATTER NAME OFIS + +SELECT (TFIS) +DELETE ALL + +LcFis=ALLTRIM(OFIS.calealfa)+'\'+TFIS+'.DBF' +*WAIT WINDOW LcFis +SELECT (TFIS) +APPEND FROM &LcFis + +RELEASE OFIS +ENDPROC + +******* +*!* SET CLASSLIB TO d:\contafin\contab\clase\caut.vcx ADDITIVE +*!* oo=ret_luna("Luna de inceput") +*** scattered = MYSCATTER() && This is instead of SCATTER NAME... +PROCEDURE myScatter +PARAMETERS tcBlank +LOCAL llBlank, loScatter + +llBlank=.F. +IF TYPE('tcBlank')='C' + IF 'BLANK'$UPPER(tcBlank) + llBlank=.T. + ENDIF +ENDIF + +myScatterObject = CREATEOBJECT("myScatterObject") +IF !EMPTY(ALIAS()) + IF llBlank + SCATTER NAME loScatter MEMO BLANK + ELSE + SCATTER NAME loScatter MEMO + ENDIF + lnFields = FCOUNT(ALIAS()) + FOR N =1 TO lnFields + lcField=FIELD(N) + lcvalue=loScatter.&lcField + myScatterObject.ADDPROPERTY(lcField, lcvalue) + ENDFOR + RELEASE loScatter +ENDIF +RETURN myScatterObject && Always return an object, so GATHER command could not choke. +ENDPROC + +DEFINE CLASS myScatterObject AS SESSION +* You may use any VFP class directly like myScatterObject = CREATEOBJECT("Session") +* But you may optionally use this DEFINE CLASS +* and declare the native PEMs here as HIDDEN if you want, so they are not exposed +* in case you are using class other than Session or work with VFP version prior to VFP 7.0 +ENDDEFINE + +*____________________________________________________________________________________________ +*** returneaza un obiect cu proprietatile an si nl (de fapt cu toate coloanele din calendar) +FUNCTION ret_luna +PARAMETERS tcTitlu + +PRIVATE loLuna + +SELECT calendar +USE DBF('calendar') IN 0 AGAIN ALIAS tsel_luna SHARE +SELECT tsel_luna +loLuna=myScatter('blank') + +Ol=CREATEOBJECT("frm_sel_luna") +WITH Ol + .lblTitlu.CAPTION=tcTitlu + IF EMPTY(.cboLuna.ROWSOURCE) + .cboLuna.ROWSOURCE="tsel_luna.nl,an" + ENDIF + .oLuna=loLuna + IF EMPTY(.cAlias) + .cAlias=LEFT(.cboLuna.ROWSOURCE,AT(".",.cboLuna.ROWSOURCE)-1) + ENDIF +ENDWITH +Ol.SHOW(1) + +USE IN tsel_luna + +RETURN loLuna +ENDFUNC && ret_oluna +*___________________________________________________________________________________________ +*________________________________________ +PROCEDURE danu_transfer +PARAMETERS cas,txt1,txt2 + +SELECT nume_2 FROM respons INTO CURSOR cRespons ORDER BY nume_2 + +SELECT mf +oi=CREATEOBJECT('ingest_transfer') +oi.label1.CAPTION=txt1 +oi.label2.CAPTION=txt2 +oi.text2.VALUE = DATE() +IF cas + oi.label2.VISIBLE=.F. + oi.text1.VISIBLE=.F. + oi.label3.VISIBLE=.F. + oi.text2.VISIBLE=.F. +ENDIF +oi.SHOW(1) +IF USED("cRespons") + USE IN cRespons +ENDIF +RETURN +*_________________________________________________ + + +FUNCTION TVA +* +ENDFUNC + +FUNCTION NRORD +* +ENDFUNC + +PROCEDURE ULTIMAZI +* +ENDPROC + +PROCEDURE ULTIMAZIL +* +ENDPROC + +PROCEDURE IERULAJMAGAZII +* +ENDPROC + +PROCEDURE IESTOCURIMAGAZII +* +ENDPROC + +PROCEDURE INRULAJMAGAZII +* +ENDPROC + +PROCEDURE INSTOCURIMAGAZII +* +ENDPROC + +*!* *!* *!* *!* *!* *!* *!* *!* *!* diff --git a/Programe/Vechi/quitapp.prg b/Programe/Vechi/quitapp.prg new file mode 100644 index 0000000..c42529b --- /dev/null +++ b/Programe/Vechi/quitapp.prg @@ -0,0 +1,340 @@ +* Program: QUITAPP.PRG +* Description: Client-side of remote termination of applications. +* Created: 07/11/2003 +* Developer: Gregory L Reichert +* Copyright: Copyright (c) 2003 GLR software +*------------------------------------------------------------ +* Id Date By Description +* 1 07/11/2003 Gregory L Reichert Initial Creation +* +*------------------------------------------------------------ + +*!* Overview + +*!* The component is the client-side portion of a Remote Application Killer. +*!* With the use of a shared table, an network administrator can determine +*!* what workstation has what application running, and instruct that application +*!* to quit. + +*!* An administrator can monitor which applications are running, and instruct them +*!* termination themselves. + +*!* Instructions + +*!* This component is based on a Timer class with a one minute interval. Each minute +*!* the application check to see if the administrator wishs the application to +*!* quit. If discovered so, the countdown begins (default 10 minutes). During the +*!* Countdown, a message is displayed notifing the user that the automatic termination of +*!* the application is underway. They can manual exit the application, or wait for the +*!* automatic. Either way, it is intended for the user to complete their current task. +*!* At the end of the countdown, the application issues a QUIT command. + +*!* Call this routine, and a object reference is returned. This object should +*!* remain active throughout the life of the application. + +*!* PRIVATE oQuitApp +*!* oQuitApp = QuitApp( "\\MyServer\MyDrive\CommonFiles\" ) +*!* +*!* When the administrator wish to terminate one or more application, they place +*!* a True (.T.) in the "lQuit" field of the QuitApp.dbf table. As the Application continues +*!* countdown to automated termination, the "Remain" field indicates the number of minutes +*!* remaining. If the Admin changes the value of "Remain", the countdown continues from +*!* that new value. If a value less then zero (0) is entered, the application terminates +*!* the next time the QuitApp timer is fired. + + +*!* Two exposed method are provided to inform the routine that the application +*!* is performing critical operations and can not be interupted. These are called +*!* EnterCritical() and LeaveCritical(). The EnterCritical() should be called when the +*!* critical section begins, and the LeaveCritical() should be called when the section +*!* ends. + +*!* The administrator can check to see a application is running, or if it crashed before hand, +*!* by set the "aLiveTest" field of the QuitApp.dbf to False (.F.). After a couple of minutes, +*!* if the application is still alive, the field will revert to True (.T.). + +*!* The form called Admin_QuitApp.scx is used by the administrator to monitor and control the +*!* remote applications. + +*!* ===================================================================================== + +LPARAMETERS tcPath, tcQuitName + +RETURN CREATEOBJECT("QuitApp", tcPath, tcQuitName) + + +#DEFINE kQuitMax 10 && Wait 10 minutes before auto-quit + +*------------------------------------------------------------ +* Description: QuitApp class +*------------------------------------------------------------ +* Id Date By Description +* 1 07/11/2003 Gregory L Reichert Initial Creation +* +*------------------------------------------------------------ +DEFINE CLASS QuitApp AS TIMER + + INTERVAL = (60*1000) && check once a minute. + ENABLE = .T. + cPath = tcPath + cQuitName ="QuitApp" + cQFile ="QuitApp" + cAlias = "QuitApp" + && Full URN to QuitApp.dbf. Must be at a shared network location for all running application to gain access. + + *------------------------------------------------------------ + * Description: Error Trap + * Parameters: internal + * Return: n/a + * Use: internal + *------------------------------------------------------------ + * Id Date By Description + * 1 07/11/2003 Gregory L Reichert Initial Creation + * + *------------------------------------------------------------ + PROCEDURE ERROR( a,b,c ) + *-- ignore all error from this class + RETURN + ENDPROC + + *------------------------------------------------------------ + * Description: Initializes the timer + * Parameters: cPath: path to the shared QuitApp.dbf - path only + * Return: N/A + * Use: ox = CreateObject( "QuitApp","\\myserver\shared\CommonFiles\" ) + *------------------------------------------------------------ + * Id Date By Description + * 1 07/11/2003 Gregory L Reichert Initial Creation + * + *------------------------------------------------------------ + PROCEDURE INIT( cPath, cQuitName ) + LOCAL lc + lc = SELECT() + + + cPath = ADDBS(IIF(EMPTY(cPath),"", cPath)) + cQuitName = IIF(EMPTY(cQuitName),"QuitApp",JUSTSTEM(cQuitName)) + cQFile = cPath+cQuitName+".dbf" + cAlias = "QuitApp" + + this.cPath = cPath + this.cQuitName = cQuitName + this.cQFile = cQFile + this.cAlias = cAlias + *------------------------------------- + * create QuitApp table if missing. + *------------------------------------- + IF NOT FILE(this.cQFile) + SELECT 0 + CREATE TABLE (this.cQFile) (ws c(40),ID N(10,0), cCaption c(100),lQuit L, remain N(3), Critical L, aLiveTest L) + USE + ENDIF + + SELECT(lc) + ENDPROC + + *------------------------------------------------------------ + * Description: Timer routine + * Parameters: n/a + * Return: n/a + * Use: internal + *------------------------------------------------------------ + * Id Date By Description + * 1 07/11/2003 Gregory L Reichert Initial Creation + * + *------------------------------------------------------------ + PROCEDURE TIMER + + + LOCAL lc + lc = SELECT() + USE (this.cQFile) IN 0 SHARED ALIAS (this.cAlias) + SELECT (this.cAlias) + + LOCATE FOR ID=_VFP.HWND AND cCaption=_VFP.CAPTION AND NOT DELETED() + IF NOT FOUND() + + *------------------------------------- + * Add an instence for this workstation / application + INSERT INTO (this.cQFile) (ws,ID,cCaption,lQuit,remain, Critical, aLiveTest) ; + VALUES ( UPPER(SYS(0)),_VFP.HWND, _VFP.CAPTION, .F., kQuitMax, .F., .T.) + ENDIF + + *- Each time, reset the aLiveTest field. + REPLACE aLiveTest WITH .T. + + IF NOT Critical AND TXNLEVEL()=0 + *- do only if not in Critical Section of the code, + * and not in a Transaction block + IF lQuit + *------------------------------------- + * if still timing out, display remaining time. + *------------------------------------- + IF remain>0 + IF remain=kQuitMax + * - if first time displaying the warning, force application on top. + _SCREEN.ALWAYSONTOP=.T. + _SCREEN.ALWAYSONTOP=.F. + ENDIF + *- decrement the counter, and display warning. + REPLACE remain WITH remain -1 + osh=CREATEOBJECT('shell.application') + osh.minimazeall + _screen.windowstate=2 + WAIT WINDOW NOCLEAR NOWAIT "Programul se va inchide automat in " +ALLTRIM(STR(remain,10))+" minute." + ?? CHR(7) + osh.undominimazeall + RELEASE osh + ELSE + *------------------------------------- + * otherwise, quit the application. + *------------------------------------- + USE IN (this.cAlias) + CLEAR EVENTS + glQuit = .T. + QUIT + ENDIF + ELSE + *------------------------------------- + * if nolonger quiing, reset counter. + *------------------------------------- + REPLACE remain WITH kQuitMax + WAIT CLEAR + ENDIF + ENDIF + + USE IN (this.cAlias) + THIS.RESET + SELECT(lc) + ENDPROC + + *------------------------------------------------------------ + * Description: Called when entering a Critical Section of the code. + * Parameters: n/a + * Return: True + * Use: .EnterCritical + *------------------------------------------------------------ + * Id Date By Description + * 1 07/11/2003 Gregory L Reichert Initial Creation + * + *------------------------------------------------------------ + PROCEDURE EnterCritical() + LOCAL lc + lc = SELECT() + USE (this.cQFile) IN 0 SHARED ALIAS (this.cAlias) + SELECT (this.cAlias) + + UPDATE (this.cQFile) SET Critical=.T. WHERE ID=_VFP.HWND AND cCaption=_VFP.CAPTION + + USE IN (this.cAlias) + SELECT(lc) + ENDPROC + + *------------------------------------------------------------ + * Description: Called when exitting a Critical Section of the code. + * Parameters: n/a + * Return: True + * Use: .LeaveCritical + *------------------------------------------------------------ + * Id Date By Description + * 1 07/11/2003 Gregory L Reichert Initial Creation + * + *------------------------------------------------------------ + PROCEDURE LeaveCritical() + LOCAL lc + lc = SELECT() + USE (this.cQFile) IN 0 SHARED ALIAS (this.cAlias) + SELECT (this.cAlias) + + UPDATE (this.cQFile) SET Critical=.F. WHERE ID=_VFP.HWND AND cCaption=_VFP.CAPTION + + USE IN (this.cAlias) + SELECT(lc) + ENDPROC + + *------------------------------------------------------------ + * Description: Destroy this object + * Parameters: n/a + * Return: n/a + * Use: internal + *------------------------------------------------------------ + * Id Date By Description + * 1 07/11/2003 Gregory L Reichert Initial Creation + * + *------------------------------------------------------------ + PROCEDURE DESTROY + *----------------------------------------------- + * On destroy, remove the application reference from the QuitApp table. + *----------------------------------------------- + LOCAL lc + lc = SELECT() + USE (this.cQFile) IN 0 SHARED ALIAS (this.cAlias) + SELECT (this.cAlias) + + DELETE FROM (this.cQFile) WHERE ID=_VFP.HWND AND cCaption=_VFP.CAPTION + + USE IN (this.cAlias) + SELECT(lc) + ENDPROC + +ENDDEFINE + + + +&& ------------------------------INCEPUT: Quit_Automat ------------------------------ +*!* Procedura: Quit_Automat +*!* Parametri: tlQuit +*!* Data/Ora generarii: 19/02/2004 12:48 +*!* Autor: MARIUS.MUTU +PROCEDURE Quit_Automat +LPARAMETERS tlQuit + +IF tlQuit + QUIT +ENDIF + +ENDPROC +&& ------------------------------SFARSIT: Quit_Automat ------------------------------ + +* Eof QUITAPP.PRG +*************************** +*!* FUNCTION AppInstance +*!* PARAMETERS WindowName + +*!* #DEFINE GW_OWNER 4 +*!* #DEFINE GW_HWNDFIRST 0 +*!* #DEFINE GW_HWNDNEXT 2 +*!* #DEFINE SW_MAXIMIZE 3 +*!* #DEFINE SW_NORMAL 1 + +*!* DECLARE integer SetForegroundWindow in win32api long lnhWnd +*!* DECLARE integer GetWindowText in win32api integer, string, integer +*!* DECLARE integer GetWindow in win32api integer,INTEGER +*!* DECLARE integer IsWindowVisible in win32api integer +*!* DECLARE integer GetActiveWindow in win32api +*!* DECLARE integer ShowWindow in user32 INTEGER lnhWnd, INTEGER lnCmdShow + +*!* IsWindEx = .F. +*!* if len(WindowName) < 1 +*!* return .t. +*!* endif + +*!* foxhwnd = GetActiveWindow() +*!* hwndNext = GetWindow(foxhwnd,GW_HWNDFIRST) + +*!* DO WHILE hwndNext <> 0 +*!* IF (hwndnext <> foxhwnd .AND. GetWindow(hwndnext,GW_OWNER) = 0) +*!* Stuffer = SPACE(64) +*!* x = GetWindowText(hwndnext,@Stuffer,64) +*!* IF WindowName $ Stuffer +*!* IsWindEx = .T. +*!* =SetForegroundWindow(hwndnext) +*!* =ShowWindow(hwndNext,SW_MAXIMIZE) +*!* EXIT +*!* ENDIF +*!* ENDIF +*!* hwndNext = GetWindow(hwndnext,GW_HWNDNEXT) +*!* ENDDO + +*!* RETURN IsWindEx +*!* ENDFUNC \ No newline at end of file diff --git a/Programe/Vechi/redeschidere.prg b/Programe/Vechi/redeschidere.prg new file mode 100644 index 0000000..d099125 --- /dev/null +++ b/Programe/Vechi/redeschidere.prg @@ -0,0 +1,128 @@ +* +Procedure redeschid_luna +PARAMETERS tcAn, tcLuna + Local lunatrec,antrec,lcLuna,lcAn,dattrec,datcrt + Set Safety Off + + IF EMPTY(tcAn) OR TYPE('tcAn') # 'C' + lcAnCrt = m.an + ELSE + lcAnCrt = ALLTRIM(tcAn) + ENDIF + + IF EMPTY(tcLuna) OR TYPE('tcLuna') # 'C' + lcLunaCrt = m.nl + ELSE + lcLunaCrt = ALLTRIM(tcLuna) + ENDIF + + Sele calendar + Locate For an = lcAnCrt AND nl = lcLunaCrt + Skip -1 + If Bof() + Do mesajatent With 'Luna '+ lcLunaCrt + ' ' + lcAnCrt ,'este prima luna deschisa!' + Return + ENDIF + + lunatrec=nl + antrec=an + + lcDatePrec = ADDBS(calefirma) + 'AN' + ADDBS(antrec) + 'DATE' + ADDBS(lunatrec) + 'mf.dbf' + + IF FILE(lcDatePrec) + USE &lcDatePrec IN 0 SHARED ALIAS mfPrec + SELECT * from mfPrec WHERE !DELETED() INTO CURSOR crs_mfPrec READWRITE + USE IN mfPrec + ELSE + Do MESAJ With 'Nu exista date in luna precedenta! ','' + SELECT * from mf WHERE 1=2 INTO CURSOR crs_mfPrec READWRITE + ENDIF + + SELECT crs_mfPrec + REPLACE ALL cod WITH 0 + REPLACE ALL amortprec WITH amorttot + + + SELECT mf + DELETE ALL FOR cod = 0 + + SELECT mflun + DELETE ALL FOR cod = 0 + + SELECT mf + APPEND FROM DBF('crs_mfPrec') + + *** stabilesc care sunt inregistrarile inactive + SELECT * from mf WHERE cod = -1 INTO CURSOR crs_mfNoi + SELECT crs_mfNoi + SCAN + SCATTER NAME omf + SELECT mf + REPLACE ALL inactiv WITH .t. For cod = 0 AND fel = omf.fel AND UPPER(ALLTRIM(denumire))=UPPER(ALLTRIM(omf.denumire)) AND datapif=omf.datapif AND nrpif=omf.nrpif AND nrinv=omf.nrinv + SELECT crs_mfNoi + ENDSCAN + + IF 12*VAL(SUBSTR(gcDataRon,4,4))+VAL(LEFT(gcDataRon,2)) = 12*VAL(lcAnCrt)+VAL(lcLunaCrt) AND verific_rolronsnr(gcCalefirma) + lnDim = 10000 + SELECT mf + REPLACE ALL valoare WITH ROUND(valoare/lnDim,gnZ) FOR cod # -1 + REPLACE ALL valin WITH ROUND(valin/lnDim,gnZ) FOR cod # -1 + REPLACE ALL valramasa WITH ROUND(valramasa/lnDim,gnZ) FOR cod # -1 + REPLACE ALL valrez WITH ROUND(valrez/lnDim,gnZ) FOR cod # -1 + REPLACE ALL amortprec WITH ROUND(amortprec/lnDim,gnZ) FOR cod # -1 + REPLACE ALL amortlun WITH ROUND(amortlun/lnDim,gnZ) FOR cod # -1 + REPLACE ALL amorttot WITH ROUND(amorttot/lnDim,gnZ) FOR cod # -1 + REPLACE ALL amortan WITH ROUND(amortan/lnDim,gnZ) FOR cod # -1 + ENDIF + + IF USED('crs_mfNoi') + USE IN crs_mfNoi + ENDIF + IF USED('crs_mfPrec') + USE IN crs_mfPrec + ENDIF + + Do MESAJ With 'Lista mijloacelor fixe din luna ',lcLunaCrt + ' ' + lcAnCrt + ' a fost actualizata!' + +RETURN + +***------------------------------------------------*** + +PROCEDURE deschid_luna_noua +PARAMETERS tcAn, tcLuna + +Set Safety Off +IF EMPTY(tcAn) OR TYPE('tcAn') # 'C' + lcAn = m.an +ELSE + lcAn = ALLTRIM(tcAn) +ENDIF + +IF EMPTY(tcLuna) OR TYPE('tcLuna') # 'C' + lcLuna = m.nl +ELSE + lcLuna = ALLTRIM(tcLuna) +ENDIF + + +Set Exclusive On +lcDateNew = ADDBS(gcCalefirma) + 'An' + lcAn + '\' + 'DATE' + lcLuna + +If !Directory(lcDateNew) + Md &lcDateNew +Endif +Set Exclusive Off + +Sele CALENDAR +LOCATE FOR an = lcAn AND luna = lcLuna +IF !FOUND() + APPEND BLANK + Repl nl With lcLuna + Repl an With lcAn +ENDIF +SCATTER MEMVAR && pt celebrele variabile globale + +Do totv.PRG +DO init_optiuni.prg + +ENDPROC && deschid_luna_noua \ No newline at end of file diff --git a/Programe/Vechi/reindexare.prg b/Programe/Vechi/reindexare.prg new file mode 100644 index 0000000..f46b8cf --- /dev/null +++ b/Programe/Vechi/reindexare.prg @@ -0,0 +1,707 @@ +Parameters tcConditie +&& conditia suplimentara && ex: gcAppPath$calealfa + +If !Empty(tcConditie) + lcConditie=Alltrim(tcConditie) +Else + lcConditie = [] +Endif +*!* DIRFIRM=loc+'\'+NFSCURT +*!* *CALEFIRMA=ALLTRIM(M.CALEFIRM) +*!* SET DELETED OFF + + +*!* IF !DIRECTORY('&CALEFIRMA') +*!* DO MESAJrosu WITH 'Calea '+CALEFIRMA+' este incorecta!','Sugeram iesirea din program.' +*!* QUIT +*!* RETRY +*!* ENDIF + +*!* DATE=CALEFIRMA+'\AN'+m.an+'\DATE'+M.nl +*!* DATEAN=CALEFIRMA+'\DATEAN' +*!* CALET=DIRFIRM+'\TEMPO' +*!* m.ANTET='S.C. '+M.FLUNG +*!* WAIT ' ' TIMEOUT 0.01 +*!* CLOSE DATABASE +*!* LOCAL ll,aa +*!* ll=m.nl +*!* aa=m.an + +*!* DO deschidf WITH '&dirgen\Imob2003\date\','&dirgen\Imob2003\date\','fistotvmf','fistotv','CALE','' + +*!* *do deschidprog in totv.prg +*!* *----------------- +*!* BUTON=2 +*!* DO dasaunu WITH 'Se reindexeaza fisierele lunare?' +*!* IF BUTON=1 +*!* SET DELETED ON +*!* SELE 0 +*!* USE &CALEFIRMA\DATEAN\calendar ALIAS calendar &&????????????????????????????????? +*!* SELECT DISTINCT an AS anan FroM calendar INTO CURSOR TANCAL +*!* SELECT TANCAL +*!* SCAN +*!* DO dasaunu WITH 'Se reindexeaza fisierele din anul '+anan+' ?' +*!* IF BUTON=1 +*!* lc_an=anan +*!* SELE calendar +*!* SCAN FOR !DELETED() AND an=lc_an +*!* SCATTER MEMVAR +*!* DATE=CALEFIRMA+'\AN'+m.an+'\DATE'+M.nl +*!* BUTON=2 +*!* DO dasaunu WITH 'Se reindexeaza fisierele din luna '+m.nl+' '+m.an+' ?' +*!* IF BUTON=1 +*!* SELE fistotv +*!* Maxs=RECCOUNT() +*!* j=0 +*!* OP=CREA('PROGRESBAR') +*!* OP.titlu.CAPTION='Se reindexeaza fisierele lunii '+m.nl+' '+m.an +*!* OP.SHOW() +*!* SELE fistotv +*!* SET FILTER TO +*!* *scan for inlist(allt(lower(cale)),'&date','&date\') +*!* SCAN FOR 'DATE'$UPPER(cale) AND !('DATEAN'$UPPER(cale)) AND 'IMOB2003'$allt(UPPER(calealfa)) +*!* SCAT MEMV +*!* WAIT WIND m.numef NOWAIT +*!* DO reindf WITH m.calealfa,m.cale,m.numef,m.alias,m.ordine,m.exc +*!* DO PR WITH j +*!* ENDSCAN +*!* OP.RELEASE +*!* WAIT CLEAR +*!* ENDIF +*!* ENDSCAN +*!* ENDIF +*!* SELECT TANCAL +*!* ENDSCAN +*!* USE IN calendar +*!* ENDIF + +*!* BUTON=2 +*!* DO dasaunu WITH 'Se reindexeaza fisierele generale din DATEAN?' +*!* IF BUTON=1 +*!* SELE fistotv +*!* Maxs=RECCOUNT() +*!* j=0 +*!* OP=CREA('PROGRESBAR') +*!* OP.titlu.CAPTION='Se reindexeaza fisierele generale. Asteptati...' +*!* OP.SHOW() +*!* SELE fistotv +*!* SET FILTER TO !DELETED() +*!* *scan for inlist(allt(lower(cale)),'&calefirma\datean','&calefirma\datean\') +*!* SCAN FOR 'DATEAN'$ALLT(UPPER(cale)) AND 'IMOB2003'$allt(UPPER(calealfa)) +*!* SCAT MEMV +*!* WAIT WIND m.numef NOWAIT +*!* DO reindf WITH m.calealfa,m.cale,m.numef,m.alias,m.ordine,m.exc +*!* DO PR WITH j +*!* ENDSCAN +*!* OP.RELEASE +*!* WAIT CLEAR +*!* ENDIF + +*!* BUTON=2 +*!* DO dasaunu WITH 'Se reindexeaza fisierele locale?' +*!* IF BUTON=1 +*!* SELE fistotv +*!* Maxs=RECCOUNT() +*!* j=0 +*!* OP=CREA('PROGRESBAR') +*!* OP.titlu.CAPTION='Se reindexeaza fisierele locale' +*!* OP.SHOW() +*!* SELE fistotv +*!* *set filter to inlist(allt(UPPER(cale)),'&LOC\&NFSCURT\TEMPO','&LOC\&NFSCURT\TEMPO\') +*!* SET FILTER TO 'LOC'$ALLT(UPPER(cale)) +*!* *brow +*!* SCAN +*!* SCAT MEMV +*!* WAIT WIND m.numef NOWAIT +*!* DO reindf WITH m.calealfa,m.cale,m.numef,m.alias,m.ordine,m.exc +*!* DO PR WITH j +*!* ENDSCAN +*!* OP.RELEASE +*!* WAIT CLEAR +*!* ENDIF + +*!* SET DELETED ON + +*!* *--------------- +*!* m.nl=ll +*!* m.an=aa +*!* DO totv +*!* RETURN + + + + +*!* *__________________________________________ +*!* PROCEDURE reindf +*!* PARAM calealfa,cale,numef,ALIAS,ordine,exc +*!* LOCAL calea,calea1,CALEAL,CALEAL1,T,fisa,fisv,fisa1,fisv1,aliasa + +*!* calea=ALLT(cale)+'\'+ALLT(numef)+'.dbf' +*!* calea1=ALLT(cale)+'\'+ALLT(numef)+'.*' +*!* CALEAL=ALLT(calealfa)+'\'+ALLT(numef)+'.dbf' +*!* CALEAL1=ALLT(calealfa)+'\'+ALLT(numef)+'.*' +*!* fisa=ALLT(cale)+'\'+ALLT(numef)+'a.dbf' +*!* fisa1=ALLT(cale)+'\'+ALLT(numef)+'a.*' +*!* fisv=ALLT(cale)+'\_%'+ALLT(numef)+'.dbf' +*!* fisv1=ALLT(cale)+'\_%'+ALLT(numef)+'.*' +*!* aliasa=ALLT(ALIAS)+'a' + +*!* IF FILE('&calea') +*!* *wait wind calea +*!* DELE FILE &fisa1 +*!* DELE FILE &fisv1 +*!* COPY FILE &CALEAL1 TO &fisa1 +*!* SELE 0 +*!* T='use '+fisa+' AGAIN ALIAS '+aliasa+' exclusive ' +*!* &T +*!* *wait wind t +*!* SELE &aliasa +*!* ZAP +*!* SELE &aliasa +*!* APPEND FROM &calea +*!* SELE &aliasa +*!* *!* WAIT WINDOW "reindex" +*!* *!* SELECT &aliasa +*!* REINDEX +*!* USE +*!* RENAME &calea1 TO &fisv1 +*!* RENAME &fisa1 TO &calea1 +*!* ENDIF + +*!* RETURN + + + +*!* *______________________ +*!* PROC errdeschid +*!* PARAM calealfa,cale,numef,ALIAS,ordine +*!* LOCAL calea,calea2,CALEAL,CALEAL2 +*!* calea=ALLT(cale)+'\'+ALLT(numef)+'.dbf' +*!* calea2=ALLT(cale)+'\'+ALLT(numef)+'.cdx' +*!* CALEAL=ALLT(calealfa)+'\'+ALLT(numef)+'.dbf' +*!* CALEAL2=ALLT(calealfa)+'\'+ALLT(numef)+'.cdx' +*!* DO CASE +*!* CASE ERROR()=24 &&Alias name is already in use +*!* RETURN +*!* CASE ERROR()=19 OR ERROR()=26 OR ERROR()=114 &&Index file does not match table. sau Table has no index order set. +*!* DO mesajatent WITH 'Se reindexeaza fisierul "'+ALLT(numef)+'"','' +*!* IF FILE('&caleal2') AND cale#calealfa +*!* COPY FILE &CALEAL2 TO &calea2 +*!* USE &calea AGAIN ALIAS &ALIAS +*!* SET INDEX TO &calea2 +*!* REINDEX +*!* ELSE +*!* DO MESAJrosu WITH 'Nu se poate reindexa fisierul "'+ALLT(numef)+'".','Sugeram iesirea din program.' +*!* QUIT +*!* RETRY +*!* ENDIF + +*!* CASE ERROR()=15 &&Not a table. +*!* DO danuquit WITH 'Fisierul "'+ALLT(numef)+'" este defect. Il inlocuim cu o structura vida?' +*!* IF FILE('&caleal') +*!* COPY FILE &CALEAL1 TO &calea1 +*!* RETRY +*!* ELSE +*!* DO MESAJrosu WITH 'Nu se poate inlocui fisierul "'+ALLT(numef)+'".','Sugeram iesirea din program.' +*!* QUIT +*!* RETRY +*!* ENDIF + +*!* CASE ERROR()=3 OR ERROR()=1705 &&File is in use. or File access is denied. +*!* DO MESAJrosu WITH 'Fisierul "'+ALLT(numef)+'" este deschis de alt program.','Inchideti fisierul si apoi redeschideti programul.' +*!* QUIT +*!* RETRY +*!* OTHERWISE +*!* DO MESAJrosu WITH 'Eroare necunoscuta (Nr.'+ALLT(STR(ERROR()))+')', 'Sugeram iesirea din program.' +*!* QUIT +*!* RETRY +*!* ENDCASE + +*!* RETURN + + + + + +*!* *____________________ +*!* PROC errgen +*!* DO MESAJrosu WITH 'Eroare necunoscuta (Nr.'+ALLT(STR(ERROR()))+')', 'Sugeram iesirea din program.' +*!* QUIT +*!* RETRY +*!* RETURN + + + +*!* *___ PROCEDURA DE DESCHIDERE DIN AFARA LUI TOTV_________________________________________________ +*!* PROC DES +*!* PARAM ALIASF +*!* IF !DIRECTORY('&CALEFIRMA') +*!* DO MESAJrosu WITH 'Calea '+CALEFIRMA+' este incorecta!','Sugeram iesirea din program.' +*!* QUIT +*!* RETRY +*!* ENDIF +*!* DATE=CALEFIRMA+'\AN'+M.an+'\DATE'+M.nl +*!* IF !USED('FISTOTV') +*!* DO deschidf WITH '&dirgen\Imob2003\date\','&dirgen\Imob2003\date\','fistotvmf','fistotv','CALE','' +*!* ENDIF +*!* SELE fistotv +*!* LOCA FOR ALLT(UPPER(ALIAS))=ALLT(UPPER(ALIASF)) +*!* IF !FOUND() +*!* DO MESAJrosu WITH 'Alias '+ALIASF+' inexistent!','Sugeram iesirea din program.' +*!* QUIT +*!* RETRY +*!* ELSE +*!* SCAT MEMV +*!* DO deschidf WITH m.calealfa,m.cale,m.numef,m.alias,m.ordine,m.exc +*!* ENDIF +*!* RETURN + + + + + +*!* *______________________________ +*!* PROCEDURE reindexaretempo +*!* DIRFIRM=loc+'\'+NFSCURT +*!* *CALEFIRMA=ALLTRIM(M.CALEFIRM) + +*!* IF !DIRECTORY('&CALEFIRMA') +*!* DO MESAJrosu WITH 'Calea '+CALEFIRMA+' este incorecta!','Sugeram iesirea din program.' +*!* QUIT +*!* RETRY +*!* ENDIF + +*!* DATE=CALEFIRMA+'\AN'+m.an+'\DATE'+M.nl +*!* DATEAN=CALEFIRMA+'\DATEAN' +*!* CALET=DIRFIRM+'\TEMPO' +*!* m.ANTET='S.C. '+M.FLUNG +*!* WAIT ' ' TIMEOUT 0.01 +*!* CLOSE DATABASE +*!* LOCAL ll,aa +*!* ll=m.nl +*!* aa=m.an + +*!* DO deschidf WITH '&dirgen\Imob2003\date\','&dirgen\Imob2003\date\','fistotvmf','fistotv','CALE','' + + +*!* SELE fistotv +*!* Maxs=RECCOUNT() +*!* j=0 +*!* OP=CREA('PROGRESBAR') +*!* OP.titlu.CAPTION='Se reindexeaza fisierele locale' +*!* OP.SHOW() +*!* SELE fistotv +*!* *set filter to inlist(allt(UPPER(cale)),'&LOC\&NFSCURT\TEMPO','&LOC\&NFSCURT\TEMPO\') +*!* SET FILTER TO 'LOC'$ALLT(UPPER(cale)) +*!* *brow +*!* SCAN +*!* SCAT MEMV +*!* WAIT WIND m.numef NOWAIT +*!* DO reindf WITH m.calealfa,m.cale,m.numef,m.alias,m.ordine,m.exc +*!* DO PR WITH j +*!* ENDSCAN +*!* OP.RELEASE +*!* WAIT CLEAR +*!* m.nl=ll +*!* m.an=aa +*!* DO totv +*!* RETURN + +**** sfarsit reindexare imobilizari + +Wait ' ' Timeout 0.01 +Close Database +Local ll,aa +ll=m.nl +aa=m.an + + +Do deschidprog In totv.prg + +*----------------- +Local man +man='' +BUTON=2 +*Do DANU With 'Se reindexeaza fisierele lunare?' +*If BUTON=1 +Sele 0 +Use &CALEFIRMA\DATEAN\calendar Alias calendar +Select Distinct an From calendar Into Cursor jan Order By an +Select jan +Scan + man=an + Do dasaunu With 'Se reindexeaza fisierele lunare din anul '+man+'?' + If BUTON=1 + Set Deleted Off && pentru mf + Sele calendar + Scan For !Deleted() And an=man + Scatter Memvar + Date=CALEFIRMA+'\AN'+m.an+'\DATE'+M.nl + BUTON=2 + Do dasaunu With 'Se reindexeaza fisierele din luna '+m.nl+' '+m.an+' ?' + If BUTON=1 + Sele fistotv + MAXS=Reccount() + j=0 + OP=Crea('PROGRESBAR') + OP.titlu.Caption='Se reindexeaza fisierele lunii '+m.nl+' '+m.an + OP.Show() + + + Sele fistotv + Set Filter To +*scan for inlist(allt(lower(cale)),'&date','&date\') + lcFiltru = ['DATE'$UPPER(cale) AND !('DATEAN'$UPPER(cale)) AND !('_ALFA'$ALLT(UPPER(cale)))] + lcFiltru = lcFiltru + Iif(!Empty(lcConditie),[ and ]+lcConditie,"") + + Scan For &lcFiltru + Scat Name loFis + Wait Wind loFis.numef Nowait + Do reindf With loFis.calealfa,loFis.cale,loFis.numef,loFis.Alias,loFis.ordine,loFis.exc + Do PR With j + Endscan + OP.Release + Release loFis + Wait Clear + Endif + Endscan + Set Deleted On + Endif + Select jan +Endscan +Use In calendar +*Endif + +BUTON=2 +Do dasaunu With 'Se reindexeaza fisierele generale din DATEAN?' +If BUTON=1 + Sele fistotv + MAXS=Reccount() + j=0 + OP=Crea('PROGRESBAR') + OP.titlu.Caption='Se reindexeaza fisierele generale. Asteptati...' + OP.Show() + Sele fistotv + Set Filter To +*scan for inlist(allt(lower(cale)),'&calefirma\datean','&calefirma\datean\') + lcFiltru = ['DATEAN'$ALLT(UPPER(cale)) AND !('_ALFA'$ALLT(UPPER(cale)))] + lcFiltru = lcFiltru + Iif(!Empty(lcConditie),[ and ]+lcConditie,"") + Scan For &lcFiltru + Scat Name loFis + Wait Wind loFis.numef Nowait + Do reindf With loFis.calealfa,loFis.cale,loFis.numef,loFis.Alias,loFis.ordine,loFis.exc + Do PR With j + Endscan + OP.Release + Wait Clear +Endif + +BUTON=2 +Do dasaunu With 'Se reindexeaza fisierele locale?' +If BUTON=1 + Sele fistotv + MAXS=Reccount() + j=0 + OP=Crea('PROGRESBAR') + OP.titlu.Caption='Se reindexeaza fisierele locale' + OP.Show() + Sele fistotv +*set filter to inlist(allt(UPPER(cale)),'&LOC\&NFSCURT\TEMPO','&LOC\&NFSCURT\TEMPO\') + Set Filter To 'LOC'$Allt(Upper(cale)) +*brow + Scan + Scat Name loFis + Wait Wind loFis.numef Nowait + Do reindf With loFis.calealfa,loFis.cale,loFis.numef,loFis.Alias,loFis.ordine,loFis.exc + Do PR With j + Endscan + OP.Release + Release loFis + Wait Clear +Endif + +*--------------- +m.nl=ll +m.an=aa +Do totv + +Return + +*__________________________________________ +Procedure reindf +Param calealfa,cale,numef,Alias,ordine,exc +Local calea,calea1,CALEAL,CALEAL1,T,fisa,fisv,fisa1,fisv1,aliasa + +calea=Allt(cale)+'\'+Allt(numef)+'.dbf' +calea1=Allt(cale)+'\'+Allt(numef)+'.*' +CALEAL=Allt(calealfa)+'\'+Allt(numef)+'.dbf' +CALEAL1=Allt(calealfa)+'\'+Allt(numef)+'.*' +fisa=Allt(cale)+'\'+Allt(numef)+'_a.dbf' +fisa1=Allt(cale)+'\'+Allt(numef)+'_a.*' +fisv=Allt(cale)+'\_%'+Allt(numef)+'.dbf' +fisv1=Allt(cale)+'\_%'+Allt(numef)+'.*' +aliasa=Allt(numef)+'_a' + +lcFisierFirma=calea +lcAlias=Alltrim(Alias) +llUsed=.F. +If Used(lcAlias) + llUsed=.T. + lcFis=Juststem(Dbf(lcAlias)) + Use In (lcAlias) +Endif + +x=Fopen('&lcFisierFirma',12) +If x < 0 + Do mesaj With "Fisierul "+lcFisierFirma," Este deschis de alt program. Nu se poate reindexa" + If llUsed + Do des With lcAlias + Endif + Return +Endif +Fclose(x) + + + +If File('&calea') + Wait Window lcAlias+[ ]+"Se sterg fisierele temporare..." Nowait + + Dele File &fisa1 + Dele File &fisv1 + + Wait Window lcAlias+[ ]+"Se copiaza structurile vide..." Nowait + Copy File &CALEAL1 To &fisa1 + Sele 0 + T='use '+fisa+' AGAIN ALIAS '+aliasa+' exclusive ' + &T +*wait wind t + Sele &aliasa + Zap + + Wait Window lcAlias+[ ]+"Se copiaza datele originale..." Nowait +*!* SELE &aliasa +*!* APPEND FROM &calea + reindf_append(lcAlias,aliasa,calea) + + Wait Window lcAlias+[ ]+"Se reindexeaza fisierul..." Nowait + Sele &aliasa + Reindex + Use + + Rename &calea1 To &fisv1 + Rename &fisa1 To &calea1 + + Wait Window lcAlias+[ ]+"Operatiune incheiata cu succes..." Nowait +Endif + +Endproc && reindf + +***---------------------------------------------------------------------------------- +*** copie indexul din structurile vide, deschide exclusiv fisierul si da reindex +*** fisierul trebuie sa fie inchis +Procedure REINDFCDX +Parameters tcCaleAlfa,tcCale,tcNumef +*** calea structurii vide, calea fisierului, numele fisierului + +Private lcCDXd,lcDBF,lcCDXs + +lcCDXd=Allt(tcCale)+'\'+Allt(tcNumef)+'.cdx' +lcDBF=Allt(tcCale)+'\'+Allt(tcNumef)+'.dbf' +lcCDXs=Allt(tcCaleAlfa)+'\'+Allt(tcNumef)+'.cdx' + +Wait Window "Se copiaza structurile vide..." Nowait + +Copy File('&lcCDXs') To ('&lcCDXd') +Use ('&lcDBF') In 0 Excl Alias FisierR +Set Index To ('&lcCDXd') + +Wait Window "Se reindexeaza fisierul..." Nowait +Select FisierR +Reindex +Use In FisierR + +Wait Window "Operatiune incheiata cu succes..." Nowait + +Endproc && REINDFCDX + + +*______________________ +Proc errdeschid_r +Param calealfa,cale,numef,Alias,ordine +Local calea,calea2,CALEAL,CALEAL2 +calea=Allt(cale)+'\'+Allt(numef)+'.dbf' +calea2=Allt(cale)+'\'+Allt(numef)+'.cdx' +CALEAL=Allt(calealfa)+'\'+Allt(numef)+'.dbf' +CALEAL2=Allt(calealfa)+'\'+Allt(numef)+'.cdx' +Do Case + Case Error()=24 &&Alias name is already in use + Return + Case Error()=19 Or Error()=26 Or Error()=114 &&Index file does not match table. sau Table has no index order set. + Do mesajatent With 'Se reindexeaza fisierul "'+Allt(numef)+'"','' + If File('&caleal2') And cale#calealfa + Copy File &CALEAL2 To &calea2 + Use &calea Again Alias &Alias + Set Index To &calea2 + Reindex + Else + Do MESAJrosu With 'Nu se poate reindexa fisierul "'+Allt(numef)+'".','Sugeram iesirea din program.' + Quit + Retry + Endif + + Case Error()=15 &&Not a table. + Do danuquit With 'Fisierul "'+Allt(numef)+'" este defect. Il inlocuim cu o structura vida?' + If File('&caleal') + Copy File &CALEAL1 To &calea1 + Retry + Else + Do MESAJrosu With 'Nu se poate inlocui fisierul "'+Allt(numef)+'".','Sugeram iesirea din program.' + Quit + Retry + Endif + + Case Error()=1683 &&index tag is not found + Do MESAJrosu With "Structura vida a fisierului "+Alltrim(numef)+" este stricata!","" +*!* Do MESAJrosu With 'Fisierul "'+Allt(numef)+'" este deschis de alt program.','Inchideti fisierul si apoi redeschideti programul.' + Quit + Retry + Case Error()=3 Or Error()=1705 &&File is in use. or File access is denied. + Do MESAJrosu With 'Fisierul "'+Allt(numef)+'" este deschis de alt program.','Inchideti fisierul si apoi redeschideti programul.' + Quit + Retry + Otherwise + Do MESAJrosu With 'Eroare necunoscuta (Nr.'+Allt(Str(Error()))+')', 'Sugeram iesirea din program.' + Quit + Retry +Endcase + +Endproc && errdeschid_r + + + + + +*____________________ +Proc errgen +Do MESAJrosu With 'Eroare necunoscuta (Nr.'+Allt(Str(Error()))+')', 'Sugeram iesirea din program.' +Quit +Retry +Return + + + + + + + +*______________________________ +Procedure reindexaretempo +DIRFIRM=loc+'\'+NFSCURT +*CALEFIRMA=ALLTRIM(M.CALEFIRM) + +If !Directory('&CALEFIRMA') + Do MESAJrosu With 'Calea '+CALEFIRMA+' este incorecta!','Sugeram iesirea din program.' + Quit + Retry +Endif +Date=CALEFIRMA+'\AN'+m.an+'\DATE'+M.nl +DATEAN=CALEFIRMA+'\DATEAN' +CALET=DIRFIRM+'\TEMPO' +m.ANTET='S.C. '+M.FLUNG +Wait ' ' Timeout 0.01 +Close Database +Local ll,aa +ll=m.nl +aa=m.an + +*!* DO deschidf WITH '&dirgen\gestiuni\date\datean\','&dirgen\gestiuni\date\datean\','fistotvgest','fistotv','CALE','' +Do deschidprog In totv.prg + +Sele fistotv +M=Reccount() +j=0 +OP=Crea('PROGRESBAR') +OP.titlu.Caption='Se reindexeaza fisierele locale' +OP.Show() +Sele fistotv +*set filter to inlist(allt(UPPER(cale)),'&LOC\&NFSCURT\TEMPO','&LOC\&NFSCURT\TEMPO\') +Set Filter To 'LOC'$Allt(Upper(cale)) +*brow +Scan + Scat Name loFis + Wait Wind loFis.numef Nowait + Do reindf With loFis.calealfa,loFis.cale,loFis.numef,loFis.Alias,loFis.ordine,loFis.exc + Do PR With j +Endscan +OP.Release + +Release loFis + +Wait Clear +m.nl=ll +m.an=aa +Do totv + + +Endproc && reindexaretempo + + + +*** INCEPUT PROCEDURA reindf_append +Procedure reindf_append +Parameters tcAlias,tcAlias_A,tcFisOriginal + +&& tcAlias: aliasul tabelului +&& tcAlias_A: aliasul tabelului vid+"_A" +&& tcFisOriginal: calea catre fisierul care se reindexeaza cu datE + +Private lcAlias,lcAlias_A,lcFisOriginal,llUsed + + +lcAlias=Alltrim(Upper(tcAlias)) +lcAlias_A=Alltrim(Upper(tcAlias_A)) +lcFisOriginal=Alltrim(Upper(tcFisOriginal)) + +Do Case + Case Inlist(lcAlias,"DEBITOR","CREDITOR","ACHIT542") + + + If !EXISTACAMP(lcAlias_A,"LUAT") && daca in fisierul structura vida nu am campul + lcFisTemp=Alltrim(loc)+"\"+Alltrim(NFSCURT)+"\tempo\T"+lcAlias+".dbf" + lcFisTemp=Strtran(lcFisTemp,"\\","\") + +&& deschid fisierul original + llUsed=.T. + If !Used(lcAlias) + llUsed=.F. + Use ('&lcFisOriginal') In 0 Shared Alias &lcAlias + Endif + + Select(lcAlias) + If !EXISTACAMP(lcAlias,"LUAT") && DACA IN FISIERUL ORIGINAL NU EXISTA CAMPUL NU FAC NIMIC + If !llUsed + Use In (lcAlias) + Endif + Else + If Inlist(lcAlias,"DEBITOR","ACHIT542") + Select *,luat As debit,dat As credit From &lcAlias Into Cursor tt + Else + Select *,dat As debit,luat As credit From &lcAlias Into Cursor tt + Endif + If !llUsed + Use In (lcAlias) + Endif + Select (lcAlias_A) + Append From Dbf('tt') + Use In tt + Endif + Endif + Otherwise + Select (lcAlias_A) + Append From &lcFisOriginal + +Endcase + + +Endproc +*** SFARSIT PROCEDURA reindf_append diff --git a/Programe/Vechi/shutdown.prg b/Programe/Vechi/shutdown.prg new file mode 100644 index 0000000..59c4677 --- /dev/null +++ b/Programe/Vechi/shutdown.prg @@ -0,0 +1,5 @@ +IF TYPE("goApp")=="O" AND NOT ISNULL(goApp) + RETURN goApp.OnShutDown() +ENDIF +*Cleanup() +*QUIT \ No newline at end of file diff --git a/Programe/Vechi/sitan.prg b/Programe/Vechi/sitan.prg new file mode 100644 index 0000000..96520e8 --- /dev/null +++ b/Programe/Vechi/sitan.prg @@ -0,0 +1,126 @@ +******** +PROCEDURE sitan + +pcNl=m.nl +pcAn=m.an + +SELECT *, SPACE(4) AS an, SPACE(2) AS nl FROM mf WHERE 1=2 INTO CURSOR mfsel READWRITE + +SELECT an,nl FROM calendar WHERE VAL(an)=VAL(pcAn) AND VAL(nl)<=VAL(pcNl) INTO CURSOR tcalendar + +SELECT tcalendar +SCAN + lcnl=nl + lcAn=an + lcdate='&calefirma\an'+lcAn+'\date'+lcnl+'\mf.dbf' + IF FILE(lcdate) + SELECT mfsel + + IF TYPE("&lcDate..inactiv")!="U" + APPEND FROM (lcdate) FOR INLIST(UPPER(fel),&pcfelul) AND !casat AND !inactiv + ELSE + APPEND FROM (lcdate) FOR INLIST(UPPER(fel),&pcfelul) AND !casat + ENDIF + REPLACE ALL nl WITH lcnl FOR EMPTY(nl) + REPLACE ALL an WITH lcAn FOR EMPTY(an) + ENDIF + SELECT tcalendar +ENDSCAN + +lcCursor = [sitmf] +SELECT SUM(amortlun) AS amortlun, SUM(amorttot) AS amorttot, SUM(valoare) AS valoare, an, nl, ALLTRIM(scd) AS scd ; + FROM mfsel ; + INTO CURSOR (lcCursor) ; + GROUP BY an, nl, scd + + +IF USED('mfsel') + USE IN mfsel +ENDIF +IF USED('tcalendar') + USE IN tcalendar +ENDIF + +RETURN lcCursor + +*--------------------------------------------------------------------------- +PROCEDURE rulaje +PARAMETERS tcCamp, tcAlias + +ancrt=m.an +luncrt=m.nl +firmcrt=nfscurt +lcRet = [] +lcCamp = ALLTRIM(tcCamp) + +IF EMPTY(tcAlias) OR TYPE('tcAlias') # 'C' + lcAlias = [sitmf] +ELSE + lcAlias = ALLTRIM(tcAlias) +ENDIF + +SELECT DISTINCT scd FROM (lcAlias) INTO CURSOR conturi +SELECT DISTINCT an,nl FROM (lcAlias) INTO CURSOR luni + +tt='create table &loc\&nfscurt\tempo\rulaje.DBF (an c(4),nl c(2)' +SELECT conturi +SCAN + SCAT MEMV + tt=tt+',c'+ALLTRIM(m.scd)+' n(14,gnZ)' + SELECT conturi +ENDSCAN + + +tt=tt+')' +&tt +SELECT rulaje +APPEND FROM DBF('luni') +USE IN luni + +*sume--- +SELECT (lcAlias) +SCAN + SCATTER MEMV + SELECT rulaje + LOCATE FOR nl=m.nl AND an=m.an + tt='REPLACE c'+ALLTRIM(m.scd)+' with '+ lcCamp + &tt + SELECT (lcAlias) +ENDSCAN + +*totaluri--- +LOCAL m.c +m.c=0 +SELECT rulaje +APPEND BLANK +REPLACE an WITH 'TOT' +SELECT conturi +SCAN + SCATTER MEMV + SELECT rulaje + tt='sum c'+ALLTRIM(m.scd)+' to m.c FOR NL<=LUNCRT' + &tt + + SELECT rulaje + GO BOTT + tt='REPLACE c'+ALLTRIM(m.scd)+' with m.c' + &tt + SELECT conturi +ENDSCAN + +m.an=ancrt +m.nl=luncrt +nfscurt=firmcrt + +IF USED('conturi') + USE IN conturi +ENDIF +IF USED('rulaje') + USE IN rulaje + lcRet = [&loc\&nfscurt\tempo\rulaje.DBF] +ENDIF +IF USED(lcAlias) + USE IN (lcAlias) +ENDIF + +RETURN lcRet diff --git a/Programe/Vechi/sitanvechi.prg b/Programe/Vechi/sitanvechi.prg new file mode 100644 index 0000000..3008b33 --- /dev/null +++ b/Programe/Vechi/sitanvechi.prg @@ -0,0 +1,80 @@ +local cond +cond='month(datapif)=val(m.nl) and year(datapif)=val(m.an) and uzuraprec=0' + +SET SAFETY Off +close database + +LOCAL NRL,NRA,L,A,UZ +local i,t,k,ancrt,luncrt,firmcrt +public m.an, m.nl, m.t_2121, m.t_2122, m.t_2123, m.t_2124, m.t_2125, m.t_2126, an, nl +store 0 to i, k, m.t_2121, m.t_2122, m.t_2123, m.t_2124, m.t_2125, m.t_2126 + +ancrt=m.an +luncrt=m.nl +firmcrt=nfscurt + + +select 0 +use &calefirma\datean\calendar.dbf again alias calendar +SELE CALENDAR +scan for !deleted() +date = calefirma+'\an'+an+'\date'+nl +*SELECT 0 +*if !file('&DATE\mf.dbf') +* copy file &dirgen\mfix2000\date\*.* to &date\*.* +*endif +*wait wind date +endscan + +sele 0 +use &DIRGEN\imob2003\datE\sitmf.dbf EXCLUSIVE ALIAS SITMF +ZAP + + +SELE CALENDAR +scan for !deleted() &&____________ + +scatter memvar +date = calefirma+'\an'+m.an+'\date'+m.nl +*wait wind date +if file('&DATE\mf.dbf') +select 0 +use &DATE\mf.dbf again alias mf +set filter to !casat +*_calc uzura______________________________ +STORE 0 TO L,A,UZ +NRL=VAL(M.NL) +NRA=VAL(M.AN) +SELE MF +SCAN +L=MONTH(DATAPIF) +A=YEAR(DATAPIF) +UZ=IIF(NRA + lcNumef=UPPER(ALLTRIM(tcNumeF)) && numele fisierului din + lcOrdine=ALLTRIM(tcOrdine) + lcExc=ALLTRIM(tcExc) + + lcDBFc=lcCale+'\'+lcNumef+'.dbf' + lcDBFs=lcCaleAlfa+'\'+lcNumef+'.dbf' + + lcTablec=lcCale+'\'+lcNumef+'.*' + lcTables=lcCaleAlfa+'\'+lcNumef+'.*' + + + + PRIVATE lcOldError + lcOldError=ON("error") + + IF !FILE('&lcDBFc') + IF INLIST(lcNumef,'ACT','RULL') + DO danuquit WITH 'Nu exista fisierul "'+ALLT(lcDBFc)+'". Il inlocuim cu o structura vida?' + ENDIF + IF FILE('&lcDBFs') + COPY FILE ('&lcTables') TO ('&lcTablec') + ELSE + DO MESAJrosu WITH 'Nu exista structura vida a fisierului "'+lcNumef+'".','Sugeram iesirea din program.' + QUIT + RETRY + ENDIF + ENDIF + + + + +*!* *** AFLU DACA FISIERUL ARE REFERINTA CATRE UN CDX + llcdx=.F. + IF !EMPTY(lcOrdine) + llcdx=.T. + ENDIF + + llUsed=.F. + IF USED(LCALIAS) + llUsed=.T. + USE IN (LCALIAS) + ENDIF + filehandle=FOPEN('&lcDBFc',10) && Open the file + IF filehandle > 0 +*!* WAIT WINDOW 'Fopen '+LCALIAS NOWA + =FSEEK(filehandle, 28,0) && Move pointer before 29th byte + cdxbyte = ASC(FGETS(filehandle,1)) && read byte 29 + IF cdxbyte % 2 = 1 && test if it has a cdx + llcdx=.T. + ENDIF + + FCLOSE(filehandle) + IF llUsed + DO des WITH LCALIAS + ENDIF + ENDIF +*!* ***-------------------------------- + + SELECT 0 + lccommand=[USE "]+lcDBFc+[" ]+ALLTRIM(lcExc)+[ AGAIN ALIAS ]+LCALIAS+IIF(llcdx," order 1","") + + ON ERROR DO errdeschid WITH lcCaleAlfa,lcCale,lcNumef,LCALIAS,ERROR(),MESSAGE(),PROGRAM() + + &lccommand + + + + + IF !EMPTY(lcOrdine) + IF USED(LCALIAS) + SELECT (LCALIAS) + SET ORDER TO TAG &lcOrdine && "VAL(NRCRT)" + ENDIF + ENDIF + + ON ERROR &lcOldError + +ENDPROC && deschidf + + + +*______________________ +PROC errdeschid + PARAM tcCalealfa,tcCale,tcNumeF,tcAlias,tnError,tcmessage,tcprogram + + PRIVATE lcCaleAlfa,lcCale,LCALIAS,lcNumef,lcDBFc,lcDBFs,lcCDXc,lcCDXs,lcTablec,lcTables + + lcCaleAlfa=ALLTRIM(tcCalealfa) && calea catre structura vida a tabelului + lcCale=ALLTRIM(tcCale) && calea catre tabel + LCALIAS=UPPER(ALLTRIM(tcAlias)) && alias-ul din + lcNumef=UPPER(ALLTRIM(tcNumeF)) && numele fisierului din + + lcDBFc=lcCale+'\'+lcNumef+'.dbf' + lcCDXc=lcCale+'\'+lcNumef+'.cdx' + lcDBFs=lcCaleAlfa+'\'+lcNumef+'.dbf' + lcCDXs=lcCaleAlfa+'\'+lcNumef+'.cdx' + + lcTablec=lcCale+'\'+lcNumef+'.*' + lcTables=lcCaleAlfa+'\'+lcNumef+'.*' + + + + DO MESAJ WITH 'Fisier: '+ALLTRIM(lcNumef)+" Eroarea nr. "+ALLTRIM(STR(tnError)),tcmessage+" "+tcprogram + + +&& de aici nu mai procesez erorile + PRIVATE lcOldError + lcOldError=ON("error") + ON ERROR * +&& + + DO CASE + + CASE INLIST(tnError,5,19,26,114,1707,1683)&&Index file does not match table. sau Table has no index order set + DO mesajatent WITH 'Se reindexeaza fisierul "'+lcNumef+'"','' + + IF FILE('&lcCDXs') AND lcCale#lcCaleAlfa +&& inchid tabelul + IF USED(LCALIAS) && fisierul trebuie sa fie inchis ca sa pot sa fac append din el in structura vida si sa-l redenumesc + USE IN (LCALIAS) + ENDIF + +&& reindexez + DO REINDFCDX WITH lcCaleAlfa,lcCale,lcNumef IN reindexare.prg + +&& deschid din nou tabelul reindexat + DO des WITH LCALIAS + + + ELSE && nu exista indexul (.cdx) in structurile vide sau e un fisier din alfa + DO MESAJrosu WITH 'Nu se poate reindexa fisierul "'+ALLT(lcNumef)+'".','Sugeram iesirea din program.' + QUIT + RETRY + ENDIF + + CASE INLIST(tnError,15,41) &&Not a table, memo file missing or invalid + DO danuquit WITH 'Fisierul "'+lcNumef+'" este defect. Il inlocuim cu o structura vida/standard?' + +&& inchid tabelul + llUsed=.F. + + IF USED(LCALIAS) && fisierul trebuie sa fie inchis ca sa pot sa fac append din el in structura vida si sa-l redenumesc + llUsed=.T. + USE IN (LCALIAS) + ENDIF + +&& fac backup + lcFisS=lcTablec + lcFisD=lcCale+'\'+"bk_"+STRTRAN(DTOC(DATE()),"/","")+"_%"+lcNumef+'.*' + COPY FILE ('&lcFisS') TO ('&lcFisD') + +&& copiez structura vida + IF FILE('&lcDBFs') + COPY FILE ('&lcTables') TO ('&lcTablec') + RETRY + ELSE + DO MESAJrosu WITH 'Nu exista structura vida a fisierului <'+lcNumef+'>.','Sugeram iesirea din program.' + QUIT + RETRY + ENDIF + +&& deschid fisierul + + DO des WITH LCALIAS + + + CASE INLIST(tnError,3,1705) &&File is in use. or File access is denied. + + DO MESAJrosu WITH 'Fisierul "'+lcNumef+'" este deschis de alt program.','Inchideti fisierul si apoi redeschideti programul.' + QUIT + RETRY + + OTHERWISE + + DO MESAJrosu WITH 'Eroare necunoscuta (Nr.'+ALLT(STR(tnError))+')', 'Sugeram iesirea din program.' + QUIT + RETRY + ENDCASE + +ENDPROC && ErrDeschid + + + + + +*____________________ +PROCEDURE errgen + DO MESAJrosu WITH 'Eroare necunoscuta (Nr.'+ALLT(STR(ERROR()))+')', 'Sugeram iesirea din program.' + QUIT + RETRY +ENDPROC && errgen + + + +*___ PROCEDURA DE DESCHIDERE DIN AFARA LUI TOTV_________________________________________________ +PROCEDURE des + PARAM tcAlias + + PRIVATE lcAlias + + + LCALIAS=UPPER(ALLTRIM(tcAlias)) + + IF !DIRECTORY('&CALEFIRMA') + DO MESAJrosu WITH 'Calea '+CALEFIRMA+' este incorecta!','Sugeram iesirea din program.' + QUIT + RETRY + ENDIF +*DATE=CALEFIRMA+'\AN'+M.an+'\DATE'+M.nl + + IF !USED('FISTOTV') + DO DESCHIDPROG && DESCHID FISTOTV + ENDIF + + + + SELE fistotv + LOCA FOR ALLT(UPPER(ALIAS))==LCALIAS + IF !FOUND() + DO MESAJrosu WITH 'Alias '+LCALIAS+' inexistent!','Sugeram iesirea din program.' + QUIT + RETRY + ELSE + SCAT NAME loFis + DO deschidf WITH loFis.calealfa,loFis.cale,loFis.numeF,loFis.ALIAS,loFis.ordine,loFis.exc + RELEASE loFis + + ENDIF + +ENDPROC && DES + + + +*------------------------------------------------ +PROCEDURE orori + DO MESAJ WITH "Contactati firma Romfast","" + QUIT + RETRY +ENDPROC && orori + + + + + + + +***--------------------------------------------------------------------------------------------------- +PROCEDURE verific_tabel + PARAMETERS tcCalealfa,tcCale,tcNumeF,tcAlias + + PRIVATE lcCaleAlfa,lcCale,LCALIAS,lcNumef,lcFisierAlfa,lcFisierFirma + + lcCaleAlfa=ALLTRIM(tcCalealfa) && calea catre structura vida a tabelului + lcCale=ALLTRIM(tcCale) && calea catre tabel + LCALIAS=UPPER(ALLTRIM(tcAlias)) && alias-ul din + lcNumef=UPPER(ALLTRIM(tcNumeF)) && numele fisierului din + + lcFisierAlfa=ALLTRIM(tcCalealfa)+"\"+ALLTRIM(tcNumeF)+".dbf" + lcFisierFirma=DBF(LCALIAS) + + + IF UPPER(ALLTRIM(lcCale))=UPPER(ALLTRIM(lcCalealfa)) && nu verific tabelele care nu au structura vida + RETURN + ENDIF +* WAIT WINDOW "Se verifica "+lcAlias NOWAIT + lnCompar=compara_tabele(LCALIAS,lcFisierAlfa) + + DO CASE + CASE lnCompar=0 && OK +* + CASE lnCompar = 1 && structura vida nu exista +* + CASE INLIST(lnCompar, 2, 3, 4) && coloane diferite, taguri diferite + + llUsed=.F. + IF USED(LCALIAS) + llUsed=.T. + USE IN (LCALIAS) + ENDIF + + x=FOPEN(lcFisierFirma,12) + + IF x<0 && daca nu pot sa il deschid exclusiv + DO MESAJ WITH "Fisierul "+lcFisierFirma+" ("+ALLTRIM(STR(lnCompar))+")"," Trebuie reindexat." + ELSE + FCLOSE(x) + DO DASAUNU WITH "Se reindexeaza fisierul "+lcFisierFirma+" ("+ALLTRIM(STR(lnCompar))+")?" + IF buton=1 + IF INLIST(lnCompar, 2, 4) && coloane diferite + DO REINDF WITH lcCalealfa,lcCale,lcNumeF,lcAlias IN reindexare.prg + ELSE && taguri diferite + DO REINDFCDX WITH lcCalealfa,lcCale,lcNumeF IN reindexare.prg + ENDIF + ENDIF + ENDIF + + + DO des WITH tcAlias + + ENDCASE + +ENDPROC && verific_tabel + +***-------------------------------------------------------------------------- +PROCEDURE DESCHIDPROG + +local lcAlias, lcFis, lcDir +lcDir = ADDBS(gcAppPath)+[date\datean] +lcFis = [fistotvmf] +lcAlias = [fistotv] + +Do deschidf With lcDir,lcDir,lcFis,lcAlias,'CALE','' + +ENDPROC && deschidprog \ No newline at end of file diff --git a/Programe/Vechi/totvMF.prg b/Programe/Vechi/totvMF.prg new file mode 100644 index 0000000..c326f50 --- /dev/null +++ b/Programe/Vechi/totvMF.prg @@ -0,0 +1,44 @@ +CLOSE DATABASE + +SELECT 0 + USE &dirgen\lunilean.dbf; + AGAIN ALIAS lunilean ; + ORDER TAG "nl" + +SELECT 0 + USE &dirgen\firma.dbf; + AGAIN ALIAS firma ; + ORDER TAG "firma" + +DIRFIRM=DIRGEN+NFSCURT +DATEAN=DIRFIRM+'\DATEAN' +CALET=DIRFIRM+'\TEMPO' + +SELECT 0 + USE &datEAN\CALENDAR.dbf; + AGAIN ALIAS CALENDAR + +date=DIRFIRM+'\AN'+m.an+'\DATE'+M.nl + + +SELECT 0 + USE &date\act.dbf; + AGAIN ALIAS act ; + ORDER TAG "dataireg" + +SELECT 0 + USE &dateAN\actAN.dbf; + AGAIN ALIAS actAN ; + ORDER TAG "COD" + +SELECT 0 + USE &dateAN\NUMEGEST.dbf; + AGAIN ALIAS NUMEGEST ; + ORDER TAG "NUMEGEST" + +SELECT 0 + USE &date\respons.dbf; + AGAIN ALIAS respons ; + ORDER TAG "nume_2" + +return \ No newline at end of file diff --git a/Programe/Vechi/totvV.prg b/Programe/Vechi/totvV.prg new file mode 100644 index 0000000..f31943c --- /dev/null +++ b/Programe/Vechi/totvV.prg @@ -0,0 +1,69 @@ +CLOSE DATABASE + +SELECT 0 + USE &dirgen\_ALFA\DATEAN\lunilean.dbf; + AGAIN ALIAS lunilean ; + ORDER TAG "nl" + +SELECT 0 + USE &dirgen\firma.dbf; + AGAIN ALIAS firma ; + ORDER TAG "firma" + +DIRFIRM=DIRGEN+NFSCURT +DATEAN=calefirma+'\DATEAN' +CALET=DIRFIRM+'\TEMPO' + +SELECT 0 + USE &datEAN\CALENDAR.dbf; + AGAIN ALIAS CALENDAR + +date=calefirma+'\AN'+m.an+'\DATE'+M.nl + + +*daca fisierele specifice nu sunt in baza de date?_____ +set defa to &date +if !file('mf.dbf') + do deschid +* do redeschid +endif + +SELECT 0 + USE &date\mf.dbf; + AGAIN ALIAS mf + +SELECT 0 + USE &dirgen\mfix2000\date\NORMA.dbf; + AGAIN ALIAS NORMA + +*_______________________________________________________ + +SELECT 0 + USE &date\act.dbf; + AGAIN ALIAS act ; + ORDER TAG "dataireg" + +SELECT 0 + USE &dateAN\actAN.dbf; + AGAIN ALIAS actAN ; + ORDER TAG "COD" + +SELECT 0 + USE &dateAN\NUMEGEST.dbf; + AGAIN ALIAS NUMEGEST ; + ORDER TAG "NUMEGEST" + +SELECT 0 + USE &date\respons.dbf; + AGAIN ALIAS respons ; + ORDER TAG "nume_2" + +SELECT 0 + USE &dirgen\mfix2000\help\helpmenu.dbf; + AGAIN ALIAS helpmenu + +SELECT 0 + USE &dirgen\mfix2000\help\helpleg.dbf; + AGAIN ALIAS helpleg + +return \ No newline at end of file diff --git a/Programe/ofunctii_imob.prg b/Programe/ofunctii_imob.prg new file mode 100644 index 0000000..ac32354 --- /dev/null +++ b/Programe/ofunctii_imob.prg @@ -0,0 +1,53 @@ +Function verificare_luna_inchisa +Parameters tcMesaj +lcMesaj=tcMesaj+",deoarece luna este inchisa!" +If glLunaInchisa + aMessagebox(lcMesaj,0+48,"Luna inchisa") + Return .F. +Endif +Return .T. +Endfunc && verificare_luna_inchisa +************************************************************************************************************* +Function get_prima_zi +PARAMETERS tnAn, tnLuna + +LOCAL lnAn, lnLuna +STORE 0 TO lnAn, lnLuna + +IF EMPTY(tnAn) OR TYPE('tnAn') # 'N' + lnAn = gnAn +ELSE + lnAn = tnAn +ENDIF + +IF EMPTY(tnLuna) OR TYPE('tnLuna') # 'N' + lnLuna = gnLuna +ELSE + lnLuna = tnLuna +ENDIF + +Return Date(lnAn,lnLuna,1) +Endfunc && get_prima_zi +************************************************************************************************************* +Function get_ultima_zi +PARAMETERS tnAn, tnLuna + +LOCAL lnAn, lnLuna +STORE 0 TO lnAn, lnLuna + +IF EMPTY(tnAn) OR TYPE('tnAn') # 'N' + lnAn = gnAn +ELSE + lnAn = tnAn +ENDIF + +IF EMPTY(tnLuna) OR TYPE('tnLuna') # 'N' + lnLuna = gnLuna +ELSE + lnLuna = tnLuna +ENDIF + +Return Gomonth(Date(lnAn,lnLuna,1),1)-1 + +Endfunc && get_ultima_zi +************************************************************************************************************* \ No newline at end of file diff --git a/Programe/oproceduri_imob.prg b/Programe/oproceduri_imob.prg new file mode 100644 index 0000000..5ed4a90 --- /dev/null +++ b/Programe/oproceduri_imob.prg @@ -0,0 +1,613 @@ +*!* 11.11.2009 +*!* marius.mutu +*!* alocare, dezalocare numere inventar + +*!* 18.10.2021 +*!* marius.mutu +*!* preluare_imob, verificare_balanta se verifica contul 303 in functie de optiunea IMOB_OBI + +#Define CRLF Chr(13) + Chr(10) + +Procedure viz_jurnal + Local lcFiltru, lcFiltruOriginal, lcGroup, lcOrder, lcSchema, lcSelect, llAfisare, llModParam + PRIVATE poLista + + Store '' To poLista + Store '' To ofrmviz + + If Used('crsjurnal') + Use In crsjurnal + Endif + + lcSchema = [] + lcSelect = [select * from imob_vjurnal2] + lcOrder = [denumire,id_mf,id_operatie_mf] + lcFiltru = [1=2] + lcFiltruOriginal = [] + llModParam = .T. + lcGroup = [] + llAfisare = .F. + gencursor('poLista', 'crsjurnal', lcSelect, lcFiltru, lcSchema, lcOrder, llAfisare, lcGroup, llModParam, lcFiltruOriginal) + poLista.ca_baza1.afisare() + Select crsjurnal + + ofrmviz = Createobject('frm_jurnal') + ofrmviz.Show(1) + + Release ofrmviz, poLista + + If Used('crsjurnal') + Use In crsjurnal + Endif + +Endproc && viz_jurnal +************************************************************************************************************* +Procedure introducere_imob_corp + Lparameters toMF + Local lnButon + lnButon = 2 + + lnButon = introducere_imob(1, toMF) + + Return lnButon +Endproc && introducere_imob_corp +************************************************************************************************************* +Procedure introducere_imob_necorp + Lparameters toMF + Local lnButon + lnButon = 2 + + lnButon = introducere_imob(2, toMF) + + Return lnButon +Endproc && introducere_imob_necorp +************************************************************************************************************* +Procedure introducere_imob + Parameters tnTip, toMF + && tnTip: 1 = corporale; 2 = necorporale + && toMF - folosit la preluarea din contabilitate - vine completat cu nract, dataact, valoare + + + + Private pnButon + Local lcMesaj, lnRaspuns + Store '' To ofrmintro + + lcMesaj = "Nu puteti face introduceri" + If !verificare_luna_inchisa(lcMesaj) + Return + Endif + + = cctipuri_amort() + = update_cote_TVA() + + lnRaspuns = 6 + pnButon = 1 + + *!* 11.11.2009 + Local lnRezultat, lnIdTipDocNrInv + Private poGeneratorNumere + lnIdTipDocNrInv = 18 + poGeneratorNumere = Createobject('oGeneratorNumere') + *!* 11.11.2009 ^ + + Do While lnRaspuns = 6 And pnButon = 1 + *!* 11.11.2009 + poGeneratorNumere.ResetAll() + lnRezultat = poGeneratorNumere.creeaza_cursor_serii(m.lnIdTipDocNrInv) + *!* 11.11.2009 ^ + ofrmintro = Createobject('frm_introducere', tnTip, 1, toMF) + ofrmintro.Show(1) + Release ofrmintro + + If pnButon = 1 + lnRaspuns = aMESSAGEBOX("Doriti sa continuati introducerile?", 4 + 32, "Confirmare") + Else + *!* 11.11.2009 + poGeneratorNumere.dezaloca_numere() + *!* 11.11.2009 ^ + Endif + Enddo + + If Used('v_tipuri_amort') + Use In v_tipuri_amort + Endif + + *!* modificare v 2.0.18 + If Used('cote_TVA') + Use In cote_TVA + Endif + *!* modificare v 2.0.18 ^ + + Return pnButon +Endproc && introducere_imob +************************************************************************************************************* +Procedure introducere_imob_in_curs + Lparameters toMF + + && toMF - folosit la preluarea din contabilitate - vine completat cu nract, dataact, valoare + + Private pnButon + Local lcMesaj, lnRaspuns + Store '' To ofrmintroc + + lcMesaj = "Nu puteti face introduceri" + If !verificare_luna_inchisa(lcMesaj) + Return + Endif + + lnRaspuns = 6 + pnButon = 1 + + *!* 11.11.2009 + Local lnRezultat, lnIdTipDocNrInv + Private poGeneratorNumere + lnIdTipDocNrInv = 18 + poGeneratorNumere = Createobject('oGeneratorNumere') + *!* 11.11.2009 ^ + + + Do While lnRaspuns = 6 And pnButon = 1 + *!* 11.11.2009 + poGeneratorNumere.ResetAll() + lnRezultat = poGeneratorNumere.creeaza_cursor_serii(m.lnIdTipDocNrInv) + *!* 11.11.2009 ^ + ofrmintroc = Createobject('frm_introducere_curs', .F., toMF) + ofrmintroc.Show(1) + Release ofrmintroc + If pnButon = 1 + lnRaspuns = aMESSAGEBOX("Doriti sa continuati introducerile?", 4 + 32, "Confirmare") + Else + *!* 11.11.2009 + poGeneratorNumere.dezaloca_numere() + *!* 11.11.2009 ^ + Endif + Enddo + + Return pnButon +Endproc && introducere_imob_in_curs + +************************************************************************************************************* + +Procedure preluare_imob + Lparameters tnTip + + Local lcSql, lcCondSucursala, lnSucces, llSucces, lcFiltru, llExperimental, llImobObiecteInventar + Private pdDataI, pdDataF, pcCond, pnFiscala + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + pcCond = [] + pnFiscala = 0 + llImobObiecteInventar = (TYPE('gnIMOB_OBI') = 'N' and m.gnIMOB_OBI = 1) + + lcCondSucursala = Strtran(gcCondSucursala, "id_sucursala", "a.id_sucursala", 1, 1, 1) + + && SELECTIE DIN ACT PENTRU CONTURILE IMOBILIZARI CORPORALE/NECORPORALE/CURS + Text To lcSql Textmerge Noshow + SELECT dataact, + nract, + scd as cont, + max(P.DENUMIRE) as part, + max(explicatia) as explicatia, + sum(suma) as suma_act, + Cast(0 as number(18,4)) as suma_imob + FROM ACT A + JOIN IMOB_CONTURI I ON A.SCD = I.CONT AND I.ID_TIP_IMOBILIZARE = <> < '303'], [])>> + LEFT JOIN NOM_PARTENERI P ON A.ID_PARTC = P.ID_PART + WHERE A.STERS = 0 AND A.AN = <> AND A.LUNA = <> <> < 3, [ AND A.SCC NOT IN (SELECT CONT FROM IMOB_CONTURI WHERE ID_TIP_IMOBILIZARE = 3)], [])>> + group by dataact, nract, scd + Endtext + + lnSucces = goExecutor.oExecute(lcSql, "cListaAct") + If lnSucces < 0 + aMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare") + Return + Endif + + lcCursor = 'crsImobPreluare' + If tnTip = 3 && IMOBILIZARI IN CURS + lcSel = [select 3 as id_tip_imobilizare, 0 as iesit_din_gest, cont, nract,data_achizitie, valoare ] + ; + [ from imob_vlista_curs WHERE TO_CHAR(DATA_ACHIZITIE,'MM/YYYY') = '] + Padl(gnLuna, 2, '0') + '/' + Padl(gnAn, 4, '0') + ['] + gcCondSucursala + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + ELSE + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + ALLTRIM(STR(m.tnTip)) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + IF m.llSucces + lcSel = [SELECT * FROM ] + IIF(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + ENDIF + ELSE + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + ENDIF + Endif + + + If m.llSucces + Select Cont, nract, data_achizitie, Sum(valoare) As valinv ; + From crsImobPreluare ; + Where ID_TIP_IMOBILIZARE = tnTip And iesit_din_gest = 0 And ; + Year(data_achizitie) * 12 + Month(data_achizitie) = m.gnAn * 12 + m.gnLuna ; + Group By Cont, nract, data_achizitie ; + Into Cursor cListaImob + + Use In (Select('crsImobPreluare')) + + Select tnTip As tip, Ttod(a.dataact) As dataact, a.nract, a.Part, a.Cont, a.explicatia, a.suma_act, Nvl(i.valinv, Cast(0 As N(18, 4))) As suma_imob, (a.suma_act = Nvl(i.valinv, 0)) As introdus ; + From cListaAct a Left Join cListaImob i On a.nract = i.nract And ; + Ttod(a.dataact) = Ttod(i.data_achizitie) And ALLTRIM(a.Cont) == ALLTRIM(i.Cont) ; + Order By 1, 2, 3 ; + Into Cursor crsPreluare Readwrite + + Use In (Select('cListaImob')) + Use In (Select('cListaAct')) + loFrmPreluare = Createobject("frm_preluare") + loFrmPreluare.Show(1) + + Use In (Select('crsPreluare')) + Endif + +Endproc && preluare_imob + +************************************************************************************************************* +Procedure vizualizare_lista_imob_corp + Parameters tnFiscala + vizualizare_lista_imob(1, tnFiscala) +Endproc && vizualizare_lista_imob_necorp +************************************************************************************************************* +Procedure vizualizare_lista_imob_necorp + Parameters tnFiscala + vizualizare_lista_imob(2, tnFiscala) +Endproc && vizualizare_lista_imob_necorp +************************************************************************************************************* +Procedure vizualizare_lista_imob + Parameters tnTip, tnFiscala + **** + * 1) imob.corporale + * 2) imob.necorporale + **** + Private poLista, pcSchema, pcSelect, pcOrder, pdDataI, pdDataF, pcCond, pnFiscala + Local lcFiltru, llSucces, llExperimental + poLista = NUll + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + Use In (SELECT('crslista')) + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + *pcCond = [id_tip_imobilizare = ] + ALLTRIM(STR(tnTip)) && merge fffff greu + pcCond = [1=2] + If Empty(tnFiscala) + pnFiscala = 0 + Else + pnFiscala = tnFiscala + Endif + lcCursor = 'crsLista' + + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + IF m.llSucces + * se mai face o data selectia din baza de date in frm_lista.show(), asa ca nu iau date acum + lcSel = [SELECT * FROM ] + IIF(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE 1=2 order by data_pif, nr_inventar] + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + ENDIF + ELSE + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + lcSchema = [''] &&['ceck n(1),totdebit n(16,gnPa),totcredit n(16,gnPa),id_fact n(10),id_part n(10),nume c(50),dataact D,dataireg D,nract n(14),datascad D,cont c(4),acont c(4)'] + + + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + IF m.llSucces + Select crslista + Index On Dtos(data_PIF) + Str(nr_inventar) Tag ordine + ENDIF + ENDIF && llExperimental + + IF m.llSucces + poLista= Createobject('frm_lista', m.tnTip, m.pnFiscala) + poLista.cnumecursor = m.lcCursor + poLista.Show(1) + Clear Class 'frm_lista' + Use In (SELECT('crslista')) + ENDIF + + Release poLista +Endproc && vizualizare_lista_imob +************************************************************************************************************* +Procedure vizualizare_lista_imob_in_curs + Private poLista, pcSchema, pcSelect, pcOrder, pcFiltru + Local llAfiseaza + Store '' To poLista + Store '' To ofrmvizc + Local lcSelect, lcFiltru, lcSchema, lcOrder, llAfisare, lcGroup, llModParam, lcFiltruOriginal + Store '' To lcSelect, lcFiltru, lcSchema, lcOrder, llAfisare, lcGroup, llModParam, lcFiltruOriginal + If Used('crslista') + Use In crslista + Endif + + lcSchema = [] + lcSelect = [select id_mf,id_lista_mf,nrord,nract,id_lucrare,id_responsabil,id_gestiune,] + ; + [id_sectie,data_achizitie,nr_inventar,denumire,explicatia,] + ; + [valoare,valoare_ramasa,cgest,gestiune,sectie,responsabil,cont, acont, utilizator,dataora,id_operatie_mf, an, luna, an_exp, luna_exp, id_sucursala, sucursala, CAST(0 as Number(16,4)) as valoareretinuta, 0 as ales ] + ; + [from imob_vlista_curs] + lcOrder = [data_achizitie,nr_inventar] + lcFiltru = [] + *!* 10.04.2008 + *!* din contafin am preluat imobilizari in curs cu valoare < 0 (o factura de stornare) si nu apareau in roa + *!* lcFiltruOriginal = [ valoare>0 ] + gcCondSucursala + lcFiltruOriginal = Iif(!Empty(gcCondSucursala), Substr(gcCondSucursala, 6), '') + *!* 10.04.2008 ^ + llAfisare = .F. + llModParam = .T. + lcGroup = [] + gencursor('poLista', 'crslista', lcSelect, lcFiltru, lcSchema, lcOrder, llAfisare, lcGroup, llModParam, lcFiltruOriginal) + poLista.ca_baza1.afisare() + + Select crslista + ofrmvizc = Createobject('frm_lista_curs') + ofrmvizc.Show(1) + + If Used('crslista') + Use In crslista + Endif + + Release ofrmvizc +Endproc && introducere_imob_in_curs +************************************************************************************************************* +Procedure MESAJ + Parameters m1 + ot = Createobject('frm_mesaj', 'Atentie', 'pericol.ico', 'AVERTIZARE', m1, ' ') + + ot.Show(1) + Return + + ************************************************************************************************************* + + +Procedure modif_operatii_rate + Parameters tnTipImob, tnFiscala, poMF + + If Empty(poMF.id_mf) + Return + Endif + + Private pnIdMf, pnTip, pnIdOperatie + Store 0 To pnIdMf, pnTip, pnIdOperatie + + pnIdMf = poMF.id_mf + + If Empty(tnTipImob) + pnTip = 1 && corporale + Else + pnTip = tnTipImob + Endif + + *** pageframe1 + lcSqlOperatii = ['select * from ] + Iif(tnFiscala = 0, [imob_voperatii_mf], [imobf_voperatii_mf]) + [ where 1=2'] + + lcSqlRate = ['select * from ] + Iif(tnFiscala = 0, [imob_vcalcul_rate ], [imobf_vcalcul_rate ]) + [ where 1=2'] + + If Used('crsOperatii') + Use In crsOperatii + Endif + + Private poOperatii + poOperatii = '' + + pcFiltru = [id_mf = ?pnIdMF ] + pcSchema = [] + pcOrder = [data_operatie, id_operatie_mf] + llAfiseaza = .F. + + gencursor('poOperatii', 'crsOperatii', lcSqlOperatii, pcFiltru, pcSchema, pcOrder, llAfiseaza) + poOperatii.ca_baza1.afisare() + + Select crsOperatii + Locate + pnIdOperatie = id_operatie_mf + + Private poRate + poRate = '' + + If Used('crsRate') + Use In crsRate + Endif + pcFiltru2 = [id_mf = ?pnIdMF and id_operatie_mf = ?pnIdOperatie] + pcSchema2 = [] + pcOrder2 = [id_calcul_rate] + llAfiseaza = .F. + gencursor('poRate', 'crsRate', lcSqlRate, pcFiltru2, pcSchema2, pcOrder2, llAfiseaza) + poRate.ca_baza1.afisare() + + + *** vizualizare + Select crsOperatii + omodif = Createobject('frm_operatii_rate') + omodif.omf = poMF + omodif.nFiscala = tnFiscala + omodif.Show() + + If Used('crsOperatii') + Use In crsOperatii + Endif + If Used('crsRate') + Use In crsRate + Endif +Endproc && modif_operatii_rate + + +&& IAU SOLDURILE DIN BALANTA DE VERIFICARE PENTRU CONTURILE DE IMOBLIZARI SI AMORTIZARI +&& SI LE COMPAR CU VALOAREA DE INVENTAR SI AMORTIZAREA TOTALA DIN IMOBILIZARI CORPORALE/NECORPORALE CONTABIL +Procedure verificare_balanta(tnTip, tnAn, tnLuna) + Private pdDataI, pdDataF, pcCond, pnFiscala, pnIdTipImobilizare + Local lcSql, lnSucces, lcMesaj, lnAn, lnLuna, lnTipImobilizare, lcCondSucursala, lcBal, lcImob, lcDif + LOCAL llSucces, llExperimental, llImobObiecteInventar + lcMesaj = '' + llImobObiecteInventar = .F. && daca verific si contul 303 (obiecte de inventar) + + lnTipImobilizare = Iif(Type('tnTip') <> 'N', 1, Iif(Inlist(tnTip, 1, 2), tnTip, 1)) + + If Pcount() < 3 + lnAn = gnAn + lnLuna = gnLuna + Else + lnAn = tnAn + lnLuna = tnLuna + Endif + + pdDataI = Date(lnAn, lnLuna, 1) + pdDataF = pdDataI + pcCond = [] + pnFiscala = 0 + llImobObiecteInventar = (TYPE('gnIMOB_OBI') = 'N' and m.gnIMOB_OBI = 1) + + lcCondSucursala = Strtran(gcCondSucursala, "id_sucursala", "b.id_sucursala", 1, 1, 1) + + Text To lcSql Textmerge Noshow +select 1 as tip, c.cont, c.cont_amortizare, + b.SOLDDEB as sold + from imob_conturi c + left join <> b on c.cont = b.cont <> <> + where c.id_tip_imobilizare = <> < '303'], [])>> +union +select 2 as tip, c.cont, c.cont_amortizare, + b.soldcred as sold + from imob_conturi c + left join <> b on c.cont_amortizare = b.cont <> <> + where c.id_tip_imobilizare = <> < '303'], [])>> +order by 1,2 + + Endtext + + llSucces = goExecutor.oExecuta(lcSql, "crsConturiVerificare") + If !m.llSucces + Return + Endif + lcCursor = 'crslistaVerificare' + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + ALLTRIM(STR(m.lnTipImobilizare)) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + IF m.llSucces + lcSel = [SELECT * FROM ] + IIF(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + ENDIF + ELSE + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + ENDIF + + If m.llSucces + Select Cont, Sum(valoare) As valinv, Sum(amort_prec + rata) As amorttot ; + From crsListaVerificare ; + Where ID_TIP_IMOBILIZARE = lnTipImobilizare And iesit_din_gest = 0; + Group By Cont ; + Into Cursor cImobilizari + + Use In (Select('crsListaVerificare')) + + && V.TIP: 1 = CONTURI IMOBILIZARI; 2 = CONTURI AMORTIZARI + Select v.tip, v.Cont, Nvl(v.sold, Cast(0 As N(18, 4))) As bal_valoare, Nvl(i.valinv, Cast(0 As N(18, 4))) As imob_valoare; + From crsConturiVerificare v Full Join cImobilizari i On v.Cont = i.Cont ; + Where v.tip = 1 ; + Union ; + Select v.tip, v.cont_amortizare As Cont, Nvl(v.sold, Cast(0 As N(18, 4))) As bal_valoare, Sum(Nvl(i.amorttot, Cast(0 As N(18, 4)))) As imob_valoare ; + From crsConturiVerificare v Full Join cImobilizari i On v.Cont = i.Cont ; + Where v.tip = 2 ; + Group By v.tip, v.cont_amortizare, v.sold ; + Into Cursor cVerificareImob ; + Order By 1, 2 + + Use In (Select('crsConturiVerificare')) + Use In (Select('cImobilizari')) + + Set Textmerge On To Memvar lcMesaj Noshow + + Select cVerificareImob + Scan For Abs(Round(bal_valoare - imob_valoare, gnPA)) > 0.00 + lcImob = Padl(Alltrim(Transform(imob_valoare, GET_MASK(16, gnPA))), 20, ' ') + lcBal = Padl(Alltrim(Transform(bal_valoare, GET_MASK(16, gnPA))), 20, ' ') + lcDif = Padl(Alltrim(Transform(imob_valoare - bal_valoare, GET_MASK(16, gnPA))), 20, ' ') + + \<>: imobilizari: <> Balanta: <> Diferenta: <> + Endscan + + Use In (Select('cVerificareImob')) + Set Textmerge To + + If !Empty(m.lcMesaj) + lcMesaj = 'Diferente valori imobilizari - balanta verificare' + CRLF + m.lcMesaj + aMESSAGEBOX(lcMesaj, 0 + 48, 'Verificare') + Else + aMESSAGEBOX('Nu sunt diferente!', 0 + 48, 'Verificare') + Endif + + Endif +Endproc && verificare_balanta +*---------------------------------------------------------------------------------------- +Procedure viz_bunuri_capital + Private poBunCapital + Store [] To poBunCapital + Local lcSchema, lcSelect, lcOrder, lcFiltru, lcFiltruOriginal, llAfisare, llModMaram, lcGroup + + lcSchema = [] + lcSelect = [select * ] + ; + [from imob_vbunuricapital] + lcOrder = [denumire,datadoc] + lcFiltru = [] + *!* lcFiltruOriginal = Iif(!Empty(gcCondSucursala), Substr(gcCondSucursala,6), '') + lcFiltruOriginal = [] + + llAfisare = .F. + llModParam = .T. + lcGroup = [] + gencursor('poBunCapital', 'crsBunCapital', lcSelect, lcFiltru, lcSchema, lcOrder, llAfisare, lcGroup, llModParam, lcFiltruOriginal) + poBunCapital.ca_baza1.afisare() + Select crsBunCapital + + frm_buncpital = Createobject('frm_bunuri_capital') + frm_buncpital.Show(1) + +Endproc &&viz_bunuri_capital + + + +************************************** +* Intoarce .T. daca numarul de inventar este duplicat +************************************** +function VerificaNumarInventar + LPARAMETERS tnNumarInventar, tnTip + + PRIVATE pnNumarInventar, pdData, pnTip, pnRec + LOCAL llDuplicat, lcSql, llSucces + + llDuplicat = .F. + + pdData = Date(gnAn, gnLuna, 1) + pnNumarInventar = IIF(TYPE('tnNumarInventar') = 'N', m.tnNumarInventar, 0) + pnTip = IIF(TYPE('tnTip') = 'N', m.tnTip, 1) + + IF !EMPTY(m.pnNumarInventar) + lcSql = [select pack_imob.verifica_nr_inventar(?pnNumarInventar,?pdData, ?pnTip) as nr from dual] + pnRec = 0 + + llSucces = goExecutor.oSelecteaza2Value(m.lcSql, @pnRec) + IF m.llSucces + llDuplicat = (m.pnRec > 0) + ENDIF + ENDIF + RETURN m.llDuplicat + +ENDfunc + + + \ No newline at end of file diff --git a/Programe/oproceduri_listari.prg b/Programe/oproceduri_listari.prg new file mode 100644 index 0000000..9ef3fe8 --- /dev/null +++ b/Programe/oproceduri_listari.prg @@ -0,0 +1,1326 @@ +*!* 16.11.2009 +*!* marius.mutu +*!* RegistruNrInventar, RegNrInvInCurs - export xls +*!* RegNrInvInCurs - conditie sucursala +*!* ListaImobInCurs - am mutat codul din meniu in procedura + +*!* 16.05.2024 +*!* marius.mutu +*!* list_inchid_amortizari - corectie apel inchidere amortizari - defalcare dupa lucrari + +*-------------------------------------------------------------------------------------------------------------- +Procedure _old_listare_amortizari_lunare() + Parameters Tip + *!* datain=CTOD('01/'+ALLTRIM(STR(v_luni.nrluna))+'/'+ALLTRIM(v_luni.an)) + *!* datadela=CTOD("01/"+loluna.nl+"/"+loluna.an) + + *!* IF Tip=1 + *!* lcsql = "select * from "+gcS+".imob_vamortizarilunare_mf_c" + *!* ELSE + *!* lcsql = "select * from "+gcS+".imob_vamortizarilunare_mf_n" + *!* ENDIF + *!* lnSucces=goExecutor.oExecute(lcsql,'crsamortizarelunara1') + *!* *SELECT distinct * FROM crsamortizarelunara1 WHERE ; + *!* CTOD('01/'+ALLTRIM(STR(luna))+'/'+ALLTRIM(STR(an)))>=datadela AND ; + *!* CTOD('01/'+ALLTRIM(STR(luna))+'/'+ALLTRIM(STR(an)))<=datain INTO CURSOR crsamortizarelunara + *!* SELECT DISTINCT * FROM crsamortizarelunara1 WHERE; + *!* luna_rata >= datadela AND luna_rata <= datain INTO CURSOR crsamortizarelunara READWRITE + + *!* SELECT crsamortizarelunara + *!* REPLACE ALL data_exp WITH CTOD('01/'+STR((MONTH(data_pif)+dns_ramas%12)%12)+'/'+STR(( YEAR(data_pif)+ INT( dns_ramas/12 )+INT((MONTH(data_pif)+dns_ramas%12 )/12) ))) + *!* *brow + *!* REPORT FORM amortanaliz_grup TO PRINTER PROMPT PREVIEW + *!* goExecutor.oReset() +Endproc +*-------------------------------------------------------------------------------------------------------------- +Procedure _old_listare_la_imprimanta() + Parameters Tip + *!* IF tip=1 + *!* lcsql = "select * from "+gcS+".IMOB_Vlistimprimanta_MF_C" + *!* ELSE + *!* lcsql = "select * from "+gcS+".IMOB_Vlistimprimanta_MF_N" + *!* ENDIF + + *!* lnSucces=goExecutor.oExecute(lcSql,'crslistmfcota') + *!* IF lnSucces<0 + *!* MESSAGEBOX("Nu a mers SQL-ul") + *!* return + *!* ENDIF + + *!* SELECT crslistmfcota + Select crslista + Report Form listmfcota To Printer Prompt Preview + *!* goExecutor.oReset() +Endproc +*------------------------------------------------------------------------------------------------------------ +Procedure _old_listare_istoric_amoritizare() + Parameters Tip + If Tip = 1 + lcsql = "select * from " + gcS + ".IMOB_VISTAMORTIZARE_MF_c " + Else + lcsql = "select * from " + gcS + ".IMOB_VISTAMORTIZARE_MF_N " + Endif + + lnSucces = goExecutor.oExecute(lcsql, 'crsamortizare') + If lnSucces < 0 + aMESSAGEBOX(goExecutor.cEroare, 16, "Eroare") + Return + Endif + Select crsamortizare + + *REPLACE ALL data_exp WITH CTOD('01/'+STR((MONTH(luna)+dns_ramas%12)%12)+'/'+STR(( YEAR(luna)+ INT( dns_ramas/12 )+INT((MONTH(luna)+dns_ramas%12 )/12) ))) + + Report Form amortizare To Printer Prompt Preview + + goExecutor.oReset() +Endproc + +*------------------------------------------------------------------------------------------------------------ + +Procedure _old_list_corp_general + list_general(1) +Endproc +*------------------------------------------------------------------------ +Procedure _old_list_necorp_general + list_general(2) +Endproc +*------------------------------------------------------------------------ +Procedure _old_list_general && CORPORALE/NECORPORALE 'cu totaluri generale' + Parameters tnTip + * tnTip 1) Corp. 2) Necorp + Private poLista, locauta + Store '' To poLista + Store "" To locauta + Private pnIdGest, pnTip + pcTitlu = "LISTA IMOBILIZARILOR " + Iif(tnTip = 1, "CORPORALE", "NECORPORALE") + " IN LUNA" + pnIdGest = 0 + + If Pcount() > 0 And Type('tnTip') = 'N' + pnTip = tnTip + Else + pnTip = 1 + Endif + + pcselect = ['select nume_gestiune,id_gestiune FROM vnom_gestiuni where inactiv=0'] + pcfiltru = [1=2] + pcschema = [''] + pcorder = [nume_gestiune] + pccoloane = [nume_gestiune] + pcTitlu = [Alegeti gestiunea] + pcTitluColoane = [Gestiune] + locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane, "", .T.) + + If gnButon = 2 + Release locuta + Return + Endif + + pcCond = [id_tip_imobilizare = ] + Alltrim(Str(m.pnTip)) + [ and id_tip_operatie <> 4] + If !Empty(locauta.nume_gestiune) And locauta.id_gestiune <> 0 + pnIdGest = locauta.id_gestiune + pcCond = pcCond + [ and id_gestiune = ] + Alltrim(Str(pnIdGest)) + Endif + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + pnFiscala = 0 + lcSchema = [''] &&['ceck n(1),totdebit n(16,gnPa),totcredit n(16,gnPa),id_fact n(10),id_part n(10),nume c(50),dataact D,dataireg D,nract n(14),datascad D,cont c(4),acont c(4)'] + lcCursor = 'crslista' + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.pnTip)) + [ and iesit_din_gest = 0] + Iif(!Empty(m.pnIdGest), [ and id_gestiune = ] + Alltrim(Str(m.pnIdGest)), []) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + If m.llSucces + Select * From crslista Into Cursor crsRap Order By gestiune, data_achizitie + Report Form listmfcota To Printer Prompt Preview + Endif + + + Release poLista + Release locauta + Use In (Select('crslista')) + Use In (Select('crsRap')) + +Endproc +*--------------------------------------------------------------------------- +Procedure _old_list_corp_peluni + list_peluni(1) +Endproc +*------------------------------------------------------------------------ +Procedure _old_list_necorp_peluni + list_peluni(2) +Endproc +*------------------------------------------------------------------------ +Procedure _old_list_peluni && CORPORALE/NECORPORALE 'cu totaluri pe luni' + Parameters tnTip + * tnTip 1) Corp. 2) Necorp + Private poLista, locauta + Store '' To poLista + Store "" To locauta + Private pnIdGest, pnTip + pnIdGest = 0 + + If Pcount() > 0 And Type('tnTip') = 'N' + pnTip = tnTip + Else + pnTip = 1 + Endif + + pcselect = ['select nume_gestiune,id_gestiune FROM vnom_gestiuni where inactiv=0'] + pcfiltru = [1=2] + pcschema = [''] + pcorder = [nume_gestiune] + pccoloane = [nume_gestiune] + pcTitlu = [Alegeti gestiunea] + pcTitluColoane = [Gestiune] + locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane, "", .T.) + + + If gnButon = 2 + Release locuta + Return + Endif + + + pcCond = [id_tip_imobilizare = ] + Alltrim(Str(pnTip)) + [ and id_tip_operatie <> 4] + If !Empty(locauta.nume_gestiune) And locauta.id_gestiune <> 0 + pnIdGest = locauta.id_gestiune + pcCond = pcCond + [ and id_gestiune = ] + Alltrim(Str(pnIdGest )) + Endif + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + pnFiscala = 0 + lcSchema = [''] &&['ceck n(1),totdebit n(16,gnPa),totcredit n(16,gnPa),id_fact n(10),id_part n(10),nume c(50),dataact D,dataireg D,nract n(14),datascad D,cont c(4),acont c(4)'] + lcCursor = 'crslista' + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.pnTip)) + [ and iesit_din_gest = 0] + Iif(!Empty(m.pnIdGest), [ and id_gestiune = ] + Alltrim(Str(m.pnIdGest)), []) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + pcTitlu = "LISTA IMOBILIZARILOR " + Iif(tnTip = 1, "CORPORALE", "NECORPORALE") + " IN LUNA" + + If m.llSucces + Select * From crslista Into Cursor crsRap Order By gestiune, data_pif, Cont + Report Form listmflunicota To Printer Prompt Preview + Endif + + Release poLista + Release locauta + If Used('crslista') + Use In crslista + Endif + If Used('crsRap') + Use In crsRap + Endif + +Endproc +*--------------------------------------------------------------------------- +Procedure _old_list_corp_pegrup + list_pegrup(1) +Endproc +*------------------------------------------------------------------------ +Procedure _old_list_necorp_pegrup + list_pegrup(2) +Endproc +*------------------------------------------------------------------------ +Procedure _old_list_pegrup && CORPORALE/NECORPORALE 'cu totaluri pe grupe' + + Parameters tnTip + * tnTip 1) Corp. 2) Necorp + Private poLista, locauta + Store '' To poLista + Store "" To locauta + Private pnIdGest, pnTip + pnIdGest = 0 + + If Pcount() > 0 And Type('tnTip') = 'N' + pnTip = tnTip + Else + pnTip = 1 + Endif + + pcselect = ['select nume_gestiune,id_gestiune FROM vnom_gestiuni where inactiv=0'] + pcfiltru = [1=2] + pcschema = [''] + pcorder = [nume_gestiune] + pccoloane = [nume_gestiune] + pcTitlu = [Alegeti gestiunea] + pcTitluColoane = [Gestiune] + locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane, "", .T.) + + If gnButon = 2 + Release locuta + Return + Endif + + pcCond = [id_tip_imobilizare = ] + Alltrim(Str(pnTip)) + [ and id_tip_operatie <> 4] + If !Empty(locauta.nume_gestiune) And locauta.id_gestiune <> 0 + pnIdGest = locauta.id_gestiune + pcCond = pcCond + [ and id_gestiune = ] + Alltrim(Str(pnIdGest )) + Endif + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + pnFiscala = 0 + lcSchema = [''] &&['ceck n(1),totdebit n(16,gnPa),totcredit n(16,gnPa),id_fact n(10),id_part n(10),nume c(50),dataact D,dataireg D,nract n(14),datascad D,cont c(4),acont c(4)'] + lcCursor = 'crslista' + pcTitlu = "LISTA IMOBILIZARILOR " + Iif(tnTip = 1, "CORPORALE", "NECORPORALE") + " IN LUNA" + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.pnTip)) + [ and iesit_din_gest = 0] + Iif(!Empty(m.pnIdGest), [ and id_gestiune = ] + Alltrim(Str(m.pnIdGest)), []) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + If m.llSucces + Select * From crslista Into Cursor crsRap Order By gestiune, Cont + Report Form listmfscdcota To Printer Prompt Preview + Endif + + Release poLista + Release locauta + If Used('crslista') + Use In crslista + Endif + If Used('crsRap') + Use In crsRap + Endif + +Endproc +*--------------------------------------------------------------------------- +Procedure _old_list_corp_pesectii + list_pesectii(1) +Endproc +*------------------------------------------------------------------------ +Procedure _old_list_necorp_pesectii + list_pesectii(2) +Endproc +*------------------------------------------------------------------------ +Procedure _old_list_pesectii && CORPORALE/NECORPORALE 'cu totaluri pe sectii' + Parameters tnTip + * tnTip 1) Corp. 2) Necorp + Private poLista, locauta + Store '' To poLista + Store "" To locauta + Private pnIdSectie, pnTip + pnIdSectie = 0 + + If Pcount() > 0 And Type('tnTip') = 'N' + pnTip = tnTip + Else + pnTip = 1 + Endif + + pcselect = ['select sectie, id_sectie FROM vnom_sectii where inactiv=0'] + pcfiltru = [1=2] + pcschema = [''] + pcorder = [sectie] + pccoloane = [sectie] + pcTitlu = [Alegeti sectie] + pcTitluColoane = [Sectii] + locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane, "", .T.) + + + If gnButon = 2 + Release locuta + Return + Endif + + pcCond = [id_tip_imobilizare = ] + Alltrim(Str(pnTip)) + [ and id_tip_operatie <> 4] + If !Empty(locauta.sectie) And locauta.id_sectie <> 0 + pnIdSectie = locauta.id_sectie + pcCond = pcCond + [ and id_sectie = ] + Alltrim(Str(pnIdSectie)) + Endif + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + pnFiscala = 0 + lcSchema = [''] &&['ceck n(1),totdebit n(16,gnPa),totcredit n(16,gnPa),id_fact n(10),id_part n(10),nume c(50),dataact D,dataireg D,nract n(14),datascad D,cont c(4),acont c(4)'] + lcCursor = 'crslista' + pcTitlu = "LISTA IMOBILIZARILOR " + Iif(tnTip = 1, "CORPORALE", "NECORPORALE") + " IN LUNA" + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.pnTip)) + [ and iesit_din_gest = 0] + Iif(!Empty(m.pnIdSectie), [ and id_sectie = ] + Alltrim(Str(m.pnIdSectie)), []) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + If m.llSucces + Select * From crslista Into Cursor crsRap Order By gestiune, Cont, data_pif + If Reccount('crsRap') > 0 + Private pcDataOra + pcDataOra = get_ora(2) + Select crsRap + Report Form listmf_grup To Printer Prompt Preview + Release pcDataOra + Else + aMESSAGEBOX("Nu exista inregistrari pentru listare!", 48, "Atentie") + Endif + Endif + + Release poLista + Release locauta + If Used('crslista') + Use In crslista + Endif + If Used('crsRap') + Use In crsRap + Endif + + +Endproc +*--------------------------------------------------------------------------- +Procedure lista_fiselor_corp && CORPORALE 'lista fiselor' + LPARAMETERS tlOperatii + lnTip = 1 && corporale + lnFiscala = 0 && amortizare contabila + llOperatii = m.tlOperatii && standard/cu operatii + + lista_fiselor(m.lnTip, m.lnFiscala, m.llOperatii) +Endproc +*--------------------------------------------------------------------------- +Procedure lista_fiselor_necorp && NECORPORALE 'lista fiselor' + LPARAMETERS tlOperatii + lnTip = 2 && necorporale + lnFiscala = 0 && amortizare contabila + llOperatii = m.tlOperatii && standard/cu operatii + + lista_fiselor(m.lnTip, m.lnFiscala, m.llOperatii) +Endproc +*--------------------------------------------------------------------------- +Procedure lista_fiselor + Parameters tnTip, tnFiscala, tlOperatii + **** + * 1) imob.corporale + * 2) imob.necorporale + **** + + Local lcCursor, lcFiltru, lcSchema, lcSel, llExperimental, llSucces, lnFiscala, llOperatii + Private pcCond, pdDataF, pdDataI, pnFiscala + + lnFiscala = IIF(!EMPTY(m.tnFiscala), m.tnFiscala, 0) + llOperatii = IIF(!EMPTY(m.tlOperatii), m.tlOperatii, .F.) + Use In (Select('crslista')) + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + pcCond = [1=1] + pnFiscala = 0 + lcSchema = [''] + lcCursor = 'crslista' + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.tnTip)) + [ and iesit_din_gest = 0] + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + If !m.llSucces + Return + Endif + + Select crslista + Set Filter To id_tip_imobilizare = tnTip And iesit_din_gest = 0 +SET STEP ON + IF m.llOperatii + * Jurnal operatii-rate + lcSql = [select * from ] + Iif(m.lnFiscala = 0, [imob_vjurnal_rate],[imobf_vjurnal_rate]) + [ where id_tip_imobilizare = ] + ALLTRIM(STR(m.tnTip)) + [ order by data_operatie] + llSucces = goExecutor.oExecuta(m.lcSql, "crsLista2") + + SELECT crsLista + INDEX on id_mf TAG id_mf + + SELECT crsLista2 + INDEX on id_mf TAG id_mf + SET RELATION TO crsLista.id_mf INTO crsLista2 + ENDIF + + lcRaport = IIF(m.llOperatii, IIF(m.tnTip = 1, "fisa_mf_istoric_rate", "fisa_mf2"), IIF(m.tnTip = 1, "fisa_mf_istoric", "fisa_mf2")) + goExport.export2frx([crslista], "fisa_mf_istoric", , , , , , .T.) + + Use In (SELECT('crsLista')) + USE IN (SELECT('crsLista2')) +Endproc +*--------------------------------------------------------------------------- + +*!* Lista de inventar imobilizari corporale model 1 +*!* am inlocuit-o cu DO list_inventar WITH 1,0 IN oproceduri_listari.prg +Procedure lista_inv_m1_c + lista_inv_m1(1) +Endproc +*--------------------------------------------------------------------------- +*!* Lista de inventar imobilizari necorporale model 1 +*!* am inlocuit-o cu DO list_inventar WITH 2,0 IN oproceduri_listari.prg +Procedure lista_inv_m1_n + lista_inv_m1(2) +Endproc +*--------------------------------------------------------------------------- +Procedure lista_inv_m1 + Parameters tnTip + * tnTip 1) Corp. 2) Necorp + Private poLista, locauta + Store '' To poLista + Store "" To locauta + Private pnIdGest + pnIdGest = 0 + + pcselect = ['select nume_gestiune,id_gestiune FROM ] + gcS + [.vnom_gestiuni where inactiv=0'] + pcfiltru = [1=2] + pcschema = [''] + pcorder = [nume_gestiune] + pccoloane = [nume_gestiune] + pcTitlu = [Alegeti gestiunea] + pcTitluColoane = [Gestiune] + locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane, "", .T.) + If !Empty(locauta.nume_gestiune) + lcCondGestiune = [1=1] + If Alltrim(locauta.nume_gestiune) # [] + pnIdGest = locauta.id_gestiune + lcCondGestiune = lcCondGestiune + [ and id_gestiune = ?pnIdGest] + Endif + + Use In (Select('crslista')) + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + pcCond = [1=1] + pnFiscala = 0 + lcSchema = [''] + lcCursor = 'crslista' + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.pnTip)) + [ and iesit_din_gest = 0] + Iif(!Empty(m.pnIdGest), [ and id_gestiune = ] + Alltrim(Str(m.pnIdGest)), []) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + If !m.llSucces + Return + Endif + + Select * From crslista With (Buffering = .T.) Where id_tip_imobilizare = tnTip And iesit_din_gest = 0 And &lcCondGestiune Into Cursor crs_rap Order By gestiune, Cont + If Used('crsLista') + Use In crslista + Endif + + If Reccount('crs_rap') > 0 + Private pcDataOra + pcDataOra = get_ora(2) + Select crs_rap + * thisform.AlwaysOnTop = .F. + Report Form listmf_inv To Printer Prompt Preview + * thisform.AlwaysOnTop = .T. + Release pcDataOra + Else + aMESSAGEBOX("Nu exista inregistari pentru listare!", 48, "Atentie") + Endif + If Used('crslista') + Use In crslista + Endif + If Used('crs_rap') + Use In crs_rap + Endif + Endif + + Release poLista + +Endproc +*--------------------------------------------------------------------------- +Procedure lista_inv_m2_c + lista_inv_m2(1) +Endproc +*--------------------------------------------------------------------------- +Procedure lista_inv_m2_n + lista_inv_m2(2) +Endproc +*--------------------------------------------------------------------------- +Procedure lista_inv_m2 + Parameters tnTip + * tnTip 1) Corp. 2) Necorp + Private poLista, locauta + Store '' To poLista + Store "" To locauta + Private nid_gestiune + nid_gestiune = 0 + + pcselect = ['select nume_gestiune,id_gestiune FROM ] + gcS + [.vnom_gestiuni where inactiv=0'] + pcfiltru = [1=2] + pcschema = [''] + pcorder = [nume_gestiune] + pccoloane = [nume_gestiune] + pcTitlu = [Alegeti gestiunea] + pcTitluColoane = [Gestiune] + locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane, "", .T.) + If !Empty(locauta.nume_gestiune) + nid_gestiune = locauta.id_gestiune + pcgestiune = Alltrim(locauta.nume_gestiune) + + pcschema = [''] + pcselect = ['select * from ] + gcS + [.imob_vjurnal2 where 1=2'] + pcorder = [gestiune,denumire] + *pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0 and id_gestiune=?nid_gestiune] + pcfiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0] + Iif(nid_gestiune = 0, [], [and id_gestiune=?nid_gestiune]) + llAfiseaza = .F. + gencursor('poLista', 'crslista', pcselect, pcfiltru, pcschema, pcorder, llAfiseaza) + poLista.ca_baza1.afisare() + pcTitlu = "LISTA IMOBILIZARILOR " + Iif(tnTip = 1, "CORPORALE", "NECORPORALE") + " IN LUNA" + + If Reccount('crslista') > 0 + Private pcDataOra + pcDataOra = get_ora(2) + Select crslista + *thisform.AlwaysOnTop = .F. + Report Form nota_inv2005 To Printer Prompt Preview + Release pcDataOra + *thisform.AlwaysOnTop = .T. + Else + aMESSAGEBOX("Nu exista inregistrari pentru listare!", 48, "Atentie") + Endif + + Endif + Release poLista +Endproc +*--------------------------------------------------------------------------- + +Procedure evidenta_mf && CORPORALE 'Evidenta MF' + Parameters tnTip + Private pcDataOra + + Local lcCursor, lcFiltru, lcSchema, lcSel, llExperimental, llSucces + Private pcCond, pdDataF, pdDataI, pnFiscala + pcDataOra = [] + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + pcCond = [1=1] + pnFiscala = 0 + + lcSchema = [''] + lcCursor = 'crslista' + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.tnTip)) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + If !m.llSucces + Return + Endif + + Select Cont, Sum(valoare) As valoare, Sum(amort_prec + rata) As amortizare_totala, ; + Sum(valoare - amort_prec - rata) As valoare_ramasa, Sum(valoare_ramasa) As valoare_justa, ; + Sum(rata) As rata, Count(*) As numar ; + From &lcCursor Where id_tip_imobilizare = tnTip And iesit_din_gest = 0 Into Cursor crsevidentamf Group By Cont Order By Cont + + If Used(lcCursor) + Use In (lcCursor) + Endif + + *!* lcsql= " SELECT cont ,sum(valoare) as valoare,sum(amort_prec+rata) as amortizare_totala,"+; + *!* " sum(valoare_ramasa-amort_prec-rata) as valoare_ramasa,sum(valoare_ramasa-amort_prec_rata) as ramas_bilant, "+; + *!* " sum(rata) as rata,count(*) as numar "+; + *!* " FROM "+gcS+".imob_vjurnal2 where id_tip_imobilizare=1 and iesit_din_gest=0 GROUP BY cont ORDER BY cont" + *!* lnSucces=goExecutor.oExecute(lcsql,'crsevidentamf') + *!* IF lnSucces<0 + *!* MESSAGEBOX("Nu a mers SQL-ul") + *!* RETURN + *!* ENDIF + *STRTOFILE(lcsql,'c:\t.txt') + If Reccount('crsevidentamf') > 0 + pcDataOra = get_ora(2) + Select crsevidentamf + *thisform.AlwaysOnTop = .F. + * Report Form evidenta_mf To Printer Prompt Preview + goExport.export2frx('crsevidentamf', "evidenta_mf", , , , , , .T.) + *thisform.AlwaysOnTop = .T. + + Select crsevidentamf + If Reccount() > 0 + If aMESSAGEBOX('Doriti sa exportati in format XLS?', 4 + 32, _Screen.Caption) = 6 + export_xls("crsevidentamf", "evidenta MF") + Endif + Endif + Else + aMESSAGEBOX("Nu exista inregistrari pentru listare!", 48, "Atentie") + Endif + + Use In (SELECT('crsevidentamf')) + +Endproc +*--------------------------------------------------------------------------- +Procedure list_inchid_amortizari + Lparameters tnTip + + Private pcTitlu, pcDataOra + Local lcCursor, lnLucrare, lnSectie + + pcTitlu = "Raport amortizare lunara " + Iif(tnTip = 1, "imobilizari corporale", "imobilizari necorporale") + pcDataOra = get_ora(2) + + Local lnTip, lnSectie + If Empty(tnTip) + lnTip = 1 && corporale + Else + lnTip = tnTip + Endif + + lnSectie = 0 + *!* 07.05.2007 + *!* optiune inchidere nota amortizare dupa sectie + If gnNotaImob = 2 + lnSectie = 1 + Else + *IF gnCampSectie = 1 + If aMESSAGEBOX("Nota de inchidere amortizari se defalca dupa 'Sectie'?", 4 + 32, "Inchidere amortizari") = 6 + lnSectie = 1 + Endif + *ENDIF + Endif + + lnLucrare = 0 + IF m.gnCampLucrare = 1 AND AMESSAGEBOX("Inchiderea se face dupa campul 'Lucrare'?", 4 + 32, "Inchidere amortizari") = 6 + lnLucrare = 1 + ENDIF + + lcCursor = GET_CURSOR_INCHIDERE_AMORTIZARI(m.lnTip, m.lnSectie, m.lnLucrare, m.gnAn, m.gnLuna, "crs_inchidere") && oproceduri_comune_imob.prg + If Used(lcCursor) + Select (lcCursor) + Set Filter To suma <> 0 + goExport.export2frx(m.lcCursor, "act", , , , , , .T.) + + Select (lcCursor) + If Reccount() > 0 + If aMESSAGEBOX('Doriti sa exportati in format XLS?', 4 + 32, _Screen.Caption) = 6 + export_xls(m.lcCursor, m.pcTitlu) + Endif + Endif + Endif + + Use In (Select(lcCursor)) + +Endproc && list_inchid_amortizari + + +*---------------------------------------------------- +Procedure list_inchid_amortizari_nec + +Endproc && list_inchid_amortizari_nec +*----------------------------------------------------------------------------------- +Procedure rulaj_amortizment + LPARAMETERS tnFiscala + Private pcfelul + + lcAlias = sitan(m.tnFiscala) && sitan.prg + rulaje('amortizare_lunara', lcAlias) && IN sitan.prg + + Select rulaje + Go Top + ov = Create('frm_analitice1') + ov.lb_titlu_alb_b121.Caption = 'SITUATIE ANALITICA - RULAJ AMORTIZMENTE (In anul curent pana in luna curenta)' + IIF(EMPTY(m.tnFiscala), ' CONTABILA', ' FISCALA') + For i = 3 To ov._grdbase1.ColumnCount + ov._grdbase1.Columns[i].InputMask = get_mask(14, gnPa) + Endfor + ov.Show(1) + Use In rulaje + +Endproc && rulaj_amortizment + +*----------------------------------------------------------------------------------- +Procedure total_amortizment + LPARAMETERS tnFiscala + Private pcfelul + + lcAlias = sitan(m.tnFiscala) && sitan.prg + rulaje('amortizare_totala', lcAlias) && IN sitan.prg + + Select rulaje + Go Top + ov = Create('frm_analitice1') + ov.lb_titlu_alb_b121.Caption = 'SITUATIE ANALITICA - TOTAL AMORTIZMENTE (In anul curent pana in luna curenta)' + IIF(EMPTY(m.tnFiscala), ' CONTABILA', ' FISCALA') + For i = 3 To ov._grdbase1.ColumnCount + ov._grdbase1.Columns[i].InputMask = get_mask(14, gnPa) + Endfor + ov.Show(1) + Use In rulaje + +Endproc && total_amortizment + +***--------------------------------- +Procedure list_situatie_lunara + Parameters tnTip, tnFiscala + && tnTip : 1 = corporala, 2 = necorporala + && tnFiscala : 0 = contabila, 1 = fiscala + + Do Form rap_situatie_lunara With tnTip, tnFiscala + +Endproc && list_situatie_lunara + +***--------------------------------- +Procedure list_inventar + Parameters tnTip, tnFiscala + && tnTip : 1 = corporala, 2 = necorporala + && tnFiscala : 0 = contabila, 1 = fiscala + + Do Form rap_lista_inventar With tnTip, tnFiscala + +Endproc && list_inventar + +*** --------------------------------------- + +Procedure compar_am_contab_fiscal + Parameters tnTip, tlXLS + *** tlXLS: .T. = export XLS, .F. (default) = listare + + Local lcCursor, lcSchema, lcSel, llOk, lnSucces, loExcelXML + *:Global pcCond, pcDataora, pcTitlu, pdDataF, pdDataI, pnFiscala + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = pdDataI + *pcCond = [id_tip_imobilizare = ] + ALLTRIM(STR(tnTip)) && merge fffff greu + pcCond = [1=1] + pnFiscala = 0 + lcCursor = 'crslistaC' + lcSchema = [''] + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.tnTip)) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + If !m.llSucces + Return + Endif + + pnFiscala = 1 + lcSchema = [''] + lcCursor = 'crslistaF' + + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.tnTip)) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + If !m.llSucces + Return + Endif + + Select c.denumire, c.nr_inventar, c.cod_mf, c.valoare As valoare_c, c.valoare_ramasa As valoare_justa_c, c.rata As rata_c, c.valoare - c.amort_prec - c.rata As valoare_ramasa_c, ; + F.valoare As valoare_f, F.valoare_ramasa As valoare_justa_f, F.rata As rata_f, F.valoare - F.amort_prec - F.rata As valoare_ramasa_f ; + From crslistaC c Join crslistaF F On c.id_mf = F.id_mf And c.id_tip_imobilizare = tnTip And F.id_tip_imobilizare = tnTip ; + Where c.rata <> F.rata Or c.valoare <> F.valoare ; + Order By c.nr_inventar, c.denumire ; + Into Cursor crs_list + + pcTitlu = 'Raport diferente dintre amortizarea contabila si cea fiscala' + If Reccount('crs_list') > 0 + pcDataOra = get_ora(2) + Select crs_list + If m.tlXLS + loExcelXML = Newobject("ExcelXML", "ExcelXML.VCX") + loExcelXML.SheetName = "Diferente amortizare" + loExcelXML.OpenAfterSaving = .T. + llOk = loExcelXML.Save("diferente_amortizare_" + Alltrim(Str(m.gnAn)) + Padl(m.gnLuna, 2, '0') + '.xls') + Else + goExport.export2frx([crs_list], "rap_diferente_cf", , , , , , .T.) + Endif + Else + aMESSAGEBOX("Nu exista inregistari pentru listare!", 48, "Atentie") + Endif + + If Used('crslistaC') + Use In crslistaC + Endif + If Used('crslistaF') + Use In crslistaF + Endif + If Used('crs_list') + Use In crs_list + Endif + + +Endproc && compar_am_contab_fiscal + +***--------------------------------------------------------- + +Procedure istoric_operatii + Parameters tnTip + + pcselect = ['select denumire,nr_pif FROM ] + gcS + [.imob_vnom_mf where inactiv=0 and id_tip_imobilizare = ?tnTip'] + pcfiltru = [1=2] + pcschema = [''] + pcorder = [denumire,nr_pif] + pccoloane = [denumire, nr_pif] + pcTitlu = [Alegeti MF] + pcTitluColoane = [Denumire MF, Nr. PIF] + locauta = cauta_alfa(pcselect, pcfiltru, pcschema, pcorder, pccoloane, pcTitlu, pcTitluColoane, "") + + If Empty(locauta.id_mf) + Return + Endif + + pnIdMf = locauta.id_mf + + lcsql = 'SELECT a.denumire, a.nr_pif, a.data_pif, l.nr_inventar, l.cod_mf, ' + ; + 'o.data_operatie, o.denumire as operatie, o.valoare, o.valoare_ramasa, o.dns_ramas,' + ; + 'r.rata, r.data_ultima_rata, r.luna, r.an, r.luna_exp, r.an_exp, r.cota_an, 0 as fiscal ' + ; + 'from imob_vnom_mf join a imob_vultimalista_mf l on a.id_mf = l.id_mf ' + + + && neterminat + +Endproc && istoric_operatii + +***------------------------ INCEPUT: RegistruNrInventar --------------------------------------- +Procedure RegistruNrInventar(tnIdTipImobilizare, tnIesitDinGest) + + Private pcDataOra + + Local lcCursor, lcFiltru, lcSchema, lcSel, llExperimental, llSucces, lnSucces + Private pcCond, pdDataF, pdDataI, pnFiscala + Use In (Select('crslista')) + + + pdDataI = Date(gnAn, gnLuna, 1) + pdDataF = m.pdDataI + pcCond = [1=1] + pnFiscala = 0 + lcSchema = [''] + lcCursor = 'crslista' + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.tnIdTipImobilizare)) + [ and iesit_din_gest = ] + Alltrim(Str(m.tnIesitDinGest)) + m.gcCondSucursala + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursor) + Endif + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + Endif + + + + lnSucces = goExecutor.oExecute(lcSel, lcCursor) + If lnSucces < 0 + aMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare") + Return + Endif + + Select denumire, cod_mf As codmf, nr_inventar As nrinv, Nvl(gestiune, "") As gestiune, Nvl(sectie, "") As sectie, ; + Left(Alltrim(cod_mf), 3) As codleft ; + From crslista ; + Where id_tip_imobilizare = tnIdTipImobilizare And iesit_din_gest = tnIesitDinGest ; + Order By codleft, nrinv ; + Into Cursor crsRegNrInv + + Use In crslista + + If Reccount('crsRegNrInv') > 0 + pcDataOra = get_ora(2) + Select crsRegNrInv + *!* Report Form reg_nr_inv To Printer Prompt Preview + goExport.export2frx([crsRegNrInv], [reg_nr_inv], , , , , , .T.) + If aMESSAGEBOX('Doriti sa exportati in format XLS?', 4 + 32, _Screen.Caption) = 6 + export_xls('crsRegNrInv', 'Registru Numere Inventar') + Endif + Else + aMESSAGEBOX("Nu exista inregistrari pentru listare!", 48, "Atentie") + Endif + + Use In crsRegNrInv +Endproc && RegistruNrInventar +***======================== SFARSIT: RegistruNrInventar ================================= + + +***------------------------ INCEPUT: ListaImobInCurs ------------------------------------ +Procedure ListaImobInCurs + LPARAMETERS tcGrupare + * tcGrupare (optional): LUCRARE + + PRIVATE pcDataOra, pcGrupDenumire, pcGrupId, pcGrupTitlu + Local lnOptiune, lcFilter, lcCursor, lcOrder + poLista = '' + pcDataOra = '' + lcOrder = [data_achizitie, nr_inventar] + + pcGrupId = '1=1' + pcGrupTitlu = '' + pcGrupDenumire = 'nrord' + If UPPER(TRANSFORM(tcGrupare)) = 'LUCRARE' + pcGrupId = 'id_lucrare' + pcGrupTitlu = 'Lucrare' + pcGrupDenumire = 'nrord' + lcOrder = [nrord, data_achizitie, nr_inventar] + ENDIF + + lcsql = [select id_mf,id_lista_mf,nrord,nract,id_lucrare,id_responsabil,id_gestiune,] + ; + [id_sectie,data_achizitie,nr_inventar,denumire,explicatia,] + ; + [valoare, valoare_ramasa, cgest,gestiune,sectie,responsabil,cont,utilizator,dataora,id_operatie_mf ] + ; + [from imob_vlista_curs ] + Iif(!Empty(gcCondSucursala), [ WHERE ] + Substr(gcCondSucursala, 6), '') + [ ORDER BY ] + m.lcOrder + + lnSucces = goExecutor.oExecute(lcsql, 'crsLista') + If lnSucces < 0 + aMESSAGEBOX(goExecutor.cEroare, 0 + 64, 'Eroare') + Return + Endif + If Reccount('crslista') > 0 + pcDataOra = get_ora(2) + Select crslista + *thisform.AlwaysOnTop = .F. + *!* Report Form listimobcurs To Printer Prompt Preview + goExport.export2frx([crslista], [listimobcurs], , , , , , .T.) + *thisform.AlwaysOnTop = .T. + Else + aMESSAGEBOX("Nu exista inregistrari pentru listare!", 48, "Atentie") + Endif + Release pcDataOra +Endproc && ListaImobInCurs +***======================== SFARSIT: ListaImobInCurs ==================================== + +***------------------------ Inceput: RegNrInvInCurs ------------------------------------- +Procedure RegNrInvInCurs + + Private poLista, pcschema, pcselect, pcorder, pcfiltru + Local llAfiseaza + Private pcDataOra + Store '' To poLista + + If Used('crslista') + Use In crslista + Endif + + pcschema = [''] + pcselect = [select id_mf,id_lista_mf,nrord,nract,id_lucrare,id_responsabil,id_gestiune,] + ; + [id_sectie,data_achizitie,nr_inventar,denumire,explicatia,] + ; + [valoare,cgest,gestiune,sectie,responsabil,cont,utilizator,dataora,id_operatie_mf ] + ; + [from ] + gcS + [.imob_vlista_curs where 2=2'] + pcorder = [data_achizitie] + *!* 16.11.2009 + pcfiltru = [valoare > 0 ] + Iif(!Empty(gcCondSucursala), gcCondSucursala, '') + *!* 16.11.2009 ^ + llAfiseaza = .F. + gencursor('poLista', 'crslista', pcselect, pcfiltru, pcschema, pcorder, llAfiseaza) + poLista.ca_baza1.afisare() + Select denumire, "" As codmf, nr_inventar As nrinv, Nvl(gestiune, "") As gestiune, Nvl(sectie, "") As sectie, ; + "" As codleft ; + From crslista ; + Order By codleft, nrinv ; + Into Cursor crsRegNrInv + + If Used('crslista') + Use In crslista + Endif + + If Reccount('crsRegNrInv') > 0 + pcDataOra = get_ora(2) + Select crsRegNrInv + *!* Report Form reg_nr_inv To Printer Prompt Preview + goExport.export2frx([crsRegNrInv], [reg_nr_inv], , , , , , .T.) + If aMESSAGEBOX('Doriti sa exportati in format XLS?', 4 + 32, _Screen.Caption) = 6 + export_xls('crsRegNrInv', 'Registru Numere Inventar') + Endif + Else + aMESSAGEBOX("Nu exista inregistrari pentru listare!", 48, "Atentie") + Endif + + If Used('crsRegNrInv') + Use In crsRegNrInv + Endif +Endproc && RegNrInvInCurs +***======================== SFARSIT: RegNrInvInCurs ===================================== + +**************************************************************** +* verifica daca exista diferente intre modul standard (pack_imob.calcul_situatie_lunara) si modul experimental (selectie din view imob_vsituatie_lunara) de calcul amortizare +**************************************************************** +Procedure raport_concordanta_experimental + Lparameters tnIdTipImobilizare + + Private pdDataI, pdDataF, pcCond, pnFiscala + Local lcsql, lcCursorS, lcCursorE + + Create Cursor cDiferenteImob (id_mf i, nr_inventar i, denumire c(200), amps N(16, 2) Null, ampe N(16, 2) Null, dif1 L, amls N(16, 2) Null, amle N(16, 2) Null, dif2 L, valas N(16, 2) Null, valae N(16, 2) Null, dif3 L, ; + valis N(16, 2) Null, valie N(16, 2) Null, dif4 L, valrs N(16, 2) Null, valre N(16, 2) Null, dif5 L, iesits N(1) Null, iesite N(1) Null, dif6 L, dataes D Null, dataee D Null, dif7 L, Tip N(1) Null) + + pdDataI = Date(m.gnAn, m.gnLuna, 1) + pdDataF = m.pdDataI + + pcCond = [2=2] + pnFiscala = 0 + + * STANDARD + lcCursorS = 'crsAmortizareStandard' + lcsql = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(m.lcsql, m.lcCursorS) + + + * EXPERIMENTAL + lcCursorE = 'crsAmortizareExperimentalTemp' + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdDataI); end;') + If m.llSucces + lcFiltru = [id_tip_imobilizare = ] + Alltrim(Str(m.tnIdTipImobilizare)) + If !Isnull(m.gnIdSucursala) + lcFiltru = m.lcFiltru + [ and ID_SUCURSALA = ] + Alltrim(Str(m.gnIdSucursala)) + Endif + lcsql = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + ' WHERE ' + m.lcFiltru + llSucces = goExecutor.oExecuta(m.lcsql, m.lcCursorE) + Endif + Select *, .F. As verificat From (m.lcCursorE) Into Cursor crsAmortizareExperimental Readwrite + + Select crsAmortizareStandard + Scan For id_tip_imobilizare = m.tnIdTipImobilizare + Scatter Name loS + + Select crsAmortizareExperimental + Locate For id_mf = loS.id_mf + If Found() + Scatter Name loE + Replace verificat With .T. + Else + Scatter Name loE Blank + Endif + llDif1 = Nvl(loS.amort_prec, 0) <> Nvl(loE.amort_prec, 0) + llDif2 = Nvl(loS.rata, 0) <> Nvl(loE.rata, 0) + llDif3 = Nvl(loS.valoare_achizitie, 0) <> Nvl(loE.valoare_achizitie, 0) && valoare achizitie + llDif4 = Nvl(loS.valoare, 0) <> Nvl(loE.valoare, 0) && valoare inventar + llDif5 = Nvl(loS.valoare_ramasa, 0) <> Nvl(loE.valoare_ramasa, 0) + llDif6 = Nvl(loS.iesit_din_gest, 0) <> Nvl(loE.iesit_din_gest, 0) + llDif7 = Nvl(loS.data_expirare, 0) <> Nvl(loE.data_expirare, 0) + If (m.llDif1 Or m.llDif2 Or m.llDif3 Or m.llDif4 Or m.llDif5 Or m.llDif6 Or m.llDif7) + Insert Into cDiferenteImob (id_mf, nr_inventar, denumire, amps, ampe, amls, amle, valas, valae, valis, valie, valrs, valre, iesits, iesite, dataes, dataee, Tip, dif1, dif2, dif3, dif4, dif5, dif6, dif7) ; + Values (loS.id_mf, loS.nr_inventar, loS.denumire, loS.amort_prec, loE.amort_prec, loS.rata, loE.rata, loS.valoare_achizitie, loE.valoare_achizitie, loS.valoare, loE.valoare, loS.valoare_ramasa, loE.valoare_ramasa, ; + loS.iesit_din_gest, loE.iesit_din_gest, loS.data_expirare, loE.data_expirare, loS.id_tip_imobilizare, m.llDif1, m.llDif2, m.llDif3, m.llDif4, m.llDif5, m.llDif6, m.llDif7) + Endif + Endscan && crsAmortizareStandard + + Insert Into cDiferenteImob (id_mf, nr_inventar, denumire, ampe, amle, valae, valie, valre, iesite, dataee, Tip, dif1, dif2, dif3, dif4, dif5, dif6, dif7) ; + Select id_mf, nr_inventar, denumire, amort_prec, rata, valoare_achizitie, valoare, valoare_ramasa, iesit_din_gest, data_expirare, id_tip_imobilizare, .T., .T., .T., .T., .T., .T., .T. ; + From crsAmortizareExperimental Where !verificat + + Use In (Select('crsAmortizareStandard')) + Use In (Select('crsAmortizareExperimental')) + + Select cDiferenteImob + Go Top + If Reccount() = 0 + aMESSAGEBOX('Nu exista diferente intre calcul amortizare standard si experimental', 0 + 64, _Screen.Caption) + Else + Browse Title 'Diferente calcul standard - experimental' + + If aMESSAGEBOX('Doriti sa exportati in format XLS?', 4 + 32, _Screen.Caption) = 6 + export_xls('cDiferenteImob', 'Diferente calcul standard - experimental') + Endif + Endif + Use In (Select('cDiferenteImob')) +Endproc && raport_concordanta_experimental + +******************************** +Procedure list_situatie_reevaluare + LPARAMETERS tnIdTipImobilizare, tcIds + * tnIdTipImobilizare: 1=corporale, 2=necorporale, 3=in curs + * tcIds (optional): lista id_mf separate prin virgula + + *!* Situatia de reevaluari a tuturor imobilizarilor + *!* 1. Am luat "valoarea de inventar" si "durata ramasa" de la toate operatiile de tip "Reevaluare". + *!* 2. Am comparat valoarea de inventar noua cu valoarea anterioara. Diferenta am impartit-o la durata ramasa (luni) si a rezultat o "rata". + *!* 3. Am generat apoi atatea inregistrari pentru "rata" respectiva cate luni ramase au fost la reevaluare. + *!* 4. Am generat aceasta situatie pentru toate lunile 2003-2020. + *!* Primele 2 coloane: an si luna reprezinta luna contabila in care sunt active ratele de majorare (de la luna operatiei de reevaluare pana la numarul de luni ramase). + + *!* Exemplu: Pentru numarul de inventar 201001, AEROTERMA 15 KW sunt 2 reevaluari: + *!* - ianuarie 2004: valoare majorare: 304.07 lei, dns ramas: 72 luni, majorarea se imparte pana in decembrie 2009 (72 luni) in rate de 4.22 lei + *!* - decembrie 2006: valoare majorare: 92.76 lei, dns ramas: 36 luni, majorarea se imparte pana in noiembrie 2009 in rate de 2.58 lei + *!* ianuarie 2004 - noiembrie 2006: rata de 4.22 lei + *!* decembrie 2006 - noiembrie 2009: rata de 4.22 + 2.58 = 6.8 lei + *!* decembrie 2009: rata 4.22 lei + + Local lcFileName, lcsql, llSucces, loPerioada, lcSelect + PRIVATE pnNrLuni1, pnNrLuni2, pcTitlu, pnIdTipImobilizare + lcSelect = SELECT() + pnIdTipImobilizare = IIF(!EMPTY(m.tnIdTipImobilizare), m.tnIdTipImobilizare, 1) + +*!* AMESSAGEBOX('Alegeti perioada pentru care doriti sa generati raportul!', 0 + 64, _Screen.Caption) + loPerioada = AlegePerioada() + If Type('loPerioada') <> 'O' + Return + Endif + + pnNrLuni1 = loPerioada.an1 * 12 + loPerioada.luna1 + pnNrLuni2 = loPerioada.an2 * 12 + loPerioada.luna2 + pcTitlu = 'Situatie reevaluari imobilizari ' + IIF(m.pnIdTipImobilizare = 1, 'corporale', 'necorporale') + ' ' + loPerioada.perioada + + lcsql = [select * from imob_vsituatie_reevaluare r] + + IF !EMPTY(m.tcIds) + lcsql = m.lcSql + [ JOIN (SELECT * FROM table(cast(CHARN2COLLECTION('] + m.tcIds + [', ',') as num_tab))) i ON r.ID_MF = i.X] + ENDIF + + lcSql = m.lcSql + [ where r.an*12+r.luna between ?pnNrLuni1 and ?pnNrLuni2 and r.id_tip_imobilizare = ?pnIdTipImobilizare] + + llSucces = goExecutor.oExecuta(m.lcsql, "cSituatieReevaluare") + If m.llSucces + goExport.export2frx([cSituatieReevaluare], [situatie_reevaluare], , , , , , .T.) + + If AMESSAGEBOX('Doriti sa exportati in format XLS?', 4 + 32, _Screen.Caption) = 6 + lcFileName = 'situatie_reevaluare_' + ALLTRIM(STR(INT(loPerioada.an1))) + PADL(INT(loPerioada.luna1),2,'0') + '_' + ALLTRIM(STR(INT(loPerioada.an2))) + PADL(INT(loPerioada.luna2),2,'0') + export_xls('cSituatieReevaluare', m.lcFileName) + Endif + Endif + Use In (Select('cSituatieReevaluare')) + SELECT (m.lcSelect) +Endproc && list_situatie_reevaluare + +******************************** +Procedure list_situatie_modificari + LPARAMETERS tnIdTipImobilizare, tcIds, tnIdTipOperatie + * tnIdTipImobilizare: 1=corporale, 2=necorporale, 3=in curs + * tcIds (optional): lista id_mf separate prin virgula + * tnIdTipOperatie (optional): 0/.F. = toate, 6 = majorare, 7 = reevaluare + + *!* Situatia de majorari a tuturor imobilizarilor + *!* 1. Am luat "valoarea de inventar" de la toate operatiile de tip "Majorare". + *!* 2. Valoarea majorare = diferenta dintre valoarea de inventar noua si valoarea anterioara + + Local lcFileName, lcsql, llSucces, loPerioada, lcSelect, lcTipOperatie, lnIdTipOperatie + PRIVATE pnNrLuni1, pnNrLuni2, pcTitlu, pnIdTipImobilizare + lcSelect = SELECT() + pnIdTipImobilizare = IIF(!EMPTY(m.tnIdTipImobilizare), m.tnIdTipImobilizare, 1) + lnIdTipOperatie = IIF(!EMPTY(m.tnIdTipOperatie), m.tnIdTipOperatie, 0) + + lcTipOperatie = '' + DO CASE + CASE m.lnIdTipOperatie = 6 + lcTipOperatie = 'majorare' + CASE m.lnIdTipOperatie = 7 + lcTipOperatie = 'reevaluare' + ENDCASE + +*!* AMESSAGEBOX('Alegeti perioada pentru care doriti sa generati raportul!', 0 + 64, _Screen.Caption) + loPerioada = AlegePerioada() + If Type('loPerioada') <> 'O' + Return + Endif + + pnNrLuni1 = loPerioada.an1 * 12 + loPerioada.luna1 + pnNrLuni2 = loPerioada.an2 * 12 + loPerioada.luna2 + pcTitlu = 'Situatie operatii ' + IIF(!EMPTY(m.lcTipOperatie), m.lcTipOperatie + ' ', '') + 'imobilizari ' + IIF(m.pnIdTipImobilizare = 1, 'corporale', 'necorporale') + ' ' + loPerioada.perioada + + lcsql = [select * from imob_vsituatie_modificari r] + + IF !EMPTY(m.tcIds) + lcsql = m.lcSql + [ JOIN (SELECT * FROM table(cast(CHARN2COLLECTION('] + m.tcIds + [', ',') as num_tab))) i ON r.ID_MF = i.X] + ENDIF + + lcSql = m.lcSql + [ where extract(year from r.data_operatie)*12+ extract(month from r.data_operatie) between ?pnNrLuni1 and ?pnNrLuni2 and r.id_tip_imobilizare = ?pnIdTipImobilizare] + + IF !EMPTY(m.lnIdTipOperatie) + lcsql = m.lcSql + [ and r.id_tip_operatie = ] + ALLTRIM(STR(m.lnIdTipOperatie)) + ENDIF + + llSucces = goExecutor.oExecuta(m.lcsql, "cSituatieModificari") + If m.llSucces + IF RECCOUNT('cSituatieModificari') > 0 + goExport.export2frx([cSituatieModificari], [situatie_modificari], , , , , , .T.) + + If AMESSAGEBOX('Doriti sa exportati in format XLS?', 4 + 32, _Screen.Caption) = 6 + lcFileName = 'situatie_operatii_' + IIF(!EMPTY(m.lcTipOperatie), m.lcTipOperatie + '_', '') + ALLTRIM(STR(INT(loPerioada.an1))) + PADL(INT(loPerioada.luna1),2,'0') + '_' + ALLTRIM(STR(INT(loPerioada.an2))) + PADL(INT(loPerioada.luna2),2,'0') + export_xls('cSituatieModificari', m.lcFileName) + ENDIF + ELSE + AMESSAGEBOX('Nu exista inregistrari pentru aceasta perioada',0+64,_screen.Caption) + ENDIF + ENDIF && llSucces + + Use In (Select('cSituatieModificari')) + SELECT (m.lcSelect) +Endproc && list_situatie_modificari \ No newline at end of file diff --git a/Programe/oproceduri_operatii.prg b/Programe/oproceduri_operatii.prg new file mode 100644 index 0000000..f75ca38 --- /dev/null +++ b/Programe/oproceduri_operatii.prg @@ -0,0 +1,565 @@ +*!* 11.11.2009 +*!* marius.mutu +*!* alocare, dezalocare numere inventar + +*!* 04.07.2018 +*!* marius.mutu +*!* op_transformare_mf - transformare imobilizare curs in imobilizare corporala/necorporala + +*!* 03.06.2021 +*!* marius.mutu +*!* + op_schimbaredns_reevaluare - adaugare operatie schimbare dns si reevaluare + +*!* 27.08.2024 +*!* marius.mutu +*!* op_adaugare_la_mf - transformare imobilizare in curs in majorare imobilizare corporala/necorporala + +************************************ +*** Cod operatie +************************************ +*** 1 - introducere +*** 2 - preluare +*** 3 - transformare in MF +*** 4 - iesire din gestiune +*** 5 - intrare in gestiune +*** 6 - majorare +*** 7 - reevaluare +*** 8 - schimbarea DNS +*** 9 - recalculare cota +*** 10 - conservare +*** 11 - scoatere din conservare +*** 12 - modificare cu istoric +*** 13 - inchidere +*** 14 - schimbare DNS + reevaluare +************************************ +* Intoarce un obiect cu lSucces = .T. daca succes, .F. daca eroare sau renunt + +Procedure op_majorare + Parameters tnTip, tnValoareMajorare + + Private pnvaloaremaj, pddatareeval, pnNrDoc, pdDataDoc, pnBunCapital, pnBazaTva, pnIdCotaTva, pnTva, pnProrataTva + Store '' To ofrmmajorare + Local llBunCapital + gnButon = 2 + pnValoareMaj = IIF(EMPTY(m.tnValoareMajorare), 0, m.tnValoareMajorare) + pdDataReeval = {} + pcExplicatie = [] + pnFiscala = 0 + pnNrDoc = 0 + pdDataDoc = {} + pnBunCapital = 0 + pnBazaTva = 0 + pnIdCotaTva = 0 + pnTva = 0 + pnProrataTva = 0 + + lcSql = [select * from imob_vbunuricapital where id_tip_operatie in (1,2) and id_mf = ?poDetaliiMf.id_mf] + lnSucces = goExecutor.oExecute(lcSql, [crsNrbuncapital]) + If lnSucces < 0 + aMessagebox(goExecutor.cEroare, 0 + 16, _screen.Caption) + Return + Endif + Select crsNrbuncapital + If Reccount() > 0 + llBunCapital = .T. + Endif + Use In crsNrbuncapital + + = update_cote_TVA() + + ofrmmajorare = Createobject('frm_op_majorare', tnTip, llBunCapital) + ofrmmajorare.Show(1) + + Release ofrmmajorare + + m.llSucces = .F. + If gnButon = 1 + lcSql = [begin pack_imob.inreg_majorare(?gcS,?poDetaliiMf.id_sucursala,?poDetaliiMf.id_mf,] + ; + [?pnvaloaremaj,?pddatareeval,?pcExplicatie,?gnIdUtil,?pnFiscala,?pdDatadoc,?pnNrDoc,?pnBunCapital ,?pnBazaTva,?pnIdCotaTva,?pnTva,?pnProrataTva ); end;] + llSucces = goExecutor.oExecuta(lcSql) + If !m.llSucces + aMessagebox('Eroare la inregistrarea majorarii! ' + CRLF + goExecutor.cEroare, 0 + 16, _screen.Caption) + ENDIF + ENDIF + + loReturn = CREATEOBJECT("empty") + ADDPROPERTY(loReturn, "lSucces", m.llSucces) + ADDPROPERTY(loReturn, "valoaremaj", m.pnvaloaremaj) + ADDPROPERTY(loReturn, "datareeval", m.pddatareeval) + ADDPROPERTY(loReturn, "Explicatie", m.pcExplicatie) + ADDPROPERTY(loReturn, "Fiscala", m.pnFiscala) + ADDPROPERTY(loReturn, "Datadoc", m.pdDatadoc) + ADDPROPERTY(loReturn, "NrDoc", m.pnNrDoc) + ADDPROPERTY(loReturn, "BunCapital", m.pnBunCapital ) + ADDPROPERTY(loReturn, "BazaTva", m.pnBazaTva) + ADDPROPERTY(loReturn, "IdCotaTva", m.pnIdCotaTva) + ADDPROPERTY(loReturn, "Tva", m.pnTva) + ADDPROPERTY(loReturn, "ProrataTva", m.pnProrataTva) + + RETURN loReturn +Endproc && op_majorare +************************************************************************************************************* +Procedure op_reevaluare + Parameters tnTip + Private pnvaloarenoua, pddatareeval, pnamortnoua, pnNrDoc, pdDataDoc, pnBunCapital, pnValreev + Local llBunCapital + Store '' To ofrmreeval + pnvaloarenoua = poDetaliiMf.valoare + pnamortnoua = poDetaliiMf.amort_prec + poDetaliiMf.rata + pddatareeval = {} + pcExplicatie = [] + pnFiscala = 0 + pnNrDoc = 0 + pdDataDoc = {} + pnBunCapital = 0 + pnValreev = 0 + + lcSql = [select * from imob_vbunuricapital where id_tip_operatie in (1,2) and id_mf = ?poDetaliiMf.id_mf] + lnSucces = goExecutor.oExecute(lcSql, [crsNrbuncapital]) + If lnSucces < 0 + aMessagebox(goExecutor.cEroare, 0 + 16, "ROA IMOB") + Return + Endif + Select crsNrbuncapital + If Reccount() > 0 + llBunCapital = .T. + Endif + Use In crsNrbuncapital + + + ofrmreeval = Createobject('frm_op_reevaluare', tnTip, llBunCapital ) + ofrmreeval.Show(1) + + *!* WAIT WINDOW STR(pnFiscala) + Release ofrmreeval + If pnButon = 1 + lcSql = [begin pack_imob.inreg_reevaluare(?gcS,?poDetaliiMf.id_sucursala,?poDetaliiMf.id_mf,] + ; + [?pnvaloarenoua,?pnamortnoua,?pddatareeval,?pcExplicatie,?gnIdUtil,?pnFiscala,?pdDataDoc,?pnNrDoc,?pnBunCapital,?pnValreev ); end;] + lnSucces = goExecutor.oExecute(lcSql) + If lnSucces < 0 + aMessagebox('Eroare la inregistrarea reevaluarii! ' + CRLF + goExecutor.cEroare, 0 + 16, "ROA IMOB") + Return + Endif + Endif + +Endproc && op_reevaluare + +************************************************************************************************************* +Procedure op_schimbaredns_reevaluare + Parameters tnTip + Local ofrmreeval, lcSql, lnSucces, llBunCapital + Private pnvaloarenoua, pddatareeval, pnAmortizareNoua, pnNrDoc, pdDataDoc, pnBunCapital, pnValreev + PRIVATE pcExplicatie, pnDNSNou, pnDurataRamasaNoua, pnFiscala, pnUzuraNoua, pcCodNou + private pnValoareRamasaNoua, pnValoareRezidualaNoua, pnValoareRamasa, pnAmortizare + Store '' To ofrmreeval + pnValoareNoua = poDetaliiMf.valoare + pnAmortizare = poDetaliiMf.amort_prec + poDetaliiMf.rata + pnAmortizareNoua = m.pnAmortizare + pnValoareRamasa = poDetaliiMf.valoare - poDetaliiMf.amort_prec - poDetaliiMf.rata - poDetaliiMf.valoare_reziduala + pnValoareRamasaNoua = m.pnValoareRamasa + pnValoareRezidualaNoua = poDetaliiMf.valoare_reziduala + pnDNSNou = poDetaliiMf.dns_luni + pnUzuraNoua = poDetaliiMf.uzura + pnDurataRamasaNoua = poDetaliiMf.durata_ramasa + pcCodNou = poDetaliiMf.cod_mf + + pcExplicatie = [] + pnFiscala = 0 + pnNrDoc = 0 + pnBunCapital = 0 + pnValReev = 0 + + pdDatadoc = get_ultima_zi() + pddatareeval = m.pdDataDoc + + lcSql = [select * from imob_vbunuricapital where id_tip_operatie in (1,2) and id_mf = ?poDetaliiMf.id_mf] + lnSucces = goExecutor.oExecute(lcSql, [crsNrbuncapital]) + If lnSucces < 0 + aMessagebox(goExecutor.cEroare, 0 + 16, "ROA IMOB") + Return + Endif + Select crsNrbuncapital + If Reccount() > 0 + llBunCapital = .T. + Endif + Use In crsNrbuncapital + + + ofrmreeval = Createobject('frm_op_schimbdns_reevaluare', m.tnTip, m.llBunCapital) + ofrmreeval.Show(1) + + *!* WAIT WINDOW STR(pnFiscala) + Release ofrmreeval + If pnButon = 1 + lcSql = [begin pack_imob.inreg_schimbdns_reevaluare(?gcS,?poDetaliiMf.id_sucursala,?poDetaliiMf.id_mf,] + ; + [?pcCodNou,?pnDnsNou,?pnValoareNoua,?pnAmortizareNoua,?pnUzuraNoua,?pnValoareRezidualaNoua,] + ; + [?pdDataReeval,?pcExplicatie,?gnIdUtil,?pnFiscala,?pdDataDoc,?pnNrDoc,?pnBunCapital,?pnValreev ); end;] + + lnSucces = goExecutor.oExecute(lcSql) + If lnSucces < 0 + aMessagebox('Eroare la inregistrarea schimbare DNS si reevaluare! ' + CRLF + goExecutor.cEroare, 0 + 16, _Screen.Caption) + Return + Endif + Endif + +Endproc && op_schimbaredns_reevaluare + +************************************************************************************************************* +Procedure op_conservare + Parameters tnTip, tlConservat + Private pddataconservare, pccauza, pnNrDoc, pdDataDoc, pnBunCapital, pnBazaTva, pnId_cota_tva, pnTva, pnProrataTva + Local llBunCapital + Store '' To ofrmgest + pddataconservare = {} + pccauza = [] + pnFiscala = 0 + pnNrDoc = 0 + pdDataDoc = {} + + pnBunCapital = 0 + pnBazaTva = 0 + pnId_cota_tva = 0 + pnTva = 0 + pnProrataTva = 0 + + lcSql = [select * from imob_vbunuricapital where id_tip_operatie in (1,2) and id_mf = ?poDetaliiMf.id_mf] + lnSucces = goExecutor.oExecute(lcSql, [crsNrbuncapital]) + If lnSucces < 0 + aMessagebox(goExecutor.cEroare, 0 + 16, "ROA IMOB") + Return + Endif + Select crsNrbuncapital + If Reccount() > 0 + llBunCapital = .T. + Endif + Use In crsNrbuncapital + + + = update_cote_TVA() + + ofrmgest = Createobject('frm_op_conservare', tlConservat, tnTip, llBunCapital) + ofrmgest.Show(1) + + Release ofrmgest + If pnButon = 1 + lcSql = [begin pack_imob.inreg_conservare(?gcS,?poDetaliiMf.id_sucursala,?poDetaliiMf.id_mf,] + Iif(!tlConservat, '1', '0') + [,] + ; + [?pccauza,?pddataconservare,?gnIdUtil,?pnFiscala,?pdDataDoc,?pnNrDoc,?pnBunCapital,?pnBazaTva,?pnId_cota_tva,?pnTva,?pnProrataTva); end;] + lnSucces = goExecutor.oExecute(lcSql) + If lnSucces < 0 + aMessagebox('Eroare la inregistrarea ' + Iif(!tlConservat, 'intrarii in conservare', 'iesirii din conservare') + ; + '!' + CRLF + goExecutor.cEroare, 0 + 16, "ROA IMOB") + Return + Endif + Endif + + +Endproc && op_conservare +************************************************************************************************************* +Procedure op_schimbaredns + Parameters tnTip + Private pddataschimbare, pndns, pccodnou, pnNrDoc, pdDataDoc + Store '' To ofrmschdns + pddataschimbare = {} + pndns = 0 + pccodnou = [] + pnUzura = 0 + pcExplicatie = [] + pnFiscala = 0 + pnNrDoc = 0 + pdDataDoc = {} + + ofrmschdns = Createobject('frm_op_schimb_dns') + ofrmschdns.Show(1) + + + Release ofrmschdns + If pnButon = 1 + lcSql = [begin pack_imob.inreg_schimbdns(?gcS,?poDetaliiMf.id_sucursala,?poDetaliiMf.id_mf,?pccodnou,] + ; + [?pndns,?pddataschimbare,?pcExplicatie,?gnIdUtil,?pnFiscala,?pdDataDoc,?pnNrDoc); end;] + lnSucces = goExecutor.oExecute(lcSql) + If lnSucces < 0 + aMessagebox('Eroare la inregistrarea schimbarii DNS-ului !' + CRLF + goExecutor.cEroare, 0 + 16, "ROA IMOB") + Return + Endif + Endif + +Endproc && op_schimbaredns +************************************************************************************************************* +Procedure op_gest + Parameters tnTip, tlCasat + Private pddataschimbare, pccauza, pnNrDoc, pdDataDoc, pnProrataTva, pnIdTipIesire + Local llBunCapital + Store '' To ofrmgest + pddataschimbare = {} + pccauza = [] + pnFiscala = 0 + pnNrDoc = 0 + pdDataDoc = {} + + pnBunCapital = 0 + pnBazaTva = 0 + pnId_cota_tva = 0 + pnTva = 0 + pnProrataTva = 0 + pnIdTipIesire = 1 && vanzare + + lcSql = [select * from imob_vbunuricapital where id_tip_operatie in (1,2) and id_mf = ?poDetaliiMf.id_mf] + lnSucces = goExecutor.oExecute(lcSql, [crsNrbuncapital]) + If lnSucces < 0 + aMessagebox(goExecutor.cEroare, 0 + 16, "ROA IMOB") + Return + Endif + Select crsNrbuncapital + If Reccount() > 0 + llBunCapital = .T. + Endif + Use In crsNrbuncapital + + = update_cote_TVA() + + lcSql = [select id, tip from imob_tipuri_iesire order by ordine] + llSucces = goExecutor.oExecuta(m.lcSql, [crsTipuriIesire]) + If !m.llSucces + Create Cursor crsTipuriIesire(Id I, tip C(100)) + Insert Into crsTipuriIesire(Id, tip) Values (1, 'VANZARE') + Endif + Go Top In crsTipuriIesire + + ofrmgest = Createobject('frm_op_gest', tlCasat, tnTip, llBunCapital ) + ofrmgest.Show(1) + + Release ofrmgest + Use In (Select('crsTipIesire')) + + If tlCasat && la intrarea in gestiune nu mai am "tip iesire din gestiune" + pnIdTipIesire = Null + Endif + If pnButon = 1 + *!* am pus valori pentru ca dadea la plevnei C00005 + *!* MARIUS.MUTU + *!* 21.11.2006 + *!* lcsql=[ begin pack_imob.inreg_gest(?gcs,?poDetaliiMf.id_mf, ] + Iif(!tlCasat, '1', '0') + [, ?pccauza, ?pddataschimbare, ?gnIdUtil, ?pnFiscala); end;] + lcSql = [ begin pack_imob.inreg_gest('] + gcs + [',] + Iif(Nvl(poDetaliiMf.id_sucursala, 0) = 0, 'NULL', Alltrim(Str(poDetaliiMf.id_sucursala))) + [, ] + Alltrim(Str(poDetaliiMf.id_mf)) + [, ] + Iif(!tlCasat, '1', '0') + [, '] + pccauza + ; + [' , TO_DATE('] + Dtos(pddataschimbare) + [', 'YYYYMMDD') , ] + ; + Alltrim(Str(gnIdUtil)) + [, ] + Alltrim(Str(pnFiscala)) + [, TO_DATE('] + Dtos(pdDataDoc) + [', 'YYYYMMDD') , ] + Alltrim(Str(pnNrDoc)) + [,] + ; + Alltrim(Str(pnBunCapital )) + [,] + Alltrim(Transform(pnBazaTva)) + [,] + Alltrim(Transform(pnId_cota_tva)) + [,] + Alltrim(Transform(pnTva )) + [,] + Alltrim(Transform(pnProrataTva )) + [,] + Iif(Isnull(m.pnIdTipIesire), 'NULL', Alltrim(Transform(m.pnIdTipIesire))) + [); end;] + *STRTOFILE(lcsql,'c:\inreg_gest.txt') + + lnSucces = goExecutor.oExecute(lcSql) + If lnSucces < 0 + aMessagebox('Eroare la inregistrarea ' + Iif(!tlCasat, 'iesirii din gestiune', 'intrarii in gestiune') + ; + '!' + CRLF + goExecutor.cEroare, 0 + 16, "ROA IMOB") + Return + Endif + Endif + +Endproc && op_iesiregest +************************************************************************************************************* +Procedure op_modificare + Parameters tnTip + Store '' To ofrmmodificare + + = cctipuri_amort() + = update_cote_TVA() && modificare v 2.0.18 + ofrmmodificare = Createobject('frm_introducere', tnTip, 2) + ofrmmodificare.Show(1) + + If Used('v_tipuri_amort') + Use In v_tipuri_amort + Endif + *!* modificare v 2.0.18 + If Used('cote_TVA') + Use In cote_TVA + Endif + *!* modificare v 2.0.18 ^ + Release ofrmmodificare + +Endproc && op_modificare +************************************************************************************************************ +Procedure op_transformare_mf + Parameters tnTip + ****************************** + ** tnTip: + ** 1) imob.corporale + ** 2) imob.necorporale + Local lnTip + Private ofrmintro + = cctipuri_amort() + = update_cote_TVA() + + Local lnRezultat, lnIdTipDocNrInv + Private poGeneratorNumere + lnIdTipDocNrInv = 18 + poGeneratorNumere = Createobject('oGeneratorNumere') + lnRezultat = poGeneratorNumere.creeaza_cursor_serii(m.lnIdTipDocNrInv) + + lnTip = Iif(!Empty(m.tnTip), m.tnTip, 1) + + gnButon = 2 + ofrmintro = Createobject('frm_introducere', m.lnTip, 4) + ofrmintro.clb_valoare.Enabled = .F. + ofrmintro.Show(1) + Release ofrmintro + + If gnButon = 2 + poGeneratorNumere.dezaloca_numere() + Endif + + Use In (Select('v_tipuri_amort')) + Use In (Select('cote_TVA')) + Return (gnButon = 1) + +Endproc && op_transformare_mf + +************************************************************************************************************* +*** adaugare valoare imobilizare in curs la o imobilizare corporala/necorporala deja existenta, prin operatia majorare valoare +************************************* +Procedure op_adaugare_la_mf + Parameters tnTip + ****************************** + ** tnTip: + ** 1) imob.corporale + ** 2) imob.necorporale + + Private pdDataI, poDetaliiMf, poMF, pnIdMf + Local lcSql, llSucces, lnFiscala, lnValoareMajorare, ldDataReevaluare + Local llBlank, llReturn, llSucces2, lnIdMf, loImobBlank, loRec + + ldDataReevaluare = {} + + ************************************** + * Aleg imobilizarea pe care doresc sa o majorez + ************************************** + + CALCULATE SUM(valoareretinuta) TO lnValoareMajorare IN crsLista3 + + poDetaliiMf = caut_imobilizare(m.tnTip) + pnIdMf = poDetaliiMf.id_mf + + + llSucces = .T. + llSucces2 = .T. + llSucces = goConn.BeginManualTransaction() + + loMajorare = op_majorare(m.tnTip, m.lnValoareMajorare) + llSucces = loMajorare.lSucces + + IF m.llSucces + =cctipuri_amort() + + * ADAUG OPERATIE TRANSFORMARE MIJLOC FIX PE FIECARE IMOBILIZARE IN CURS + TEXT TO lcSql NOSHOW +begin + pack_imob.inreg_transformare_in_mf(v_schema => ?gcS, + v_id_mf => ?poMF.id_mf, + v_id_mf_nou => ?pnIdMf, + v_datamodificare => ?poMF.datamodificare, + v_nract => ?poMF.nract, + v_dataact => ?poMF.dataact, + v_denumire => ?poMF.denumire, + v_explicatia => ?poMF.explicatia, + v_valoare => ?poMF.valoare, + v_data_pif => ?poMF.data_pif, + v_nr_pif => ?poMF.nr_pif, + v_nr_inventar => ?poMF.nr_inventar, + v_cod => ?poMF.cod, + v_dns => ?poMF.dns, + v_uzura => ?poMF.uzura, + v_dns_ramas => ?poMF.dns_ramas, + v_valoare_ramasa => ?poMF.valoare_ramasa, + v_valoare_retinuta => ?poMF.valoare_retinuta, + v_id_gestiune => ?poMF.id_gestiune, + v_id_responsabil => ?poMF.id_responsabil, + v_id_sectie => ?poMF.id_sectie, + v_id_lucrare => ?poMF.id_lucrare, + v_id_sucursala => ?poMF.id_sucursala, + v_id_tip_amortizare => ?poMF.id_tip_amortizare, + v_procent => ?poMF.procent, + v_coeficient => ?poMF.coeficient, + v_id_tip_imobilizare => ?poMF.id_tip_imobilizare, + v_cont => ?poMF.cont, + v_acont => ?poMF.acont, + v_id_util => ?gnIdUtil, + v_amort_max_deductibil => ?poMF.amort_max_deductibil, + v_fiscala => ?poMF.fiscala, + v_datadoc => ?poMF.datadoc, + v_nrdoc => ?poMF.nrdoc, + v_id_tip_operatie => ?poMF.id_tip_operatie); +end; + ENDTEXT + + + Select crslista3 + SCAN + SCATTER NAME poMF MEMO + + poMF.valoare_ramasa = poMF.valoare_ramasa - poMF.valoareretinuta + ADDPROPERTY(poMF, "dataact", poMf.data_achizitie) + ADDPROPERTY(poMF, "valoare_retinuta", poMF.valoareretinuta) + ADDPROPERTY(poMF, "datamodificare", loMajorare.datareeval) + ADDPROPERTY(poMF, "datadoc", loMajorare.datadoc) + ADDPROPERTY(poMF, "nrdoc", loMajorare.nrdoc) + ADDPROPERTY(poMF, "data_pif", poMf.data_achizitie) + ADDPROPERTY(poMF, "nr_pif", poMf.nr_inventar) + ADDPROPERTY(poMF, "id_tip_amortizare", 1) && liniar + ADDPROPERTY(poMF, "id_tip_imobilizare", 3) && in curs + ADDPROPERTY(poMF, "fiscala", 0) + ADDPROPERTY(poMF, "cod", NULL) + ADDPROPERTY(poMF, "dns", 0) + ADDPROPERTY(poMF, "uzura", 0) + ADDPROPERTY(poMF, "dns_ramas", 0) + ADDPROPERTY(poMF, "procent", 0) + ADDPROPERTY(poMF, "coeficient", 0) + ADDPROPERTY(poMF, "amort_max_deductibil", 0) + ADDPROPERTY(poMF, "id_tip_operatie", 3) && transformare in imobilizare + WITH poMF + .explicatia = ALLTRIM(.explicatia) + ENDWITH + + llSucces = goExecutor.oExecuta(lcSql) + If !m.llSucces + Exit + Endif + + Select crslista3 + Endscan + + Use In (SELECT('v_tipuri_amort')) + ENDIF && llSucces + + USE IN (SELECT('cImobBlank')) + + llSucces2 = goConn.EndManualTransaction(Iif(m.llSucces, 'COMMIT', 'ROLLBACK')) + + llReturn = m.llSucces And m.llSucces2 + + RETURN m.llReturn + +Endproc && op_transformare_mf +*!* ************************************************************************************************************* + + Define class oImobFrm as form + width=650 + height=480 + showWindow=2 + Autocenter=.T. + caption="Alegeti imobilizarea" + name="form1" + + Add object grid1 as grid with ; + Anchor=15,; + left=5,; + top=100,; + width=600,; + height=300,; + gridlines=0,; + deletemark=.t.,; + name="grid1" + + procedure grid1.init + with this + .recordsource="crsListaTemp" + .recordsourcetype=1 + endwith + endproc +ENDDEFINE \ No newline at end of file diff --git a/Programe/ovariabile_globale.prg b/Programe/ovariabile_globale.prg new file mode 100644 index 0000000..45aebbd --- /dev/null +++ b/Programe/ovariabile_globale.prg @@ -0,0 +1 @@ +**OVARIABILE_GLOBALE.PRG \ No newline at end of file diff --git a/Programe/proceduri_meniu.prg b/Programe/proceduri_meniu.prg new file mode 100644 index 0000000..5276e5c --- /dev/null +++ b/Programe/proceduri_meniu.prg @@ -0,0 +1,746 @@ +*!* PROCEDURE list_corp_general +*!* list_general(1) +*!* ENDPROC +*!* *------------------------------------------------------------------------ +*!* PROCEDURE list_necorp_general +*!* list_general(2) +*!* ENDPROC +*!* *------------------------------------------------------------------------ +*!* procedure list_general && CORPORALE/NECORPORALE 'cu totaluri generale' +*!* PARAMETERS tnTip +*!* * tnTip 1) Corp. 2) Necorp +*!* PRIVATE poLista,locauta +*!* Store '' To poLista +*!* Store "" To locauta +*!* private nid_gestiune +*!* nid_gestiune=1 + +*!* pcselect = ['select nume_gestiune,id_gestiune FROM ] + gcs + [.vnom_gestiuni where inactiv=0'] +*!* pcfiltru = [1=2] +*!* pcschema = [''] +*!* pcorder = [nume_gestiune] +*!* pccoloane = [nume_gestiune] +*!* pcTitlu = [Alegeti gestiunea] +*!* pcTitluColoane = [Gestiune] +*!* locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"") +*!* If !Empty(locauta.nume_gestiune) +*!* nid_gestiune=locauta.id_gestiune +*!* pcgestiune=ALLTRIM(locauta.nume_gestiune) +*!* Endif + + +*!* pcSchema=[''] +*!* pcSelect=['select * from ]+gcS+[.imob_vjurnal where 1=2'] +*!* pcOrder=[gestiune,data_achizitie] +*!* *pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0 and id_gestiune=?nid_gestiune] +*!* pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0]+IIF(pcgestiune="TOATE GESTIUNILE",[],[and id_gestiune=?nid_gestiune]) +*!* llAfiseaza = .F. +*!* gencursor('poLista','crslista',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza) +*!* poLista.ca_baza1.afisare() +*!* pctitlu="LISTA IMOBILIZARILOR "+IIF(tnTip=1,"CORPORALE","NECORPORALE")+" IN LUNA" + +*!* SELECT crslista +*!* REPORT FORM listmfcota TO PRINTER PROMPT PREVIEW +*!* Release poLista +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE list_corp_peluni +*!* list_peluni(1) +*!* ENDPROC +*!* *------------------------------------------------------------------------ +*!* PROCEDURE list_necorp_peluni +*!* list_peluni(2) +*!* ENDPROC +*!* *------------------------------------------------------------------------ +*!* PROCEDURE list_peluni && CORPORALE/NECORPORALE 'cu totaluri pe luni' +*!* PARAMETERS tnTip +*!* * tnTip 1) Corp. 2) Necorp +*!* PRIVATE poLista,locauta +*!* Store '' To poLista +*!* Store "" To locauta +*!* private nid_gestiune +*!* nid_gestiune=1 + +*!* pcselect = ['select nume_gestiune,id_gestiune FROM ] + gcs + [.vnom_gestiuni where inactiv=0'] +*!* pcfiltru = [1=2] +*!* pcschema = [''] +*!* pcorder = [nume_gestiune] +*!* pccoloane = [nume_gestiune] +*!* pcTitlu = [Alegeti gestiunea] +*!* pcTitluColoane = [Gestiune] +*!* locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"") +*!* If !Empty(locauta.nume_gestiune) +*!* nid_gestiune=locauta.id_gestiune +*!* pcgestiune=ALLTRIM(locauta.nume_gestiune) +*!* Endif + + +*!* pcSchema=[''] +*!* pcSelect=['select * from ]+gcS+[.imob_vamortizarilunare_mf where 1=2'] +*!* pcOrder=[gestiune,cont,data_pif] +*!* *pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0 and id_gestiune=?nid_gestiune] +*!* pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0]+IIF(pcgestiune="TOATE GESTIUNILE",[],[and id_gestiune=?nid_gestiune]) +*!* llAfiseaza = .F. +*!* gencursor('poLista','crslista',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza) +*!* poLista.ca_baza1.afisare() +*!* pctitlu="LISTA IMOBILIZARILOR "+IIF(tnTip=1,"CORPORALE","NECORPORALE")+" IN LUNA" + + +*!* SELECT crslista +*!* * thisform.AlwaysOnTop = .F. +*!* REPORT FORM listmflunicota TO PRINTER PROMPT PREVIEW +*!* * thisform.AlwaysOnTop = .T. +*!* Release poLista +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE list_corp_pegrup +*!* list_pegrup(1) +*!* ENDPROC +*!* *------------------------------------------------------------------------ +*!* PROCEDURE list_necorp_pegrup +*!* list_pegrup(2) +*!* ENDPROC +*!* *------------------------------------------------------------------------ +*!* PROCEDURE list_pegrup && CORPORALE/NECORPORALE 'cu totaluri pe grupe' + +*!* PARAMETERS tnTip +*!* * tnTip 1) Corp. 2) Necorp +*!* PRIVATE poLista,locauta +*!* Store '' To poLista +*!* Store "" To locauta +*!* private nid_gestiune +*!* nid_gestiune=1 + +*!* pcselect = ['select nume_gestiune,id_gestiune FROM ] + gcs + [.vnom_gestiuni where inactiv=0'] +*!* pcfiltru = [1=2] +*!* pcschema = [''] +*!* pcorder = [nume_gestiune] +*!* pccoloane = [nume_gestiune] +*!* pcTitlu = [Alegeti gestiunea] +*!* pcTitluColoane = [Gestiune] +*!* locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"") +*!* If !Empty(locauta.nume_gestiune) +*!* nid_gestiune=locauta.id_gestiune +*!* pcgestiune=ALLTRIM(locauta.nume_gestiune) +*!* Endif + + +*!* pcSchema=[''] +*!* pcSelect=['select * from ]+gcS+[.imob_vjurnal where 1=2'] +*!* pcOrder=[gestiune,cont] + +*!* *pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0 and id_gestiune=?nid_gestiune] +*!* pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0]+IIF(nid_gestiune=11071,[],[and id_gestiune=?nid_gestiune]) + +*!* llAfiseaza = .F. +*!* gencursor('poLista','crslista',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza) +*!* poLista.ca_baza1.afisare() +*!* pctitlu="LISTA IMOBILIZARILOR "+IIF(tnTip=1,"CORPORALE","NECORPORALE")+" IN LUNA" + +*!* SELECT crslista +*!* * thisform.AlwaysOnTop = .F. +*!* REPORT FORM listmfscdcota TO PRINTER PROMPT PREVIEW +*!* * thisform.AlwaysOnTop = .T. +*!* Release poLista + +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE list_corp_pesectii +*!* list_pesectii(1) +*!* ENDPROC +*!* *------------------------------------------------------------------------ +*!* PROCEDURE list_necorp_pesectii +*!* list_pesectii(2) +*!* ENDPROC +*!* *------------------------------------------------------------------------ +*!* PROCEDURE list_peSECTII && CORPORALE/NECORPORALE 'cu totaluri pe sectii' +*!* PARAMETERS tnTip +*!* * tnTip 1) Corp. 2) Necorp +*!* PRIVATE poLista,locauta +*!* Store '' To poLista +*!* Store "" To locauta +*!* private nid_gestiune +*!* nid_gestiune=1 + +*!* pcselect = ['select sectie, id_sectie FROM ] + gcs + [.vnom_sectii where inactiv=0'] +*!* pcfiltru = [1=2] +*!* pcschema = [''] +*!* pcorder = [sectie] +*!* pccoloane = [sectie] +*!* pcTitlu = [Alegeti sectie] +*!* pcTitluColoane = [Sectii] +*!* locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"") +*!* If !Empty(locauta.sectie) +*!* nid_gestiune=locauta.id_sectie +*!* pcgestiune=ALLTRIM(locauta.sectie) +*!* Endif + + +*!* pcSchema=[''] +*!* pcSelect=['select * from ]+gcS+[.imob_vjurnal where 1=2'] +*!* pcOrder=[gestiune,cont,data_pif] +*!* *pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0 and id_sectie=?nid_gestiune] +*!* pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0]+IIF(pcgestiune="TOATE SECTIILE",[],[and id_sectie=?nid_gestiune]) +*!* llAfiseaza = .F. +*!* gencursor('poLista','crslista',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza) +*!* poLista.ca_baza1.afisare() +*!* pctitlu="LISTA IMOBILIZARILOR "+IIF(tnTip=1,"CORPORALE","NECORPORALE")+" IN LUNA" + +*!* SELECT crslista +*!* *thisform.AlwaysOnTop = .F. +*!* REPORT FORM listmf_grup TO PRINTER PROMPT PREVIEW +*!* * thisform.AlwaysOnTop = .T. +*!* Release poLista + + +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE lista_fiselor_corp_istoric && CORPORALE 'lista fiselor' +*!* lista_fiselor(1) +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE lista_fiselor_necorp && NECORPORALE 'lista fiselor' +*!* lista_fiselor(2) +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE lista_fiselor +*!* PARAMETERS tnTip +*!* **** +*!* * 1) imob.corporale +*!* * 2) imob.necorporale +*!* **** + +*!* If Used('crslista') +*!* Use In crslista +*!* Endif + +*!* lcsql=[SELECT * from ]+gcS+[.imob_vjurnal where id_tip_imobilizare=]+ALLTRIM(STR(tnTip))+[ and iesit_din_gest=0] +*!* +*!* lnSucces=goExecutor.oExecute(lcsql,'crsLista') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul actcs") +*!* return +*!* ENDIF +*!* +*!* SELECT crsLista +*!* IF tntip=1 +*!* REPORT FORM fisa_mf_istoric TO PRINTER PROMPT PREVIEW +*!* ELSE +*!* REPORT FORM fisa_mf2 TO PRINTER PROMPT PREVIEW +*!* ENDIF +*!* If Used('crslista') +*!* Use In crslista +*!* Endif + +*!* ENDPROC +*!* *--------------------------------------------------------------------------- + +*!* PROCEDURE lista_inv_m1_c +*!* lista_inv_m1(1) +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE lista_inv_m1_n +*!* lista_inv_m1(2) +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE lista_inv_m1 +*!* PARAMETERS tnTip +*!* * tnTip 1) Corp. 2) Necorp +*!* PRIVATE poLista,locauta +*!* Store '' To poLista +*!* Store "" To locauta +*!* private nid_gestiune +*!* nid_gestiune=1 + +*!* pcselect = ['select nume_gestiune,id_gestiune FROM ] + gcs + [.vnom_gestiuni where inactiv=0'] +*!* pcfiltru = [1=2] +*!* pcschema = [''] +*!* pcorder = [nume_gestiune] +*!* pccoloane = [nume_gestiune] +*!* pcTitlu = [Alegeti gestiunea] +*!* pcTitluColoane = [Gestiune] +*!* locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"") +*!* If !Empty(locauta.nume_gestiune) +*!* nid_gestiune=locauta.id_gestiune +*!* pcgestiune=ALLTRIM(locauta.nume_gestiune) +*!* Endif + + +*!* pcSchema=[''] +*!* pcSelect=['select * from ]+gcS+[.imob_vjurnal where 1=2'] +*!* pcOrder=[gestiune,cont] +*!* *pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0 and id_gestiune=?nid_gestiune] +*!* pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0]+IIF(pcgestiune="TOATE GESTIUNILE",[],[and id_gestiune=?nid_gestiune]) +*!* llAfiseaza = .F. +*!* gencursor('poLista','crslista',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza) +*!* poLista.ca_baza1.afisare() +*!* pctitlu="LISTA IMOBILIZARILOR "+IIF(tnTip=1,"CORPORALE","NECORPORALE")+" IN LUNA" + +*!* SELECT crslista +*!* * thisform.AlwaysOnTop = .F. +*!* REPORT FORM listmf_inv TO PRINTER PROMPT PREVIEW +*!* *thisform.AlwaysOnTop = .T. +*!* Release poLista + +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE lista_inv_m2_c +*!* lista_inv_m2(1) +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE lista_inv_m2_n +*!* lista_inv_m2(2) +*!* ENDPROC +*!* *--------------------------------------------------------------------------- +*!* PROCEDURE lista_inv_m2 +*!* PARAMETERS tnTip +*!* * tnTip 1) Corp. 2) Necorp +*!* PRIVATE poLista,locauta +*!* Store '' To poLista +*!* Store "" To locauta +*!* private nid_gestiune +*!* nid_gestiune=1 + +*!* pcselect = ['select nume_gestiune,id_gestiune FROM ] + gcs + [.vnom_gestiuni where inactiv=0'] +*!* pcfiltru = [1=2] +*!* pcschema = [''] +*!* pcorder = [nume_gestiune] +*!* pccoloane = [nume_gestiune] +*!* pcTitlu = [Alegeti gestiunea] +*!* pcTitluColoane = [Gestiune] +*!* locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"") +*!* If !Empty(locauta.nume_gestiune) +*!* nid_gestiune=locauta.id_gestiune +*!* pcgestiune=ALLTRIM(locauta.nume_gestiune) +*!* Endif + + +*!* pcSchema=[''] +*!* pcSelect=['select * from ]+gcS+[.imob_vjurnal where 1=2'] +*!* pcOrder=[gestiune,denumire] +*!* *pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0 and id_gestiune=?nid_gestiune] +*!* pcFiltru = [id_tip_imobilizare=?tnTip and iesit_din_gest=0]+IIF(pcgestiune="TOATE GESTIUNILE",[],[and id_gestiune=?nid_gestiune]) +*!* llAfiseaza = .F. +*!* gencursor('poLista','crslista',pcSelect,pcFiltru,pcSchema,pcOrder,llAfiseaza) +*!* poLista.ca_baza1.afisare() +*!* pctitlu="LISTA IMOBILIZARILOR "+IIF(tnTip=1,"CORPORALE","NECORPORALE")+" IN LUNA" + +*!* SELECT crslista +*!* *thisform.AlwaysOnTop = .F. +*!* REPORT FORM nota_inv2005 TO PRINTER PROMPT PREVIEW +*!* *thisform.AlwaysOnTop = .T. +*!* Release poLista +*!* ENDPROC +*!* *--------------------------------------------------------------------------- + +*!* PROCEDURE evidenta_mf && CORPORALE 'Evidenta MF' + +*!* lcsql= " SELECT cont ,sum(valoare) as valoare,sum(amort_prec+rata) as amortizare_totala,"+; +*!* " sum(valoare_ramasa-amort_prec-rata) as valoare_ramasa,sum(valoare_ramasa-amort_prec_rata) as ramas_bilant, "+; +*!* " sum(rata) as rata,count(*) as numar "+; +*!* " FROM "+gcs+".imob_vjurnal where id_tip_imobilizare=1 and iesit_din_gest=0 GROUP BY cont ORDER BY cont" +*!* lnSucces=goExecutor.oExecute(lcSql,'crsevidentamf') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul") +*!* return +*!* ENDIF +*!* STRTOFILE(lcsql,'c:\t.txt') +*!* SELECT crsevidentamf + +*!* *thisform.AlwaysOnTop = .F. +*!* REPORT FORM evidenta_mf TO PRINTER PROMPT PREVIEW +*!* *thisform.AlwaysOnTop = .T. + +*!* USE IN crsevidentamf + +*!* ENDPROC +*!* *--------------------------------------------------------------------------- + +*!* PROCEDURE list_inchid_amortizari +*!* PRIVATE buton +*!* *ldDATAACT=GOMONTH(CTOD('01/'+m.nl+'/'+m.AN),1)-1 +*!* LOCAL plcampsectie +*!* buton=1 +*!* losterge=CREATEOBJECT('frm_mesaj','','info_c.ico','INTREBARE','Se calculeaza inchiderea dupa sectie ?',' ') +*!* losterge.show(1) +*!* If buton = 2 +*!* plCampSectie = .F. +*!* Else +*!* plCampSectie = .T. +*!* ENDIF + + + +*!* IF plCampSectie +*!* +*!* lcsql="select a.id_tip_imobilizare,a.data_achizitie,a.nract,b.cont, b.cont as ccont ,d.rata , "+; +*!* " e.sectie, c.explicatie "+; +*!* " from "+gcs+".imob_nom_mf a "+; +*!* " left join "+gcs+".imob_lista_mf b on a.id_mf=b.id_mf "+; +*!* " left join "+gcs+".imob_vultima_rata d on a.id_mf=d.id_mf "+; +*!* " left join "+gcs+".plcont c on b.cont=c.cont "+; +*!* " left join "+gcs+".nom_sectii e on b.id_sectie=e.id_sectie "+; +*!* " where a.inactiv=0 and a.sters=0 and a.id_tip_imobilizare=1 order by ccont" + +*!* ELSE +*!* lcsql="select a.id_tip_imobilizare,a.data_achizitie,a.nract, c.explicatie,'.' as sectie , b.cont,b.cont as ccont,d.rata"+; +*!* " from "+gcs+".imob_nom_mf a "+; +*!* " left join "+gcs+".imob_lista_mf b on a.id_mf=b.id_mf "+; +*!* " left join "+gcs+".imob_vultima_rata d on a.id_mf=d.id_mf "+; +*!* " left join "+gcs+".plcont c on b.cont=c.cont "+; +*!* " where a.inactiv=0 and a.sters=0 and a.id_tip_imobilizare=1 order by ccont" + +*!* ENDIF + +*!* pcTitlu = [INCHIDERE AMORTIZARE - IMOBILIZARI CORPORALE] + +*!* lnSucces=goExecutor.oExecute(lcSql,'tinchid') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul") +*!* return +*!* ENDIF +*!* SELECT tinchid +*!* REPLACE ALL cont WITH [6811] +*!* SELECT distinct * FROM tinchid INTO CURSOR tinchid2 + +*!* SELECT tinchid2 + +*!* REPORT FORM act TO PRINTER PROMPT PREVIEW +*!* IF USED('tinchid2') +*!* USE IN tinchid2 +*!* ENDIF +*!* IF USED('tinchid') +*!* USE IN tinchid +*!* ENDIF + +*!* ENDPROC && list_inchid_amortizari + +*!* *---------------------------------------------------- +*!* PROCEDURE list_inchid_amortizari_nec + +*!* PRIVATE buton +*!* *ldDATAACT=GOMONTH(CTOD('01/'+m.nl+'/'+m.AN),1)-1 +*!* LOCAL plcampsectie +*!* buton=1 +*!* losterge=CREATEOBJECT('frm_mesaj','','info_c.ico','INTREBARE','Se calculeaza inchiderea dupa sectie ?',' ') +*!* losterge.show(1) +*!* If buton = 2 +*!* plCampSectie = .F. +*!* Else +*!* plCampSectie = .T. +*!* ENDIF + +*!* IF plCampSectie +*!* lcsql="select a.id_tip_imobilizare,a.data_achizitie,a.nract,b.cont, b.cont as ccont ,d.rata , "+; +*!* " e.sectie, c.explicatie "+; +*!* " from "+gcs+".imob_nom_mf a "+; +*!* " left join "+gcs+".imob_lista_mf b on a.id_mf=b.id_mf "+; +*!* " left join "+gcs+".imob_vultima_rata d on a.id_mf=d.id_mf "+; +*!* " left join "+gcs+".plcont c on b.cont=c.cont "+; +*!* " left join "+gcs+".nom_sectii e on b.id_sectie=e.id_sectie "+; +*!* " where a.inactiv=0 and a.sters=0 and a.id_tip_imobilizare=2 order by ccont " + +*!* ELSE +*!* lcsql="select a.id_tip_imobilizare,a.data_achizitie,a.nract,c.explicatie,'.' as sectie , b.cont,b.cont as ccont,d.rata"+; +*!* " from "+gcs+".imob_nom_mf a "+; +*!* " left join "+gcs+".imob_lista_mf b on a.id_mf=b.id_mf "+; +*!* " left join "+gcs+".imob_vultima_rata d on a.id_mf=d.id_mf "+; +*!* " left join "+gcs+".plcont c on b.cont=c.cont "+; +*!* " where a.inactiv=0 and a.sters=0 and a.id_tip_imobilizare=2 order by ccont" + +*!* ENDIF + +*!* pcTitlu = [INCHIDERE AMORTIZARE - IMOBILIZARI NECORPORALE] + +*!* lnSucces=goExecutor.oExecute(lcSql,'tinchid') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul") +*!* return +*!* ENDIF + +*!* SELECT tinchid +*!* REPLACE ALL cont WITH [6811] + +*!* SELECT distinct * FROM tinchid INTO CURSOR tinchid2 +*!* SELECT tinchid2 + +*!* REPORT FORM act TO PRINTER PROMPT PREVIEW +*!* IF USED('tinchid2') +*!* USE IN tinchid2 +*!* ENDIF +*!* IF USED('tinchid') +*!* USE IN tinchid +*!* ENDIF + +*!* ENDPROC && list_inchid_amortizari_nec +*!* *----------------------------------------------------------------------------------- +*!* PROCEDURE rulaj_amortizment +*!* PRIVATE pcfelul +*!* +*!* lcAlias = sitan() && sitan.prg +*!* rulaje('amortizare_lunara',lcAlias) && IN sitan.prg +*!* +*!* SELECT rulaje +*!* GO top +*!* ov=CREATE('frm_analitice1') +*!* ov.lb_titlu_alb_b121.CAPTION='SITUATIE ANALITICA - RULAJ AMORTIZMENTE (In anul curent pana in luna curenta)' +*!* ov.SHOW(1) +*!* USE IN rulaje + +*!* ENDPROC && rulaj_amortizment + +*!* *----------------------------------------------------------------------------------- +*!* PROCEDURE total_amortizment +*!* PRIVATE pcfelul +*!* +*!* lcAlias = sitan() && sitan.prg +*!* rulaje('amortizare_totala',lcAlias) && IN sitan.prg +*!* +*!* SELECT rulaje +*!* GO top +*!* ov=CREATE('frm_analitice1') +*!* ov.lb_titlu_alb_b121.CAPTION='SITUATIE ANALITICA - TOTAL AMORTIZMENTE (In anul curent pana in luna curenta)' +*!* ov.SHOW(1) +*!* USE IN rulaje + +*!* ENDPROC && total_amortizment +*!* *---------------------------------------------------------------------------------------------- +*!* PROCEDURE preluare_corporale + + +*!* datain=CTOD('01/'+ALLTRIM(STR(v_luni.nrluna))+'/'+ALLTRIM(v_luni.an)) +*!* lcsql="SELECT DISTINCT cod,id_fdoc,dataact,nract,partd as nume,explicatia,scd,SUMA, 0 as intr,id_fact,id_util "+; +*!* "FROM "+gcs+".vact WHERE substr(scd,1,2)=21 AND substr(scc,1,3)!=231"+; +*!* " AND nract!=0 and an="+ALLTRIM(v_luni.an)+" and luna="+ALLTRIM(STR(v_luni.nrluna))+"" +*!* +*!* lnSucces=goExecutor.oExecute(lcsql,'actcs') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul actcs") +*!* return +*!* ENDIF + +*!* lcsql="SELECT * FROM "+gcs+".imob_vjurnal where id_tip_imobilizare=1" +*!* lnSucces=goExecutor.oExecute(lcSql,'mf') +*!* *STRTOFILE(lcsql,'c:\t.txt') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul mf") +*!* return +*!* ENDIF + + +*!* SELECT actcs +*!* +*!* IF _tally # 0 +*!* SELECT actcs +*!* SCAN +*!* SCATTER NAME oact +*!* lnVal = 0 +*!* SELECT mf +*!* SUM valoare FOR nract = oact.nract AND data_achizitie = oact.dataact AND cont = oact.scd AND inactiv=0 TO lnVal +*!* DO CASE +*!* CASE lnVal = 0 +*!* lnIntr = 0 +*!* CASE lnVal = oact.suma +*!* lnIntr = 1 +*!* CASE lnVal # oact.suma +*!* lnIntr = 2 +*!* ENDCASE +*!* SELECT actcs +*!* REPLACE intr WITH lnIntr +*!* ENDSCAN +*!* else +*!* SELECT mf +*!* SCATTER NAME omf +*!* ENDIF + + +*!* SELECT actcs +*!* GO top +*!* SCATTER NAME oact +*!* +*!* *!* SELECT mf +*!* *!* LOCATE FOR nract = oact.nract AND data_achizitie = oact.dataact AND cont = oact.scd AND inactiv=0 +*!* *!* IF !FOUND() +*!* *!* SCATTER MEMVAR blank +*!* *!* * MESSAGEBOX('Nu e OK') +*!* *!* ELSE +*!* *!* SCATTER MEMVAR +*!* *!* *MESSAGEBOX('OK') +*!* *!* ENDIF +*!* SELECT actcs +*!* SCATTER MEMVAR +*!* IF _tally#0 +*!* SCATTER NAME oact +*!* SELECT mf +*!* LOCATE FOR nract = oact.nract AND data_achizitie = oact.dataact AND cont = oact.scd AND inactiv=0 +*!* IF FOUND() +*!* SCATTER NAME omf +*!* ELSE +*!* SCATTER NAME omf blank +*!* endi +*!* endi + +*!* STORE 1 TO m.tipcalcul +*!* PRIVATE INTRODUSTOT +*!* INTRODUSTOT=.F. +*!* =cctipuri_amort() +*!* SELECT actcs +*!* OI=CREATE('frm_preluare_contab1',1) +*!* OI.FEL_IMOB=1 +*!* oi._lbbase3.caption=IIF(oact.intr=0,'Acest element nu este introdus!',IIF(oact.intr=1,'Acest element este introdus!','Introdus partial!')) +*!* oi.lb_titlu_alb_b121.CAPTION="LISTA IMOBILIZARILOR CORPORALE IN LUNA "+DTOC(datain) +*!* OI.SHOW(1) + +*!* ENDPROC +*!* *---------------------------------------------------------------------------------------------- +*!* PROCEDURE preluare_necorporale + +*!* datain=CTOD('01/'+ALLTRIM(STR(v_luni.nrluna))+'/'+ALLTRIM(v_luni.an)) +*!* lcsql="SELECT DISTINCT cod,id_fdoc,dataact,nract,partd as nume,explicatia,scd,SUMA, 0 as intr,id_fact,id_util "+; +*!* "FROM "+gcs+".vact WHERE substr(scd,1,2)=20 AND substr(scc,1,3)!=233"+; +*!* " AND nract!=0 and an="+ALLTRIM(v_luni.an)+" and luna="+ALLTRIM(STR(v_luni.nrluna))+"" +*!* +*!* lnSucces=goExecutor.oExecute(lcsql,'actcs') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul actcs") +*!* return +*!* ENDIF + +*!* lcsql="SELECT * FROM "+gcs+".imob_vjurnal where id_tip_imobilizare=2" +*!* lnSucces=goExecutor.oExecute(lcSql,'mf') +*!* *STRTOFILE(lcsql,'c:\t.txt') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul mf") +*!* return +*!* ENDIF + +*!* SELECT actcs +*!* +*!* IF _tally # 0 +*!* SELECT actcs +*!* SCAN +*!* SCATTER NAME oact +*!* lnVal = 0 +*!* SELECT mf +*!* SUM valoare FOR nract = oact.nract AND data_achizitie = oact.dataact AND cont = oact.scd AND inactiv=0 TO lnVal +*!* DO CASE +*!* CASE lnVal = 0 +*!* lnIntr = 0 +*!* CASE lnVal = oact.suma +*!* lnIntr = 1 +*!* CASE lnVal # oact.suma +*!* lnIntr = 2 +*!* ENDCASE +*!* SELECT actcs +*!* REPLACE intr WITH lnIntr +*!* ENDSCAN +*!* ELSE +*!* SELECT mf +*!* SCATTER NAME omf +*!* ENDIF + + +*!* SELECT actcs +*!* GO TOP +*!* IF _tally#0 +*!* SCATTER NAME oact +*!* SELECT mf +*!* LOCATE FOR nract = oact.nract AND data_achizitie = oact.dataact AND cont = oact.scd AND inactiv=0 + +*!* IF FOUND() +*!* SCATTER NAME omf +*!* ELSE +*!* SCATTER NAME omf blank +*!* ENDIF +*!* endi + +*!* * STORE 1 TO m.tipcalcul +*!* PRIVATE INTRODUSTOT +*!* INTRODUSTOT=.F. +*!* =cctipuri_amort() +*!* SELECT actcs +*!* +*!* OI=CREATE('frm_preluare_contab1',2) +*!* OI.FEL_IMOB=2 +*!* oi.lb_titlu_alb_b121.CAPTION="LISTA IMOBILIZARILOR NECORPORALE IN LUNA "+DTOC(datain) +*!* oi._lbbase3.caption=IIF(oact.intr=0,'Acest element nu este introdus!',IIF(oact.intr=1,'Acest element este introdus!','Introdus partial!')) +*!* OI.SHOW(1) +*!* ENDPROC +*!* *---------------------------------------------------------------------------------------------- +*!* PROCEDURE preluare_incurs +*!* *!* SELECT DISTINCT cod, fdoc, dataact, nract, nume, explicatia, scd, ascd, SUMA ; +*!* *!* FROM act WHERE INLIST(LEFT(scd,3),'231','233') INTO CURSOR actcs + +*!* * SELECT mf +*!* * SCATTER MEMVAR BLANK +*!* * SELECT DISTINCT act.cod,act.fdoc,act.dataact,act.nract,act.nume,act.explicatia,act.scd,act.SUMA, 0 as intr ; +*!* FROM act WHERE INLIST(LEFT(act.scd,3),'231','233') AND act.nract#0 INTO CURSOR actcs READWRITE +*!* datain=CTOD('01/'+ALLTRIM(STR(v_luni.nrluna))+'/'+ALLTRIM(v_luni.an)) +*!* lcsql="SELECT DISTINCT cod,id_fdoc,dataact,nract,partd as nume,explicatia,scd,SUMA, 0 as intr,id_fact,id_util "+; +*!* "FROM "+gcs+".vact WHERE (substr(scd,1,3)=231 or SUBSTR(scd,1,3)=233) AND nract!=0"+; +*!* " AND nract!=0 and an="+ALLTRIM(v_luni.an)+" and luna="+ALLTRIM(STR(v_luni.nrluna))+"" +*!* +*!* lnSucces=goExecutor.oExecute(lcsql,'actcs') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul actcs") +*!* return +*!* ENDIF + +*!* lcsql="SELECT * FROM "+gcs+".imob_vjurnal where id_tip_imobilizare=3" +*!* lnSucces=goExecutor.oExecute(lcSql,'mf') +*!* *STRTOFILE(lcsql,'c:\t.txt') +*!* IF lnSucces<0 +*!* MESSAGEBOX("Nu a mers SQL-ul mf") +*!* return +*!* ENDIF + +*!* SELECT actcs +*!* IF _tally # 0 +*!* SELECT actcs +*!* SCAN +*!* SCATTER NAME oact +*!* lnVal = 0 +*!* SELECT mf +*!* SUM valoare FOR nract = oact.nract AND data_achizitie = oact.dataact AND cont = oact.scd TO lnVal +*!* DO CASE +*!* CASE lnVal = 0 +*!* lnIntr = 0 +*!* CASE lnVal = oact.suma +*!* lnIntr = 1 +*!* CASE lnVal # oact.suma +*!* lnIntr = 2 +*!* ENDCASE +*!* SELECT actcs +*!* REPLACE intr WITH lnIntr +*!* ENDSCAN +*!* ELSE +*!* SELECT mf +*!* SCATTER NAME omf blank + +*!* ENDIF + + +*!* SELECT actcs +*!* GO TOP +*!* IF _tally#0 +*!* SCATTER NAME oact +*!* SELECT mf +*!* LOCATE FOR nract = oact.nract AND data_achizitie = oact.dataact AND cont = oact.scd AND inactiv=0 + +*!* IF FOUND() +*!* SCATTER NAME omf +*!* ELSE +*!* SCATTER NAME omf blank +*!* ENDIF +*!* ENDIF + +*!* M.ID_SECTIE=0 +*!* PRIVATE INTRODUSTOT +*!* INTRODUSTOT=.F. +*!* OI=CREATE('frm_preluare_contab_curs') +*!* OI.FEL_IMOB=3 +*!* oi.lb_titlu_alb_b121.CAPTION="LISTA IMOBILIZARILOR NECORPORALE IN LUNA "+DTOC(datain) +*!* oi._lbbase3.caption=IIF(oact.intr=0,'Acest element nu este introdus!',IIF(oact.intr=1,'Acest element este introdus!','Introdus partial!')) +*!* OI.SHOW(1) +*!* ENDPROC && preluare_incurs +*!* *------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Programe/roaimob.prg b/Programe/roaimob.prg new file mode 100644 index 0000000..e5e5738 --- /dev/null +++ b/Programe/roaimob.prg @@ -0,0 +1,911 @@ +*!* 24.04.2012 +*!* nu se mai verifica seria HDD + +PARAMETERS tparam +&&& roaimob +LOCAL lchost, lcUserName, lcPassword, lnIdUtil, lnIdProgram, lcUserNameApp,lcPasswordApp +STORE '' TO lchost, lcUserName, lcPassword, lcUserNameApp,lcPasswordApp +STORE 0 TO lnIdUtil, lnIdProgram +PRIVATE gcNumeProgram +gcNumeProgram = [ROAIMOB] +_SCREEN.ICON = gcNumeProgram + [.ICO] +IF !LIKE(gcNumeProgram + '*', UPPER(ALLTRIM(JUSTSTEM(SYS(16,0))))) + Messagebox("Nu puteti porni acest program!",0+16,"Atentie") + RETURN +ENDIF + +SET CENTURY ON +SET DELETED ON +SET DATE TO DMY +SET MARK TO '/' +SET EXCLUSIVE OFF +SET CPDIALOG OFF +SET TALK OFF +SET SAFETY OFF +SET ESCAPE OFF +SET EXACT ON +SET ANSI ON +SET CONSOLE OFF +SET NOTIFY OFF +SET SECONDS OFF +*SET NULLDISPLAY TO '*' +SET NULLDISPLAY TO '' +SET DECIMALS TO 4 +SET POINT TO '.' + +_SCREEN.VISIBLE=.F. + +*VARIABILE_______ +LOCAL lcMainClassLib +LOCAL lcLastSetTalk,lcLastSetPath,lcLastSetClassLib,lcOnShutdown + +*VARIABILE__________________________________________________________________________ +DECLARE nror[65000] +PUBLIC CRLF +STORE CHR(13) + CHR(10) TO CRLF +*!* PUBLIC pcNl,pcAn +*!* STORE "" TO pcNl,pcAn && se initializeaza in start00 + +PUBLIC pcTitlu,pl_verificat,pcdurata +STORE "" TO pcTitlu +STORE .F. TO pl_verificat + +*!* PUBLIC BUTON, luna_inchisa, luna_neplatita, PRIMADATA, m.ctva, m.ctvam, m.ctvai, antet, m.nivel +PUBLIC buton,primadata,dirgen,col_menu,gestiune,gcAntet, m.antet +*!* Public OStart,OSETVIZ,OSETTULBAR,OSETINSTRUM,orm,OTEXT,OJUR,osetgest,tlbr_INSTR,tlbr_VIZ,oprinc,DIRGEN,buton +*!* PUBLIC pcapsocsub,pcapsocvar +*!* pcapsocsub=0 +*!* pcapsocvar=0 +*!* PUBLIC a4 +*!* a4=.T. +*!* m.nrgrup=999 + +*!* Store .F. To luna_inchisa,tlbr_INSTRum,tlbr_VIZ +STORE 1 TO buton,col_menu +STORE .T. TO primadata &&,luna_neplatita + + +*-- Save and configure environment.*********************** +lcLastSetTalk=SET("TALK") +SET TALK OFF +lcLastSetPath=SET("PATH") + +PUBLIC glVerificTabel && daca se verifica structura tabelelor in totv.prg +glVerificTabel=.T. + +PUBLIC glQuit +glQuit = .F. + +PUBLIC gnIdIstoric +gnIdIstoric = 0 + +PUBLIC gcAppPath,gcAppName, gcTempPath, gcCaleServerDate, gcUserNameApp, gcPasswordApp +STORE '' TO gcUserNameApp, gcPasswordApp, gnNivelUtilizator, gnGrupUtilizator, gcAcces +*!* PUBLIC gcSchemaPath +*!* STORE '' TO gcSchemaPath + +Set Procedure To "D:\ROA\ROAIMOB\COMUN\UTILE\web\WWUTILS.PRG" Additive +Set Procedure To "D:\ROA\ROAIMOB\COMUN\UTILE\web\WWAPI.PRG" Additive + +gcAppPath = ADDBS(ShortPath(GetAppStartPath())) && wwutils.prg +If Right(gcAppPath ,9)="PROGRAME\" + gcAppPath = Substr(gcAppPath ,1,Len(gcAppPath )-9) +Endif +gcAppName=ALLT(UPPE(JUSTSTEM(SYS(16,0)))) && "roaimob" + +gcUtilizatoriPath = gcAppPath + "UTILIZATORI\" + +Set Default To (gcAppPath) +lcPath = gcAppPath + 'Date;' + ; + gcAppPath + 'Include;' + ; + gcAppPath + 'FERESTRE;' + ; + gcAppPath + 'GRAFICE;' + ; + gcAppPath + 'CLASE;' + ; + gcAppPath + 'MENIURI;' + ; + gcAppPath + 'PROGRAME;' + ; + gcAppPath + 'RAPOARTE;' + ; + gcAppPath + 'COMUN;' + ; + gcAppPath + 'COMUN\CLASE;' + ; + gcAppPath + 'COMUN\FERESTRE;' + ; + gcAppPath + 'COMUN\PROGRAME;' + ; + gcAppPath + 'COMUN\GRAFICE;' + ; + gcAppPath + 'COMUN\RAPOARTE;' + ; + gcAppPath + 'COMUN\MENIURI;' + ; + gcAppPath + 'COMUN\UTILE\GRIDEXTRAS;' + ; + gcAppPath + 'COMUN\UTILE\CTL32;' + ; + gcAppPath + 'COMUN\UTILE\HPDF;' + ; + gcAppPath + 'COMUN\UTILE\HPDF\REPORTOUTPUT;' + ; + gcAppPath + 'COMUN\UTILE\WEB;' + ; + gcAppPath + 'COMUN\UTILE\Excel;' + ; + Addbs(Substr(gcAppPath,1,Rat([\],gcAppPath,2)))+[COMUNROA\] + +*!*Set Path To Date;Include;FERESTRE;GRAFICE;Help;CLASE;MENIURI;PROGRAME;RAPOARTE;PROGS;LIBS + +SET PATH TO &lcPath ADDITIVE + +PUSH MENU _MSYSMENU +lcLastSetClassLib=SET("CLASSLIB") +lcMainClassLib= gcAppPath + "clase\oimobilizari.vcx" + +STORE "" TO gcTempPath, gcCaleServerDate + +*** DIRGEN +liat = RAT("\",gcAppPath,2) +dirgen = ADDBS(LEFT(gcAppPath,liat-1)) +*!* v 2.0.17 +PUBLIC gcDirMare +gcDirMare = dirgen +*!* v 2.0.17 ^ + +gcSecurityPath = dirgen + 'Security\' +gcSecurityFile = gcSecurityPath + 'ROA_SECURITY.TXT' + + +*CLASE__________________________________________________________ +SET CLASSLIB TO (lcMainClassLib) ADDITIVE +SET CLASSLIB TO registry ADDITIVE +SET CLASSLIB TO cauta_alfa_forms ADDITIVE +SET CLASSLIB TO caut_ora ADDITIVE +SET CLASSLIB TO ofundal_imob ADDITIVE + +SET CLASSLIB TO serii_numere ADDITIVE +*PROCEDURI______________________________________________________ +*!* Set Procedure To proceduri Additive +*!* Set Procedure To pmenu Additive +SET PROCEDURE TO proceduri_comune ADDITIVE +SET PROCEDURE TO sitan ADDITIVE +SET PROCEDURE TO quitapp ADDITIVE +SET PROCEDURE TO init_program ADDITIVE +SET PROCEDURE TO oproceduri_listari ADDITIVE +SET PROCEDURE TO proceduri_meniu ADDITIVE +*!* 11.11.2009 +SET PROCEDURE TO oserii_numere ADDITIVE +*!* 11.11.2009 ^ + +SET PROCEDURE TO regex ADDITIVE + +&& CLASE ORACLE +SET CLASSLIB TO DECABAZA ADDITIVE +SET CLASSLIB TO onomenclatoare ADDITIVE +SET CLASSLIB TO ferestre_oracle ADDITIVE +SET CLASSLIB TO onom_imob ADDITIVE +SET CLASSLIB TO otoolbar ADDITIVE +SET CLASSLIB TO ocriterii ADDITIVE + +SET CLASSLIB TO MESSAGEBOX ADDITIVE +*!* v 2.0.17 +SET CLASSLIB TO wwdialogs.vcx additive +*!* v 2.0.17 ^ + +*!* 11.11.2009 +SET CLASSLIB TO serii_numere.vcx ADDITIVE +*!* 11.11.2009 ^ + +SET CLASSLIB TO accessibility.vcx ADDITIVE + +************************************************************************************************ +&& PROCEDURI ORACLE +SET PROCEDURE TO gencursor.prg ADDITIVE +SET PROCEDURE TO oproceduri_comune.prg ADDITIVE +SET PROCEDURE TO oproceduri_imob.prg ADDITIVE +SET PROCEDURE TO oproceduri_operatii.prg ADDITIVE +SET PROCEDURE TO ofunctii_imob.prg ADDITIVE +SET PROCEDURE TO oinit_optiuni.prg ADDITIVE +SET PROCEDURE TO update_imob.prg ADDITIVE +SET PROCEDURE TO updateserver.prg ADDITIVE +SET PROCEDURE TO oproceduri_ams.prg ADDITIVE +SET PROCEDURE TO ocautare.prg ADDITIVE +SET PROCEDURE TO osecurity.prg ADDITIVE +SET PROCEDURE TO acces_meniu.prg ADDITIVE +SET PROCEDURE TO oheader.prg ADDITIVE +*!* 12.07.2006 +*!* marius.mutu +SET PROCEDURE TO oproceduri_comune_imob.prg ADDITIVE +*!* 19feb2009 +*!* liana.neagu +Set Procedure To cauta_alfa.prg ADDITIVE + +SET PROCEDURE TO oexport.prg ADDITIVE + +*!* v 2.0.17 +Set Procedure To validare.prg ADDITIVE +SET PROCEDURE TO iniacces.prg ADDITIVE +SET PROCEDURE TO oupdate.prg additive +SET PROCEDURE TO procese.prg additive +SET PROCEDURE TO version.prg additive +SET PROCEDURE TO xmlaccess.prg additive +SET PROCEDURE TO xmlparser.prg additive +SET PROCEDURE TO filebringer.prg additive +SET PROCEDURE TO wwcodeupdate.prg additive +SET PROCEDURE TO wwhttp.prg ADDITIVE + +*!* 19.06.2006 +*!* marius.mutu +SET PROCEDURE TO wwxmlhttp.prg ADDITIVE +SET PROCEDURE TO ini.prg ADDITIVE +SET PROCEDURE TO wwconfig.prg ADDITIVE +*!* SET PROCEDURE TO wwutils.prg ADDITIVE +*!* SET PROCEDURE TO wwapi.prg ADDITIVE +SET PROCEDURE TO excelxml.prg ADDITIVE + +Declare Integer GetPrivateProfileString In Kernel32 ; + string, String, String, String @, Integer, String +Declare Integer WritePrivateProfileString In Kernel32 ; + string, String, String, String +Declare Integer CopyFile In kernel32; + STRING lpExistingFileName,; + STRING lpNewFileName,; + INTEGER bFailIfExists +Declare Integer URLDownloadToFile In urlmon.Dll; + INTEGER pCaller, String szURL, String szFileName,; + INTEGER dwReserved, Integer lpfnCB +Declare Integer PathFileExists In shlwapi; + STRING pszPath +*!* v 2.0.17 ^ +******************************************************************************************* + +IF PCOUNT() = 1 AND TYPE('tparam') = 'C' + glParametri = .T. + PRIVATE laParametri + DECLARE laParametri[1] + lcParam = ALLTRIM(tparam) + lnNr = lista2array(lcParam,@laParametri,";") + IF lnNr < 5 + MESSAGEBOX('Numar incorect de parametri',0+16,'Eroare') + RETURN + ENDIF + lchost = laParametri[1] + lcUserName = laParametri[2] + lcPassword = laParametri[3] + lnIdUtil = ROUND(VAL(laParametri[4]),0) + lnIdProgram = ROUND(VAL(laParametri[5]),0) +ELSE + glParametri = .F. + lchost = 'JCSSERVER' + lcUserName = 'CONTAFIN_ORACLE' + lcPassword = '' + lnIdUtil = 0 + lnIdProgram = 0 + +ENDIF + + +PRIVATE gcGeneralIniFile, gcSettingsFile +gcGeneralIniFile = ADDBS(m.dirgen) + "settings.ini" +gcSettingsFile = m.gcGeneralIniFile +IF !FILE(gcGeneralIniFile) + + TEXT TO lcSettings NOSHOW +[errors] +host= + ENDTEXT + + STRTOFILE(lcSettings, gcGeneralIniFile) +ENDIF + +PRIVATE poLog,goLog && obiect pt logarea mesajelor sistemului +poLog = NEWOBJECT("Log_Mesaje","Log_Mesaje.prg") +goLog = poLog +*!* Locale +Set Classlib To locale Additive +Private gcLocalePath, goLocale, gcLocale, glTraducere +glTraducere = .F. +gcLocalePath = gcAppPath + "Locale\" +*!* lcLocaleDb = gcLocalePath + "locale.dbc" +*!* Open Database (m.lcLocaleDb) +goLocale=Newobject("Locale","Locale.vcx") +lcLanguage = getini(gcGeneralIniFile,"locale","lang") +llLocale= getini(gcGeneralIniFile,"locale","llocale") +IF !EMPTY(m.llLocale) AND m.llLocale<>'0' +goLocale.llocale=.T. +ENDIF +If Empty(m.lcLanguage) + gcLocale = 'Romana' +Else + gcLocale = m.lcLanguage +Endif +goLocale.locale = gcLocale +*!* Locale ^ +IF verificari() + _SCREEN.VISIBLE=.T. + MESSAGEBOX("Se fac verificari programului!"+CRLF+"Va rugam reveniti!",64,"ROA Imobilizari") + glQuit= .T. + QUIT +ENDIF + +IF !Debug_Start() + lcParam=tparam + IF EMPTY(tparam) OR (TYPE('tParam')='C' AND !verific_start(tparam,dirgen,gcAppName)) + _SCREEN.VISIBLE=.T. + MESSAGEBOX("Programul trebuie pornit doar din START!",64,"ROA Imobilizari") + QUIT + ENDIF +ENDIF + +*!* PUBLIC tipar,SER_PERM,SER_PERI,VERSIUNE +*!* STORE .F. TO SER_PERM,SER_PERI +***************************** VARIABILE ORACLE +PRIVATE goUtilizator +PRIVATE gnHandle,gnidutil,GCCODFISCAL,GCADRESA,GCNUMEFIRMA,GCMONEDA,GNDIFZILE, gcUserNameApp, gcPasswordApp +PRIVATE gnButon && variabila pentru renunt si terminat +STORE 2 TO gnButon +STORE '' TO GCCODFISCAL,GCADRESA,GCNUMEFIRMA,GCMONEDA, gcUserNameApp, gcPasswordApp, gcNivelUtilizator, gcGrupUtilizator, gcAcces +gnHandle = -1 +gnidutil = 0 + +PRIVATE gcHost, gcUserName, gcPassword,gofundal, gnIdProgram, gnId_Prg_Owner +gnIdProgram = 0 +gnId_Prg_Owner = 0 +gofundal='' + + +PRIVATE goFirma,gnIdFirma,gcFirma,gnAn,gnLuna && ,gnPA,gnPC +&& STORE 0 TO gnPA,gnPC && nr. de zecimale afisare, calcul +STORE NULL TO goFirma +STORE 0 TO gnIdFirma, gnAn, gnLuna +STORE '' TO gcFirma + +PRIVATE glUltimaLuna,glPrimaLuna, glLunaBuna,glLuna_neplatita,glLunaInchisa +STORE .F. TO glUltimaLuna,glPrimaLuna, glLunaBuna,glLuna_neplatita,glLunaInchisa + +***toolbar*** +PRIVATE otool,ohelp +STORE '' TO otool,ohelp +***toolbar*** + +PRIVATE gcS && schema firmei +STORE 'CONTAFIN' TO gcS + +IF TYPE('laparametri',1)="A" + IF ALEN(laParametri,1)=10 + gnAn = VAL(laParametri[7]) + gnLuna = VAL(laParametri[8]) &&lansare noua + gcS = laParametri[9] + gnIdFirma = Val(laParametri[10]) + ENDIF +ENDIF + +PRIVATE gcCopyRight +gcCopyRight = '© ROA Romfast SRL' + +&& obiect global wrap pentru sqlexec cu text eroare si succes +PRIVATE goExecutor +goExecutor = CREATEOBJECT("oExecutor") + +&& obiect global wrap pentru sqlconnect, sqldisconnect; apeleaza proceduri postconectare pentru setare variabile sesiune +PRIVATE goConn +goConn = CREATEOBJECT("oConn") + +PRIVATE goMyXMLHTTP +lcHostErrors = getini(gcGeneralIniFile,'errors','host') +goMyXMLHTTP = CREATEOBJECT("MyXMLHTTP", lcHostErrors) + + +&& obiect global pentru export : frx, xls +Private goExport +goExport = Createobject("oExportConfig") + + +&& obiect global pt luna aleasa din calendar +PRIVATE goCalendar +STORE NULL TO goCalendar + + +gcHost = lchost +gcUserName = lcUserName +gcPassword = lcPassword +gcUserNameApp = lcUserNameApp +gcPasswordApp = lcPasswordApp +gnidutil = lnIdUtil +gnIdProgram = lnIdProgram + +IF !glParametri + lnValid = getcrsSecurity(gcSecurityFile) + IF lnValid > 0 + IF USED('crsHost') + SELECT crsHost + GO TOP + gcHost = ALLTRIM(HOST) + gcUserName = ALLTRIM(schema) + gcPassword = ALLTRIM(pwd) + USE IN crsHost + ENDIF + ENDIF +ENDIF +***************************** VARIABILE ORACLE +&& DECLARARE VARIABILE GLOBALE SPECIFICE APLICATIEI CARE NU SE AFLA IN OPTIUNI_FIRMA +&& (SE AFLA IN DIRECTORUL PROIECTULUI, NU IN COMUN) +*!* Do OVARIABILE_GLOBALE.PRG +*!* USE &gcAppPath\SERIMOB IN 0 ALIAS SER SHARED +*!* SELECT SER +*!* GO TOP +*!* tipar=TIP +*!* SER_PERM=SER_PERMAN +*!* SER_PERI=SER_PERIOD +*!* VERSIUNE=VERcont +*!* MODEL_PROGRAM=MODEL +*!* USE IN SER +*!* parolamea=SUBSTR(tipar,MONTH(DATE()),1) +*!* parolamea=parolamea+ALLT(STR(DAY(DATE())))+ALLT(STR(MONTH(DATE()))) + +*!* IF !_DEBUG() +*!* IF SER_PERM AND !verif_ser_perm() +*!* * daca exista comdir.snr - trec mai departe :) presupun ca s-a instalat kitul de client chiar daca nu s-a verificat seria +*!* IF !FILE(getCaleWin() + 'comdir.snr') +*!* QUIT +*!* ENDIF +*!* ENDIF +*!* ENDIF + +PUBLIC NUMEPROGRAM,MENIUPROGRAM,FUNDALPROGRAM +MODEL_PROGRAM = 'M' +NUMEPROGRAM='ROA Imobilizari '+MODEL_PROGRAM +MENIUPROGRAM=gcAppPath+"meniuri\roaimob.mpr" +FUNDALPROGRAM=gcAppPath+"FERESTRE\FUNDAL.scx" +_program='cont' + +*-- Configure application object.***************************** +_SCREEN.WINDOWSTATE=2 + +*!* 20.04.2012 +PRIVATE gcReportPreviewer, gcReportPreviewerPath +gcReportPreviewer = "FoxyPreview" && oexport.prg +gcReportPreviewerPath = dirgen + "COMUNROA\" +*!* 20.04.2012 ^ + + +lcOnShutdown="ShutDown()" +ON SHUTDOWN &lcOnShutdown +ON ERROR ErrorHandler(ERROR(),PROGRAM(),LINENO()) +*_SHELL="DO Cleanup IN progs\cont2003" + +*-- Instantiate application object.*************************** +RELEASE goApp +PUBLIC goApp +goApp = CREATEOBJECT("cApplication") +* 10.06.2020 mod experimental se citeste din optiuni utilizator +ADDPROPERTY(goApp, 'nExperimental', 0) + +LOCAL laVersion +DIMENSION laVersion(12) +IF AGETFILEVERSION(laVersion, SYS(16,0)) > 0 + NUMEPROGRAM = laVersion(10) +ENDIF +RELEASE laVersion + + + +goApp.SetCaption(NUMEPROGRAM) +goApp.cStartupMenu=MENIUPROGRAM +*goApp.cStartupForm=FUNDALPROGRAM +goApp.cStartupForm = gcAppPath + "COMUN\ferestre\frm_login.scx" +_SCREEN.WINDOWSTATE=2 +*-- Show application. +goApp.SHOW + +*-- Release application. +RELEASE goApp +cleanup() + +*-- Restore default menu. +POP MENU _MSYSMENU + +*-- Restore environment. +ON ERROR +ON SHUTDOWN +*!* IF NOT lcLastSetClassLib==SET("classlib") +*!* RELEASE CLASSLIB (lcMainClassLib) +*!* ENDIF +*!* IF EMPTY(lcLastSetPath) +*!* SET PATH TO +*!* ELSE +*!* SET PATH TO &lcLastSetPath +*!* ENDIF +*!* IF lcLastSetTalk=="ON" +*!* SET TALK ON +*!* ELSE +*!* SET TALK OFF +*!* ENDIF + +RETURN +************************************************************************************************ +* FUNCTII______________________________________________________________________ +FUNCTION ErrorHandler(nError,cMethod,nLine) + LOCAL lcErrorMsg,lcCodeLineMsg + + WAIT CLEAR + lcErrorMsg=MESSAGE()+CHR(13)+CHR(13) + lcErrorMsg=lcErrorMsg+"Method: "+cMethod + lcCodeLineMsg=MESSAGE(1) + IF BETWEEN(nLine,1,10000) AND NOT lcCodeLineMsg="..." + lcErrorMsg=lcErrorMsg+CHR(13)+"Line: "+ALLTRIM(STR(nLine)) + IF NOT EMPTY(lcCodeLineMsg) + lcErrorMsg=lcErrorMsg+CHR(13)+CHR(13)+lcCodeLineMsg + ENDIF + ENDIF + + IF TYPE('goMyXMLHTTP') = 'O' + lcLunaHTTP = IIF(TYPE('gnLuna') = 'N', TRANSFORM(gnLuna) + "/","") + IIF(TYPE('GNAN') = 'N', TRANSFORM(gnAn),"") + lcErrorMsgHTTP = SYS(0) + ":" + IIF(TYPE('GCS')='C'," " + gcS,"") + ": " + lcLunaHTTP + CHR(13) +CHR(10) + lcErrorMsg + ; + CHR(13) +CHR(10) + CHR(13) + CHR(10) + GETCALLSTACK() + lcUserName = gcUserNameApp + lcProgram = JUSTSTEM(SYS(16,0)) + goMyXMLHTTP.postError(lcErrorMsgHTTP, lcUserName, lcProgram) + ENDIF + + IF AMESSAGEBOX(lcErrorMsg,17,_SCREEN.CAPTION)#1 + ON ERROR + RETURN .F. + ENDIF +ENDFUNC +************************************************************************************************ +FUNCTION SHUTDOWN +*!* IF Start_Nou() +*!* =End_Istoric(gnIdIstoric, ADDBS(dirgen)+"DATERETEA\", "START_ISTORIC") +*!* ENDIF + IF TYPE("goApp")=="O" AND NOT ISNULL(goApp) + RETURN goApp.OnShutDown() + ENDIF + Cleanup() + QUIT +ENDFUNC +************************************************************************************************ +FUNCTION Cleanup +*!* IF CNTBAR("_msysmenu")=7 +*!* RETURN +*!* ENDIF + ON ERROR + ON SHUTDOWN + SET CLASSLIB TO + SET PATH TO + CLEAR ALL + *CLOSE ALL + POP MENU _MSYSMENU + RETURN + ************************************************************************************************ +*!* FUNCTION verif_ser_perm +*!* CLEAR +*!* RETURN .T. +*!* *!* RETURN PORNIRE() + ************************************************************************************************ +*!* FUNCTION PORNIRE +*!* SET EXACT ON +*!* PRIVATE calewin,calesys,checksum1,checksum2,serinreg,serdisk,file1,file2,valret,serdisktemp,ser1,ser2,key1,KEY2 +*!* STORE '' TO calewin,serinreg,serdisk,calesys,serdisktemp,catehd,ser1,ser2,key1,KEY2 +*!* STORE 0 TO checksum1,checksum2 +*!* STORE .T. TO valret +*!* DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ; +*!* INTEGER hwndOwner, ; +*!* INTEGER nFolder, ; +*!* INTEGER hToken, ; +*!* INTEGER dwFlags, ; +*!* STRING @ pszPath +*!* DECLARE INTEGER GetActiveWindow IN WIN32API +*!* #DEFINE CSIDL_WINDOWS 36 +*!* #DEFINE CSIDL_SYSTEM 37 +*!* #DEFINE CSIDL_PROGRAMS 38 +*!* lcPath = REPL(CHR(0),261) +*!* =SHGetFolderPath(GetActiveWindow(),CSIDL_WINDOWS,0,0,@lcPath) +*!* calewin=LEFT(lcPath,AT(CHR(0),lcPath)-1) +*!* lcPath = REPL(CHR(0),261) +*!* =SHGetFolderPath(GetActiveWindow(),CSIDL_SYSTEM,0,0,@lcPath) +*!* calesys=LEFT(lcPath,AT(CHR(0),lcPath)-1) +*!* &&se verifica existenta celor trei fisiere +*!* IF (NOT FILE(calesys+'\diskserial.dll')) OR (NOT FILE(calesys+'\getmacip.dll')) OR (NOT FILE(calewin+'\comdir.snr')) +*!* valret=.F. +*!* ENDIF +*!* IF valret +*!* file1=FILETOSTR(calesys+'\diskserial.dll') +*!* checksum1=SYS(2007,file1) +*!* file2=FILETOSTR(calesys+'\getmacip.dll') +*!* checksum2=SYS(2007,file2) +*!* &&severifica daca dll-urile nu au fost modificate +*!* IF (VAL(checksum1) != 58755) OR (VAL(checksum2) != 30476) +*!* valret=.F. +*!* ENDIF +*!* ENDIF +*!* &&se citesc seriile tutturor celor patru hard disk-uri posibile(pe IDE primary master,primary slave...) +*!* &&se tine minte primul cu seria nenula-daca nu s-a putut citi seria de la nici unul se pune o serie default +*!* &&seria default este "NUAREHAR" +*!* IF valret +*!* DECLARE INTEGER GetSerialNumber IN diskSerial.DLL INTEGER ,STRING +*!* catehd=0 +*!* FOR i=0 TO 3 +*!* serdisktemp=SPACE(40) +*!* GetSerialNumber(i,@serdisktemp) +*!* IF (LEN(ALLTRIM(serdisktemp))!=0) AND (catehd=0) +*!* serdisktemp=sircaracter(serdisktemp) +*!* serdisk=serdisktemp +*!* catehd=catehd+1 +*!* ENDIF +*!* ENDFOR +*!* IF (LEN(ALLTRIM(serdisk))=0) +*!* serdisk='NUAREHAR' +*!* ELSE +*!* IF ((LEN(ALLTRIM(serdisk))>0) AND (LEN(ALLTRIM(serdisk))<8)) +*!* serdisk=serdisk+REPLICATE('1',8-LEN(ALLTRIM(serdisk))) +*!* ENDIF +*!* ENDIF +*!* serdisk=SUBSTR(ALLTRIM(serdisk),LEN(ALLTRIM(serdisk))-7,8) +*!* ENDIF +*!* &&se citeste din comdir.snr seria de inregistrare si se verifica egalitatea cu seria obtinuta anterior +*!* IF valret +*!* gnFileHandle = FOPEN(calewin+'\comdir.snr') +*!* nSize = FSEEK(gnFileHandle, 0, 2) && Move pointer to EOF +*!* IF nSize!=9 +*!* valret=.F. +*!* ELSE +*!* = FSEEK(gnFileHandle, 0, 0) && Move pointer to BOF +*!* cString = FREAD(gnFileHandle,9) +*!* ser1=SUBSTR(cString,1,4) +*!* ser2=SUBSTR(cString,5,4) +*!* key1=SUBSTR(cString,9,1) +*!* KEY2=DECTOBIN(ALLTRIM(HEXDEC(key1))) +*!* serinreg=decodare1(ALLTRIM(UPPER(ser1)),KEY2)+decodare1(ALLTRIM(UPPER(ser2)),KEY2) +*!* IF serdisk!=serinreg +*!* valret=.F. +*!* ENDIF +*!* ENDIF +*!* = FCLOSE(gnFileHandle) +*!* ENDIF +*!* seriedisk1=serdisk +*!* serieinreg1=serinreg +*!* ON ERROR valret=.F. +*!* RETURN valret + ************************************************************************************************ +FUNCTION decodare1 + PARAMETERS lstring,CHEIE + LOCAL lens,poz1,poz2,POZ3,lret,LRET2,lcstring,val1,lret1 + lret='' + lret1='' + LRET2='' + lcstring=ALLTRIM(UPPER(lstring)) + lens=LEN(lcstring) + FOR i=1 TO 4 + poz1=SUBSTR(lcstring,i,1) + val1=ASC(poz1) + POZ3=SUBSTR(CHEIE,i,1) + DO CASE + CASE val1>=48 AND val1<=57 + IF ((val1-47)+INT(VAL(POZ3)))<=10 + poz2=CHR(val1+INT(VAL(POZ3))) + ELSE + poz2=CHR(val1+INT(VAL(POZ3))-10) + ENDIF + CASE val1>=65 AND val1<=90 + IF ((val1-64)+2*INT(VAL(POZ3)))<=26 + poz2=CHR(val1+2*INT(VAL(POZ3))) + ELSE + poz2=CHR(val1+2*INT(VAL(POZ3))-26) + ENDIF + ENDCASE + LRET2=LRET2+poz2 + ENDFOR + FOR i=1 TO lens + poz1=SUBSTR(LRET2,i,1) + val1=ASC(poz1) + DO CASE + CASE val1>=48 AND val1<=57 + IF ((val1-47)+i)<=10 + poz2=CHR(val1+i) + ELSE + poz2=CHR(val1+i-10) + ENDIF + CASE val1>=65 AND val1<=90 + IF ((val1-64)+2*i)<=26 + poz2=CHR(val1+2*i) + ELSE + poz2=CHR(val1+2*i-26) + ENDIF + ENDCASE + lret=lret+poz2 + ENDFOR + lens=LEN(lret) + FOR i=1 TO lens + poz1=SUBSTR(lret,i,1) + val1=ASC(poz1) + DO CASE + CASE val1>=48 AND val1<=57 + poz2=CHR(val1+17)&& din 0-9 in A-J + CASE val1>=65 AND val1<=74 + poz2=CHR(val1-17)&& din A-J in 0-9 + CASE val1>=75 AND val1<=82 + poz2=CHR(val1+8)&&din K-R in S-Z + CASE val1>=83 AND val1<=90 + poz2=CHR(val1-8)&&din S-Z in K-R + ENDCASE + lret1=lret1+poz2 + ENDFOR + RETURN lret1 + ************************************************************************************************ + &&transformarea in decimal a unui caracter hexa +FUNCTION HEXDEC + LPARAMETERS LC + LOCAL LV + DO CASE + CASE LC=='0' + LV='0' + CASE LC=='1' + LV='1' + CASE LC=='2' + LV='2' + CASE LC=='3' + LV='3' + CASE LC=='4' + LV='4' + CASE LC=='5' + LV='5' + CASE LC=='6' + LV='6' + CASE LC=='7' + LV='7' + CASE LC=='8' + LV='8' + CASE LC=='9' + LV='9' + CASE LC=='A' + LV='10' + CASE LC=='B' + LV='11' + CASE LC=='C' + LV='12' + CASE LC=='D' + LV='13' + CASE LC=='E' + LV='14' + CASE LC=='F' + LV='15' + ENDCASE + RETURN LV + ************************************************************************************************ + &&codarea binara din hexa pe patru biti +FUNCTION DECTOBIN + PARAMETERS sc + LOCAL lretf + DO CASE + CASE sc=='0' + lretf='0000' + CASE sc=='1' + lretf='0001' + CASE sc=='2' + lretf='0010' + CASE sc=='3' + lretf='0011' + CASE sc=='4' + lretf='0100' + CASE sc=='5' + lretf='0101' + CASE sc=='6' + lretf='0110' + CASE sc=='7' + lretf='0111' + CASE sc=='8' + lretf='1000' + CASE sc=='9' + lretf='1001' + CASE sc=='10' + lretf='1010' + CASE sc=='11' + lretf='1011' + CASE sc=='12' + lretf='1100' + CASE sc=='13' + lretf='1101' + CASE sc=='14' + lretf='1110' + CASE sc=='15' + lretf='1111' + ENDCASE + RETURN lretf + ************************************************************************************************ +FUNCTION ECARACTER + PARAMETERS strg1 + PRIVATE pz,ch,lcstring,vret,lg1 + STORE 0 TO pz,lg1 + STORE '' TO ch,lcstring + STORE .T. TO vret + lcstring=UPPER(strg1) + lg1=LEN(lcstring) + FOR ind1=1 TO lg1 + ch=SUBSTR(lcstring,ind1,1) + IF (NOT BETWEEN(ASC(ch),48,57)) AND (NOT BETWEEN(ASC(ch),65,90)) + vret=.F. + EXIT + ENDIF + ENDFOR + RETURN vret + ************************************************************************************************ +FUNCTION sircaracter + PARAMETERS strg1 + PRIVATE pz,ch,lcstring,vret,lg1,lciesire + STORE 0 TO pz,lg1 + STORE '' TO ch,lcstring,lciesire + STORE .T. TO vret + strg1=STRTRAN(strg1,ALLTRIM(CHR(39)),'')&&caracterul ' + strg1=STRTRAN(strg1,ALLTRIM(CHR(39)),'')&&caracterul " + lcstring=UPPER(ALLTRIM(strg1)) + lg1=LEN(lcstring) + FOR ind1=1 TO lg1 + ch=SUBSTR(lcstring,ind1,1) + IF BETWEEN(ASC(ch),48,57) OR BETWEEN(ASC(ch),65,90) + lciesire=lciesire+ch + ENDIF + ENDFOR + RETURN lciesire + ************************************************************************************************ +PROCEDURE _DEBUG + PRIVATE lcret,lcfisier,lcPath,lccalewin + DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ; + INTEGER hwndOwner, ; + INTEGER nFolder, ; + INTEGER hToken, ; + INTEGER dwFlags, ; + STRING @ pszPath + DECLARE INTEGER GetActiveWindow IN WIN32API + #DEFINE CSIDL_WINDOWS 36 + + lcPath = REPL(CHR(0),261) + =SHGetFolderPath(GetActiveWindow(),CSIDL_WINDOWS,0,0,@lcPath) + lccalewin=LEFT(lcPath,AT(CHR(0),lcPath)-1) + + lcret=.F. + lcfisier=ADDBS(lccalewin)+[DEBUG.TXT] + + IF FILE(lcfisier) + LCVAL=FILETOSTR(lcfisier) + + LNVAL1=MOD(VAL(RIGHT(LCVAL,1)),2) && restul 1 sau 0; daca e impar e 1 + lnval2=VAL(LEFT(LCVAL,LEN(LCVAL)-1)) + IF LNVAL1=1 OR YEAR(DATE())-MONTH(DATE())=lnval2 + lcret=.T. + ENDIF + ENDIF + RETURN lcret + +ENDPROC +************************************************************************************************ +FUNCTION Start_Nou + RETURN Exista_Branch(,,dirgen) +ENDFUNC && start_nou +************************************************************************************************ +PROCEDURE Debug_Start + lcFile = gcAppPath + "debug.txt" + IF FILE(lcFile) OR !Start_Nou() + RETURN .T. + ENDIF + RETURN .F. +ENDPROC && Debug_Start +************************************************************************************************ +PROCEDURE verificari + PARAMETERS tcFisierVerif + + lcverificari = ADDBS(gcAppPath)+gcAppName+".txt" + IF FILE(lcverificari) + RETURN .T. + ENDIF + RETURN .F. +ENDPROC && verificari +************************************************************************************************ +FUNCTION getCaleWin + LOCAL lcPath, lcCaleWin + lcPath = "" + lcCaleWin = "c:\windows\" + + DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ; + INTEGER hwndOwner, ; + INTEGER nFolder, ; + INTEGER hToken, ; + INTEGER dwFlags, ; + STRING @ pszPath + DECLARE INTEGER GetActiveWindow IN WIN32API + #DEFINE CSIDL_WINDOWS 36 + + + lcPath = REPL(CHR(0),261) + =SHGetFolderPath(GetActiveWindow(),CSIDL_WINDOWS,0,0,@lcPath) + lccalewin=LEFT(lcPath,AT(CHR(0),lcPath)-1) + lcCaleWin = ADDBS(lcCaleWin) + + RETURN lcCaleWin + +ENDFUNC \ No newline at end of file diff --git a/Programe/sitan.prg b/Programe/sitan.prg new file mode 100644 index 0000000..6bde46d --- /dev/null +++ b/Programe/sitan.prg @@ -0,0 +1,156 @@ +******** +Procedure sitan + LPARAMETERS tnFiscala + + Local lcCursor, lcCursorTemp, lcFiltru, lcSchema, lcSel, llExperimental, llSucces, lnLuna + PRIVATE pcCond, pdDataF, pdDataI, pdData, pnFiscala + pdDataI = Date(gnAn, 1, 1) + pdDataF = Date(gnAn, gnLuna, 1) + pcCond = [1=1] + IF EMPTY(m.tnFiscala) OR TYPE('tnFiscala') <> 'N' + pnFiscala = 0 + ELSE + pnFiscala = m.tnFiscala + ENDIF + lcSchema = [''] &&['ceck n(1),totdebit n(16,gnPa),totcredit n(16,gnPa),id_fact n(10),id_part n(10),nume c(50),dataact D,dataireg D,nract n(14),datascad D,cont c(4),acont c(4)'] + lcCursor = 'crslista' + + llExperimental = .T. && 25.11.2021 llExperimental = (goApp.nExperimental = 1) + If m.llExperimental + * EXPERIMENTAL SELECTIE DIN IMOB_VSITUATIE_LUNARA IN LOC DE PACK_IMOB.CALCUL_SITUATIE_LUNARA() + * Setez luna pentru view + lcFiltru = [id_tip_imobilizare in (1,2)] + m.gcCondSucursala + + For lnLuna = 1 To m.gnLuna + pdData = DATE(m.gnAn, m.lnLuna, 1) + WAIT WINDOW 'Luna ' + PADL(m.lnLuna,2,'0') + '/' + ALLTRIM(STR(m.gnAn)) NOWAIT + llSucces = goExecutor.oExecuta('begin pack_imob.setlunacurenta(?pdData); end;') + If m.llSucces + lcSel = [SELECT * FROM ] + Iif(m.pnFiscala = 0, [imob_vsituatie_lunara], [imobf_vsituatie_lunara]) + [ WHERE ] + m.lcFiltru + lcCursorTemp = Sys(2015) + llSucces = goExecutor.oExecuta(m.lcSel, m.lcCursorTemp) + If !Used(m.lcCursor) + Select * From (m.lcCursorTemp) Into Cursor (m.lcCursor) Readwrite + Else + Select (m.lcCursor) + Append From Dbf(m.lcCursorTemp) + Endif + Use In (Select(m.lcCursorTemp)) + Endif + Endfor + Else + lcSel = [{call pack_imob.CALCUL_SITUATIE_LUNARA(?pdDataI,?pdDataF,?pcCond,?pnFiscala,?gnIdSucursala)}] + llSucces = goExecutor.oExecuta(lcSel, lcCursor) + Endif + + If !m.llSucces + Return + Endif + + Select Sum(rata) As amortizare_lunara, Sum(rata + amort_prec) As amortizare_totala, data_test As ddata, Cont ; + FROM &lcCursor ; + WITH (Buffering = .T.) ; + WHERE Inlist(id_tip_imobilizare, 1, 2) ; + INTO Cursor sitmf ; + GROUP By ddata, Cont + + Use In (SELECT(m.lcCursor)) + + Return [sitmf] +Endproc && sitan + +*--------------------------------------------------------------------------- +Procedure rulaje + Parameters tcCamp, tcAlias + + + datain = Ctod('01/' + Alltrim(Str(v_luni.nrluna)) + '/' + Alltrim(v_luni.an)) + + lcCamp = Alltrim(tcCamp) + + If Empty(tcAlias) + lcAlias = [sitmf] + Else + lcAlias = Alltrim(tcAlias) + Endif + + Select Distinct Cont From (lcAlias) Into Cursor conturi + *!* SELECT distinct ddata as luna FROM (lcAlias) INTO CURSOR luni + + Select Distinct ddata As luna From (lcAlias) Into Cursor crsluni + Create Cursor luni (luna c(8)) + + Select crsluni + Scan + Scatter Name aaa + Select luni + Append Blank + Replace luna With Alltrim(Str(Month(aaa.luna))) + "/" + Alltrim(Str(Year(aaa.luna))) + Select crsluni + Endscan + + + *!* tt='create cursor rulaje (total c(6),luna d(8)' + tt = 'create cursor rulaje ( _ c(6),luna c(8)' + Select conturi + Scan + * SCAT MEMV + tt = tt + ',c' + Alltrim(Nvl(Cont, '')) + ' n(14,gnpa)' + * SELECT conturi + Endscan + + + tt = tt + ')' + &tt + Select rulaje + Append From Dbf('luni') + Use In luni + + + *sume--- + Select (lcAlias) + Scan + Scatter Memv + Select rulaje + Locate For Alltrim(luna) = Alltrim(Str(Month(m.ddata))) + "/" + Alltrim(Str(Year(m.ddata))) + *!* LOCATE FOR luna=m.ddata + tt = 'REPLACE c' + Alltrim(Nvl(m.cont, '')) + ' with ' + lcCamp + &tt + Select (lcAlias) + Endscan + + *totaluri--- + If Lower(Alltrim(tcCamp)) = [amortizare_lunara] + Local m.c + m.c = 0 + Select rulaje + Append Blank + Replace _ With 'TOTAL' + Select conturi + Scan + Scatter Memv + Select rulaje + tt = 'sum c' + Alltrim(Nvl(m.cont, '')) + ' to m.c FOR ddata<=datain' + &tt + + Select rulaje + Go Bott + tt = 'REPLACE c' + Alltrim(Nvl(Cont, '')) + ' with m.c' + &tt + Select conturi + Endscan + Endif + + + If Used('conturi') + Use In conturi + Endif + If Used('luni') + Use In conturi + Endif + + + If Used(lcAlias) + Use In (lcAlias) + Endif + *------------------------------------------------------------------------------------------------ diff --git a/Programe/update_nomenclator.prg b/Programe/update_nomenclator.prg new file mode 100644 index 0000000..8b9beef --- /dev/null +++ b/Programe/update_nomenclator.prg @@ -0,0 +1,53 @@ +********************************************************** +PROCEDURE update_nomenclator + +*!* *!* DO update_coresp_tip_part +*!* *!* DO update_coresp_tip_cont +*!* DO update_lunilean + +*!* *** tabele meniu deschise din proiect +*!* LOCAL lcCaleDateMenu + +*!* lcCaleDateMenu=gcAppPath+[DATEMENU\] + +*!* IF !USED('XREQUEST') +*!* USE &lcCaleDateMenu.XREQUEST IN 0 ALIAS XREQUEST +*!* ENDIF +*!* IF !USED('xitems') +*!* USE &lcCaleDateMenu.xitems IN 0 ALIAS xitems +*!* ENDIF +*!* IF !USED('YACT') +*!* USE &lcCaleDateMenu.YACT IN 0 ALIAS YACT +*!* ENDIF +*!* IF !USED('XSETS') +*!* USE &lcCaleDateMenu.XSETS IN 0 ALIAS XSETS ORDER TAG ID_SET +*!* ENDIF +*!* IF !USED('xACT') +*!* USE &lcCaleDateMenu.xACT IN 0 ALIAS xACT +*!* ENDIF +*!* IF !USED('xnote') +*!* USE &lcCaleDateMenu.xnote IN 0 ALIAS xnote +*!* ENDIF + +*!* IF !USED('menu1') +*!* USE &lcCaleDateMenu.menu1 IN 0 ALIAS menu1 EXCL +*!* ENDIF + +*!* IF !USED('INFISIERE') +*!* USE &lcCaleDateMenu.INFISIERE IN 0 ALIAS INFISIERE +*!* ENDIF + +*!* IF !USED('nom_meniu') +*!* USE &lcCaleDateMenu.nom_meniu IN 0 ALIAS nom_meniu +*!* ENDIF + +*!* IF !USED('refaceri') +*!* USE &lcCaleDateMenu.refaceri IN 0 ALIAS refaceri +*!* ENDIF + +*!* IF !USED('tabela_fisa_cont') +*!* USE &lcCaleDateMenu.tabela_fisa_cont IN 0 ALIAS tabela_fisa_cont +*!* ENDIF + + +ENDPROC && update_nomenclator \ No newline at end of file diff --git a/Rapoarte/Vechi/act.FRT b/Rapoarte/Vechi/act.FRT new file mode 100644 index 0000000..f76e759 Binary files /dev/null and b/Rapoarte/Vechi/act.FRT differ diff --git a/Rapoarte/Vechi/act.frx b/Rapoarte/Vechi/act.frx new file mode 100644 index 0000000..e343930 Binary files /dev/null and b/Rapoarte/Vechi/act.frx differ diff --git a/Rapoarte/Vechi/amortanaliz.FRT b/Rapoarte/Vechi/amortanaliz.FRT new file mode 100644 index 0000000..73930de Binary files /dev/null and b/Rapoarte/Vechi/amortanaliz.FRT differ diff --git a/Rapoarte/Vechi/amortanaliz.frx b/Rapoarte/Vechi/amortanaliz.frx new file mode 100644 index 0000000..2aedb24 Binary files /dev/null and b/Rapoarte/Vechi/amortanaliz.frx differ diff --git a/Rapoarte/Vechi/amortanaliz2.FRT b/Rapoarte/Vechi/amortanaliz2.FRT new file mode 100644 index 0000000..2679353 Binary files /dev/null and b/Rapoarte/Vechi/amortanaliz2.FRT differ diff --git a/Rapoarte/Vechi/amortanaliz2.frx b/Rapoarte/Vechi/amortanaliz2.frx new file mode 100644 index 0000000..f6c9b28 Binary files /dev/null and b/Rapoarte/Vechi/amortanaliz2.frx differ diff --git a/Rapoarte/Vechi/amortanaliz_grup.FRT b/Rapoarte/Vechi/amortanaliz_grup.FRT new file mode 100644 index 0000000..86923b3 Binary files /dev/null and b/Rapoarte/Vechi/amortanaliz_grup.FRT differ diff --git a/Rapoarte/Vechi/amortanaliz_grup.frx b/Rapoarte/Vechi/amortanaliz_grup.frx new file mode 100644 index 0000000..f9bffc9 Binary files /dev/null and b/Rapoarte/Vechi/amortanaliz_grup.frx differ diff --git a/Rapoarte/Vechi/amortizare.FRT b/Rapoarte/Vechi/amortizare.FRT new file mode 100644 index 0000000..0892441 Binary files /dev/null and b/Rapoarte/Vechi/amortizare.FRT differ diff --git a/Rapoarte/Vechi/amortizare.frx b/Rapoarte/Vechi/amortizare.frx new file mode 100644 index 0000000..3f7cf9c Binary files /dev/null and b/Rapoarte/Vechi/amortizare.frx differ diff --git a/Rapoarte/Vechi/amortlun1.FRT b/Rapoarte/Vechi/amortlun1.FRT new file mode 100644 index 0000000..6f61b3d Binary files /dev/null and b/Rapoarte/Vechi/amortlun1.FRT differ diff --git a/Rapoarte/Vechi/amortlun1.frx b/Rapoarte/Vechi/amortlun1.frx new file mode 100644 index 0000000..a1cb33f Binary files /dev/null and b/Rapoarte/Vechi/amortlun1.frx differ diff --git a/Rapoarte/Vechi/amorttot1.FRT b/Rapoarte/Vechi/amorttot1.FRT new file mode 100644 index 0000000..220ec86 Binary files /dev/null and b/Rapoarte/Vechi/amorttot1.FRT differ diff --git a/Rapoarte/Vechi/amorttot1.frx b/Rapoarte/Vechi/amorttot1.frx new file mode 100644 index 0000000..62d57d8 Binary files /dev/null and b/Rapoarte/Vechi/amorttot1.frx differ diff --git a/Rapoarte/Vechi/evidenta_mf.FRT b/Rapoarte/Vechi/evidenta_mf.FRT new file mode 100644 index 0000000..733bf88 Binary files /dev/null and b/Rapoarte/Vechi/evidenta_mf.FRT differ diff --git a/Rapoarte/Vechi/evidenta_mf.frx b/Rapoarte/Vechi/evidenta_mf.frx new file mode 100644 index 0000000..ba2fef9 Binary files /dev/null and b/Rapoarte/Vechi/evidenta_mf.frx differ diff --git a/Rapoarte/Vechi/fisa.FRT b/Rapoarte/Vechi/fisa.FRT new file mode 100644 index 0000000..bbb2b04 Binary files /dev/null and b/Rapoarte/Vechi/fisa.FRT differ diff --git a/Rapoarte/Vechi/fisa.frx b/Rapoarte/Vechi/fisa.frx new file mode 100644 index 0000000..03cc5b8 Binary files /dev/null and b/Rapoarte/Vechi/fisa.frx differ diff --git a/Rapoarte/Vechi/fisa_ic.FRT b/Rapoarte/Vechi/fisa_ic.FRT new file mode 100644 index 0000000..4189613 Binary files /dev/null and b/Rapoarte/Vechi/fisa_ic.FRT differ diff --git a/Rapoarte/Vechi/fisa_ic.frx b/Rapoarte/Vechi/fisa_ic.frx new file mode 100644 index 0000000..3746255 Binary files /dev/null and b/Rapoarte/Vechi/fisa_ic.frx differ diff --git a/Rapoarte/Vechi/fisa_mf.FRT b/Rapoarte/Vechi/fisa_mf.FRT new file mode 100644 index 0000000..caed1f3 Binary files /dev/null and b/Rapoarte/Vechi/fisa_mf.FRT differ diff --git a/Rapoarte/Vechi/fisa_mf.frx b/Rapoarte/Vechi/fisa_mf.frx new file mode 100644 index 0000000..1c5e352 Binary files /dev/null and b/Rapoarte/Vechi/fisa_mf.frx differ diff --git a/Rapoarte/Vechi/fisa_mf2.FRT b/Rapoarte/Vechi/fisa_mf2.FRT new file mode 100644 index 0000000..1c169da Binary files /dev/null and b/Rapoarte/Vechi/fisa_mf2.FRT differ diff --git a/Rapoarte/Vechi/fisa_mf2.frx b/Rapoarte/Vechi/fisa_mf2.frx new file mode 100644 index 0000000..4b412d1 Binary files /dev/null and b/Rapoarte/Vechi/fisa_mf2.frx differ diff --git a/Rapoarte/Vechi/fisa_mf_istoric.FRT b/Rapoarte/Vechi/fisa_mf_istoric.FRT new file mode 100644 index 0000000..96d89c7 Binary files /dev/null and b/Rapoarte/Vechi/fisa_mf_istoric.FRT differ diff --git a/Rapoarte/Vechi/fisa_mf_istoric.frx b/Rapoarte/Vechi/fisa_mf_istoric.frx new file mode 100644 index 0000000..95bdf62 Binary files /dev/null and b/Rapoarte/Vechi/fisa_mf_istoric.frx differ diff --git a/Rapoarte/Vechi/jurnal.FRT b/Rapoarte/Vechi/jurnal.FRT new file mode 100644 index 0000000..6c88a92 Binary files /dev/null and b/Rapoarte/Vechi/jurnal.FRT differ diff --git a/Rapoarte/Vechi/jurnal.frx b/Rapoarte/Vechi/jurnal.frx new file mode 100644 index 0000000..4db069d Binary files /dev/null and b/Rapoarte/Vechi/jurnal.frx differ diff --git a/Rapoarte/Vechi/listimobcurs.FRT b/Rapoarte/Vechi/listimobcurs.FRT new file mode 100644 index 0000000..af39a4f Binary files /dev/null and b/Rapoarte/Vechi/listimobcurs.FRT differ diff --git a/Rapoarte/Vechi/listimobcurs.frx b/Rapoarte/Vechi/listimobcurs.frx new file mode 100644 index 0000000..ea152ed Binary files /dev/null and b/Rapoarte/Vechi/listimobcurs.frx differ diff --git a/Rapoarte/Vechi/listmf.FRT b/Rapoarte/Vechi/listmf.FRT new file mode 100644 index 0000000..6679200 Binary files /dev/null and b/Rapoarte/Vechi/listmf.FRT differ diff --git a/Rapoarte/Vechi/listmf.frx b/Rapoarte/Vechi/listmf.frx new file mode 100644 index 0000000..9357270 Binary files /dev/null and b/Rapoarte/Vechi/listmf.frx differ diff --git a/Rapoarte/Vechi/listmf_grup.FRT b/Rapoarte/Vechi/listmf_grup.FRT new file mode 100644 index 0000000..81e7352 Binary files /dev/null and b/Rapoarte/Vechi/listmf_grup.FRT differ diff --git a/Rapoarte/Vechi/listmf_grup.frx b/Rapoarte/Vechi/listmf_grup.frx new file mode 100644 index 0000000..665eee6 Binary files /dev/null and b/Rapoarte/Vechi/listmf_grup.frx differ diff --git a/Rapoarte/Vechi/listmf_inv.FRT b/Rapoarte/Vechi/listmf_inv.FRT new file mode 100644 index 0000000..e443ec8 Binary files /dev/null and b/Rapoarte/Vechi/listmf_inv.FRT differ diff --git a/Rapoarte/Vechi/listmf_inv.frx b/Rapoarte/Vechi/listmf_inv.frx new file mode 100644 index 0000000..62846d1 Binary files /dev/null and b/Rapoarte/Vechi/listmf_inv.frx differ diff --git a/Rapoarte/Vechi/listmfcota.FRT b/Rapoarte/Vechi/listmfcota.FRT new file mode 100644 index 0000000..0b93633 Binary files /dev/null and b/Rapoarte/Vechi/listmfcota.FRT differ diff --git a/Rapoarte/Vechi/listmfcota.frx b/Rapoarte/Vechi/listmfcota.frx new file mode 100644 index 0000000..2b9ea49 Binary files /dev/null and b/Rapoarte/Vechi/listmfcota.frx differ diff --git a/Rapoarte/Vechi/listmfjurnal.FRT b/Rapoarte/Vechi/listmfjurnal.FRT new file mode 100644 index 0000000..b66bf07 Binary files /dev/null and b/Rapoarte/Vechi/listmfjurnal.FRT differ diff --git a/Rapoarte/Vechi/listmfjurnal.frx b/Rapoarte/Vechi/listmfjurnal.frx new file mode 100644 index 0000000..2507113 Binary files /dev/null and b/Rapoarte/Vechi/listmfjurnal.frx differ diff --git a/Rapoarte/Vechi/listmflunicota.FRT b/Rapoarte/Vechi/listmflunicota.FRT new file mode 100644 index 0000000..f17beec Binary files /dev/null and b/Rapoarte/Vechi/listmflunicota.FRT differ diff --git a/Rapoarte/Vechi/listmflunicota.frx b/Rapoarte/Vechi/listmflunicota.frx new file mode 100644 index 0000000..30093a0 Binary files /dev/null and b/Rapoarte/Vechi/listmflunicota.frx differ diff --git a/Rapoarte/Vechi/listmfscd.FRT b/Rapoarte/Vechi/listmfscd.FRT new file mode 100644 index 0000000..5c6019e Binary files /dev/null and b/Rapoarte/Vechi/listmfscd.FRT differ diff --git a/Rapoarte/Vechi/listmfscd.frx b/Rapoarte/Vechi/listmfscd.frx new file mode 100644 index 0000000..d68e52d Binary files /dev/null and b/Rapoarte/Vechi/listmfscd.frx differ diff --git a/Rapoarte/Vechi/listmfscdV.FRT b/Rapoarte/Vechi/listmfscdV.FRT new file mode 100644 index 0000000..d564063 Binary files /dev/null and b/Rapoarte/Vechi/listmfscdV.FRT differ diff --git a/Rapoarte/Vechi/listmfscdV.frx b/Rapoarte/Vechi/listmfscdV.frx new file mode 100644 index 0000000..b48f363 Binary files /dev/null and b/Rapoarte/Vechi/listmfscdV.frx differ diff --git a/Rapoarte/Vechi/listmfscdcota.FRT b/Rapoarte/Vechi/listmfscdcota.FRT new file mode 100644 index 0000000..70b2fd7 Binary files /dev/null and b/Rapoarte/Vechi/listmfscdcota.FRT differ diff --git a/Rapoarte/Vechi/listmfscdcota.frx b/Rapoarte/Vechi/listmfscdcota.frx new file mode 100644 index 0000000..ada5d78 Binary files /dev/null and b/Rapoarte/Vechi/listmfscdcota.frx differ diff --git a/Rapoarte/Vechi/listmfscdlun.FRT b/Rapoarte/Vechi/listmfscdlun.FRT new file mode 100644 index 0000000..eea8b6e Binary files /dev/null and b/Rapoarte/Vechi/listmfscdlun.FRT differ diff --git a/Rapoarte/Vechi/listmfscdlun.frx b/Rapoarte/Vechi/listmfscdlun.frx new file mode 100644 index 0000000..7801e9b Binary files /dev/null and b/Rapoarte/Vechi/listmfscdlun.frx differ diff --git a/Rapoarte/Vechi/listmftot.FRT b/Rapoarte/Vechi/listmftot.FRT new file mode 100644 index 0000000..40391a8 Binary files /dev/null and b/Rapoarte/Vechi/listmftot.FRT differ diff --git a/Rapoarte/Vechi/listmftot.frx b/Rapoarte/Vechi/listmftot.frx new file mode 100644 index 0000000..beee2f8 Binary files /dev/null and b/Rapoarte/Vechi/listmftot.frx differ diff --git a/Rapoarte/Vechi/nota_inv2005.FRT b/Rapoarte/Vechi/nota_inv2005.FRT new file mode 100644 index 0000000..942d3c9 Binary files /dev/null and b/Rapoarte/Vechi/nota_inv2005.FRT differ diff --git a/Rapoarte/Vechi/nota_inv2005.frx b/Rapoarte/Vechi/nota_inv2005.frx new file mode 100644 index 0000000..27cbef6 Binary files /dev/null and b/Rapoarte/Vechi/nota_inv2005.frx differ diff --git a/Rapoarte/Vechi/pvcasare.FRT b/Rapoarte/Vechi/pvcasare.FRT new file mode 100644 index 0000000..1ed169e Binary files /dev/null and b/Rapoarte/Vechi/pvcasare.FRT differ diff --git a/Rapoarte/Vechi/pvcasare.frx b/Rapoarte/Vechi/pvcasare.frx new file mode 100644 index 0000000..8a2f4f6 Binary files /dev/null and b/Rapoarte/Vechi/pvcasare.frx differ diff --git a/Rapoarte/Vechi/sitmf1.FRT b/Rapoarte/Vechi/sitmf1.FRT new file mode 100644 index 0000000..823f799 Binary files /dev/null and b/Rapoarte/Vechi/sitmf1.FRT differ diff --git a/Rapoarte/Vechi/sitmf1.frx b/Rapoarte/Vechi/sitmf1.frx new file mode 100644 index 0000000..d0a1d6b Binary files /dev/null and b/Rapoarte/Vechi/sitmf1.frx differ diff --git a/Rapoarte/Vechi/sitmf2.FRT b/Rapoarte/Vechi/sitmf2.FRT new file mode 100644 index 0000000..0e06cbb Binary files /dev/null and b/Rapoarte/Vechi/sitmf2.FRT differ diff --git a/Rapoarte/Vechi/sitmf2.frx b/Rapoarte/Vechi/sitmf2.frx new file mode 100644 index 0000000..b16858f Binary files /dev/null and b/Rapoarte/Vechi/sitmf2.frx differ diff --git a/Rapoarte/Vechi/sitmfv.FRT b/Rapoarte/Vechi/sitmfv.FRT new file mode 100644 index 0000000..7988ba0 Binary files /dev/null and b/Rapoarte/Vechi/sitmfv.FRT differ diff --git a/Rapoarte/Vechi/sitmfv.frx b/Rapoarte/Vechi/sitmfv.frx new file mode 100644 index 0000000..2d69521 Binary files /dev/null and b/Rapoarte/Vechi/sitmfv.frx differ diff --git a/Rapoarte/Vechi/sitmfvr.FRT b/Rapoarte/Vechi/sitmfvr.FRT new file mode 100644 index 0000000..6c6d963 Binary files /dev/null and b/Rapoarte/Vechi/sitmfvr.FRT differ diff --git a/Rapoarte/Vechi/sitmfvr.frx b/Rapoarte/Vechi/sitmfvr.frx new file mode 100644 index 0000000..a55d5b6 Binary files /dev/null and b/Rapoarte/Vechi/sitmfvr.frx differ diff --git a/Rapoarte/Vechi/valoare1.FRT b/Rapoarte/Vechi/valoare1.FRT new file mode 100644 index 0000000..93490a4 Binary files /dev/null and b/Rapoarte/Vechi/valoare1.FRT differ diff --git a/Rapoarte/Vechi/valoare1.frx b/Rapoarte/Vechi/valoare1.frx new file mode 100644 index 0000000..4ca0649 Binary files /dev/null and b/Rapoarte/Vechi/valoare1.frx differ diff --git a/Rapoarte/act.FRT b/Rapoarte/act.FRT new file mode 100644 index 0000000..610ce30 Binary files /dev/null and b/Rapoarte/act.FRT differ diff --git a/Rapoarte/act.frx b/Rapoarte/act.frx new file mode 100644 index 0000000..e02a82f Binary files /dev/null and b/Rapoarte/act.frx differ diff --git a/Rapoarte/amortanaliz_grup.FRT b/Rapoarte/amortanaliz_grup.FRT new file mode 100644 index 0000000..2de8d95 Binary files /dev/null and b/Rapoarte/amortanaliz_grup.FRT differ diff --git a/Rapoarte/amortanaliz_grup.frx b/Rapoarte/amortanaliz_grup.frx new file mode 100644 index 0000000..ddba554 Binary files /dev/null and b/Rapoarte/amortanaliz_grup.frx differ diff --git a/Rapoarte/amortizare.FRT b/Rapoarte/amortizare.FRT new file mode 100644 index 0000000..1de21af Binary files /dev/null and b/Rapoarte/amortizare.FRT differ diff --git a/Rapoarte/amortizare.frx b/Rapoarte/amortizare.frx new file mode 100644 index 0000000..3c3ce52 Binary files /dev/null and b/Rapoarte/amortizare.frx differ diff --git a/Rapoarte/evidenta_mf.FRT b/Rapoarte/evidenta_mf.FRT new file mode 100644 index 0000000..db85b58 Binary files /dev/null and b/Rapoarte/evidenta_mf.FRT differ diff --git a/Rapoarte/evidenta_mf.frx b/Rapoarte/evidenta_mf.frx new file mode 100644 index 0000000..e2cd5ec Binary files /dev/null and b/Rapoarte/evidenta_mf.frx differ diff --git a/Rapoarte/fisa_mf2.FRT b/Rapoarte/fisa_mf2.FRT new file mode 100644 index 0000000..0efb9f6 Binary files /dev/null and b/Rapoarte/fisa_mf2.FRT differ diff --git a/Rapoarte/fisa_mf2.frx b/Rapoarte/fisa_mf2.frx new file mode 100644 index 0000000..29c0f71 Binary files /dev/null and b/Rapoarte/fisa_mf2.frx differ diff --git a/Rapoarte/fisa_mf_istoric.FRT b/Rapoarte/fisa_mf_istoric.FRT new file mode 100644 index 0000000..19e99cb Binary files /dev/null and b/Rapoarte/fisa_mf_istoric.FRT differ diff --git a/Rapoarte/fisa_mf_istoric.frx b/Rapoarte/fisa_mf_istoric.frx new file mode 100644 index 0000000..429bad2 Binary files /dev/null and b/Rapoarte/fisa_mf_istoric.frx differ diff --git a/Rapoarte/fisa_mf_istoric_rate.FRT b/Rapoarte/fisa_mf_istoric_rate.FRT new file mode 100644 index 0000000..8f8ab88 Binary files /dev/null and b/Rapoarte/fisa_mf_istoric_rate.FRT differ diff --git a/Rapoarte/fisa_mf_istoric_rate.frx b/Rapoarte/fisa_mf_istoric_rate.frx new file mode 100644 index 0000000..1962e1c Binary files /dev/null and b/Rapoarte/fisa_mf_istoric_rate.frx differ diff --git a/Rapoarte/jurnal.FRT b/Rapoarte/jurnal.FRT new file mode 100644 index 0000000..30e48cf Binary files /dev/null and b/Rapoarte/jurnal.FRT differ diff --git a/Rapoarte/jurnal.frx b/Rapoarte/jurnal.frx new file mode 100644 index 0000000..73ea7c0 Binary files /dev/null and b/Rapoarte/jurnal.frx differ diff --git a/Rapoarte/list_mfgrup.FRT b/Rapoarte/list_mfgrup.FRT new file mode 100644 index 0000000..fb8ac80 Binary files /dev/null and b/Rapoarte/list_mfgrup.FRT differ diff --git a/Rapoarte/list_mfgrup.frx b/Rapoarte/list_mfgrup.frx new file mode 100644 index 0000000..94be804 Binary files /dev/null and b/Rapoarte/list_mfgrup.frx differ diff --git a/Rapoarte/listimobcurs.FRT b/Rapoarte/listimobcurs.FRT new file mode 100644 index 0000000..b38c01e Binary files /dev/null and b/Rapoarte/listimobcurs.FRT differ diff --git a/Rapoarte/listimobcurs.frx b/Rapoarte/listimobcurs.frx new file mode 100644 index 0000000..170359c Binary files /dev/null and b/Rapoarte/listimobcurs.frx differ diff --git a/Rapoarte/listmf_grup.FRT b/Rapoarte/listmf_grup.FRT new file mode 100644 index 0000000..cee8256 Binary files /dev/null and b/Rapoarte/listmf_grup.FRT differ diff --git a/Rapoarte/listmf_grup.frx b/Rapoarte/listmf_grup.frx new file mode 100644 index 0000000..100b9c2 Binary files /dev/null and b/Rapoarte/listmf_grup.frx differ diff --git a/Rapoarte/listmf_inv.FRT b/Rapoarte/listmf_inv.FRT new file mode 100644 index 0000000..1fdf429 Binary files /dev/null and b/Rapoarte/listmf_inv.FRT differ diff --git a/Rapoarte/listmf_inv.frx b/Rapoarte/listmf_inv.frx new file mode 100644 index 0000000..59f706c Binary files /dev/null and b/Rapoarte/listmf_inv.frx differ diff --git a/Rapoarte/listmfcota.FRT b/Rapoarte/listmfcota.FRT new file mode 100644 index 0000000..05557da Binary files /dev/null and b/Rapoarte/listmfcota.FRT differ diff --git a/Rapoarte/listmfcota.frx b/Rapoarte/listmfcota.frx new file mode 100644 index 0000000..45313f5 Binary files /dev/null and b/Rapoarte/listmfcota.frx differ diff --git a/Rapoarte/listmflunicota.FRT b/Rapoarte/listmflunicota.FRT new file mode 100644 index 0000000..603c553 Binary files /dev/null and b/Rapoarte/listmflunicota.FRT differ diff --git a/Rapoarte/listmflunicota.frx b/Rapoarte/listmflunicota.frx new file mode 100644 index 0000000..1f51b10 Binary files /dev/null and b/Rapoarte/listmflunicota.frx differ diff --git a/Rapoarte/listmfscdcota.FRT b/Rapoarte/listmfscdcota.FRT new file mode 100644 index 0000000..768926e Binary files /dev/null and b/Rapoarte/listmfscdcota.FRT differ diff --git a/Rapoarte/listmfscdcota.frx b/Rapoarte/listmfscdcota.frx new file mode 100644 index 0000000..d379045 Binary files /dev/null and b/Rapoarte/listmfscdcota.frx differ diff --git a/Rapoarte/nota_inv2005.FRT b/Rapoarte/nota_inv2005.FRT new file mode 100644 index 0000000..116376a Binary files /dev/null and b/Rapoarte/nota_inv2005.FRT differ diff --git a/Rapoarte/nota_inv2005.frx b/Rapoarte/nota_inv2005.frx new file mode 100644 index 0000000..6ec6499 Binary files /dev/null and b/Rapoarte/nota_inv2005.frx differ diff --git a/Rapoarte/nota_inv_m1.FRT b/Rapoarte/nota_inv_m1.FRT new file mode 100644 index 0000000..1de9cdf Binary files /dev/null and b/Rapoarte/nota_inv_m1.FRT differ diff --git a/Rapoarte/nota_inv_m1.frx b/Rapoarte/nota_inv_m1.frx new file mode 100644 index 0000000..8c14004 Binary files /dev/null and b/Rapoarte/nota_inv_m1.frx differ diff --git a/Rapoarte/nota_inv_m2.FRT b/Rapoarte/nota_inv_m2.FRT new file mode 100644 index 0000000..dd6743d Binary files /dev/null and b/Rapoarte/nota_inv_m2.FRT differ diff --git a/Rapoarte/nota_inv_m2.frx b/Rapoarte/nota_inv_m2.frx new file mode 100644 index 0000000..6a6c643 Binary files /dev/null and b/Rapoarte/nota_inv_m2.frx differ diff --git a/Rapoarte/rap_diferente_cf.FRT b/Rapoarte/rap_diferente_cf.FRT new file mode 100644 index 0000000..d27f2b2 Binary files /dev/null and b/Rapoarte/rap_diferente_cf.FRT differ diff --git a/Rapoarte/rap_diferente_cf.frx b/Rapoarte/rap_diferente_cf.frx new file mode 100644 index 0000000..01c0205 Binary files /dev/null and b/Rapoarte/rap_diferente_cf.frx differ diff --git a/Rapoarte/rap_istoric_operatii_old.frt b/Rapoarte/rap_istoric_operatii_old.frt new file mode 100644 index 0000000..ca45d9e Binary files /dev/null and b/Rapoarte/rap_istoric_operatii_old.frt differ diff --git a/Rapoarte/rap_istoric_operatii_old.frx b/Rapoarte/rap_istoric_operatii_old.frx new file mode 100644 index 0000000..80953bc Binary files /dev/null and b/Rapoarte/rap_istoric_operatii_old.frx differ diff --git a/Rapoarte/rap_operatii.FRT b/Rapoarte/rap_operatii.FRT new file mode 100644 index 0000000..6509b5b Binary files /dev/null and b/Rapoarte/rap_operatii.FRT differ diff --git a/Rapoarte/rap_operatii.frx b/Rapoarte/rap_operatii.frx new file mode 100644 index 0000000..9ed5857 Binary files /dev/null and b/Rapoarte/rap_operatii.frx differ diff --git a/Rapoarte/reg_nr_inv.FRT b/Rapoarte/reg_nr_inv.FRT new file mode 100644 index 0000000..319ae2e Binary files /dev/null and b/Rapoarte/reg_nr_inv.FRT differ diff --git a/Rapoarte/reg_nr_inv.frx b/Rapoarte/reg_nr_inv.frx new file mode 100644 index 0000000..7188589 Binary files /dev/null and b/Rapoarte/reg_nr_inv.frx differ diff --git a/Rapoarte/situatie_modificari.FRT b/Rapoarte/situatie_modificari.FRT new file mode 100644 index 0000000..b6666f4 Binary files /dev/null and b/Rapoarte/situatie_modificari.FRT differ diff --git a/Rapoarte/situatie_modificari.frx b/Rapoarte/situatie_modificari.frx new file mode 100644 index 0000000..adf7aa3 Binary files /dev/null and b/Rapoarte/situatie_modificari.frx differ diff --git a/Rapoarte/situatie_reevaluare.FRT b/Rapoarte/situatie_reevaluare.FRT new file mode 100644 index 0000000..4e94583 Binary files /dev/null and b/Rapoarte/situatie_reevaluare.FRT differ diff --git a/Rapoarte/situatie_reevaluare.frx b/Rapoarte/situatie_reevaluare.frx new file mode 100644 index 0000000..4b88114 Binary files /dev/null and b/Rapoarte/situatie_reevaluare.frx differ diff --git a/changelog_roaimob.txt b/changelog_roaimob.txt new file mode 100644 index 0000000..400c458 --- /dev/null +++ b/changelog_roaimob.txt @@ -0,0 +1,1017 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config.fpw b/config.fpw new file mode 100644 index 0000000..120cdb2 --- /dev/null +++ b/config.fpw @@ -0,0 +1,43 @@ + + +SCREEN = OFF + + +_STARTUP = "" + +* to eliminate load time: +_BROWSER = "" +_SPELLCHK = "" +_GENMENU = "" +_GENGRAPH = "" +_GENXTAB = "" +_COVERAGE = "" +_SCCTEXT = "" +_CONVERTER = "" +_TRANSPORTER = "" +_BUILDER = "" +_WIZARD = "" + +* other special CONFIG.FPW settings you may wish to change: +* (these are the defaults) +MVCOUNT = 1025 +OUTSHOW = ON + +* Set other global settings here if you like, for example: +RESOURCE = OFF +_THROTTLE = 0 + +* See the application object's SetDataSessionSets() method +* for some additional settings you +* may like to use in your config file. +* The following are not the default settings, +* (and ordinarily will be taken care of in the +* Load of private-session forms and formsets): +TALK = OFF +MULTILOCKS = ON +EXCLUSIVE = OFF +SAFETY = OFF +editwork=c:\ +sortwork=c:\ +tmpfiles=c:\ +progwork=c:\ \ No newline at end of file diff --git a/conturi_imob.prg b/conturi_imob.prg new file mode 100644 index 0000000..5bd37a0 --- /dev/null +++ b/conturi_imob.prg @@ -0,0 +1,18 @@ +Set Deleted On +Set Century on +Set Date DMY +Set Exclusive Off +Set Ansi On +Set Exact On +Set Safety Off + +Clear +lcSql = [] +Set Textmerge ON TO memvar lcSql noshow +Select CONTAMORT +Scan + +\EXECUTE IMMEDIATE 'INSERT INTO IMOB_CONTURI(CONT, CONT_CHELTUIALA, CONT_AMORTIZARE, ID_TIP_IMOBILIZARE) VALUES (''<>'',''6811'',''<>'',<>)'; +EndScan +Set Textmerge to +_CLIPTEXT = lcSql diff --git a/istoric_amortizare_contabila.sql b/istoric_amortizare_contabila.sql new file mode 100644 index 0000000..8e24148 --- /dev/null +++ b/istoric_amortizare_contabila.sql @@ -0,0 +1,86 @@ +select a.valoare, + a.valoare_ramasa, + a.dns_ramas, + a.id_tip_operatie, + a.id_operatie_mf, + a.data_operatie, + a.id_operatie_prec, + a.denumire as numeoperatie, + Add_months(a.data_operatie, a.DNS_RAMAS) as data_expirare, + a.explicatia as explicatiaoperatie, + b.id_mf, + b.denumire, + b.data_achizitie, + b.data_pif, + b.nract, + b.nr_pif, + b.id_tip_imobilizare, + b.EXPLICATIA, + b.tip_amortizare, + b.tip_imobilizare, + c.dataora, + c.utilizator, + c.dns_luni, + c.id_lista_mf, + c.id_lucrare, + c.id_gestiune, + c.nr_inventar, + c.cod_mf, + c.cont, + c.acont, + c.id_sectie, + c.id_responsabil, + c.cgest, + c.gestiune, + c.responsabil, + NVL(k.rata, 0) as rata, + k.luna, + k.an, + k.luna_exp, + k.an_exp, + NVL(k.cota_an, 0) as cota_an, + NVL(k.cota_luna, 0) as cota_luna, + k.ID_CALCUL_RATE, + k.amortizare_prec as amort_prec, + k.uzura_prec, + /*k.data_ultima_rata as data_expirare,*/ + i.data_operatie as ultima_operatie, + c.id_sucursala, + a.utilizator as utilizatorop, + a.DATAORA as dataoraop, + a.STERS as stersop, + a.DATAORA_STERS as dataoraop_sters, + a.ID_UTIL_STERS as id_utilop_ster, + a.UTILIZATORS as utilizatorop_sters + from imob_voperatii_mf a + left join imob_vlista_mf c on a.ID_MF = c.ID_MF + and to_date(to_char(extract(month from + a.DATA_OPERATIE)) || '/' || + to_char(extract(year from + a.DATA_OPERATIE)), + 'mm/yyyy') <= + to_date(c.LUNA_EXP || '/' || c.an_exp, + 'MM/YYYY') + and to_date(to_char(extract(month from + a.DATA_OPERATIE)) || '/' || + to_char(extract(year from + a.DATA_OPERATIE)), + 'mm/yyyy') >= + to_date(to_char(c.LUNA) || '/' || + to_char(c.AN), + 'mm/yyyy') + left join imob_vnom_mf b on a.id_mf = b.id_mf + left join imob_vcalcul_rate k on a.id_operatie_mf = k.ID_OPERATIE_MF + left join (select id_operatie_mf, id_mf, id_operatie_prec, data_operatie + from imob_voperatii_mf + where id_operatie_mf in + (select distinct first_value(id_operatie_mf) over(partition by id_mf order by data_operatie desc) + from imob_voperatii_mf + where data_operatie <= to_date('31102021','ddmmyyyy') + and sters = 0 + and id_operatie_mf in (select distinct id_operatie_mf + from imob_vcalcul_rate + where sters = 0))) i on a.id_mf = i.id_mf + and a.id_operatie_mf = i.ID_OPERATIE_MF + where months_between(a.data_operatie, to_date('31102021','ddmmyyyy')) <= 0 + order by b.denumire, b.nract, a.id_operatie_mf asc; diff --git a/istoric_amortizare_fiscala.sql b/istoric_amortizare_fiscala.sql new file mode 100644 index 0000000..3da8380 --- /dev/null +++ b/istoric_amortizare_fiscala.sql @@ -0,0 +1,86 @@ +select a.valoare, + a.valoare_ramasa, + a.dns_ramas, + a.id_tip_operatie, + a.id_operatie_mf, + a.data_operatie, + a.id_operatie_prec, + a.denumire as numeoperatie, + Add_months(a.data_operatie, a.DNS_RAMAS) as data_expirare, + a.explicatia as explicatiaoperatie, + b.id_mf, + b.denumire, + b.data_achizitie, + b.data_pif, + b.nract, + b.nr_pif, + b.id_tip_imobilizare, + b.EXPLICATIA, + b.tip_amortizare, + b.tip_imobilizare, + c.dataora, + c.utilizator, + c.dns_luni, + c.id_lista_mf, + c.id_lucrare, + c.id_gestiune, + c.nr_inventar, + c.cod_mf, + c.cont, + c.acont, + c.id_sectie, + c.id_responsabil, + c.cgest, + c.gestiune, + c.responsabil, + NVL(k.rata, 0) as rata, + k.luna, + k.an, + k.luna_exp, + k.an_exp, + NVL(k.cota_an, 0) as cota_an, + NVL(k.cota_luna, 0) as cota_luna, + k.ID_CALCUL_RATE, + k.amortizare_prec as amort_prec, + k.uzura_prec, + /*k.data_ultima_rata as data_expirare,*/ + i.data_operatie as ultima_operatie, + c.id_sucursala, + a.utilizator as utilizatorop, + a.DATAORA as dataoraop, + a.STERS as stersop, + a.DATAORA_STERS as dataoraop_sters, + a.ID_UTIL_STERS as id_utilop_ster, + a.UTILIZATORS as utilizatorop_sters + from imobf_voperatii_mf a + left join imob_vlista_mf c on a.ID_MF = c.ID_MF + and to_date(to_char(extract(month from + a.DATA_OPERATIE)) || '/' || + to_char(extract(year from + a.DATA_OPERATIE)), + 'mm/yyyy') <= + to_date(c.LUNA_EXP || '/' || c.an_exp, + 'MM/YYYY') + and to_date(to_char(extract(month from + a.DATA_OPERATIE)) || '/' || + to_char(extract(year from + a.DATA_OPERATIE)), + 'mm/yyyy') >= + to_date(to_char(c.LUNA) || '/' || + to_char(c.AN), + 'mm/yyyy') + left join imob_vnom_mf b on a.id_mf = b.id_mf + left join imobf_vcalcul_rate k on a.id_operatie_mf = k.ID_OPERATIE_MF + left join (select id_operatie_mf, id_mf, id_operatie_prec, data_operatie + from imobf_voperatii_mf + where id_operatie_mf in + (select distinct first_value(id_operatie_mf) over(partition by id_mf order by data_operatie desc) + from imobf_voperatii_mf + where data_operatie <= to_date('31102021','ddmmyyyy') + and sters = 0 + and id_operatie_mf in (select distinct id_operatie_mf + from imobf_vcalcul_rate + where sters = 0))) i on a.id_mf = i.id_mf + and a.id_operatie_mf = i.ID_OPERATIE_MF + where months_between(a.data_operatie, to_date('31102021','ddmmyyyy')) <= 0 + order by b.denumire, b.nract, a.id_operatie_mf asc; diff --git a/roaimob.PJT b/roaimob.PJT new file mode 100644 index 0000000..48b453e Binary files /dev/null and b/roaimob.PJT differ diff --git a/roaimob.PJX b/roaimob.PJX new file mode 100644 index 0000000..f51a8a2 Binary files /dev/null and b/roaimob.PJX differ diff --git a/versiune_db.txt b/versiune_db.txt new file mode 100644 index 0000000..64c60c5 --- /dev/null +++ b/versiune_db.txt @@ -0,0 +1 @@ +2026_05_18_01 \ No newline at end of file